
assuming my bot is at the black position. if i move forward and then turn right, i end up at the red position. if i turn first and move forward later, i end up at the blue position...
[edited by - vogela on August 18, 2003 10:54:07 AM]
quote:
Original post by vogela
i still think this needs clarification, 'cause i still dont see how this exactly works.
assuming my bot is at the black position. if i move forward and then turn right, i end up at the blue position. if i turn first and move forward later, i end up at the blue position...
Admin for GameDev.net.
quote:
Original post by Khawkquote:
Original post by vogela
i still think this needs clarification, 'cause i still dont see how this exactly works.
assuming my bot is at the black position. if i move forward and then turn right, i end up at the blue position. if i turn first and move forward later, i end up at the blue position...
Assuming you turn and move in the same Update() cycle.. you end up at the blue position no matter what order you send the commands. If you do these things during different Update() cycles, then sure, order matters (i.e. Update() cycle 1 you move, Update() cycle 5 you turn, etc).
quote:
Original post by Khawkquote:
Original post by vogela
i still think this needs clarification, ''cause i still dont see how this exactly works.
assuming my bot is at the black position. if i move forward and then turn right, i end up at the blue position. if i turn first and move forward later, i end up at the blue position...
Assuming you turn and move in the same Update() cycle.. you end up at the blue position no matter what order you send the commands. If you do these things during different Update() cycles, then sure, order matters (i.e. Update() cycle 1 you move, Update() cycle 5 you turn, etc).
quote:
Original post by Ready4Disquote:
Original post by Khawk
Assuming you turn and move in the same Update() cycle.. you end up at the blue position no matter what order you send the commands. If you do these things during different Update() cycles, then sure, order matters (i.e. Update() cycle 1 you move, Update() cycle 5 you turn, etc).
The point is, one HAS to happen before the other...
x += cosf(theta);
... but when is theta updated, before or after you add the value, that was the question. It HAS to be one or the other, it can''t be done at the same exact time, it either:
theta+=turn_angle;
x+= cosf(theta)*speed;
or it does this:
x+= cosf(theta)*speed;
theta+=turn_angle;
Both give DIFFERENT results, I was just wondering which way it happens in the code. The man with the diagram showed it pretty well... The first case (angle updated first) would result in the blue location, while the second case (angle updated after) would result in the red location. I was questioning which order it happens in the update function, not what happens between multiple updates.
Admin for GameDev.net.
quote:
Original post by Illumini
We don''t know why it wouldn''t be, but we''d rather be sure before writing our code one way or another (prediction code could be effected by this along with many other things).
So to that point, how do stafing and firing fit in?
You''ve stated so far that it is
Turn
Move
Which makes sense... So I''m assuming strafing also follows turning (as this would also make sense), whether it goes before or after move doesn''t matter, so we can assume...
Turn
Move
Strafe
Hopefully firing happens either completely before or completely after all these steps. I''m going to go with AFTER based on the logic you have seemed to use in creating the arena.
But for satefy sake verification would be nice![]()
Admin for GameDev.net.
quote:
As you send commands to the GDArena, only the first time a command is sent will it be executed. This means that if you send a TurnLeft() command early on in your processing, and then later send a TurnRight() command, only the TurnLeft() command will be processed by the arena during that Update() cycle. These commands are processed for the current Update() cycle only, and do not persist once that cycle is over.
quote:
Original post by Epidemi
Hi,
I guess these comments more or less don''t apply to GDArena anymore since the readme states that you can send only one command each update cycle:quote:
As you send commands to the GDArena, only the first time a command is sent will it be executed. This means that if you send a TurnLeft() command early on in your processing, and then later send a TurnRight() command, only the TurnLeft() command will be processed by the arena during that Update() cycle. These commands are processed for the current Update() cycle only, and do not persist once that cycle is over.
Am I right here?
Admin for GameDev.net.