Creating believable A.I. for racing game

Get help using Construct 2

Post » Sun Dec 18, 2016 4:28 pm

I'm working on a simple top-down racing game.
Initially, the idea is to simply set the best lap times along with some other challenges I would add.
But I feel that it would be important to add traditional racing elements, which means the option to race against other cars, typically controlled by the computer. My problem is creating A.I. that's natural enough to feel like it's actually trying to RACE you.

Basically, what are some resources or ways I can do that within C2?

I know Pathfinding behavior would be my initial go-to, but I have this sense that it won't be completely suitable (I could try to articulate why, but I'm trying to keep this a short and to-the-point post). Alternatively, I might be able to devise something using the Bullet behavior and a constantly updating direction based on any other obstacles or cars on its way to its immediate goal on the track... (Easier to SHOW than to explain what I'm thinking...)

Anyway, while I test out some ideas and do some searching, myself, I would be grateful if anyone could point me to some proven racing A.I. tips and tricks, please. Thank you so much!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,830

Post » Sun Dec 18, 2016 5:07 pm

i know for sure i seen a masters @rexrainbow capx somewhere with some racing cars and AI going in circles topview and they where awesome actually, even hard to beat, but not cause of their speed, cause they where smart little buggers :D

i think was called LJ potential or CAR AI if you dont want something complex thats what your looking for :) i found it awesome at first sight i bet u will also :D


he has a custom plugin made for racing AI i think ... that is a first start i guess all car ai's of rexrainbow that i know off and are shared.


however for "actual try to race you " that is no AI you seen in big games, that is a shadow past gameplay of a experienced user or maybe a multiple users moves database trying to beat you. which is called shadowing, and its difficult to do, since you'l need game plays from multiple human beings and the only ones with enough AI RACE capabilities at that scale are EA games and they NFS series since 1980 till now they have tons of data u could use... if u had access too :( sadly... we dont have access to that data... so we just need to start slow and little, with small little games, capture game plays and moves... re-use it, in future gameplay. and so on till actually AI gets good. however all the blabbing from above might not even be possible in C2 since you basically need to create a small neural network. but if u find a good racing AI in C2 let me know cause i want to get it too :))


this might also help you

https://www.youtube.com/watch?v=_XKphuY ... AlexBrooks he talks about racing AI i think.

https://www.youtube.com/watch?v=y9BR3yC ... TimBeaudet some explanation how to give waypoints of the map to AI

https://www.youtube.com/watch?v=BuL6oXq ... TimBeaudet raycasting AI - live AI guiding itself using raycasting.

https://www.youtube.com/watch?v=0Str0Rd ... hewRobbins racing neural network

https://www.youtube.com/watch?v=pvgh0nr ... TimBeaudet racing genetic code/neural network

also you might get a AI using waypoints or mapping for AI like in counter strike if you know what i mean.. where the AI/BOTS wold learn the obstacles and map hidden areas best spots etc and use them.


edited the original AI capx publishers.... my bad i apologize.
Last edited by gamecorpstudio on Mon Dec 19, 2016 3:08 am, edited 1 time in total.
B
75
S
22
G
68
Posts: 1,337
Reputation: 43,271

Post » Sun Dec 18, 2016 10:42 pm

I didn't make those examples or plugins. Rexrainbow did.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Mon Dec 19, 2016 2:52 am

@gamecorpstudio and @R0J0hound - thank you both for everything. It always means a lot to me to have such kind and supportive people like yourselves. GOD BLESS you for that.

And I had a feeling @Rexrainbow would be THE go-to guy.
(Rex, if you have anything specific that could assist me, would you point me in the right direction, please? Otherwise, I will try to find the list of everything you've done so far... God bless you, too, sir!)

I'll check out the videos you suggested, GameCorp, and see if those give me a proper direction for what I'm trying to do.
Although, in my initial search, I did find several potentially good options in the tutorials section: https://www.scirra.com/tutorials/search?q=AI
THIS one stood out to me: https://www.scirra.com/tutorials/1051/b ... cing-games

I'm still just starting to go through them, so I don't know which, if any, would suit our needs for a racing game as we picture, but maybe that'll help.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,830

Post » Mon Dec 19, 2016 3:07 am

R0J0hound wrote:I didn't make those examples or plugins. Rexrainbow did.



yes sorry i mistaken the masters sorry senpai

Image


Rhindon wrote:
I'll check out the videos you suggested, GameCorp, and see if those give me a proper direction for what I'm trying to do.
Although, in my initial search, I did find several potentially good options in the tutorials section: https://www.scirra.com/tutorials/search?q=AI
THIS one stood out to me: https://www.scirra.com/tutorials/1051/b ... cing-games

I'm still just starting to go through them, so I don't know which, if any, would suit our needs for a racing game as we picture, but maybe that'll help.


the videos i suggested are to give you a guide of how "GOOD really smart AI " are done, the stupid kinda or pattern build in code types are simple to make, you just create a smarter pathfinding, however as i said above, to truly make a AI that "tries to beat you", you'l probably need a neural network with past gameplay, or AI that uses genetic generation.

il check the tutorials you shared im really intrigued now by AI in games, thanks for the links also .... i might get stuck in the AI world now...
B
75
S
22
G
68
Posts: 1,337
Reputation: 43,271

Post » Mon Dec 19, 2016 3:45 am

@Rhindon

Solution 1.
Here is a sample capx without using any of my plugin. It adds some waypoints to lead car moving forwarding.

Solution 2.
Here is another more complex behavior of car AI.


Solution 1 is good enough, imo.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Mon Dec 19, 2016 5:33 am

Thank you, @rexrainbow! As always, you have my deepest gratitude. I will check those out and see what I can learn from them. GOD BLESS!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,830


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 18 guests