New Terrain Generator - ideas, thoughts wanted

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

New Terrain Generator - ideas, thoughts wanted

Post by richk67 »

I will be getting some free time soon, away from it all with only a laptop for evening company. So I was planning on having a major overhaul of the TerraGenesis terrain generator, and trying some experiments.

There are a few weaknesses to the method used for TerraGenesis - mainly to do with the regularity of the subdivisions causing a blockiness to appear at MapView level. This is not trivial to adjust for - it will entail redesigning the entire way it builds the map.

Current thoughts are to have a "pre-map" designer that works out the features at a grand scale - placing areas for mountains, plains, lakes, plateaus, etc.. The TerraGenesis subdivision algorithm can then be used to create the randomness within the vertical constraints.

For those who want more info on TerraGenesis, please see my sig.

What I would like are some detailed ideas of things that you would like to see in the terrain options. My current thoughts are:

a) Islands option
b) Carving channels for rivers/lakes through terrain, rather than by "luck"
c) Improved map-edge specialised terrain - may make placement of oil refineries awkward, but I think I will explicitly include a new method for industry placement in the generator
d) Town and Industry placement to match the generation for New Game maps. (currently Many Random towns is poor, and Many Random Industries is like a pox spreading across your map - try it on 2048x2048 ... almost every hamlet gets 1 of every industry!!)

There will need to be many changes to the scenario generator to accomodate the new terrain gen. I will add an interface to the "Reset Landscape" button that brings all the terrain options into one place immediately before generation. So you will be able to pick the climate, the quantity of water, the hilliness, map size, etc, inside the Scenario Generator without having to hunt in the current scattering of menus, etc.

Are there any specific features you want to see (that are achievable without the new MapArray - so no cliffs, etc.)?

Let me know... otherwise I'll just do what I like :twisted:
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
thepizzaking
Traffic Manager
Traffic Manager
Posts: 198
Joined: 08 Aug 2005 07:47
Location: Melbourne, Victoria, Australia
Contact:

Post by thepizzaking »

I think with the random industries, it shouldn't be purely random, it should be like real life where towns in a certain area are mining towns and have only mines, and another area of towns is an Oil area or something along those lines.
I'm A Cobra (or so the rumours go) :)
Get OpenTTD, It's awesome!!
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7597
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

The random generation of roads between all towns. I was told this was feasible by two people already, and would be quite simple to do. Not knowing anything about coding, I wouldn't know.
Image
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

thepizzaking wrote:I think with the random industries, it shouldn't be purely random, it should be like real life where towns in a certain area are mining towns and have only mines, and another area of towns is an Oil area or something along those lines.
OK - thats a good one. Each TG map is built in 64x64 sections, so I could allocate certain industries a section bias - say 1/2 of those industries appear in the section, the rest randomly over the map.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Born Acorn wrote:The random generation of roads between all towns. I was told this was feasible by two people already, and would be quite simple to do. Not knowing anything about coding, I wouldn't know.
It would have to be "each town to 4 nearest neighbours" - keep the roads local. Very much an optional switch, as it will splatter potentially unremovable roads everywhere - depending on your settings of course.
Maybe worth an experiment.
[edit]Just had a thought... have it only add a road between towns if the towns are over, say, 750 pop. That way it wont network up *everything*.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

One of the advantages of buses over trains is not having to fund the infrastructure. In TTD, this is partly negated by the lack of roads between towns. Some inter-city roads would definitely be a Good Thing.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Singaporekid
Tycoon
Tycoon
Posts: 1966
Joined: 21 May 2004 07:39
Location: Singapore

Post by Singaporekid »

How about being able to set the amount of trees, or clusters of trees?
<+Raichase> ugh, I just ate some of my beard D:
User avatar
Wolve
Engineer
Engineer
Posts: 3
Joined: 17 Jan 2006 02:09
Location: Nijmegen, Netherlands

Re: New Terrain Generator - ideas, thoughts wanted

Post by Wolve »

richk67 wrote: Current thoughts are to have a "pre-map" designer that works out the features at a grand scale - placing areas for mountains, plains, lakes, plateaus, etc.. The TerraGenesis subdivision algorithm can then be used to create the randomness within the vertical constraints.

[...]

a) Islands option
b) Carving channels for rivers/lakes through terrain, rather than by "luck"
c) Improved map-edge specialised terrain - may make placement of oil refineries awkward, but I think I will explicitly include a new method for industry placement in the generator
d) Town and Industry placement to match the generation for New Game maps. (currently Many Random towns is poor, and Many Random Industries is like a pox spreading across your map - try it on 2048x2048 ... almost every hamlet gets 1 of every industry!!)
thepizzaking wrote:I think with the random industries, it shouldn't be purely random, it should be like real life where towns in a certain area are mining towns and have only mines, and another area of towns is an Oil area or something along those lines.
Brianetta wrote:One of the advantages of buses over trains is not having to fund the infrastructure. In TTD, this is partly negated by the lack of roads between towns. Some inter-city roads would definitely be a Good Thing.
I believe all of the ideas above to be good. The reason of it is that they all have one thing in common: realism.

I've never (or hardly ever) seen a bus company build a road, so regional roads would be very logical.
The same goes for water placement. This is not the first time rivers were suggested for a map generator.
For hills, they hardly ever pop out alone. Some areas are more "hilly" than others. Same for forests.

Making placement of random industries more realistic seems (for a great part) a sightly different problem to me. Some balancing could be done there. Not very difficult, but it would already increase the fun of maps a lot. In my opinion, increasing the percentage of industries that produce source material is a good idea. Since a factory (or steel mill or any other industry that requires materials) can handle several sources, we don't need that many of them.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: New Terrain Generator - ideas, thoughts wanted

Post by richk67 »

Wolve wrote:I believe all of the ideas above to be good. The reason of it is that they all have one thing in common: realism.

I've never (or hardly ever) seen a bus company build a road, so regional roads would be very logical.
The same goes for water placement. This is not the first time rivers were suggested for a map generator.
For hills, they hardly ever pop out alone. Some areas are more "hilly" than others. Same for forests.

Making placement of random industries more realistic seems (for a great part) a sightly different problem to me. Some balancing could be done there. Not very difficult, but it would already increase the fun of maps a lot. In my opinion, increasing the percentage of industries that produce source material is a good idea. Since a factory (or steel mill or any other industry that requires materials) can handle several sources, we don't need that many of them.
I may include a section in the creation dialog to customise the standard ratios of industries. OTTD has a fixed array for number of industries placed, which is then scaled relative to the map size. I could easily add a mini-menu to allow you to override the standard settings. This way you could have lots of forests, and only 1 sawmill, etc.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Singaporekid wrote:How about being able to set the amount of trees, or clusters of trees?
I already include my clumping algorithm within TerraGenesis, but that only affects "Random Trees", and the New Game trees. In the Scen Editor, I will be extending my desert-density-ratio to tree placement. (For those who missed it, I created a small patch to add buttons 1 to 8 that allow desert and rocks to be placed at a density from 1:1 to 1:8. It makes smoothing the edges of desert a pleasure. See my Africa map for heavy use of this tool.)

One feature in tree placement I have thought about is to have a "pattern" placement tool. It would have a scale - probably up to 20 tiles long max. The patterns would be Line, Round clump, Oval clump, Rectangle (2:1 & 3:1), Square, with Line, Oval, and Rectangle having directions.

I have also thought about adding a Building Placement menu for towns, so you can add precisely the building you want, where you want it, within a town. I really hated the random "Expand" option when creating my big Africa scenario, when space was at a premium and I really wanted tower blocks. Expand also doesnt react to terrain like "natural" town growth in-game. Expand bulldozes the terrain - or expands it, rather than having roads go up/down hill. If you have imported a nice height map, there is nothing more annoying than having Expand destroy it.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

My ideas on map generating window. It would be great if there were some checkboxes like

Code: Select all

[]Generate map
 < >Map type
[]Generate towns
 < >Amount of towns
[]Generate industries
 < >Amount of industries
[]Generate trees
 < >Amount of trees
[]Generate extras (rocks, rough lands, lighthouses)
so player can choose what does he want in a one window instead of five different windows.
User avatar
Wolve
Engineer
Engineer
Posts: 3
Joined: 17 Jan 2006 02:09
Location: Nijmegen, Netherlands

Re: New Terrain Generator - ideas, thoughts wanted

Post by Wolve »

richk67 wrote:I may include a section in the creation dialog to customise the standard ratios of industries. OTTD has a fixed array for number of industries placed, which is then scaled relative to the map size. I could easily add a mini-menu to allow you to override the standard settings. This way you could have lots of forests, and only 1 sawmill, etc.
Sounds good. Much better than (any) fixed ratio.
richk67 wrote:I have also thought about adding a Building Placement menu for towns, so you can add precisely the building you want, where you want it, within a town. I really hated the random "Expand" option when creating my big Africa scenario, when space was at a premium and I really wanted tower blocks. Expand also doesnt react to terrain like "natural" town growth in-game. Expand bulldozes the terrain - or expands it, rather than having roads go up/down hill. If you have imported a nice height map, there is nothing more annoying than having Expand destroy it.
Altering a town building by building could be too much hassle. Maybe looking into the expand function and altering unwanted behaviour there could have the same effect, but will speed up map editing.
User avatar
prissi
Chief Executive
Chief Executive
Posts: 648
Joined: 15 Nov 2004 19:46
Location: Berlin, Germany
Contact:

Post by prissi »

A small preview window of the outline of the map may be nice. Probably with an option to change the inital random seed (or how the generator work on). That way, one can easily avoid a terrain distribution, one does not like. Also more detailed settings (how many towns, what and how many industries, connect towns with roads, etc. )

Some of these aspects are in simutrans (where you may take some inspiration) other I have not seen so far.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

prissi wrote:A small preview window of the outline of the map may be nice. Probably with an option to change the inital random seed (or how the generator work on). That way, one can easily avoid a terrain distribution, one does not like. Also more detailed settings (how many towns, what and how many industries, connect towns with roads, etc. )

Some of these aspects are in simutrans (where you may take some inspiration) other I have not seen so far.
Preview window is an interesting idea, but Im not sure my graphics skills are up to it. Also, it adds an extra stage before the map is generated, and this slowing will be a major irritant to players with regular use. I'll think about this one. I like the idea of seeing the rough layout - and having the options "Use This", "Try again", "Cancel" may be useful. Since map generation - especially if I add more complex features like river valley carving etc - is a processor intensive task, having the chance to abort early could be handy.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

richk67 wrote:[Preview window]
Since map generation - especially if I add more complex features like river valley carving etc - is a processor intensive task, having the chance to abort early could be handy.
But will a preview window really save processor time? Obviously, some work is unnecessary for the preview (eg town,s industries, intercity roads), but the more you leave out of the preview, the less useful the preview becomes.

OTOH, Simutrans manages a quite fast preview window. I don't know if its terrain generation algorithm looks anything like TerraGenesis, though.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

DaleStan wrote:
richk67 wrote:[Preview window]
Since map generation - especially if I add more complex features like river valley carving etc - is a processor intensive task, having the chance to abort early could be handy.
But will a preview window really save processor time?
If you read the original description of what I am planning, I need to create a "pre-map" to provide bias information. It is this that could be shown as a preview to give a rough idea of what will be generated. It saves processing time since if you dont like the look of the preview, you dont need to generate the full map (the processor intensive bit - since the algorithm recursively calls itself, the overheads can get big on big maps).

Im not talking "reduced graphics version of map with all bells and whistles" - Im talking a simple block map probably showing 4/5 levels of terrain, eg. blue - water, dark green - low level plains, mid green - hills, white - mountains. That sort of thing. Give a general feel for "mountains there, water here, flat bits, yeah that will do.... now give me detail".
DaleStan wrote:OTOH, Simutrans manages a quite fast preview window. I don't know if its terrain generation algorithm looks anything like TerraGenesis, though.
I havent tried Simutrans - I dont know what their maps look like, what the capabilities of their MapArray are, etc.

TerraGenesis took about 3-4 hours to design the algorithm, and about 10-12 hours to write to its current state. I would hope a more established product would have considerably more effort put into it.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

richk67 wrote:I havent tried Simutrans - I dont know what their maps look like, what the capabilities of their MapArray are, etc.
In terms of tile-shape, it's basically the TTD array (no cliffs, except build-on-slopes type stuff; only one height-unit change per tile side), but the map generator is vastly superior to the current [O]TTD generator.
It's been a while, but the last map I remember playing had two landmasses and one body of water. None of these sponges that [O]TTD often produces.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

DaleStan wrote:
richk67 wrote:I havent tried Simutrans - I dont know what their maps look like, what the capabilities of their MapArray are, etc.
In terms of tile-shape, it's basically the TTD array (no cliffs, except build-on-slopes type stuff; only one height-unit change per tile side), but the map generator is vastly superior to the current [O]TTD generator.
It's been a while, but the last map I remember playing had two landmasses and one body of water. None of these sponges that [O]TTD often produces.
Ok - I may look into it then. My subdivision method does suffer from "spongification" ;)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Horse
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 10 Sep 2004 20:25

Post by Horse »

To make temperate snowland and Tropical at one map.
for 2024x2024 maps it will be great
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Horse wrote:To make temperate snowland and Tropical at one map.
for 2024x2024 maps it will be great
Not possible with current MapArray. Wont be done. Sorry.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 26 guests