Skip to content

KariVargr/NeoFPS_Mirror-Networking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

NeoFPS_Mirror-Networking

This is an "In Progress" build
NOTE: There are only 2 Working weapon prefab, Basic Hitscan and Ballistic shooter are working

Currently Working
Client Authority on
Movement, Aim, Enviro Damage, Shooting, weapon change
Server Authority on
Weapon Damage, Health, Ammo
only 1 Network working Weapon currently

# Lag Compensation

I have Intergarted both projectile and hitscan a Lag Compensation
Hitscan is based on https://twoten.dev/lag-compensation-in-unity.html and MLAPI
Projectiles are currently not network based elements and are spawned with a speed increase that diminishes over time

Lag Emulation can be done with https://jagt.github.io/clumsy/download.html
Set Preset to "ipv6 all" and select the lag option.

# Install Required

NeoFPS ( https://assetstore.unity.com/packages/templates/systems/neofps-fps-controller-template-toolkit-150179 )

Mirror Networking ( https://mirror-networking.com/ ) ( https://assetstore.unity.com/packages/tools/network/mirror-129321 )

NeoFPS files that need to be modified

File: FpsGameMode.cs
( This allows the use of FpsNetCharacter and FpsNetPlayerController )
Line 132: protected abstract void ProcessOldPlayerCharacter(ICharacter oldCharacter);
Line 133: protected abstract IController InstantiatePlayer();


File: FpsSoloGameMinimal.cs
( Correstion to keep the Solo working with Above Changes )
Line 120: protected override IController InstantiatePlayer ()
Line 175: protected override void ProcessOldPlayerCharacter(ICharacter oldCharacter)


File: BaseController.cs
( Making isLocalPlayer Viritaul allows FpsNetPlayerController to check its networkInstance to see if the the player is local)
Line 24: public virtual bool isLocalPlayer

Recommendation

I also suggest using https://github.com/SoftwareGuy/Ignorance/ transport lay for Mirror, this implaments ENet in to Mirror, to move away from UNet

3rd Party Tools

I suggest using First Gear Games Mirror "Assets For Mirror Networking" (https://www.patreon.com/firstgeargames/posts)
His FlexNetworkTransform is very handy and i have been using his tutorials to help, and seem to be making quite a few assets to improve the Mirror Networking.

I have intergated FFG's ColliderRollback
Changes needed to First Gear Games are as follow
in "RollbackSteps()" change uint fixedFrame to float frameDiff
Comment out line 81 "uint frameDiff ="

Add FIRSTGEARGAMES_COLLIDERROLLBACKS
to Project Setting -> Player -> Other Settings -> Scripting Define Symbols
This will disable free one and enable First Gear Games

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages