Sign in to follow this  

Server/Client architecture for space sim, movement collisions etc

This topic is 2629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having a dilemma at the moment, I am unsure as to which is the best way to implement my client/server architecture.

The game I intend to make (that is still in the concept stage) will hopefully be a space sim rpg with MMO elements to it.

Anyway the problem that I am having is that I do not know what is going to be the best way to implement the synchronisation of player movements/health/etc.

I know that I could do it all on the server and send all the data to all the necessary players once a cycle or whatever. But this is not a point and click, I intend to have the player in control of the ship(s) (eg speed and direction) and have it work that way. It strikes me that to have the server calculate all this for all the possible players and their ships would need way too much overhead and use of the server CPU.

So what I was thinking was to have the clients in control of their own ship(s) and have them tell the server where they are and what he is doing and then all of the remaining ships current coordinates and orientations sent to the clients and keep it all updated and in sync like that. Therefore meaning that the clients will be responsible for collision detection not only of their own ships but of their bullets and enemy ships (the cheats ensue lol).

Is my proposal the best way to accomplish what I want to do?

A problem I can see is that when there is a collision of two player ships, they will both report the collision and if they are out of sync at all the server will treat it as two separate collisions, I don't know what to do about this. Maybe someone has an idea?

Thanks

Share this post


Link to post
Share on other sites
How many players do you intend to support?

You could take your approach if you don't care at all about cheaters, but it only takes a few cheaters to ruin an entire game/community.

Share this post


Link to post
Share on other sites
Space is enormous. Ships are small. Collisions pretty much never happen -- even if you aim for something, with manual controls, you're likely to miss. (Ballistic control computers will probably hit if you tell them to, though)

Share this post


Link to post
Share on other sites
I've been working on something similar (with a target of 16-32 max players in the same space location) and my approach was something like:
- the server is the king and it runs the whole game like the remote clients were AI's
- clients runs the same code as the server (physics, collision, etc.) and sends input to the server
- server sends frame updates to clients
- clients updates their simulated world to match the status received from server (since the updates from server comes at a low rate ... 10-20 updates per second I have several client frames to interpolate until I reach the server version).

It seems to be working relatively well ...

Share this post


Link to post
Share on other sites

This topic is 2629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this