Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 911 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[Anet] client side prediction #296055
10/29/09 13:56
10/29/09 13:56
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
currently i do movement on the server which works fine, downfall is, the clients dont see their movement until the roundtrip to and from the server, what i want is some advice on predicting local movements.

my idea so far is to let the client be able to move locally and updates it position to the movement received from the server, this works but as can tell there is a jump most times as the local movement is snapped to the position received from the server...

any ideas on implementing this update smoothly?

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 Offline
Serious User
Dark_samurai  Offline
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: Dark_samurai] #296149
10/29/09 23:01
10/29/09 23:01
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
also think about letting the server calculate the one-trip lag from the client, and re-calculate that last segment of movement with the input included (ensuring legality). This might drop some of your difference in server and client-side effective movement.

Don
have a great day

Re: [Anet] client side prediction [Re: Gumby22don] #296562
11/01/09 18:55
11/01/09 18:55
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Make the player move directly on the client,
and send it position to the server.
Only show the other bots/players according to their servestate.

Thats the way Unreal Tounament and WoW work for example.

Take the clients position as direct data for the server,
thats the simplest way.
The server then does not move the entity, but takes
the clients send postion as actual serverposition.

You could also let the client calculate directly how another
player was hit by a weapon. But doing the movement locally
is more important.

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 Offline
Serious User
Dark_samurai  Offline
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: Dark_samurai] #296643
11/02/09 09:17
11/02/09 09:17
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
am also curious to why you think Unreal and WoW did that, i knwo speed checks work but i guess there are work arounds

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 Offline
Expert
Germanunkol  Offline
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_ Offline
Expert
Damocles_  Offline
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.


Re: [Anet] client side prediction [Re: Damocles_] #296686
11/02/09 13:29
11/02/09 13:29
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
i dont think they are doing fully client side movement, i think they do as we were suggesting, move on client and on server, the server is king, so every few seconds or so, an update is sent to the client to set him to what the server sees, if i were to plug out the lan cable, i'd still be able to run around the entire map but the server character wouldnt move at all

Re: [Anet] client side prediction [Re: darkinferno] #296687
11/02/09 13:41
11/02/09 13:41
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
But the short term movement is done by the client.
The server is a mere control instance, to adjust
for object-interactions that the client can not predict,
and inaccuracies (by cheating or timeoffsets)

In your game you can assume that there is not cheating,
making the whole development easier.

But it is definitely not done in the classic way:
-client does an input/keystroke
-server receives it, moves the player
-server send it to the client
-client receives it and updates/interpolates position

That would play awfull in a first person game.

---

ANother thing:
by having a full server side movement, you
would allways give the full advantage to the server hosting
player. He would be the only one who could do lag-free
accurate and quick movements, making the game unfair
by stucture.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1