[Feature Request] Isometric Pathfinding

Discussion and feedback on Construct 2

Post » Fri Nov 29, 2013 12:10 pm

Okay thanks. I'm just worrying about performance, but maybe invisible/hidden sprites don't use up that much performance?
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Nov 29, 2013 12:26 pm

Generally invisible objects, and layers have little impact, unless you use hundreds, and hundreds of objects.
Image ImageImage
B
164
S
49
G
138
Posts: 7,951
Reputation: 91,868

Post » Sat Nov 30, 2013 7:12 pm

Check out this approach to isometric pathfinding

https://www.facebook.com/photo.php?fbid=514132838660053&set=a.420414431365228.97395.394702773936394&type=1&theater

From Kenney.nl


1. First I draw a polygon where the user can walk. This would be the ground where no obstacles are.

2. Then the game automatically generates a tile map over the polygon, whenever a tile touches a polygon it's marked as a walkable tile.

3. Using the A* algorithm I calculate the path from the player to the point he has to walk to. Diagonals are a bit more 'expensive' to walk on, read more about A* here: https://en.wikipedia.org/wiki/A*_search_algorithm

4. Now comes the best part: I shoot a raycast vector from the first point in the path to the next, if the raycast doesn't hit the edge of the polygon then it goes to the next point...and the next, and the next. Until it hits an edge of the polygon, then it marks a point back as a straight line. It does this for all poins, resulting in a smooth, straight path which looks very natural and would be the path we humans would take.

5. Hide everything for the user and make the player walk along the path.
B
68
S
30
G
9
Posts: 905
Reputation: 12,318

Post » Sun Aug 23, 2015 1:45 pm

"I love the new pathfinding plugin, but I think it's a bit too limited. I think It would be better if you could specify what sprites the pathfinder CAN use as well as the ones it cant. "
>Might give you a start, since adding an extra condition should allow you to add the obstacle or not depending on group matching, via an instance variable set on your obstacle...

2 conditions:
System / On start of layout
(your obstacle sprite here) / "obstaclegroup" = "1" (Compare Instance Variable)
1 action:
(your character sprite here) / Add Pathfinding obstacle (your obstacle sprite here)

And in Properties panel, on your obstacle sprite, ensure you have an Instance Variable created. Name it "obstaclegroup" and set text value to "1".

"To make it more clear my post what I mean is that the current pathfinding from scirra still do some minor diagonal movements even when the diagonal are disabled. If a gamedesigner want only straight movements like up, down, left or right (like a Final Fantasy from SNES) then it will have to use another way to make possible pathfinding while respecting the movement."
> I totally agree with you. Would be terribly useful for those developers who need that. It seems there is no easy way to avoid that with Scirra's Pathfinding.

"I had to use another pathfinding plugin to make possible what I want in my game, "
> Which other one did you used? Can I know please?
B
9
S
4
G
1
Posts: 18
Reputation: 1,315

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests