Start with the server side. This doesn't actually have to be a server application with no gui, but start with the simulation of an entire world. Then 'rebuild' the logic on the client side. This lets you be a little bit sloppy—though not too sloppy, obviously—because it's ok if the server 'cheats', since it has no ulterior motives (except for yours) and there's only one of it.
Much easier to sync keys and play forward vs syncing at every Rand call.
Especially on an mmo, there is no point telling a player that his next fireball spell will also trigger a "random chance to put a burn status on target". The client would start casting a fireball, which takes a second to cast and in that 1 second duration the server would decide what is the damage and if the spell is going to apply burn and by end of 1 second, you would get that information so you can see the damage values and burn icon on enemy
It is better to keep clients dumb if possible
In the era it was used, server chips weren't really a thing. So it was really just "the current decent CPU."
It's also a fascinating historical artifact of "when internet play meant orders of magnitude higher latency and jitter... as a base assumption."
Per memory, there's a bit where they've ferreted out all the sources of randomness, except one. And any source of randomness corrupted the downstream calculations, as they used global random generators.
There was some reason they couldn't just trace calls directly.
It turned out there was a line of code somewhere that said something like "if {rare condition} then rand.next {to figure out where to place an ornamental rock/tree}."
So everyone has to have the same results and calculations at all times, because there's no authoritative simulation.
It's a common architecture for RTS's (interactions are far less numerous than individual entities) but not for general multiplayer games due to issues like everyone must be on the same timestep at all times -- so a single slow player slows everyone down. See https://gafferongames.com/post/deterministic_lockstep/
If you have an authoritative server, so the client is mostly a presentation/view of current game state, you don't need to be as careful about maintaining game state/randomness, since there's only one source of randomness (your authoritative server)
Ofc, if in an mmo you have multiple authoritative servers, you're back to the same problem, though I believe the more common solution is to have 1 server - 1 universe, and you just have more game instances (shards/servers) to connect to
E.g. grid & turn-based vs 3-D free-motion worlds
They say they specifically made the deterministic lockstep choice because it was the only option that (a) allowed the multiplayer gameplay they wanted and (b) fit within the computing and network resources of the time.
once a combat session is initiated you don't need that much prediction going on because where you move is uncorrelated to where a fireball hit or not, only player stats.
the real exception are are effect, as the client need to reconcile them, but the client can chat as much as it wants as long as the presentation matches the server player stats: it can for example position area effect that hit on the server in a position such as the player hit was in range.
the client only had to make sure action result are in sync, not the world physical station whole
Usually these mechanics are not as advanced and detailed as in single-player action games, but they do exist.
To improve the experience and compensate for lag player clients run a simulation and can update their state based on their player actions directly before the action is registered or acknowledged by the server client then they only get a confirmation from the server or they get a forced update if the action they performed wasn’t in agreement with the server.
As for other things like give mentioned you don’t usually have to run a full model on the server side of your world, you however hold a representation of it in the form of maps, these are usually huge arrays of coordinates with various properties they basically transform the 3D game world into a board game board.
For MMO’s specifically while there aren’t many good open source frameworks there is something quite good and that is private server clients for popular MMO’s like Mangos https://github.com/mangoszero/server/blob/master/README.md
I think it's because of a combination of technical difficulty and game design reasons dealing with overcrowding and camping and other bad behavior.
And I also think it's a total cop out and decimates any sense of "place" in these games, which I think is so important in games like these.
If anyone has examples of modern games that don't do most of these these things, I'd love to hear it. I'm not up on all of em, particularly the ones in the primarily Asian market.
It seems to be impossible to handle unlimited players that are crowded together, even despite all the design issues. Because the logic and synchronization could grow in superlinear complexities in those scenarios. Clustered states and dynamic instance provisioning could ease some degrees but that actually can only solve sublinear to linear complexity problems at most.
With that being said, I played the Elder Scrolls Online many years ago. There were definitely phasing mechanisms. But when it just came out, there were like one thousand users PVP in Cyrodiil. Compared to World of Warcraft which one hundred players AOE in a city could make the server crawling it's already pretty impressive to me. Not sure how they have done it.
Within a system, your area of interest is always the grid you are in, which is equal for all players in that grid. "Grid" despite the name is a dynamic boundary that contains all nearby players that are likely to interact with each other. The game doesn't allow most cross-grid interactions, probably to make implementation much easier. I think they get away with this since solar systems are so large and you have to be relatively close to interact with anything.
Some of these designs became problematic.
Players can perform "grid-hacking" where they manipulate the shape and position of these grids so that they can suddenly cross a grid boundary to ambush or escape other players.
I haven't played in a while, so some of this might work differently now. The lack of server scalability within a system also causes time dilation, which besides making fights slower and boring also gives more people enough time to join and rejoin fights and cause more time dilation.
The problem was when everyone decides to hang out in one shard.
It turns out to build a solid solution that is largely overwhelming to individuals, and I yet to found an open-source framework that tackles these issues in a straightforward way.
To my shallow understanding, it's less about Unity, the game client, despite there are many protocol related works. Here are something I found really hard for me:
1. The first step is basically rebuilding all the game logic in the server-side, or you'll be facing endless cheating. The combat, the inventory, especially the map - you're going to model a huge 3D world on the server-side without existing client-side GUI helpers.
2. The most difficult thing is most of the states need to spread across the whole cluster like a distributed database, and keep sync because there might be interactions between those states (eg. shoot a fireball through the edge of the map to another map then hit someone), this usually done by modeling a quadtree across the cluster.
3. Players can randomly fight each other in an open world, and those combat needs to be dynamically grouped and disbanded. Players should only receive the state update they care about, instead of receiving every information of the world(area of interest), and everyone's interest might be different.
4. Of course, there are global clock and synchronization.
5. Many operations would require transactions, or players can trade and duplicate items when they cross the border of maps or directly disconnect.