|
Re: client update ranges
[Re: SchokoKeks]
#316431
03/24/10 03:58
03/24/10 03:58
|
Joined: Jul 2004
Posts: 74 Inside Maya
Sichlid
Junior Member
|
Junior Member
Joined: Jul 2004
Posts: 74
Inside Maya
|
my suggestion would be to store the value of old health in a var like old_health and check on the client machine every frame if health has changed. if yes then only send the new health value to all machines.
Best Regards,
Sichlid
|
|
|
Re: client update ranges
[Re: Puppeteer]
#316984
03/28/10 13:27
03/28/10 13:27
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
thank you all for your answers.
@ Sichlid + darkinferno: that doesn't solve the problem. using "old"-variables is something thats needed independent of client update ranges.
@Puppeteer: Thats a good idea, and it keeps the code simple. However, you'd have to keep the zones quite small, and you'd have to take care of smooth transitions between the zones, or entities will just pop up in front of the player when he gets near the zone border.
I'll be using zones with "hard transitions", meaning that the player will see a loading screen when switching between those zones (through doors or small gateways). They are supposed to be quite big, so I still need an update ranges system.
I've solved the problem this way: Every entity that wants to send updates has an array that has as many slots as there can be players (about 100). Every frame, the entity checks whether it is within the range of the players. When the array entry for the player x is 0 (means "not in range before") it sends all its information (health, position, level etc) to x. The entry is then set to 1 (means "has been in range last frame"). When the array entry is 1 in the first place, only changed values are send.
This code has to run on the server only. I've yet to see if I'll get performance problem.
|
|
|
Re: client update ranges
[Re: SchokoKeks]
#316997
03/28/10 14:58
03/28/10 14:58
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Ok this is a nice concept. But if you use seperate zones I would advice you to use a seperate server for each zone. (look at HowTo 2 in the ANet manual)
Why? Because if a lot of people are playing your game let's say about 200 at the same time, it will be impossible that one server handles all these players. So you split your whole game into 10 zones. Now you have 20 players on 10 servers and that should be possible.
Of course this is unimportant if you are creating a small game. But then I would advice you to create it with vec_dist(): Every client sends its position updates to the server. The server then forwards it to the clients depending on the distance of the clients to the entity that sends the new position. Entities that are out of range should turn their invisible flag on. The Dead Reckoning Template of ANet does it this way.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|