jonkirkman / tronhub

Server to coordinate awesome light-cycle battles between remote clients
MIT License
3 stars 1 forks source link

Game Loop #2

Open nickstew opened 10 years ago

nickstew commented 10 years ago

What actions should we always perform in the game loop?

Game state should affect what we do/don't do in these actions, but the actions should always be called.

Move...Verify...Update...Cleanup?

jonkirkman commented 10 years ago

For each iteration of the game loop:

  1. prompts are sent to each player
  2. each player either responds with an intent to travel or the default intent is used (default intent is to continue on their current bearing)
  3. intents are validated
  4. valid intents are fulfilled (player moves)
  5. invalid intents terminate the player

Can you think of anything I'm neglecting?

nickstew commented 10 years ago

Do we want to have any notification systems?

Will updating the game state fire notifications to anything?

Notifications and event triggers can help the game stick to core functionality now and allow an easy way to extend the game and add more functionality...

jonkirkman commented 10 years ago

I don't really know what we'd need to add for this. Take a look at Observable

If you're confident in both the need and general implementation, you should jump in and add it. Otherwise feel free to draft something in a branch and we'll discuss it further.

nickstew commented 10 years ago

Will do. I just wanted to get some excitement and activity into working on this project by asking questions. :)

nickstew commented 9 years ago

Was doing some poking around this morning and found this Stack Overflow - Dealing with Latency in Networked Games, which then led me to this, Valve Developer Community - Source Multiplayer Networking, really good article by Valve on the issue.

nickstew commented 9 years ago

"During each tick, the server processes incoming user commands, runs a physical simulation step, checks the game rules, and updates all object states." - Take from the above Valve article. I'm still trying to understand some of those pieces, but they are a good starting point for our game loop.