🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Simulation speed/deltatime has changed?!

Started by
19 comments, last by T2k 20 years, 9 months ago
There are definitely still 45 updates per simulation second, regardless of real time. I did discover, however, that ::Update() is called twice on the first frame.

[0] sim=0.00000000 real=0.00000000
[1] sim=0.02222222 real=0.01300000
[2] sim=0.04444445 real=0.04100000
[3] sim=0.06666667 real=0.06800000
[4] sim=0.08888889 real=0.08900000
[5] sim=0.11111111 real=0.12100000
[6] sim=0.13333334 real=0.12900000
[7] sim=0.15555556 real=0.15100000
[8] sim=0.17777778 real=0.17700000
[9] sim=0.20000000 real=0.19900000
[10] sim=0.22222222 real=0.23100000
...
[40] sim=0.88888890 real=0.94400000
[41] sim=0.91111112 real=0.96500000
[42] sim=0.93333334 real=0.98800000
[43] sim=0.95555556 real=1.02000000
[44] sim=0.97777778 real=1.04100000
[45] sim=1.00000000 real=1.07400000
[46] sim=1.02222228 real=1.08400000
[47] sim=1.04444444 real=1.10600000
[48] sim=1.06666672 real=1.13400000
[49] sim=1.08888888 real=1.16600000
[50] sim=1.11111116 real=1.17700000
...
[85] sim=1.88888896 real=2.02000000
[86] sim=1.91111112 real=2.04100000
[87] sim=1.93333340 real=2.07400000
[88] sim=1.95555556 real=2.08400000
[89] sim=1.97777784 real=2.11800000
[90] sim=2.00000000 real=2.14600000
[91] sim=2.02222228 real=2.16700000
[92] sim=2.04444456 real=2.20000000
[93] sim=2.06666660 real=2.20700000
...

[edited by - Martel on September 1, 2003 1:09:47 AM]
Advertisement
quote: Original post by Dragon88
Why are u using 3.9996 and 1.9998 for your turning rates? I thought that it was 4.0 and 2.0 even (or that''s what kevin said in the ''Bot Speeds'' topic)


Well the readme states the frametime is 0.02222 so I calculated those values with:
90 * 0.02222 = 1.9998
180 * 0.02222 = 3.9996

But I guess I''d better multiply by 1 / 45 ?
--------------------Life after death? Is it like terminate and stay resident?
Yeah, you should multiply by 1/45 to get an exact answer of 2 and 4.

However, that''s not entirely correct... to test it, try getting an object in sight, then turning without moving. You''ll find that the change in angle every update is something like 2.002 or 1.997, or something that isn''t exactly correct... it''s my thought that this is the reason for the shifting.
This is why we need a function that you can query on how far you have moved since last frame.

[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
Well I think I''ll skip the mapping and absolute coord stuff. It''s easy to get your real map coordinates, but if you can''t update them correctly they''re of no use.

So I might just go with relative coordinates.
--------------------Life after death? Is it like terminate and stay resident?
quote: Original post by HappyDude
My guess would be that your problem is being caused by the new feature which lets you bot to ''see'' a small area 360 degrees around it. However, any object which isn''t the +-40 degrees in front of you will report itself as being at 180 degrees, regardless of where it really is. Because of this, whenever your bot is close to something and starts turning, it will spew out bad data onto your map. Currently, I have my bot ignoring all objects whose angles are reported as 180, and that fixes it up fine.

hey, thanks HappyDude. that was my problem with the small rocks. i had them tagged as "proximity" objects but i forgot to add this test to the mapper. now everything''s solid.
I''ve written in some code to auto-correct my bot''s position based on objects in view, and so far I''ve found that I''m no longer getting the problem with the positions shifting. Every cycle I check what''s in view, and shift my bot''s position by the average error in the object positions. I was worried that eventually my angle would become too inaccurate, because I''m not correcting it along with the position (because there''s no simple way to determine what proportion of the error is in the angle and what proportion in the position), but it seems to be small enough that it doesn''t matter if the position is being corrected.
happydude, thanks for the tips on correcting for this.
however, does anyone have any ideas on why it's actually happening? just float-point imprecision?

also, i agree with T2K, this did not happen before 0.03...
i could move my bot around however i liked and it was fine. the bot would never store more than the max number of objects in its internal map.


-------------------------------------------------------
A headache, ancillary; an hourglass auxiliary.

"something witty, blah, blah, blah"
--That One Witty Guy (remember? that one dude?)

(author of DustBot)



[edited by - drreagan on September 4, 2003 12:16:53 PM]
------------------------------------------------------- A headache, ancillary; an hourglass auxiliary."something witty, blah, blah, blah" --That One Witty Guy (remember? that one dude?)(author of DustBot)
so i've been playing around with a player controlled bot, and it looks like i only get problems with overlapping obstacles in the bot's internal map after turning a full 360 degrees in either direction. i can sit still, turn a full 358 degrees, stop turning and turn back the other way to 2 degrees as much as i want (turn back and forth). but as soon as i go over 360 or under -360, the objects positions start to become displaced relative to the bot's internal map.


anyone else notice this?

-------------------------------------------------------
A headache, ancillary; an hourglass auxiliary.

"something witty, blah, blah, blah"
--That One Witty Guy (remember? that one dude?)

(author of DustBot)



[edited by - drreagan on September 8, 2003 6:15:13 PM]
------------------------------------------------------- A headache, ancillary; an hourglass auxiliary."something witty, blah, blah, blah" --That One Witty Guy (remember? that one dude?)(author of DustBot)
bump
------------------------------------------------------- A headache, ancillary; an hourglass auxiliary."something witty, blah, blah, blah" --That One Witty Guy (remember? that one dude?)(author of DustBot)

This topic is closed to new replies.

Advertisement