Jump to content
  • Advertisement
Sign in to follow this  
clixby

Sending radar info from server

This topic is 2682 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'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.

Share this post


Link to post
Share on other sites
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. Edited by TheTroll

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!