Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tkmagic55

City AI

This topic is 5926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I''m working on a game similar to transport tycoon and other games in that genre. Especially the city construction AI is of interest. What''s the best approach if I want the city to construct houses + roads that follow a certain style. Houses should be built in blocks with 1 to 4 buildings. Then roads should be built round the blocks. The problem appear when a human player remove roads / houses that the city have built. The city has to adjust the construction of new buildings / roads to the new situation. Thanks / Tommy

Share this post


Link to post
Share on other sites
Advertisement
If your question refers to the movement of the vehicles in the city (ie along roads) then I think the answer to your question lies in graph theory (ie construct a tree, store crossroads etc) which you can then search for routes. When a road is deleted, this means updating or removing a node from the tree. Check out "travelling salesman" problems on the net for determing the best route.


If the question refers to the actual city construction well you simply have to define your rules (ie housing blocks of max 4 width) and then create a map following the rules (ie after you have constructed housing construct roads or whatever) You can use a random seed of some sort to make sure the city isn't always the same...

And if you don't want the AI to build on specific squares (those the player has built on for example) just use some sort of flag to identify these tiles and don't let the AI build there.

and otherwise I don't understood the question, maybe you want to rephrase it?

[edited by - sjm on July 3, 2002 5:45:15 PM]

Share this post


Link to post
Share on other sites
It might work to partition the City AI into a Block AI, and rig each block to develop itself based on what''s in or around it. Something like an A-Life sim (if tile has x adjacent houses, and block is STATE_Y & STATE_Z) for the city generator. Blocks would have given zoning and growth conditions, maybe land value. Look at some articles on city planning and some zoning ordinences (any large city website will do, like Portland, OR) to get some ideas for this. Or play SimCity for a while.
If you''re using classes (Cpp), consider which routines would have road building access.

-Sta7ic

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!