Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Stooq now requires an API key
by VHX. 06/08/26 20:14
ZorroGPT
by TipmyPip. 06/06/26 12:36
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 3,506 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dead Reckoning: Need tips and Help #276138
07/03/09 13:51
07/03/09 13:51
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Hi,
Ok for my next projekt i moved to RakNet. I am programing a small RPG for up to 20 Players(and GSTNet doesnt support 20 connections v.v).

Ok since iam able to create+update Entites for every server/client, i have a question about Dead Reckoning.

Currently, i send the information of movement speed of an Entity(if changed. Is 1 or 0 for every direction) and every second i send the position to keep them in sync.

But sometimes (of course), the entity jumps a bit when getting the new position since it isnt 100% at the same place.

Can someone help me to get a simple death reckoning to work?

The perspective is 3rd-Person an a RPGMAKER-Like top view.
The character is controlled by W,A,S,D.

MY first idea was to interpolate between the new position and the entity and not to use the speed vector on the remote entity. SO i would just send the entity position every second. But today its seems iam to stupid to do such a simple task :P.

Maybe someone can help me?

And no, i wont use ANet because i have no MONEY wink

Greets
Rackscha


Last edited by Rackscha; 07/03/09 13:52.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Dead Reckoning: Need tips and Help [Re: Rackscha] #277435
07/09/09 09:17
07/09/09 09:17
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
What I do is: when the new position update arrives, I do:
vec_diff(temp,newPos,my.x);
Then temp gives the difference between my current location and the location I am at right now.
Now without interpolation, you'd just do: vec_set(my.x,newPos); but that makes the player jump.
Instead, I devide the temp vector by the update rate (it's one second in your case, so I'll use 16 ticks)
vec_scale(temp,1/16);
Now temp is a sixteenth of the difference, meaning it's the distance that I need to move every tick to make up for the offset that was there when the new position arrived. Over the next second, I now add this temp (would be better to call it something else, and save it into the player's skills) to the position by using c_move:

c_move(my,vector_that_you_use_for_the_movement,vector(temp.x*time_step,temp.y*time_step,temp.z*time_step),GLIDE|IGNORE_PASSABLE);

so when the second is over, I've added a sixteenth of the distance every tick, for 16 ticks, so I should have made up for the offset when the next update arrives. Of course, this may be off again, so I do the same thing again, just overwriting temp (or whatever you call it).

Hope this is what you're looking for...?

I would still send speed though.
You could remember the last positions that were sent and try to find out the speed value that way, but that's not really a good method: sudden speed/direction changes would be lost.


~"I never let school interfere with my education"~
-Mark Twain
Re: Dead Reckoning: Need tips and Help [Re: Germanunkol] #278859
07/15/09 21:33
07/15/09 21:33
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Thx for the tip smile


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Moderated by  HeelX, Spirit 

Gamestudio download | 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