Creatures in a client-sided generated world

I want to make a game where the world is entirely generated like Minecraft. To do this, I figured that I need to do the generation on the client, so that it scales. The game should be performant when multiple players are playing.

One issue with this approach is that there is no good way to handle creatures. For example, you might come across a pack of sheep in the world. From the game’s perspective, it would be easy to handle the sheep on the client, since the world exists on the client. However, the pack of sheep should behave the same for all players in the server. Creatures are not meant to be client-sided.

So far, I have not come up with a performant solution. One solution would be to generate one chunk per creature on the server, so that it can be server-sided. Maybe this is not so bad, although the server should ideally not do too much heavy lifting.

2 Likes

You could have the client only tell the server where the creature should be. The server will then replicate this information to all clients. Each respective client will determine where the creature should be based on the position provided and the subsequent position updates from the client that is controlling the creature.

The server could simply do sanity checks and ensure that the creature isn’t moving too fast or doing things that are against the laws of physics.

2 Likes