3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [Anet] client side prediction
[Re: darkinferno]
#296060
10/29/09 14:25
10/29/09 14:25
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
you could interpolate to give it i smoother look (of course this doesn't solve the problem completly, but it will look much better).
You should think about why the movement of the server is so different to the movement of the client and try to minimize that problem (more updates, better prediction, ...)
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [Anet] client side prediction
[Re: Damocles_]
#296641
11/02/09 08:47
11/02/09 08:47
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I wonder why Ureal and WoW did it that way... Isn't that totally insecure (speedhack, aimbot, ...) or do they have security checks on the server like controling the maximum speed?
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [Anet] client side prediction
[Re: darkinferno]
#296651
11/02/09 09:42
11/02/09 09:42
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I'd go for both client and serverside movement. the serverside movement should depend on the keystates on the client, and, if you're good, calculate the ping into it somehow. then the position should be sent back to the client who then checks how different the server side movement was. Shooting is more complicated, you once sent me the link where they explained how css did it, with the server using the ping to calculate if the trace the client sends out would have hit something if the sending of packets were instant. I'd attempt to go for that method, if you want to make it real accurate, even though it's a pain: you'll have to remember the positions of the players during the past second or so to make sure all clients have an equal chance of hitting something, even when their shot arrives late on the server.
as for movement: send keystates from client to server and let both calculate the movement. then send back the positions from the server to all clients. let the client who's playing the character check if his movement was correct, and let all other clients simply interpolate and predict what position will be next, depending either on the last positions or on the keystates that the client sends. The animations I'd do entirely locally, I don't think you'd even need to send animation states or types, instead check in what direction the player moved during the last frame and play the corresponding animation.
Just my idea. Good luck.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: [Anet] client side prediction
[Re: Germanunkol]
#296682
11/02/09 13:13
11/02/09 13:13
|
Joined: Feb 2009
Posts: 2,154
Damocles_
Expert
|
Expert
Joined: Feb 2009
Posts: 2,154
|
Wow and Unreal (also Quake World) did this client side calculation for a good reason: Playerexperience in Internet play. (Test it yourself: when playing WoW, take out the LAN cable. You can still walk freely with your player for some seconds. Its clearly calculated on the client)
While a LAN game can be handeled fully on the server, it does not work in the Internet. The worst is to have a lag in players own movement + rotation. This would make the best game not enjoyable.
(RTS games for example can work fully server side, as the Lag in unitmovements is not experienced in first person)
Unreal Tournament for example does a serversimulation of the movements, given the keystrokes, positionas and velocities of the clientmovement. If there are diviations, the server will kick back the client to it "simulated" correct position. Its important that client and server have agreed on a syncronized gametime. For you (hobby game) you can skip the server check, as cheating is not really an issue, and the serverside clientsimulation is quite complex.
Other actions like shooting can be handeled in a clasic way by the server. You will notice in UnrealTournament, that the bullets are shot with an offset in high latency games. So the shooting is actually done on the server, triggered by the client input. But movement+rotation should be done locally on the server.
A problem can be collisions between players. Quake World solved that by using a prediction algorythm, based on the position + velocity of the bots/actors. KInd of having an additional collision hull interpolated in front of the players movement direction for bot to bot collisions. Wow solved that, well : by having no player to player collitions at all.
|
|
|
|