I posted this in the forum earlier from my phone and then realized it wasn't really a forum type post... So, here it is in the permanent record of my project blog where it belongs.
So, I've been struggling with my perception of time. Haha, at least with how it pertains to the game system I'm building. Some of you may have even noticed. My biggest hurdle has been language I think. Everybody uses words and sometimes I'm not sure they are even sure what those words really mean. E.g. Frame, Simulation, Tick, Time.. It's taken me a few weeks of just watching how they are used to put them into any kind of context that makes sense for my game.
So I took a long look at the code I'm writing and lo and behold, I'm essentially creating a simulation frame number that's synchronizing the rest of the system.. I'm just doing it in a very silly and wasteful way.
So I guess this is more about me saying, yup you were right all the TIME.. Lol
Anyhow, the primary reason behind most of my confusion is my desire to build a system(servers and clients) that can allow the clients to operate somewhat autonomously in a bulk of the gameplay senarios that I have in mind. By that I mean the system will be retrospectively authoritative wherever possible. For all of this to work, it implied to my mind that the clients essentially are running different simulations from each other. And there we find our culprit. Somehow while riding my bicycle today, clarity. In order for simulation elements to truly be shared, there has to be a "server simulation" that synchronizes the shared portion of each clients simulation. And as soon as you refactor the client only simulations as more or less unrelated client code.. Its the same simulation frame synchronization scheme everybody else uses... Smh.
...when you end up poorly reinventing the wheel and don't even notice until it goes flat...
@Septopus, I think I understand your dilemma. You kinda lost me at "the system will be retrospectively authoritative wherever possible" but after reading enough of your words I think I get the problem you're talking about. The only thing I can offer is what I'm doing but it comes with limitations that may not suite you 100% and by all means you may have already thought of something similar.
I'm planning on running the simulation as far into the future as possible, basically I plan on processing as much of the NPC activitiy as I can. For instance the way I've got my NPC movement worked out is they all move on lines, this is great because all I need to store for NPC movement are sets of lines. So All movement about the world has been simplified. The simulation server all ready knows which line comes next in the line set. I plan on doing the same with NPC logic too. The server will have all the future actions of NPC's stored, then tick by tick each server than says 'This is now what is happening'. The server doesn't send the clients updates about what is happening now but what will happen. The client just basically plays the animation for you. The idea is the client and server process at double speed but play a normal speed.
Then, any time a player modifies the actions of a NPC, the server devotes real-time resources to quickly update the effects it may have on the rest of the simulation and NPC and, in theory, will replace actions within the store of action sets.
For my project, because of the type of game I'm making, the action isn't going to happen within milliseconds, like a FPS, so I can get away with not having two human players seeing the exact same thing within a very small time-frame. If there is a bit of a difference I think It should be kosher, so long as the bigger simulation is preserved.
What are your thoughts?