Sending radar info from server

Started by
0 comments, last by TheTroll 13 years ago
I'm a complete noob and still in the planning stages of my game, so I'm trying to work out the problems before I jump in. I'm still undecided on which programming language to use, but leaning towards vanilla Python.

The problem:
My game is a multiplayer 2d space game that will probably end up with A LOT of ships running around at once. Players can control multiple ships while AI controls others. I want to send a list of nearby ships to each ship, preferably every second. I want to do this without sending all ship positions to the client, because I'm guessing it will be trivial to mod a client to show all ship locations if the client was sent all that info.

I'm afraid that nesting loops to achieve a per-ship list of nearby ships will destroy the server past a few ships. What would be the possible solutions for 500+ ships?

Also, I am probably not going to be using any game-making or networking frameworks, if that makes a difference. If there's an elegant way of doing it with one of them, though, I'd be interested.
Advertisement

I'm a complete noob and still in the planning stages of my game, so I'm trying to work out the problems before I jump in. I'm still undecided on which programming language to use, but leaning towards vanilla Python.

The problem:
My game is a multiplayer 2d space game that will probably end up with A LOT of ships running around at once. Players can control multiple ships while AI controls others. I want to send a list of nearby ships to each ship, preferably every second. I want to do this without sending all ship positions to the client, because I'm guessing it will be trivial to mod a client to show all ship locations if the client was sent all that info.

I'm afraid that nesting loops to achieve a per-ship list of nearby ships will destroy the server past a few ships. What would be the possible solutions for 500+ ships?

Also, I am probably not going to be using any game-making or networking frameworks, if that makes a difference. If there's an elegant way of doing it with one of them, though, I'd be interested.


The way I would do it is to break the map up into smaller squares. Now if you have only a single range for your radar then you make the squares 2/3rds the size of that radar. That will mean that the square the person is in plus the surrounding squares are the only ones you need to test against to see if they can be seen.

This topic is closed to new replies.

Advertisement