jorio / CroMagRally

The wildest racing game since man invented the wheel!
https://pangeasoft.net/cromag
Other
118 stars 13 forks source link

AI Improvements possible? #15

Open EliasHeydrich opened 7 months ago

EliasHeydrich commented 7 months ago

I have not looked at the source regarding how the AI works exactly, but after replaying this and finishing the cup on hard in about 2h without ever loosing, I am a bit shocked about how weak the AI is. In all tracks, but some tracks particular, like the "Ice Age"-Level or the "Great Wall", the AI drivers can and often will be utterly stuck on an obstacle for what feels like a minute.

My question is: Can something be done to improve AI awareness of the track or mitigate issues of the existing implementation?

I envision a sort of an enable advanded AI routines-checkbox in the settings, keeping the original behavior intact and as default, so that people like me can have the same moment of gosh, that AI is shit-revelation 20 years later 😉 .

jorio commented 7 months ago

DoCPUControl_Car() basically follows a path baked in the map. If it detects that it’s heading for an obstacle, it’ll try to swerve around it and get back on the path. If its position has barely moved within a second, it decides that it’s stuck, goes into reverse for 4 seconds, then it hits the gas again.

Then there’s the difficulty level, which affects some of the car physics and whether or not the CPU cars will use their powerups.

Perhaps the obstacle detection could use some work. For instance, in Crete, one of the CPU cars pretty consistently hits one of the pillars at the start.