generating random maps
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 9
- Joined: 12 May 2005 21:34
generating random maps
I couldn't find any threads about this, but it's definitely my biggest TT pet peeve, especially now that the developers have done such a wonderful job implementing bigmaps: the larger the map is, the less the the map looks like a real map. What I mean by that is that they don't look like they've been formed by geographical events; they look like they've been generated by a computer program that is trying to achieve a roughly even distribution of land and water, or highland and lowland. I would love it if the options consisted of you could choose between having a patagonia, or continents, or archipelegos (as in civilization 3), as well as mountainousness and the amount of lakes and seas. I find that when I'm playing on bigmaps, I just get lost in the sameness of the land; it would be nice to have recognisable coastlines, mountain ranges, bays, and penninsulas that give shape to the land-masses. Right now you can tell right away whether a map is a scenario or a random game, because of the shapes of the land. A good map-generator would generate landforms that look like scenarios.
I know that there's a planned rewrite of the way that map data is stored or something, and so these changes I'm suggesting would probably best wait until after such rewrites have taken place. This is definitely a change I'd like to see, though. Anyway, just my two cents.
I know that there's a planned rewrite of the way that map data is stored or something, and so these changes I'm suggesting would probably best wait until after such rewrites have taken place. This is definitely a change I'd like to see, though. Anyway, just my two cents.
This would mean a rewrite of the landscape generation algorithm. Maprewrite or no maprewrite, the underlying algorithm fundamentals will be the same. So if you would like to code it, you don't have to wait for the maprewrite 

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."
Thos features would be absolutely awesome, you'd have to build around them instead of bulldozing your way through.
James
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
-
- Engineer
- Posts: 9
- Joined: 12 May 2005 21:34
Thanks, I'll get right on that...Darkvater wrote:This would mean a rewrite of the landscape generation algorithm. Maprewrite or no maprewrite, the underlying algorithm fundamentals will be the same. So if you would like to code it, you don't have to wait for the maprewrite

I've actually done some map-generation scripts for Flash projects, but I've got very little experience coding anything in C. Still, I'll have a look and see what I can do...
-
- Traffic Manager
- Posts: 130
- Joined: 08 May 2005 08:45
- Location: Bergen, Scandinavia
I agree, I was thinking the other day I would like to see more varied landscapes. If I choose "hilly", for example, everything is hilly, there isn't flat land, with hills here and there, which would be more realisitic.
Water too, is either everywhere or nowhere, the odd lake, more smaller ones, maybe one or two bigs ones, would be nice. Maybe it would be simplest if we could have say an adjustable percentage of the land at one setting, and the rest at another. 50% flat, 50% hilly would be very nice. The same for water.
Water too, is either everywhere or nowhere, the odd lake, more smaller ones, maybe one or two bigs ones, would be nice. Maybe it would be simplest if we could have say an adjustable percentage of the land at one setting, and the rest at another. 50% flat, 50% hilly would be very nice. The same for water.
-
- Engineer
- Posts: 9
- Joined: 12 May 2005 21:34
I had free time in the last couple days to mock-up the sort of map generation tool I'd like to see.
This is a java-based app (Linux/Mac/Windows included) for generating maps using Perlin Noise. Use the sliders to adjust things like complexity, erosion, water level, etc. My goal for the time-being is to make the sliders more intuitive, make the landscapes more realistic, and to make this compatible with the png import patch. Currently, you can press 'Enter' to capture a png (automatically saved in the app directory), but it may not import correctly.
I don't think it's worthwhile to try to integrate these functions in OpenTTD until the map rewrite is done, but if there's interest, I'll continue developing this as a standalone app.
This is a java-based app (Linux/Mac/Windows included) for generating maps using Perlin Noise. Use the sliders to adjust things like complexity, erosion, water level, etc. My goal for the time-being is to make the sliders more intuitive, make the landscapes more realistic, and to make this compatible with the png import patch. Currently, you can press 'Enter' to capture a png (automatically saved in the app directory), but it may not import correctly.
I don't think it's worthwhile to try to integrate these functions in OpenTTD until the map rewrite is done, but if there's interest, I'll continue developing this as a standalone app.
- Attachments
-
- perland.png (49.9 KiB) Viewed 5311 times
-
- perland.zip
- (525.36 KiB) Downloaded 205 times
If I was incharge that would never get in because it's java LOLanthropomorph wrote:This is a java-based app (Linux/Mac/Windows included) for generating maps using Perlin Noise.

But luckly for you I'm not! Still it would never get it because it's java and not C...

EDIT: just remembered that the AI will most likely be able to get stuff written in java... Yet I hope I won't ave to use it cause java is SLOOOOWWWWWW...
Uncle Dex Says: Follow the KISS Principle!
-
- Engineer
- Posts: 9
- Joined: 12 May 2005 21:34
Yeah, I agree fully, but I'm not a C programmer (or a programmer of any sort, really). I'm just developing this as a concept for how a random map generator should work (hence the fact that it's under suggestions, not development). If anyone wants to try coding this in C, I'm sure they could do a much better job than me!Dextro wrote:If I was incharge that would never get in because it's java LOLanthropomorph wrote:This is a java-based app (Linux/Mac/Windows included) for generating maps using Perlin Noise.(stupid, bug-prone, slow-as-hell, time-waster among others thing...)
But luckly for you I'm not! Still it would never get it because it's java and not C...
EDIT: just remembered that the AI will most likely be able to get stuff written in java... Yet I hope I won't ave to use it cause java is SLOOOOWWWWWW...
Do a google search for Jake II sometime. It's a java-version of Quake 2. It's just like all the other languages. In capable hands, it can be a very useful tool, just like all the other programming languages.Dextro wrote:If I was incharge that would never get in because it's java LOL(stupid, bug-prone, slow-as-hell, time-waster among others thing...)
A computer scientist is someone who, when told to "Go to Hell," sees the "go to," rather than the destination, as harmful.
that's absolute nonsense. Java is way less bug-prone than C because of it's inherent exception handling, and compiled Java code is actually faster than C, it's the JVM that kills performance. It sure isn't stupid or time-wasting, or else 50% of all new business research in software wouldn't be done in Java.Dextro wrote:If I was incharge that would never get in because it's java LOLanthropomorph wrote:This is a java-based app (Linux/Mac/Windows included) for generating maps using Perlin Noise.(stupid, bug-prone, slow-as-hell, time-waster among others thing...)
But luckly for you I'm not! Still it would never get it because it's java and not C...
EDIT: just remembered that the AI will most likely be able to get stuff written in java... Yet I hope I won't ave to use it cause java is SLOOOOWWWWWW...
Please, don't spew nonsense like that as if it's fact.
I do agree that Java is totally not suited to ttd. it's simply the wrong tool.
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
- LordOfThePigs
- Route Supervisor
- Posts: 435
- Joined: 01 Jul 2004 10:28
- Location: Jura/Switzerland
Java is a very good tool for prototyping. However, the things that make it so good for prototyping is also what limits it functionality in some other cases, like when you need function pointers or other obscure c constructs.
What makes C so good is that it allows the programmer to do anything he wants. The problem is, it also allows him to do things he doesn't want or even thought of.
What makes C so good is that it allows the programmer to do anything he wants. The problem is, it also allows him to do things he doesn't want or even thought of.
PHP all the way baby!
Seriously, there's a PHP-OGL library out there now. Mad or what?
Anyway... I seem to recall that this has been requested before but never acted on. Shame really, because it's a really cool idea. And, as far as I know from a very cursory read of the code, etc, it doesn't actually need to wait for the map array re-write. Once that comes along I assume it would be a fairly simple task to tweak it for the new map array. Why not write it up as a patch?
Seriously, there's a PHP-OGL library out there now. Mad or what?
Anyway... I seem to recall that this has been requested before but never acted on. Shame really, because it's a really cool idea. And, as far as I know from a very cursory read of the code, etc, it doesn't actually need to wait for the map array re-write. Once that comes along I assume it would be a fairly simple task to tweak it for the new map array. Why not write it up as a patch?
Brignell’s law of consensus: At times of high scientific controversy, the consensus is always wrong.
-
- Engineer
- Posts: 9
- Joined: 12 May 2005 21:34
I'd love it if someone made a patch for this. Again, I think the best approach to creating good random maps is using the Perlin Noise method. The method basically uses layers (or octaves) of waves to allow for infinite layers of complexity. Basically, you can modify the frequency (scale) of the original noise (I recommend having scale linked to the map size, so that settings that tend to produce a single continent at 256 will produce a similar continent at 2048, but with more complexity), persistance, the number of octaves. I also put in a sea-level adjuster and a simple multiplier to make mountainous terrain easier to generate.Archonix wrote:PHP all the way baby!
Seriously, there's a PHP-OGL library out there now. Mad or what?
Anyway... I seem to recall that this has been requested before but never acted on. Shame really, because it's a really cool idea. And, as far as I know from a very cursory read of the code, etc, it doesn't actually need to wait for the map array re-write. Once that comes along I assume it would be a fairly simple task to tweak it for the new map array. Why not write it up as a patch?
This page has a great tutorial on it:
http://freespace.virgin.net/hugo.elias/ ... perlin.htm
I got about three-quarters of the way through generating my own code for it, before I realized the environment I was developing on (the Processing API for Java--processing.org) has perlin noise features built in.
I don't see what C has to do with keeping people from shooting themselves in the foot. C will happily load the gun, offer you a drink to steady your nerves, and help you aim. -- Peter da Silva
Yes, Java is so bulletproofed that to a C programmer it feels like being in a straightjacket, but it's a really comfy and warm straightjacket, and the world would be a safer place if everyone was straightjacketed most of the time. -- Mark 'Kamikaze' Hughes
Yes, Java is so bulletproofed that to a C programmer it feels like being in a straightjacket, but it's a really comfy and warm straightjacket, and the world would be a safer place if everyone was straightjacketed most of the time. -- Mark 'Kamikaze' Hughes
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
Thanks for the inspiration on this one. I went and researched, and the easiest algorithm to implement was a recursive subdivision method. Although its normally used for clouds, it produces OK terrain.anthropomorph wrote:I had free time in the last couple days to mock-up the sort of map generation tool I'd like to see.
I don't think it's worthwhile to try to integrate these functions in OpenTTD until the map rewrite is done, but if there's interest, I'll continue developing this as a standalone app.
See the TerraGenesis thread for the patch, and the Integrated Nightly will have this once Ive got the rest of the patches working.
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 3 guests