Page 1 of 1

Super Sprint A.I.

Posted: Fri May 11, 2018 2:01 am
by Wall_Axe
has anyone got any idea how the AI works for games like super sprint, ivan 'iron man' stewart's off road racing, overhead codemasters games like super jetski simulator?

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 7:48 am
by Ersh
For Jet Bike Simulator they used the very same record function the game uses for replays to record gameplay for the computer. They had some clever code to get the computer back on track if it got bumped by the player.

The Oliver twins talk about it here:
https://www.youtube.com/watch?v=tDX5tqY8fSY

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 3:25 pm
by Kweepa
That's awesome!
However, "do something clever" is not a very detailed algorithm :)
I would try a 32x24 map of direction (0-7) and speed (0-31) for each map which would fit in 768 bytes, then for each character turn towards the ideal direction, and thrust if slower than the ideal speed. You could drive around yourself and have the computer accumulate your direction and speed in each square, although that wouldn't work so well to populate the edges of the map, which should instead point towards the ideal lines.

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 3:35 pm
by ZXDunny
Draw two vectors from the front of the car, pointing towards the edges of the road. If one is shorter than the other, turn the other direction. The amount of turning can be tuned to make the cars more or less "intelligent" - if they only adjust in small increments then their reaction time in corners will be reduced, making them more likely to crash.

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 4:11 pm
by Ersh
Kweepa wrote: Fri May 11, 2018 3:25 pm However, "do something clever" is not a very detailed algorithm :)
It's a bit vague isn't it. The video states that the replay function only recorded key presses and duration, not actual coordinates. Though I'm wondering if they didn't also record positions at certain points and did some simple extrapolating to get them there, if bumped, before continuing with the replay.

The advantage of pre-recorded computer players is of course that it looks organic, the downside would be that the computer always behaves the same (bumps discluded) unless you have multiple recordings (which Jet Bike Simulator doesn't appear to have).

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 4:49 pm
by Ralf
The video states that the replay function only recorded key presses and duration, not actual coordinates.
It means that the game is 100% deterministic, at given circumstances enemy vehicles would always behave the same. So we need to record human behaviour only and all the rest would be recalculated to the same result.

It's an interesting subject. Personally I never wondered much about AI for vehicles on a track but have a feeling that a comment from [mention]ZXDunny[/mention] may be pointing us in right direction.

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 5:15 pm
by Ersh
I just tried Jet Bike Simulator and it was pretty easy to figure out the 'clever' part... there's no collision between player(s) and the computer. :lol: They simply recorded a three player game and used that for the computer players.

Re: Super Sprint A.I.

Posted: Fri May 11, 2018 6:58 pm
by Wall_Axe
good answers, i thought jetski was really tough too!

Re: Super Sprint A.I.

Posted: Mon May 28, 2018 3:34 am
by hikoki
some kind of tron variation logic where cars follow two invisible bikes ?