[Request] Car+Pathfinding

Post your work in progress addons and get feedback

Post » Mon Feb 16, 2015 6:28 pm

Hi everyone, I'm new to the Construct 2 development world, I've built a few projects that helped me get a basic understanding of the program.

I'm wondering if there is a plugin that combines the car features with the pathfinding features, or if there is a way to combine them within Construct 2 to use the pathfinding logic to get the path, but the car behavior to navigate said path.

If this can be done, or if someone already has a plugin made, I would be grateful, if such a plugin does not exist, and wouldn't be too difficult for someone with experience writing plugins to make, also I would be grateful.

Thank you.
B
5
Posts: 22
Reputation: 271

Post » Mon Feb 16, 2015 11:49 pm

You might see this plugin, although it is not using path finding.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Tue Feb 17, 2015 12:50 am

it doesn't "Have" to use pathfinding, as long as I can simulate NPC vehicles, one thing I did notice is the vehicles don't seem to care if there are other vehicles on the road, they won't try to avoid them, simply smash into them without concern.

As of this moment tho, this seems to be the best fit, thank you.
B
5
Posts: 22
Reputation: 271

Post » Tue Feb 17, 2015 2:20 am

@Cyles

It is possible to make the car not too closed to other cars (not collision free).
See the first demo of this plugin, the ship will try to fly to the target without hit these rocks.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Tue Feb 17, 2015 2:58 am

@rexrainbow

Awesome, I'm gonna tear that apart and see how it works :D

Thanks
B
5
Posts: 22
Reputation: 271

Post » Tue Feb 17, 2015 3:06 am

@Cyles

There has one problem: what is the behavior (i.e. AI) of your car?- When to speed up, when to slow down, when to turn left/right. This plugin only provides an advice according to current environment.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Tue Feb 17, 2015 3:13 am

@rexrainbow

I'd like the AI to be able to navigate traffic, slow down to a stop if they cannot continue on their path due to a red light, traffic, etc continue when room becomes available, turn in certain directions based on randomized target points throughout the map. Every Tick Pathfinding would be perfect for on screen objects, but I cannot simulate car physics with Pathfinding (car chase/race/etc) unless there is a way to combine the behaviors which I have yet to find a way to get the path, then drive on it using car physics.

I'm sure for basic traffic I could use events to produce the effects desired, but as I said, with things like car chases, races, etc I would like the AI to be able to react to the environment using car physics in a similar way to what we see in Need for Speed games and such.

EDIT: Upon further inspection, it appears as tho the race track .capx is almost exactly what I need. So I guess the request would be now, is there a way to make the vehicles use pathfinding waypoints as target locations instead of manual waypoints? Like add car physics to pathfinding, or add the pathfind system to the car logic. I'm sure this would be really simple, as both already exist by default, I just know if I try to go in and look at the code I'll just muck it all up.
B
5
Posts: 22
Reputation: 271

Post » Tue Feb 17, 2015 4:16 am

@Cyles

I guess you might create some instances at the result points of path finding by events.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Tue Feb 17, 2015 4:19 am

@rexrainbow

I'll check that out, see if I can't rig it up, I'm sure I seen an example of finding pathways and placing arrows, I could do the exact same for the waypoints, perfect, based on what I've seen of your contributions, as always, thank you. You just opened my eyes to a whole new level of development for my project :D
B
5
Posts: 22
Reputation: 271

Post » Tue Feb 17, 2015 4:26 am

@Cyles

In my example, I only use one attracting point in the same time, to make the attracting source/direction clearly. It might be another thing you have to watch out in your case.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest