Platform AI help

For questions about using Classic.

Post » Wed May 16, 2012 12:48 am

I'm new in the game. Checked out tutorials and videos and I'm doin ok making a platform game thats action packed but the challenges starts with enemy AI.

To describe it, I wanted the AI to walk back and forth on the ground, when its LOS to object, it chases and tries to attack, it can jump, it can die, its animated, it spawns in a set position. If its too much or confusing I'm sorry, I just need some basic AI help for a platform game.
B
6
S
2
G
3
Posts: 3
Reputation: 2,143

Post » Sun May 20, 2012 11:40 pm

Make him walk autommaticaly(bullet behavior)to left when a boolean is true,and when he collides with and object in his way he toggles the boolean to right(false)
WALK IS TRUE - BULLET SET ANGLE OF MOTION TO LEFT
WALK IS FALSE- BULLET SET ANGLE OF MOTION TO RIGHT

and when he gets next to you(compare values:distace between player and enemy)make he walk to your direction
B
16
S
5
G
1
Posts: 43
Reputation: 1,787

Post » Sat May 26, 2012 12:28 am

Hey man.
I'm making an action packed platformer too!
The way I tackle the platformer AI stuff is with hidden sensors. Having an invisible "Jump" sensor near a ledge, for example, and testing if the player is higher than the AI and if the AI is overlapping the sensor, you would make the AI jump.
Take a look at this diagram. (The font changes the position of these lines and stuff, so try to understand XD)
       ________
______|

Floors and a wall. Now, placing icons into it.

       ____P___
__@__J|

If the @(AI) touches J(Jump sensor) whilst P(Player) is higher than @, then jump ^.^

Making the AI follow the player, when the AI isn't nearby (to detect "near by" stuff, you could use more sensors, or the "Line of sight" behaviour iirc), should be able to have hidden sensors on each side of where the AI is restricted. Make the AI's direction change when touching the sensors.
Here is another poorly made diagram. the lines are floors, the @ is the AI
|____@_____|
Just place the direction sensors close to the wall or in the walls.
|>___@___<|
Also, on a side note, if the AI IS chasing you, make sure to disable these direction things, otherwise the AI will not behave properly XD
To basically make the AI follow you, compare the players position to the AI's and change its direction.

+If Player.X < AI
- Set AI direction to LEFT

+If Player.X > AI
- Set AI direction to RIGHT

I don't know how to make decent "Path finding AI" if the player were to be far away and the AI needed to get to you in a fast route >.<

I'm terrible at explaining things, I'm sorry if this was useless information. Really tired too.Jase002012-05-26 00:28:59
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Thu Jun 28, 2012 8:54 am

@Jase00 u are good at explaining things :)

that was really very useful indeed
B
6
Posts: 30
Reputation: 585

Post » Thu Jun 28, 2012 7:51 pm

Thanks :)
Wonder how gtouch1 is doing with AI now.
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Thu Apr 11, 2013 9:20 am

[QUOTE=Jase00] Thanks :)
Wonder how gtouch1 is doing with AI now.[/QUOTE]

Hey, I came across this thread, and am working on a similar mechanic. However, I wanted to know how you were checking and activating the jump sensors along with the direction changing.

Could you post a capx possibly?

Thanks again :)Fynnick2013-04-11 09:21:37
B
3
Posts: 12
Reputation: 499


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests