0 Favourites

How do I organize my car city ?

  • 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.

  • 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.

  • What's the AI of the cars ?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • Thanks for help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)