Fast Gear – Week 5
|
As I mentioned in my previous post I have been working on the waypoints and the AI practically throughout the week. I have made some progress and the frame drops does not seem to be noticeable. The problem was that for 21ms the pathfinding for the units allocated 18MB memory but now I have reduced that to only 8.9MB which is a notable difference. The problem seemed to be the threading which you can implement so you can have different calculations parallel with one another without interference if I understand it correctly. Since I have not done something like this before in a project it caused an issue. But the threading is now gone and the frame drops are considerably lower. I also changed some things with the target. Instead of the different AI’s using the same target I assigned them their own. It is now a list of different target locations that check if the assigned AI has collided with them and in that case it moves to the next index in the list. I did this incase one AI came to a waypoint faster than the others. There was a small jerk in the other AI as the may have been in the middle of a turn or colliding with something, now they can take their time with the track without relying on each others targets. Next week I am going to be working on making my own controller/physics for the car instead of using the prebuilt, which has helped during the prototyping and alpha but it is a lot of code which we do not know much about making it hard to troubleshoot. |