First Games in C++: Krazy Karts (v0.73) - Improved AI @s0lly
First Games in C++: Krazy Karts (v0.73) - Improved AI  @s0lly
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.
First Games in C++: Krazy Karts (v0.73) - Improved AIFirst Games in C++: Krazy Karts (v0.90) - New Map, Tire Tracks, Invincibility, Sprites Updated!Ray Tracing: Texture Mapping & Lighting2D Game Engine in C++: [9] Bounding BoxesFirst Games in C++: Dungeons and Flagons (v0.88) - Multithreading!N-Body Simulation Tutorial in Excel!First Games in C++: Krazy Karts (v0.79b) - Homing-in Missiles!First Games in C++: Krazy Karts (v0.78) - Powerups!First Games in C++: Dungeons and Flagons (v0.85) - Torch Shadow Casting!Game Engine 20: Camera TransitionsNew to C++: Breakout - My First Challenge!Real 3D Engine - in Excel!!
s0lly |

First Games in C++: Krazy Karts (v0.73) - Improved AI

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER