Clients handling their own platform in replicated game?

Hey!

I"m working on a multiplayer game. I do know how replication should work but i may need a custom approach if it is possible.
So i have a 2D game where the world is generated procedurally and split into chunks. Each chunk is represented by an actor, which has a tilemap component and all the stuff its need. I do spawn 3x3 of these chunks at the time and when the player leaves the center chunk a handler refreshes the neighbors (spawns the missing ones and destroys the leftovers).
If i spawn it from the server and to the replication as it should, it works fine. BUT because its a listen server i do not want to overload it when lot of players are in the game.

So i thought if it is possible to handle the spawning by the clients? All the clients should have their own 9 actor all the time and they don’t really have to know for each others platforms because all have their own and any changes on them are replicated by their dataset so if a player for example open a door its refreshed on all clients own actor by reloading it. (This data is replicated on an other handler actor which is run by the server)
Can this approach work?

My concerns are the collision. The server will try to fix the client position as it doesn’t know the platform collision which is owned by the client. Can i outplay this or not worth to implement it?

Its kind of a hacky solution and probably cant work but is there a smart way for this or similar solution?

Too much of questions for you, and too much of answers to type,

  • are players shares the same “world” (they can meet each other) or each have individual one (they can never meet each other)?
  • should the other players know anything about my pawn?
  • what is “a lot of players” in your understanding? 5? 20? 100?
  • what is a Tile in your game? a dozen of sprites? a quad with a pair of low-poly meshes? a landscape section with a hundred of high-poly meshes?
  • do you store some kind of map in your game? if player move left-right, will the tiles spawned on the second step will be the same as the ones removed on the first step?
  • do you planning to host a dozens of dedicated servers in a cloud, or your goal is desktop-only game?

Those will make it easier to make a better recommendations about your architecture.

Without this info, i can only clarify your concern:

My concerns are the collision. The server will try to fix the client position as it doesn’t know the platform collision which is owned by the client. Can i outplay this or not worth to implement it?

The server will try to fix the client position only if you using ACharacter (which handle movement replication by UCharacterMovementComponent) for your pawn. Depending on what you want from your pawn you could consider using a plain APawn with custom movement replication (it’s easy for turn-based game, but for realtime ACharacter is a good choice to start from).
If you have custom movement replication - you may manipulate by all the “server fixes” being made;
if you using ACharacter with CMC - the CMC have an option bIgnoreClientMovementErrorChecksAndCorrection. It have its drawbacks in the form of having no corrections, but depending on your game it maybe the thing you need.

On the other hands, if you using bIgnoreClientMovementErrorChecksAndCorrection permanently that means you kinda don’t need movement replication ->you don’t need ACharacter → you have no problems with any collisions.

CMC also have bServerAcceptClientAuthoritativePosition that will make a server to use a client’s calculations instead, but the drawback in this case is that you basically allows cheating, but, again, depending on the game it’s may be okayish approach