In follow up to our hugely successful Complete Unreal Engine Developer course we bring you Unreal Multiplayer Mastery - as on featured on Epic's UE4 blog.
In this section make your games feel responsive no matter what network conditions your players face. Understand and explain concepts such as lag. Devise mechanism to compensate for lag in your games.
You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Unreal Multiplayer Mastery
- We overview the sections topics.
- Create the project.
- Create a pawn.
- Setup GameMode Spawning.
- Setup Camera.
- Attach throttle controls.
- Revision of forces in physics.
- Calculating movement from force.
- Providing the driving force.
- Setting up collision volumes.
- Sweeping with
AddActorWorldOffset
. - Resetting velocity on collision.
- Refactoring the
Tick
function.
- Angle axis rotations with FQuat.
- Adding rotations actors.
- Rotating our velocity.
- Understanding air resistance.
- Getting the "speed".
- Calculating force due to air resistance.
- What is rolling resistance?
- Finding the gravity in Unreal.
- Implementing rolling resistance.
- Example rolling resistance coeffients.
- Why we get turning circles.
- Calculating our rotation geometry.
- Correcting steering behaviour.
- How to change state from the client.
- Introduction to RPC server functions.
- What is validation?
- Implementing validation for input.
- What are Actor roles?
- Investigating the network roles.
- Updating the
AutonomousProxy
.
- How simulation error effect our game.
- Overview the different sources of error.
- Investigate approaches to eliminating them.
- Overview of property replication.
- Replicating the actor position.
- Setting and reading the property.
- Replicating the actor rotation.
- Deep dive on property replication.
- Setting the network update interval.
- Notify on replicate.
- Simulate between updates.
- Replicating velocity.
- Why is movement jerky?
- Replicating control input to SimulatedProxy.
- What is lag?
- Simulating lag and packet loss.
- Why does lag cause glitching?
- Why do we reset when accelerating?
- Keeping AutonomousProxy ahead of the Server.
- What information needs to be sent to the server.
- Compare our different simulation approaches.
- Pseudocode for client prediction.
- Adding structs for synchronisation.
- What do we have already?
- Replicating state via a struct.
- Sending the
Move
struct via RPC.
- The
SimulateMove
signature. - Updating the canonical state.
- Implement
SimulateMove
.
TArray
for the Move queue.- Tidying the move creation code.
- Printing the queue length.
- Removing acknowledged moves.
- Simulate all moves.
- Testing for smoothness.
- How can we still make it glitch?
- Ensuring the Server simulates once.
- Local prediction on the client.
- Making smoother predictions.
- Red-Green-Refactor process.
- How to spot your "code smells".
- Identifying a suitable refactor.
- Planning our refactor.
- Create and name the component.
- Move member declarations across.
- Move function implementations.
- Fix build errors.
- Creating the component.
- Enable replication.
- Move member declarations across.
- Move function implementations.
- Fix build errors.
- What happens if we disable the replicator?
- Allow the Movement Component to tick.
- Getting the information to replicate.
- How does linear interpolation work?
- Overview of client interpolation.
- Pseudocode for client interpolation.
- Ensure movement replication is off.
- Updating the time variables.
FMath::Lerp
vsFMath::LerpStable
.- Implementing the pseudocode.
Slerp
vsLerp
.- Store tranform instead of location.
- Implementing
Slerp
ed location.
- Understanding jarring movement.
- How velocity can help or hinder.
- A brief overview of polynomials.
- Introducing the Hermite Cubic Spline.
- Slopes, derivatives and velocity.
- Using
CubicInterp
for location. - Using
CubicInterpDerivative
for velocity.
- Assessing the existing code.
- Creating a plain C++ struct.
- Pulling out methods.
- Understanding mesh offseting.
- Set up the mesh offset root component.
- Manipulating the offset instead.
- Bounding the inputs.
- Stressing our DeltaTime.
- Tracking simulation time.
- Congratulations on making it this far!
- Why we don't cover dedicated server.
- How to continue practicing your skills