TerraGenesis Perlin
Moderator: OpenTTD Developers
i have to agree on most of the comments here :=)
it looks fantastic, absolutely great work. expecially in the winter climate, where the old map generator made one half of the map snowy and the other non-snow, which sucked, it is now WAY better!
a bit of criticism though....
- the "mountaineous" setting is a way too flat. i miss some really steep hills. also there is not much of a difference between flat and hilly/mountaineous.
- water level "very low" should generate something with nearly no water at all, don't you think? at the moment i struggle to find any difference between very low and low, and at "very low" it's still the half of the map filled with water. thats too much for this setting!
i think you should just make the "extremes" more extreme.... then it'd be perfect!
and just an idea:
maybe it would be possible then instead of using "very low", "low", "medium", "high", etc..... you use a factor from 0 to 10 ?
i don't know how this thing works internally but i guess the selection you do in the GUI is translated into a number, and that influences the generator. using values from 0 to 10 would give you a finer control over the generator's parameters..?
it looks fantastic, absolutely great work. expecially in the winter climate, where the old map generator made one half of the map snowy and the other non-snow, which sucked, it is now WAY better!
a bit of criticism though....
- the "mountaineous" setting is a way too flat. i miss some really steep hills. also there is not much of a difference between flat and hilly/mountaineous.
- water level "very low" should generate something with nearly no water at all, don't you think? at the moment i struggle to find any difference between very low and low, and at "very low" it's still the half of the map filled with water. thats too much for this setting!
i think you should just make the "extremes" more extreme.... then it'd be perfect!
and just an idea:
maybe it would be possible then instead of using "very low", "low", "medium", "high", etc..... you use a factor from 0 to 10 ?
i don't know how this thing works internally but i guess the selection you do in the GUI is translated into a number, and that influences the generator. using values from 0 to 10 would give you a finer control over the generator's parameters..?
to everyone who's coding on openttd: YOU ROCK !!!
I did warn in the original post that it had some issues with randomness!tecxx wrote:i have to agree on most of the comments here :=)
it looks fantastic, absolutely great work. expecially in the winter climate, where the old map generator made one half of the map snowy and the other non-snow, which sucked, it is now WAY better!
a bit of criticism though....
- the "mountaineous" setting is a way too flat. i miss some really steep hills. also there is not much of a difference between flat and hilly/mountaineous.
- water level "very low" should generate something with nearly no water at all, don't you think? at the moment i struggle to find any difference between very low and low, and at "very low" it's still the half of the map filled with water. thats too much for this setting!
i think you should just make the "extremes" more extreme.... then it'd be perfect!
and just an idea:
maybe it would be possible then instead of using "very low", "low", "medium", "high", etc..... you use a factor from 0 to 10 ?
i don't know how this thing works internally but i guess the selection you do in the GUI is translated into a number, and that influences the generator. using values from 0 to 10 would give you a finer control over the generator's parameters..?
On "Very Low" sea level, I proportionately raise the land so that only the lowest 1/20th or so of the terrain is water. Now if there is still a large sea there, then the random seed has just created an awfully big and deep ocean, and lowering the sea level has not managed to dry it out!
Mountainous, Hilly, Flat, Very Flat, just determine the maximum amplitude of the variations. So VFlat allows only about height 8 as a maximum, and Mountainous should allow a max of 15. However, it is again dependent on the random generation. If it generates a big flat plain on Mountainous, it does - not a lot of control over it.
I can tweak the Roughness however - and may create a blend of roughness and Terrain type (M,H,F,VF) to increase the vertical variation. In the code, I have included a different set of 6 decimal numbers for each Roughness. Each number is the frequency for the variation algorithm, at each power. So the first number gives the major variation, and each successive number gives smaller and smaller variations.
In theory, the larger the first couple of numbers, the greater the vertical variation, and hence this may relate better to the Terrain Type than to the roughness. I will try some variations, but ultimately I may not find a simple solution.
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
- Jim Starluck
- Traffic Manager
- Posts: 135
- Joined: 26 Jun 2005 20:12
- Location: Cincinnati, OH
- Contact:
What would also be nice is some tweaking to industries...say, guarantee that there won't be more Steel Mills or Factories than there are Ore Mines or Farms. Perhaps a slider for the # of industries per area of tile as well.
And an adjustable minimum distance between towns would also be welcomed...gets very annoying (to me anyway) when there are two or three in close proximity.
And an adjustable minimum distance between towns would also be welcomed...gets very annoying (to me anyway) when there are two or three in close proximity.
If at first you don't succeed, get a bigger locomotive and try again.
I'd love an option to select different industries independently; so, for example, you could place mills/factories/refineries in specific locations for a scenario, but then have it randomly place the primary industries across the map.
Personally, I'd prefer to see cities grouped around certain map features. Coastlines (and rivers if that becomes possible), lakes, and (in mountains especially) around industries. But depends what sort of game you're after.
Personally, I'd prefer to see cities grouped around certain map features. Coastlines (and rivers if that becomes possible), lakes, and (in mountains especially) around industries. But depends what sort of game you're after.
Good ideas... but tricky. I think placing towns near water should not be too hard. (eg. pick random location then see if it is within say 8 tiles of water, if so then place town.)sc79 wrote:I'd love an option to select different industries independently; so, for example, you could place mills/factories/refineries in specific locations for a scenario, but then have it randomly place the primary industries across the map.
Personally, I'd prefer to see cities grouped around certain map features. Coastlines (and rivers if that becomes possible), lakes, and (in mountains especially) around industries. But depends what sort of game you're after.
Ive thought about redesigning the place industry dialog to include "Newgame Industry Density". Currently "Random Industries" is like declaring a pox on the entire map. Every town/village gets pretty much 1 of each industry. You cant then "undo" the industries. It would also make sense to have a "Current Industries" count for each type - so you can see instantly that your scenario needs more Iron Ore mines, 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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Good to see someone taking up the random landscape generation and GUI
.
I have a few comments/suggestions:
1. Prissi said something about just transferring the random seed on game-start. This is unfortunately impossible as for reasons mentioned earlier. It only works if all clients start at the same time (in games such as Diablo, Warcraft, etc.). But when clients start later you need to 1. send seed 2. send a diff of all changes that have occured since the start of the game. The later a player joins the more work this becomes and really slows down the join process. Much easier to just dump the current state and only sync the actions that have happened since starting join if the game was not paused
2. The generated landscape looks nice, perhaps even natural but not rough enough I think. I don't know what mountainious looks like, but even small plateau'd maps need small random hills/depressions to make them look good.
Of course things like rivers, lakes, forest areas, smarter town placement (next to sea?, rivers) would be pretty cool. Perhaps a look at Korenn's spinoff might be an idea? He had albeit a bit strangely, but nice maps there.
Keep up the good work

I have a few comments/suggestions:
1. Prissi said something about just transferring the random seed on game-start. This is unfortunately impossible as for reasons mentioned earlier. It only works if all clients start at the same time (in games such as Diablo, Warcraft, etc.). But when clients start later you need to 1. send seed 2. send a diff of all changes that have occured since the start of the game. The later a player joins the more work this becomes and really slows down the join process. Much easier to just dump the current state and only sync the actions that have happened since starting join if the game was not paused
2. The generated landscape looks nice, perhaps even natural but not rough enough I think. I don't know what mountainious looks like, but even small plateau'd maps need small random hills/depressions to make them look good.
Of course things like rivers, lakes, forest areas, smarter town placement (next to sea?, rivers) would be pretty cool. Perhaps a look at Korenn's spinoff might be an idea? He had albeit a bit strangely, but nice maps there.
Keep up the good work

TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Thanks. From my perspective, I never intended to have anything like Prissi's idea. To me, it just wouldnt work as it precludes terrain mods, scenarios, etc.Darkvater wrote:Good to see someone taking up the random landscape generation and GUI.
When I next get the urge to code, I'll have a go at making mountainous very much more variable. At the moment, you can have very flat land that has rough variations, so that is sorted. It does also allow to smooth it out too, and very smooth is like a pool table!
The more feedback the better, so many thanks.
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
I don't get quite this? I just commented on Prissi's idea about just sending the random seed over the network.richk67 wrote:Thanks. From my perspective, I never intended to have anything like Prissi's idea. To me, it just wouldnt work as it precludes terrain mods, scenarios, etc.
Looking at the earth if the land is very flat it is either a wetlands with lots of water or a desert. I think very flag like a pool-table wouldn't look very good.richk67 wrote:When I next get the urge to code, I'll have a go at making mountainous very much more variable. At the moment, you can have very flat land that has rough variations, so that is sorted. It does also allow to smooth it out too, and very smooth is like a pool table!
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
i'm not sure if this patch should bother with town placement and industry generation.
because if it should, theres quite much that should be changed... e.g. i think that the game places WAY too much industry and towns even in "low" setting. if you play on a 2kx2k map and everything is just filled up with industries it's rather boring. i always change the code before starting a new game so that there is a max of 40 cities and the number of industries is divided by four, that makes for a way more interesting game.
also there should be a better placement logic e.g. for power plants, they should be near cities, etc and so on....
but again, i think this should be covered in a completely different patch/topic. :=)
because if it should, theres quite much that should be changed... e.g. i think that the game places WAY too much industry and towns even in "low" setting. if you play on a 2kx2k map and everything is just filled up with industries it's rather boring. i always change the code before starting a new game so that there is a max of 40 cities and the number of industries is divided by four, that makes for a way more interesting game.
also there should be a better placement logic e.g. for power plants, they should be near cities, etc and so on....
but again, i think this should be covered in a completely different patch/topic. :=)
to everyone who's coding on openttd: YOU ROCK !!!
Err... I was agreeing with you thenDarkvater wrote:I don't get quite this? I just commented on Prissi's idea about just sending the random seed over the network.richk67 wrote:Thanks. From my perspective, I never intended to have anything like Prissi's idea. To me, it just wouldnt work as it precludes terrain mods, scenarios, etc.

Now there is an idea - on Very Flat, some areas will be marshes. Yeah, I could code something for that.Darkvater wrote:Looking at the earth if the land is very flat it is either a wetlands with lots of water or a desert. I think very flag like a pool-table wouldn't look very good.
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Here is an update to TerraGenesis Perlin. I am really happy with this version. It now features a far more responsive Mountainous setting, and the amount of water also responds far better to the GUI choice.
One of my test terrains is attached. This was generated with random seed 11556, Mountainous, Arctic, Smoothness=Rough, Lakes=Low, Towns=Low, Industries=Low. In the scenario editor (with no towns etc.) this takes 26 secs to generate.
From the New Game menu, it takes 37secs.
I would still class this patch as IN DEVELOPMENT. But it is getting closer.
Code for the patch is also in the first post of this thread.
Please contact me with any feedback, thanks.
One of my test terrains is attached. This was generated with random seed 11556, Mountainous, Arctic, Smoothness=Rough, Lakes=Low, Towns=Low, Industries=Low. In the scenario editor (with no towns etc.) this takes 26 secs to generate.



I would still class this patch as IN DEVELOPMENT. But it is getting closer.
Code for the patch is also in the first post of this thread.
Please contact me with any feedback, thanks.
- Attachments
-
- TerraGenesisPerlin_v3.patch
- TGP v3
- (28.94 KiB) Downloaded 238 times
-
- Map view of a new terrain
- screenshot #12.png (18.51 KiB) Viewed 5473 times
-
- A headland from the random snippings that happen along the map edges.
- screenshot #11.png (24.54 KiB) Viewed 5473 times
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
This latest one is a VAST improvement on my first effort. Its not perfect - I would like more irregular map edges, but I think this is getting close to the necessary "trunk" quality.tecxx wrote:cool you're still working on it :=)
i'll test it out soon... can't await this to be in the official version!
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
When I compiled your patch with last trunk (I forgot the number, but I updated the my trunk folder today) I found 2 errors:
this define in macros.h
don't work on Visual C++ 2003 and the solution is to comment out.
The second error is the M_PI constant wasn't defined.
I added this define for enabling the math constants of M$ math.h:
I put the define after the previous commented out in macro.h and I compiled successiful like this example:
Now I like the new mountain terrain generated by new version of Perlin Terragen.
Good work, richk67!.
I added also my patch for Italian towns names and I'm happy because I can play realistic terrain with familiar town names.
this define in macros.h
Code: Select all
#define abs myabs
The second error is the M_PI constant wasn't defined.
I added this define for enabling the math constants of M$ math.h:
Code: Select all
#define _USE_MATH_DEFINES 1
Code: Select all
//#define abs myabs // this define cause compile error on VC7
#define _USE_MATH_DEFINES 1
Good work, richk67!.

I added also my patch for Italian towns names and I'm happy because I can play realistic terrain with familiar town names.
Sidewinder
Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
OK. Thanks. Im not sure about what errors other compilers produce - it compiles cleanly on my MingW32, so thats as far as I can go.sidew wrote:The solution is to comment out.
I have a further update tonite, with improvements on the coastline (I discovered a CTD error in one of the routines).Now I like the new mountain terrain generated by new version of Perlin Terragen.
Good work, richk67!.
I added also my patch for Italian towns names and I'm happy because I can play realistic terrain with familiar town names.
I have also changed the behaviour of the Desert terrain. It now produces a desert valley between two ranges of mountains (on mountainous/hilly). As usual, desert climate doesnt respond well to "flat" or "very flat", as the whole map tends to go desert.
I also discovered that my "prime" was in fact divisible by 3!! So I have consulted a list, and every call to Perlin noise uses a different prime. Nice and (pseudo)random.

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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Yet another update.
Added "Smoothness" to the Terrain patches menu so that it is stored between sessions. Also modified gui screen to pass back changes to the _patches variables correctly.
Unmovables now only places 15 transmitters per 256x256 square. Previous total was 40!! (Hence why transmitters were springing up everywhere!)
Updated patch in original post.
Some more screenies:
Added "Smoothness" to the Terrain patches menu so that it is stored between sessions. Also modified gui screen to pass back changes to the _patches variables correctly.
Unmovables now only places 15 transmitters per 256x256 square. Previous total was 40!! (Hence why transmitters were springing up everywhere!)
Updated patch in original post.
Some more screenies:
- Attachments
-
- Rand seed 1830.
- Map1830.png (159.01 KiB) Viewed 1490 times
-
- A nice lake
- Nice Lake.png (163.34 KiB) Viewed 1489 times
-
- A desert / tropical terrain, rand seed 31598. 2048x2048 took 52 secs to generate! :)
- Map 31598.png (169.19 KiB) Viewed 1516 times
Last edited by richk67 on 16 Mar 2006 00:44, edited 1 time in total.
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Yet more screenies, showing the progession in heights from Flat to Hilly to Mountainous.
- Attachments
-
- Mountainous.png (20.72 KiB) Viewed 5274 times
-
- Hilly.png (17.02 KiB) Viewed 5275 times
-
- Flat.png (12.16 KiB) Viewed 5272 times
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
It could do with a few more trees 
Looking nicer every time
.
Do keep in mind that you probably want to update _patches_newgame and not _patches to remember the settings.

Looking nicer every time

Do keep in mind that you probably want to update _patches_newgame and not _patches to remember the settings.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
I followed your lead on that, and modify both in the latest patch. Wherever I change the parameters on the generate terrain gui, it feeds back to through the other screens.Darkvater wrote:It could do with a few more trees
Looking nicer every time.
Do keep in mind that you probably want to update _patches_newgame and not _patches to remember the settings.
I took your advice from earlier, and every time you visit New Game, it chooses a new random seed. If you need to enter a specific one to override this, you can by clicking on the random seed number. This allows a player to hit New Game/Generate, and get a different terrain each time.
Let me know how I can get this considered by the devs for inclusion in v0.5. (since Im down on the wiki to create it!!) Do I need to have you guys review it, and have a chat session for me to get your comments, or what?
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Who is online
Users browsing this forum: No registered users and 16 guests