Questions Before Using Nakama (WorldGen & World Sharding)

Hey there, I’m Rauf.
Currently I’m developing an open-world game and my plan is make it multiplayer using nakama. My plan is to segmentize the world for handling parts of the world (similar to albion online)

My other question is, is it possible to handle world in Nakama? I want to make world tiled too (similar to minecraft block system). If I do this I believe I can render the world entirely on the server side. What I mean is, if the world is tiled, I can save SEGMENT-1 as json and have the player render which prop is in the specific x,y,z tile. In this way, users can build and view these builds when entering the server. Or I just edit the world on the server side for moderation or other edits. (Similar to Minecraft, in minecraft when you join the server, you get the world that server is built on)

Thanks for any help! If there are more optimized way to do please feel free to say it.

Hello @rafucuk, it definitely should be possible to handle a segmented open world in Nakama. After dividing the world space into shards, you will need have to handle logic for broadcasts to/from other players in the shard you’re located into. You may also have one Nakama match for each section of the world, then seamlessly transfer players from one match to another. There’s a few threads that go into this type of design, here’s one.
As for representing the tiled world as json and rendering it server side, it will depend on the size of the world and your data structure format. By sharding it into regions, you’ll already have more manageable file sizes.

Hope it helps.

thanks! that what I was looking for!!

Another question. Let’s say I have premade world and there is chest in it that gives random rewards. Chest interacts with realtime server to give items to player. Can’t a hacker just run that rpc command in client side to duplicate items? Any way to avoid this?
I was going to use get players current location and get chest location from map data in serverside to check if player near the chest etc. but since it seems to be a common question I wanted to ask.

I mean lets say I handled player physics & collision etc. with client and send player pos to the server. With that way can players use fly hacks etc? Since it all handled from client side or do I need to implement collision detection in server side?

Hey @rafucuk
Hacker can’t run that rpc command in client side to duplicate items :slight_smile: Why?
First in your case, you would need to handle chest opening on server side, that means, state of chests, rolling for items, etc… It is preferable to run through socket chest opening in your case, as it will be realtime.
How it would go?

Player A → is near chest B.
Player A clicks on chests and sends to server match state command update that it is “REQUESTING” to open chest B at that location,
Server checks is chest B at location clamiable, if it is, proceeds with rolling/getting items. Upon completation it sends to Player A, again through same socket connection match state upate, with opcde for what player has received. Player stores that in its client…

Now it is true, that player could dupe items if he can get the return call from server and which parameters were executed and call that. But on server side, you would need to handle also inventory to know what player has.
Threat everything at client side as purely display.

how about flying and collision detection