How do I organize my car city ?

Get help using Construct 2

Post » Fri Jul 10, 2015 5:16 pm

Let's say we have city with lots and lots of roads on it, and the non-road area is filled with grass. and we have a car that should move randomly in that city, and that's easy using the pathfinding behavior, but there is a little problem, our car can find a path to the grass. Still have a solution which is adding the grass as an obstacle, but that makes a new problem, cause when it finds a path to an obstacle, it will search for the nearest non-obstacle area, and it can be at the edge of the road which will block the path of other cars, and cars will start to hit their each other... Huge mess isn't it ?
Please help. :P
B
6
Posts: 38
Reputation: 338

Post » Fri Jul 10, 2015 5:29 pm

I think you can't use the Pathfinder, because your obstacles are too flexible - you have to program the AI of your cars in based on their target and the things immediately around them.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Fri Jul 10, 2015 5:38 pm

What's the AI of the cars ?
B
6
Posts: 38
Reputation: 338

Post » Fri Jul 10, 2015 8:35 pm

Well .... that depends on what you are doing. I guess that your cars are driving round a grid, a bit like Sim City ?

One way might be to (say) set them off using a bullet - on collision with an intersection graphic you can look at where it can go, and pick a good direction , occasionally randomising it a bit otherwise it would go round in circles.

It really depends. If (as in Sim City) it is purely graphic fluff, something simple - if it is a core part of the game, say you have to build the layout so traffic moves without getting stuck, you might want to spend a lot more time on it

As I said, it depends on what you are actually doing.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Sat Jul 11, 2015 9:55 am

Thanks for help.
B
6
Posts: 38
Reputation: 338


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 56 guests