AI

Get help using Construct 2

Post » Sun Nov 27, 2011 2:42 pm

I want to make a little racing game, And i want to include AI for the opponents. Now im sure there is a limit to what construct can do in terms of AI but can i get the AI to follow way way-points set out by me?

I looked at the example file for the space blast game, and thats the start of what i mean i guess but im not sure thats exactly what i need.

Any advice?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Nov 27, 2011 2:59 pm

Hi smitchell

Take a look at this

Car Race

this should get you going.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Nov 27, 2011 3:43 pm

Oh wow thanks! very usefull. I added a few more of the NPC's to the stage, so it felt more like a race but obviously they all follow the same route and same speed, is there any way to add more randomness to this?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Nov 27, 2011 5:07 pm

You can try setting different value for min and max speed for each NPC.
But for it to work correctly, you have to change all global variable (which are just "helper" variable to avoid big mathematical expression) from global variable to instance variable to store the proper value of each instance.
Like that :
carAI.capx
Last edited by Yann on Sun Sep 14, 2014 10:58 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Nov 27, 2011 6:10 pm

What did you change? i cannot see a difference..
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Nov 27, 2011 7:02 pm

indeed bad saved file :D

you can redownload
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to How do I....?

Who is online

Users browsing this forum: jul, TELLES0808 and 21 guests