The International Simutrans Forum

 

Author Topic: Easier Manual City Generation  (Read 3101 times)

0 Members and 1 Guest are viewing this topic.

Offline statto

  • *
  • Posts: 16
Easier Manual City Generation
« on: June 20, 2009, 04:54:54 PM »
This idea is mostly for custom maps.

Instead of using random city generation, you would be able to read the city name, x and y coordinates, and population from a text file.

So, if you load up, say, Germany.ppm as a height map, the game would look for, say, Germany.city in the same folder.

Germany.city would look like:
Berlin,(xcoord),(ycoord),(population)
Hamburg,(xcoord),(ycoord),(population)
München,(xcoord),(ycoord),(population)
etc, where the xcoord and ycoord are the coordinates of the city hall, and the population is the city population.

This would allow users to play on "realistic" maps without having to add any of the cities manually while maintaining a random yet consistent flavor every time they start a new game.

Further thought: If (x,y) is under water, the city is ignored.

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: Easier Manual City Generation
« Reply #1 on: June 20, 2009, 05:08:39 PM »
Would be a good extension request for scenario files..

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Easier Manual City Generation
« Reply #2 on: June 20, 2009, 05:22:15 PM »
And it would indeed be a very useful extensions in combination with heightmaps. It's one if have often thought about.

Offline statto

  • *
  • Posts: 16
Re: Easier Manual City Generation
« Reply #3 on: June 20, 2009, 05:32:04 PM »
I haven't looked at the code since I am not at all proficient in C++, but in theory, this shouldn't be too hard to implement, should it? Anyone with knowledge of world generation?

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Easier Manual City Generation
« Reply #4 on: June 20, 2009, 06:01:56 PM »
PPM files could work as PAK's do.

To make a pak file you need: 1) A PNG image file; 2) A DAT text file.

Then, PPM file: 1) A BMP image file for heights; 2) A TXT text file for data: object, coord x/y, population etc.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Easier Manual City Generation
« Reply #5 on: June 20, 2009, 06:51:04 PM »
I thought it would be impossible, but PPM could be extended exactly as you describe. If the other information comes after the picture.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9454
  • Languages: De,EN,JP
Re: Easier Manual City Generation
« Reply #6 on: June 20, 2009, 07:37:02 PM »
Since BMP is the preferred image format for maps (since it is, at least RLE encoded, much smaller as PPM), the imformations should be rather independent of the image format.

Offline jap train fan

  • *
  • Posts: 114
  • i'm from australia and proud of it
Re: Easier Manual City Generation
« Reply #7 on: July 23, 2010, 11:26:09 AM »
i like it

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Easier Manual City Generation
« Reply #8 on: July 24, 2010, 09:23:12 PM »
i like it

And? Anything else to add to the discussion?

I would ask you to post in an old topic only messages that are useful. Bumping pointlessly an old topic is considered spam.

Please read this: http://forum.simutrans.com/index.php?topic=4529.0
« Last Edit: July 25, 2010, 01:16:37 AM by IgorTekton »

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3649
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Easier Manual City Generation
« Reply #9 on: July 25, 2010, 12:53:54 AM »
And to clarify, jap train fan, please consider this an official mod warning. We are glad to have you on the forum, but this bumping of old topics to not add anything useful is getting to be too much.

Offline jap train fan

  • *
  • Posts: 114
  • i'm from australia and proud of it
Re: Easier Manual City Generation
« Reply #10 on: July 25, 2010, 01:39:03 AM »
ok i'll stop