🎉 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
i was playing a bit with my bot and enabled my debugwindow to view what my bot does and then i saw that my map gets messed, so i disabled the ai code and returned the botcode to a working pre 0.3 version code, but the map is still messing... i cant tell what it is but i know that this was not happening in <0.3 versions of the arena, i cant imagine that its a fault of my code, because the mapping part wasnt changed by me, and ive also checked the readme/changelog but it is not listening anything related to this, so whats wrong?? i mean when i rotate, no movement, all my objects are apperaing at a slight different position, and its getting worser every rotation, as ive mentioned before this wasnt happening in the <0.3versions and i have not changed my code for this. Is there maybe some bug that ignores sometimes rotation orders or a changed simulation-delta-time? thx for any help T2k
Advertisement
I''m glad you mention that, because I''m experiencing the exact same thing. In fact, when my bot has moved for a couple of seconds through the map, I find the bot''s position to be slightly displaced, resulting in a scenario where the bot adds all objects to his map again because they''re on different coordinates and so the bot thinks they''re different objects.

I thought it was just my code being buggy (or at least having rounding differences), but if more ppl are suffering from this, there might be still hope
--------------------Life after death? Is it like terminate and stay resident?
And I forgot to mention this, but it also happens when the bot only rotates, like yours, T2k..
--------------------Life after death? Is it like terminate and stay resident?
yes, the same thing is happening to me.

i did a little research with a key-controlled bot that spews out map positioning info, and what i noticed is that when i position the bot close to a small rock, then rotate it, the mapper starts adding new objects.

it kind of looks like it might have something to do with the rock being incorrectly identified as a small rock, when in fact it's a big rock, and therefore the bot begins to slide. or maybe the arena is using the big rock radius for its collision calculations when it should be using the small rock radius.

i've done this enough now that i'm convinced that this is the problem. and it always happens when close to any small rock. and it never happens if i keep the bot away from any small rocks. the mapper always correctly identifies and tracks 26 objects, time and time again. it's only when the bot gets near a small rock that the mapper goes wonkers.

[edited by - flipper76108 on August 30, 2003 6:33:25 PM]
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.

Also, there seems to be (for me at least) a slight inconsistancy in the distances/angles - nothing big, something like 0.001 per update cycle, but it accumulates and can cause your bot double-vision... it''s because of this that I think I''m going to have to write some functions to check and readjust my bot''s position every cycle based on what it sees...
hmm no thats not the problem, iam ignoring the 180deg objects and my mapper worked in preversions perfect (only movement caused a slight displacement but this was compensated). Iam also using a toleranzvalue to identify objects but in the acual version it seems that something different isnt working.


T2k
I''m also ignoring the objects with a +/- 180 direction. Furthermore I am using a small tolerance factor which I add to the radius of an object (so the bot thinks it''s bigger than it actually is) to loosen up the object detection. This still doesn''t seem to be enough.

I''ve also tried the "self-correcting" approach, ie. the bot adjusts it''s own position according to the difference in the position of an object that it sees and the position of that object in the map.

Still no luck.

Maybe I should just choose a different approach, because I don''t know where this inaccuracy lies. Is the rotation wrong? Is the movement wrong? And what is it''s value per x frames?
--------------------Life after death? Is it like terminate and stay resident?
I did some testing and I'm seeing this drift also. I'm not sure if it's new or not, but I am fairly sure it's not my fault. I haven't really thought about ways to work around it yet, but I'll keep you guys updated if I do.


(white objects are mapped, purple shows objects currently visible)

If I turn left, the mapped objects are off to the right from the actual objects. If I turn right, they are off to the left. Sounds like some kind of math error (i.e. imprecision).

What values are you guys using for rotation? I'm using:

FRAMETIME = 1.0f / 45.0f
SPEED_TURN_SLOW = 90 deg/sec
SPEED_TURN_FAST = 180 deg/sec

Then inc/decrement the bot's internal facing angle by DEG2RAD( SPEED_TURN_SLOW * FRAMETIME ).



[edited by - Martel on August 31, 2003 8:49:53 AM]

[edited by - Martel on August 31, 2003 8:52:53 AM]
Yep, that''s about the problem.

movementSpeeds[STRAFE_LEFT] = 0.3333f;
movementSpeeds[STRAFE_RIGHT] = -0.3333f;
movementSpeeds[SET_NO_SPEED] = 0.0000f;
movementSpeeds[SET_NORMAL_SPEED] = 0.4444f;
movementSpeeds[SET_HIGH_SPEED] = 0.8888f;
movementSpeeds[SET_REVERSE_SPEED] = -0.5555f;
movementSpeeds[TURN_SLOW] = 1.9998f;
movementSpeeds[TURN_FAST] = 3.9996f;

And I increment the angle just by movementSpeeds[TURN_SLOW] or movementSpeeds[TURN_FAST] each frame that I turn. My rotation angle is in degrees.
--------------------Life after death? Is it like terminate and stay resident?
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)


(Stolen from Programmer One)
UNIX is an operating system, OS/2 is half an operating system, Windows is a shell, and DOS is a boot partition virus

This topic is closed to new replies.

Advertisement