Alternate landscape generator
Moderator: OpenTTD Developers
Alternate landscape generator
Greetings,
The new terragen generator is great, but what I lack about is the ability to generate various terrain types in different areas of the map. I mean, you either have all land low or all land hilly, but not a mix. Maybe someone in development responsible for terragen generator could do something with it??
-------
Since I am lazy to wait I took the official 0.4.8 release and wrote my own generator. It's not as fast as terragen, it works on different principle, but it can generate quite distinct terrain types just by playing with the parameters. And it is also capable of randomly mixing terrain types into one map. I did this work mainly for myself, but then I thought maybe someone might be interested in it (and maybe it could become an alternate terrain generator in the game if it's worth it??).
Source, screenshots and scenarios are available. Please note, I accidentally mixed screenshot numbers and scenario numbers - they don't match as they should. Oh, and btw, the scenario format is the old savegame format (that is, version 0.4.8 savegame format).
The source is not a patch, since I haven't figured out how to make one (in win xp) and anyway, it's just one .C with whole functions replaced.
There is still some work I want to do with it. Depending on interest, I might post it here if I get anything better than this version.
There is no GUI, the generator currently picks random terrain type or a random mix of them when you click 'generate'. Look for "static byte *tcAll[]", it lists all configuration structures which produce different terrain types. Create your structure and play around with params if you want to.
The new terragen generator is great, but what I lack about is the ability to generate various terrain types in different areas of the map. I mean, you either have all land low or all land hilly, but not a mix. Maybe someone in development responsible for terragen generator could do something with it??
-------
Since I am lazy to wait I took the official 0.4.8 release and wrote my own generator. It's not as fast as terragen, it works on different principle, but it can generate quite distinct terrain types just by playing with the parameters. And it is also capable of randomly mixing terrain types into one map. I did this work mainly for myself, but then I thought maybe someone might be interested in it (and maybe it could become an alternate terrain generator in the game if it's worth it??).
Source, screenshots and scenarios are available. Please note, I accidentally mixed screenshot numbers and scenario numbers - they don't match as they should. Oh, and btw, the scenario format is the old savegame format (that is, version 0.4.8 savegame format).
The source is not a patch, since I haven't figured out how to make one (in win xp) and anyway, it's just one .C with whole functions replaced.
There is still some work I want to do with it. Depending on interest, I might post it here if I get anything better than this version.
There is no GUI, the generator currently picks random terrain type or a random mix of them when you click 'generate'. Look for "static byte *tcAll[]", it lists all configuration structures which produce different terrain types. Create your structure and play around with params if you want to.
- Attachments
-
- landscape.c
- Source file (tested with official version 0.4.8).
- (36.71 KiB) Downloaded 237 times
-
- screens.zip
- Screenshots
- (803.23 KiB) Downloaded 347 times
-
- scenario.zip
- Scenarios from which screenshots were made.
- (897.51 KiB) Downloaded 217 times
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
Well, I just downloaded the version 0.4.8 (http://www.openttd.org 'download' button at the top) and it loads all scenarios within the editor without problems. 

-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
I have worked on this generator some more and made it better in that it contains another logic level. The one posted here has some certain types of terrain "features" (such as 'steep hill', 'small low island', etc.) which it uses to build terrain by repeating one of it all over the place or by randomly mixing all of the features in one landscape.
I recently added a 'configurations' level where each configuration defines which features can be mixed in one landscape and their probability. So now it is more flexible and also the results are somewhat more realistic. Now I'm working on a river generator.
I am playing with the idea of separating the generator into a software which would produce grayscale images for importing, since I guess this generator won't make it into the game... Haven't decided on commandline or one with GUI, since GUI would be better but not portable (and vice versa).
Of course all these plans of mine all depend on how much time I'll have to play with all this.
I recently added a 'configurations' level where each configuration defines which features can be mixed in one landscape and their probability. So now it is more flexible and also the results are somewhat more realistic. Now I'm working on a river generator.
I am playing with the idea of separating the generator into a software which would produce grayscale images for importing, since I guess this generator won't make it into the game... Haven't decided on commandline or one with GUI, since GUI would be better but not portable (and vice versa).
Of course all these plans of mine all depend on how much time I'll have to play with all this.
Thanks for your interest in this. My simple problem lies within 0.0f experience in "developing against the trunk", "generating diffs" and using CVS. I might try but what I'm very much worried about is making more mess than anything good.
Anyhow, I first want to +/- finish the generator off-line at home and see if I can get those rivers right. Then I have to learn to create windows in OpenTTD so that I can make GUI. Then I have to learn the diff and cvs stuff and than I possibly might success in uploading anything. Well, maybe one day...
Anyhow, I first want to +/- finish the generator off-line at home and see if I can get those rivers right. Then I have to learn to create windows in OpenTTD so that I can make GUI. Then I have to learn the diff and cvs stuff and than I possibly might success in uploading anything. Well, maybe one day...
Well, that one is decidedly a non-issue. OpenTTD uses svn, not cvs.Mlynki wrote:Thanks for your interest in this. My simple problem lies within 0.0f experience in ... using CVS.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
svn is Subversion.
And if you use an svn client, you don't have to worry about how quickly you can get it fixed; svn will, among other things, merge your changes with the changes that other people have made.
And if you use an svn client, you don't have to worry about how quickly you can get it fixed; svn will, among other things, merge your changes with the changes that other people have made.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
I am quite sorry to say but I am totally out of time to work on this currently.MeusH wrote:Mlynki, how's the progress?

The latest news I have on this topic is that the river generator is working. The rivers are not the most realistic ones one could ever see, but I guess they could do for a start.
Well, I returned from my other duties to the generator. Downloaded some nightlies and found out that the DSP and DSW files (MSVC 6.0 project) are no longer present. I reconstructed them somehow from older version and after getting over some problems I finally ended up with compiler error message saying something nested templates. Namely, it refuses to compile some source files for YAPF. Guess this is a problem of old MSVC version.
So as far as my promises go, I must admit that maybe I won't be able to keep them unless I manage to compile the nigthly. Can anyone give me any quick suggestion what's the easiest way to go? Or do I just visit microsoft.com for some downloads and fight with it? Or the wiki? Do I need any cash to get going...?
So as far as my promises go, I must admit that maybe I won't be able to keep them unless I manage to compile the nigthly. Can anyone give me any quick suggestion what's the easiest way to go? Or do I just visit microsoft.com for some downloads and fight with it? Or the wiki? Do I need any cash to get going...?
google://Microsoft Visual Studio Express Edition
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Who is online
Users browsing this forum: No registered users and 31 guests