Enemy pathfinding

For questions about using Classic.

Post » Mon Sep 03, 2012 12:02 pm

Hello guys! I'm creating AI for my platformer. I need to make enemy to turn back before falling from edge of platform. I thought that it may be done using "overlaps at offset" condition. I tried different values of x and y but failed Maybe you can give some advice, because I don't want to put bouncer objects at the edge of eah platform.
B
54
S
11
G
4
Posts: 250
Reputation: 5,074

Post » Mon Sep 03, 2012 12:31 pm

There's a number of ways to do this, the most straightforward ones involve detectors. Instead of manually setting up invisible objects to each platform edge that are used by the AI to detect it you could just create them in the runtime by making use of image points and families.

Say, start of layout for each of the family Platform -> create detector left on image point xy, create detector right on image point xy.

You could also use detectors positioned to the feet of the enemies and make the turning condition true whenever the detector DOESN'T touch the platform.

It doesn't get much easier than this if you don't want to compare the distance an enemy has walked to the width of the platform which isn't exactly a smart way of doing it.
B
11
S
2
G
3
Posts: 100
Reputation: 2,150

Post » Mon Sep 03, 2012 1:57 pm

If you have more enemies than platform edges it might be better to make the static invisible objects at runtime for each platform instead (same idea, but stuck to the platform instead of AI). Then there is less objects, and it should work the same way.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Mon Sep 03, 2012 2:01 pm

Thanks a lot guys! I'll try that methods.
B
54
S
11
G
4
Posts: 250
Reputation: 5,074


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests