Uploaded March 2019 | Updated September 2026, 1 hour ago
A video in a series, finishing with my next game, Krazy Karts!
This video is again from the perspective of an AI Kart and demonstrates all AI karts being able to complete a relatively complex 3-lap race.
The most obvious difference to other videos is the racecourse - I've displayed the data "map" that each racecourse will have underlying the racecourse that would usually be visible to the player. This data map includes the various checkpoints and finish line for each map, as well as the drive-able area for the AI, displayed in red.
The technique I've used so far is as mentioned previously: a "feeler" approach. The AI currently extends 3 feeler arms with 10 feelers that "see" what the racecourse looks like in the distance, and decides whether to turn or continue straight, and whether to accelerate or brake.
These feelers are displayed on camera - colour-coded to determine whether the feeler is on drive-able terrain - to visualise how the AI decides where to go. Cyan indicates a feeler is on drive-able terrain, green otherwise.
The AI actually only uses two simple rules:
- If the number of valid left hand feelers outweigh the number of valid right hand feelers , start turning left (and visa versa). If they are equal, continue straight.
- If any of the feelers directly ahead of the Kart are not valid, start braking based on the percentage of feelers turned off compared to all forward looking feelers. Maximum brakes are therefore only applied if all feelers are not valid.
Any comments on my method would be more than welcome!!
This game uses a simple 2D game engine with pseudo-3d techniques: decidedly retro. I'm using a tweaked version of the one presented by javidx9; watch his brilliant tutorial here: youtu.be/ybLZyY655iY
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
I will release the game on itch and all code on GitHub once I've finalised the game.
A video in a series, finishing with my next game, Krazy Karts!
This video is again from the perspective of an AI Kart and demonstrates all AI karts being able to complete a relatively complex 3-lap race.
The most obvious difference to other videos is the racecourse - I've displayed the data "map" that each racecourse will have underlying the racecourse that would usually be visible to the player. This data map includes the various checkpoints and finish line for each map, as well as the drive-able area for the AI, displayed in red.
The technique I've used so far is as mentioned previously: a "feeler" approach. The AI currently extends 3 feeler arms with 10 feelers that "see" what the racecourse looks like in the distance, and decides whether to turn or continue straight, and whether to accelerate or brake.
These feelers are displayed on camera - colour-coded to determine whether the feeler is on drive-able terrain - to visualise how the AI decides where to go. Cyan indicates a feeler is on drive-able terrain, green otherwise.
The AI actually only uses two simple rules:
- If the number of valid left hand feelers outweigh the number of valid right hand feelers , start turning left (and visa versa). If they are equal, continue straight.
- If any of the feelers directly ahead of the Kart are not valid, start braking based on the percentage of feelers turned off compared to all forward looking feelers. Maximum brakes are therefore only applied if all feelers are not valid.
Any comments on my method would be more than welcome!!
This game uses a simple 2D game engine with pseudo-3d techniques: decidedly retro. I'm using a tweaked version of the one presented by javidx9; watch his brilliant tutorial here: youtu.be/ybLZyY655iY
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
I will release the game on itch and all code on GitHub once I've finalised the game.


![2D Game Engine in C++: [9] Bounding Boxes
This video demonstrates the inclusion of bounding boxes into the game engine. This is the first of a series of controls that will allow for viewing how various items are being represented in the game world.
I anticipate that there will be a number of uses for these controls, most obviously when setting up and testing collision detection. This particular switch allows me to get a sense of whether sprites are moving around the screen exactly as intended.
Its more difficult to see, but there is also a switch used for pinpointing where light sources exist. You may notice small yellow pixels at various points in the video in the middle of the torches, representing light positions. This helped me debug the issue I had in the previous video.
This video also displays a bit of new art. It definitely takes a lot of time to put together any new art assets, as Im no artist!
I will release all code on GitHub once Ive finalised the engine - and have nice looking code to boot!
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili! 2D Game Engine in C++: [9] Bounding Boxes](https://i.ytimg.com/vi/ZSL4Ky4xVYo/mqdefault.jpg)







