Fast Gear – Week 4
|
Up until this point and probably for a couple of more weeks my focus have been on doing the AI(Artificial Intelligence) for our game. The AI is not that complicated as of right now. It has a road which it follows using A* which an algorithm for calculating the fastest way to the goal. The area surrounding the road is not made out of the same material so it has a higher value, meaning it costs more to drive on it. This makes it so the AI will try to keep itself on the road as much as it can. I have also added physics to it so that it looks more realistic when it drives around the track. Also if the AI does get outside the road I made it so it has a bit more drag which makes it go slower until it gets back on the road. During the playtest we had this week we understood that the AI needs more testing against players who are not used to playing racing games. It was fairly easy to keep up with and beat the AI for us but for the ones playtesting it was very hard, they hardly ever saw it after the start. For the upcoming weeks my focus will be on optimizing the AI. There is currently a spike in memory usage when it is calculating its new route which causes the frames to drop down to around 30 for half a second. Right now I am not sure what is causing it so this is a priority for me and the group.
What you see in this picture is the A* algorithm. The red and white squares are cars and the black dots are waypoints which it tries to follow as best it can. The white lines are displaying when they should turn. |
