Calculation of new position

Looking at SimulateTick in the TickProcessingService it appears that each new position is calculated in several small steps by using the current position, the heading and a speed of 1. Each time QuadrantMath is called with the same parameters (speed = 1 and heading), which means you will get the same position delta. The final position will thus be the original position updated with speed times the position delta produced by a single execution of QuadrantMath with the fixed heading and a speed of 1. It appears that movement will be along the x- or y-axis or one of the diagonals only.

Or am I missing something?

Hi @thinus and welcome back to the challenge!

Indeed as you’ve inspected, we calculate the bots’ change in position over multiple small steps across their speed.

I’m confirming your question and will get back to you once we have more information.

Hi @thinus,

Did a lot of digging after your question and it uncovered quite a couple things around this question - so thanks for bringing it up.

We refactored the way that logic is dealt with, to better maintain the heading over a range of moves, as well as maintain distances correctly. As you pointed out, at a speed of 1, you would only move in a cardinal direction.

The above still holds true, once your speed becomes 1, as that is the minimum size of unit of distance, you will still move in a cardinal direction (0, 90, 180, 270) rather than directly diagonally.

However, as soon as your speed is higher than 1, the heading should be maintained relatively well, with increasing precision relative to how fast you are going.

Depending on balancing feedback, we might lock out the minimum speed to something higher than 1 to help deal with this case. However right now we feel the compromise is fine, as once your size gives you a speed of 1, your bot will pretty much hit whatever it was planning to so long as it is heading in the general direction of it.

Let me know if that helps, and will be keen to hear your feedback!

1 Like

I agree that the compromise is fine if you do the calculation to find a new postion for the bot, irrespective of the bot speed.
I am still missing something. Inside SimulateTick you are calling MovePlayerObject multiple times ( i from 0 to bot.speed) which will keep moving the bot in a cardinal direction. The approximation of the position of the bot will get worse as the speed increases?

Please check you are looking at the latest code, that was updated with the 2021.1.1 release.

We now trace points along the path that most accurately describe the movement required, and then iterate the bot along those points.

1 Like