azriel91 / autexousious

Main repository for Will -- 2.5D moddable action adventure game
https://azriel.im/will
Apache License 2.0
44 stars 3 forks source link

Synchronize Game Clients #232

Closed azriel91 closed 4 years ago

azriel91 commented 4 years ago

Add a frame synchronization mechanism so that Will game clients receive input events from the session server and process them in the same logical frame.

Network Input Sync Sequence:

  1. [x] To Do: Client resets SessionCondition status. SessionMessageResponseSystem
  2. Input events received per client: amethyst::input::InputSystem
  3. Client sends input events to server: NetworkInputRequestSystem
  4. [x] To Do: Client sends SessionMessageEvent::GameInputTick to server -- GameInputTickRequestSystem.
  5. Server receives input events: NetListenerSystem,
  6. [x] To Do: Server receives SessionMessageEvent::GameInputTick from all clients -- SessionMessageResponderSystem.
  7. Server sends input events to all clients: NetworkInputResponderSystem
  8. [x] To Do: Server sends SessionMessageEvent::GameInputTick to all clients -- SessionMessageResponderSystem.
  9. [x] To Do: Client receives SessionMessageEvent::GameInputTick from server and sets SessionCondition::Ready -- SessionMessageResponseSystem.
  10. Client responds to game input events from server: NetworkInputResponseSystem