BIT Nurse - Networked Gameplay Programming Consultant

Combat Network Sync

Authoritative Server

Description of the Schematic Above
Combat Sync Including Client-Side Prediction

 

  1. Player (p1C) holds down left mouse to charge a Fireball Spell and a charging GameObject, cC, is instantiated.

  2. RPC sent to p1S with information that p1C is charging a Fireball Spell.

  3. p1S instantiates cS.

  4. RPC sent to p1P with information to charge a Fireball Spell.

  5. p1P instantiates cP so that other players see that p1 is charging a Fireball Spell.

  6. Player (p1C) releases left mouse to cast the Fireball Spell and instantiates its GameObject, pC.

  7. RPC sent to p1S with information that p1C has casted the Fireball Spell from which position in which direction it was casted.

  8. p1S checks its position compared with the position p1C told the server the Fireball Spell was casted from, if no cheating is found p1S instantiates pS with the information give from p1C.

  9. RPC sent to p1P with information to instantiate a Fireball Spell at a specified position in a specified direction.

  10. p1P instantiates pP with info from RPC sent in step 9.

  11. pC uses Client-Side Hit-Prediction to instantiate iC on impact.

  12. pP uses Client-Side Hit-Prediction to instantiate iP on impact.

  13. pS uses Hit-Detection and instantiates iS on impact.

  14. iS tells p1S (the server-side owner of the spell) the position of the impact on the server.

  15. RPC sent to p1C with the impact position of the Fireball Spell.

  16. p1C transfer the position of iS to iC, iC then adjusts its position if the position differs.

  17. RPC sent to p1P with the impact position of the Fireball Spell.

  18. p1P transfer the position of iS to iP, iP then adjusts its position if the position differs.

  19. iS impacted on p2S and calls a method on p2S to take damage and transfers information about which spell iS originates from.

  20. p2S instantiates seS which deals Damage over Time on p2S.

  21. RPC sent to p2C with information that it has been hit by a Fireball Spell.

  22. p2C instantiates seC to show a burning effect on the player.

  23. RPC sent to p2P with information that it has been hit by a Fireball Spell.

  24. p2P instantiates seP to show a burning effect on the player.

Non-Authoritative Server

*Not Complete*