Pathfinding Custom Obstacles not taking effect

Get help using Construct 2

Post » Wed Apr 10, 2013 6:08 am

.CAPX: https://www.sugarsync.com/pf/D6025908_4317202_6638796

Please bear with me...this might be difficult to follow.

If you're familiar with stealth-action games like Metal Gear (Solid) and Splinter Cell, then you're already on par with the gist of my game.

To help me with organization and easier referencing portions of the game instructs in the event sheets, I've been breaking things down into multiple event sheets and (of course) layouts.

Thanks to @Wrangler's awesome tutorial on Pathfinding (which also happens to be a stealth-action set-up paying some serious homage to Metal Gear), I've already gotten some more insight to the Pathfinder behavior, which is where my primary concern rests now.

The viewpoint is top-down is with some layered scaling effects to create some pseudo-3D visuals...you'll see when you load the .capx. In the editor, look at the Layout Level 1 layout. You'll notice a row of thin black lines (object L1WallThin1) near the top of the canvas. Between two solid lines are several dotted ones (that's actually frame 1 of instances of the same object). That's a visual cue on the layout so I can remember what wall sections I want set to invisible during actual gameplay.

Any wall section set to invisible also has its Solid behavior deactivated. Keep in mind that I have the layered effect going on. So only the black wall objects will ever be set to invisible (unless I later change my mind...). This means that the black section will create this semblance of a "crawl space" below the other two "elevated" blocks that I place above the black blocks (see event sheet Event Wall Set-Up).

Seeing as this is a stealth-action game, clearly we want ways for the player to sneak around while the enemies stick to the obvious main paths. This means that we don't want the enemy to be able to track the player under walls and into crawl spaces, effectively breaking off any pursuit that might be under way. We want to break his line of sight.

Now, because Pathfinding uses up SO MUCH of the CPU, I don't want a bunch of enemies walking/running around with active or even pre-active Pathfinding behaviors eating up CPU unless they are actually needed and ONLY when they are needed. So you may notice that I deactivate the behavior whenever the player is far away enough from the enemy (the method by which I test this is subject to change).

All that's said to hopefully make the main problem clearer...

After checking the manual and @Wrangler's tutorial, the best spot to use the Regenerate Obstacle Map action is at the On Start Of Layout event. I've added all the object walls to the list of Custom Obstacles that I want the enemy to look out for...
Problem is, the enemy never engages in pursuit even when I'm right on top of it!

I want ALL of the black block objects to be effectively solid, regardless if the the behavior is active or not for the Player. They should always be "active" to the enemies with the help of the Custom Obstacle setting.

Is that clear? Or do I need to explain better what I'm having issues with? Thanks for your feedback!

UPDATE: Does the fact that I have the Add Obstacle action early on in the set-up (see the Event Wall Set-Up) matter? The Event Wall Set-Up is designed to add the additional wall objects above the primary black wall objects (saving ME time in actual level design). But this event sheet comes before the Event CharEnemyRed event sheet...does that make a difference even though the actual CharEnemyRed object is already on the layout to begin with?Rhindon2013-04-10 16:55:53
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Wed Apr 10, 2013 6:27 am

The .capx link appears to be broken.

Can you provide a tl;dr or state what specific problem you're having with?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 10, 2013 4:37 pm

@Excal - The link should work now...
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Wed Apr 10, 2013 5:56 pm

[quote]Problem is, the enemy never engages in pursuit even when I'm right on top of it![/quote]
It does for me. The enemy starts following the player when you move within 50px.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Apr 10, 2013 8:03 pm

@ramones - Really? With the Custom Objects in effect? I tested it when toggled on and off and it only worked when I had the Obstacles set to Solids. I can't help but think there's a factor in the order of the behavior's events/actions that I'm missing...
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests