I am developing a project in java and have successfully made a game where you run around and shoot zombie AI the walk directly toward your player when you are within a given radius. now that the framework of my game is set up, for my next step i was considering a way to network it for multi player. I understand basic networking and already have a server and client but wanted to know how i could track both the players and the zombies positions without completely lagging up the server. there can be around 100 zombies at a time and i am concerned that constantly sending the X,Y position would really slow the server. is their any alternative? how do games like Halo keep track of enemies online so well?
Asked
Active
Viewed 82 times
0
-
Do you have any code to show for the multiplayer feature? Or even technologies you want to use – Steven V May 01 '13 at 01:56
1 Answers
0
A lot of calculation is taken on the client, rather than the server in action games.
The client tracks position, actions taken, damage taken, etc. Every once in a while (not long really) some of that data is sent to the server.
Current position, enemies attacked from a position, etc.
Then the server's level of trust kicks in. You'll have to determine whether the actions the client claims to have taken are possible. Could he have traveled across the map and headshot 50 zombies in the past 5 seconds... for example.
There is a tradeoff on "claim-checking" and just sending more data from the client. At a certain point your server may be performing too much calculation and not enough talking over the network.

Nocare
- 9
- 4