Archived

This topic is now archived and is closed to further replies.

Dead reckoning

This topic is 5768 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI! I've used dead reckoning for my online game and all works fine. Server used win98 and client used win98. But when I installed WinXP on the server the dead reckoning started to become more choppy/jerky than it was before. Then I checked the diffrent speeds on my players (I use netspeeds to calc the DR) and found out that the precision on the floating point values differs from winXP to win98 I tried again to go win98 on both client/server and the dead reckoning was better at once I'll try WinXP on both machines later tonight and hope that it will perform as well as win98-win98 did.. Has anyone else noticed this precision differing on XP-98, am I correct? (I'm talking about 0.000000XXXX changes). Edited by - Herr_O on February 21, 2002 10:00:18 AM Edited by - Herr_O on February 21, 2002 10:00:40 AM

Share this post


Link to post
Share on other sites
Can you try to run your game in XP, but with a compatibility mode enabled?

My game DIDN''T run in XP at all, but with Win2k compat mode, it worked without problems. it was also a problem with a precision. When calculating the angle of the shields (which are prerendered and in an array), it sometimes exceeded the limits of the array. This never happened in one year of programming on Win2k, OR win98. Well, I fixed it simply by checking if the value exceeded the array bound, but still it is a flaw in XP somewhere.

Okay, that was slightly off-topic. Anyway, I''m not sure if it affects my network code too. I haven''t tested the game over the internet yet since XP is available... my game is also based on many digits ater the comma, so I will certainly keep this thing in mind for XP users/players!

Regards,
Almar

Share this post


Link to post
Share on other sites
Hello

I''ve haven''t tried compability mode yet.. it runs fine on XP anyway (just that precision bugg) but I''ll check it out

I did try using xp on both client and server, and as I expected.. the Dead Reckoning started to work much better.

I''ll will try later again to run the program on three machines, XP(server) XP(client) 98(client)... that''ll be intresting =)

But if I can''t get around the precision bugg then thats no big deal.. The choppy movement are not too big and only happens when diffrent OS are in use, every one is using XP/W2k now a days, right?

Share this post


Link to post
Share on other sites
It worked better for me also in compability mode argh!, I don''t want to use that.. compability mode is stupid =P shouldn''t be necessary. I whish I could fix it myself as you did but my problem is not coused by arrays. Don''t think it can be solved with a simple "hack"

I like windows alot (NOT) sigh..

Share this post


Link to post
Share on other sites
What are you saying ?? That if I multiply two floats then the result will come out different in XP vs W95 ?????

I have a hard time believing that...

Share this post


Link to post
Share on other sites
noo... I''ve tested that just to be sure and it did not. But I did this:

I use a netspeed to calculate the deadreckoning. This speed I send over the network and multiply it with my frame time to make it go att the same speed for all clients. If the speed is constant, not acc, then the deadreckoning should be pretty exact(no jumps when a new mess is received) but it was not

So I printed out the netspeed on both computers and found out that the speed was diffrent after the dynamics and frametimer was put on it.. That''s funny, couse I use the exact same funcions on both computers, they should have been the same after the calculation.

That''s why I started to wonder about the precision diff (allways thinking the worst, common error ) The whole problem was sorted out though.. it seemed to be a debug error, if I compiled the release version of the app - all went ok (*puh*) And if I used compability mode with the debug exe, that worked fine too (funny?)..

So I learned this: ALLWAYS use release mode if you find a strange bug! argh, spent two days on nothing.. jej!

-----------------------------
Sometimes a Guru meditation must be followed by a Vulcan neck grip.

Share this post


Link to post
Share on other sites
I usually work in release mode unless I encounter some sort of bug.

If you work in debug mode some errors stay hidden until you run it in release mode. And then you have no idea what caused it if you have been in debug mode the last 2 days.

Share this post


Link to post
Share on other sites
Yeah, but under VB there''s no release mode =-)

And I compile everything to Native since it takes ages to decrypt the resource data from the IDE. And like I said, in compatibility mode it works flawless, and under XP mode the miscalc occurs. No problems under any other OS...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Timmer functions have different resolutions on win9x and win2k/XP, specificly the timeGetTime() functions have 1 ms resolution on 98, and on win2k/XP can be 10 ms or more. You can set it explicitly on the later. Look on msdn on how too.

Hope this helps.

Good Luck!

-ddn

Share this post


Link to post
Share on other sites
If GetTickCount() has been your favorite timer, then you could have problems there. The high performance counters (QueryPerformanceCounter) are the only ways to establish cross-platform resolution. WinXP/2000/98/95/ME all have different resolutions to GetTickCount().

Share this post


Link to post
Share on other sites
Sphet is right, QueryPerformanceCounter() is the only way to
have a decent timing function for Windoze. Working with
Linux you can use gettimeofday() which also has microsecond resolution but thats not the issue here.

Share this post


Link to post
Share on other sites
Soo I should replace all of my GetTickCount with QPC?.. Im only using QPC now to determine frametime..

-----------------------------
Sometimes a Guru meditation must be followed by a Vulcan neck grip.

Share this post


Link to post
Share on other sites