Thursday, January 31, 2019

Welcome to Undiscovered Worlds

Welcome to Undiscovered Worlds!

(Updated 10 March 2023)

Undiscovered Worlds is a world and map generating program. With it, you can do the following things:
  • Procedurally generate planets of varying sizes and types, including terrain and climate information.
  • Display different world maps: relief, elevation, temperature, precipitation climate zones, and rivers.
  • Procedurally generate much more detailed regional maps of areas of interest.
  • Export map images of global, regional, or custom areas.
  • Set parameters for custom worlds with particular terrain and climate types.
  • Import your own world terrain maps and generate climate information for them.
  • Adjust the colours and other render settings.
You can read the current patch notes here.

Screenshots

Here are some images to show what the program looks like:



And here are some maps made with UW. These are all exported directly from it, without any additional processing:









Here's an example of an imported terrain map, with climates and river placements by UW:


Download

You can download Undiscovered Worlds for Windows (only, right now) here.

Example maps to import into the program, to show the correct format, are here.

All of the source code is available here. Feel free to re-use it if you like, or to fork the project - please give me credit if you do!

Instructions for use

When you start the program, you are prompted to enter a seed number for the new world. You can choose a random number or enter your own, before clicking "OK" to begin the generation process.

Alternatively, you can load a previously created world, or create a custom world (see below).

When the world is ready, you will see the global map screen.

The global map screen

This screen displays a map of your world. The buttons to the left perform several functions:

"World controls" - these buttons let you create a new world, load in a different one, save the current one, or create a custom one (see below).

"Export options" - these allow you to export images showing maps of the world, or of a user-defined area (see below).

"Display map type" - these allow you to display different kinds of information on the map.

"Properties" - opens a window giving information about this world.

"Appearance" - open the settings to change the map appearance (see below).

"Zoom" - open up the regional map screen for the selected point.

You can also click on any point on the map to get more information about it, displayed in the panel at the bottom. This panel also contains two buttons that open monthly charts showing temperature and precipitation.

The regional map screen

This screen displays a map of a small area of your world, shown at a scale of approximately 1 pixel to 1 km. The buttons to the left perform several functions:

"World controls" - the button here lets you return to the global map screen.

"Export options" - these allow you to export images showing maps of the currently viewed region, or of a user-defined area (see below).

"Display map type" - these allow you to display different kinds of information on the map.

"Properties" - opens a window giving information about this world.

"Appearance" - open the settings to change the map appearance (see below).

To the top right of the screen is a mini-map showing the current region on a world map. You can click on this map to go directly to another region. You can also use the cursor keys to move to neighbouring regions.

As with the global map screen, you can also click on any point on the map to get more information about it, displayed in the panel at the bottom. This panel also contains two buttons that open monthly charts showing temperature and precipitation.

The map appearance settings

This window allows you to change the appearance of the relief maps. Note that any changes here will be applied to both global and regional maps. These changes are purely aesthetic - nothing about the world itself is changed here, and none of these changes affects the other maps such as elevation, temperature, etc.

The first tab shows the colours that are used to generate the maps. You can click on the colour boxes to bring up a colour picker. The program mixes these colours to create the relief maps - try changing them to see what sort of effect it has. You can also try making some colours identical to produce simpler maps - e.g. if you want the sea to be a single colour throughout, set "shallow ocean" and "deep ocean" to the same colour and turn off both shading and marbling on sea. Note that you can type new values directly into the boxes by clicking on them while holding down the control key.

The second tab has a number of other appearance settings.

"Shading" - this controls the pseudo-3D shading effect. The sliders allow you to change its intensity on land, on lakes, and on sea.

"Marbling" - this controls the marbling effect, which adds variety to the appearance of the maps. You can, again, change its intensity on land, on lakes, and on sea.

"Rivers" - this controls how many rivers are shown on the map. Only rivers with flow greater than the given number are shown, so the lower the number, the more rivers you will see. You can set different values for the global and regional maps.

There are also some other controls to the right. The "light" box allows you to change the apparent direction of the lighting. The "snow" box under it allows you to change the way the map displays the transition between snowy and non-snowy regions on the map. Finally, the "sea ice" button allows you to set whether sea ice is shown.

The buttons at the bottom right allow you to save or load settings, restore the defaults, and close the panel. Note that if you save the world from the global map screen, its appearance settings are saved with it and will be restored if you reload it. So you don't need to save the settings separately unless you plan to load them into other worlds.

If "Show mangrove forests" is selected, these will be shown in the appropriate locations on the regional map. The "Only cliffs use high base colour" is intended for non-tectonic planets, which sometimes have extensive high plateaux that can look a little odd if rendered using colours intended for mountains. Selecting this option will force the program to render these plateaux using the lower base colour.

The appearance settings are stored as part of the world, so if you save the world and reload it they will be restored. If you generate a new world it will inherit the current settings. You can also save the settings by themselves to load later, or click "Default" to reset everything.

The custom area export screen

This window allows you to export maps from a custom-defined area of the world. These maps are at the same scale as the regional map - 1 pixel to 1km - but they can be of larger areas. Note that very large areas may crash the program! You will be warned before attempting this, but it is wise to save the world before exporting to be on the safe side.

Click a point on the map to select a point. Do this again to select a second point, defining a rectangle. You can continue to click or drag the points to re-define the area. When you have the area you want, click on "export maps". There are also buttons to clear your selected area and to return to the global map screen.

The custom world screen

This screen allows you generate worlds to your own specifications. You can also import your own maps - created with an image editor - and turn them into Undiscovered Worlds worlds. In this way, you can create your own terrain, and have Undiscovered Worlds calculate the climates, rivers, lakes, etc. You can then explore maps of your world just like any other. The files used to create the Tolkien map shown above can be found here - have a look at these to get an idea of how to create your own.

On opening this screen, you will be prompted to choose the size of your custom world: 512x257, 1024x513, or 2048x1025 pixels. In each case, 1 pixel is roughly 16km.

Having selected the size you want, you will see several groups of buttons on the left.

"Import" - these buttons are for importing your own maps. They must be the same size as the world and in .png format. For the land, sea, and mountains maps, only the red values of the colours are important (so for example a point that's coloured 100, 50, 50 will be interpreted the same as one that's coloured 100, 0, 0 - both convey the value of 100 alone). (Note that you should set the colours on a scale from 0-255 - some paint programs allow you to do so on a scale from 0-100, so be sure to use the correct scale.)

The program will interpret the maps in the following way:

land map - only the red value is used. 0 indicates sea, and any higher value is elevation above sea level, in increments of 10. So e.g. 100, 0, 0 indicates a height of 1,000 metres above sea level.

sea map - only the red value is used. 0 indicates land, and any higher value is depth below sea level, in increments of 50. So e.g. 100, 0, 0 indicates a depth of 5,000 metres below sea level.

mountains map - only the red value is used. It shows the peak elevation above the surrounding land, in increments of 50. So e.g. 100, 0, 0 indicates a height of 5,000 metres above sea level.

volcanoes map - the red value shows the peak elevation above the surrounding land, in increments of 50.  A green value of 0 indicates an extinct volcano, or a higher value indicates an active volcano. A blue value of 0 indicates a shield volcano, or a higher value indicates a stratovolcano. So e.g. 100, 1, 0 indicates an active shield volcano with a height of 5,000 metres above sea level, while 70, 0, 1 indicates an extinct stratovolcano with a height of 3,500 metres above sea level.

In theory you only need a land map - the others are optional. It's important to note that the land map shouldn't show mountain ranges. Undiscovered Worlds does not treat mountain ranges as normal elevation. If you want to define your own mountain ranges, you must import a mountains map, on which you have drawn the lines of the main mountain ranges as indicated above.

Also, the land map doesn't have to be very detailed. If you want, you could simply use the values of 0 to show sea and 1 to show land, without bothering about specifying elevation beyond that. You can use the "land elevation" button in the "generate" section to add random elevation to your map.

"Generate terrain" - instead of importing your own maps, you can use these buttons to generate a new map from scratch. You can choose a "tectonic" map (roughly Earthlike, with continents and mountain ranges) or a "non-tectonic" map (a more alien terrain with unpredictable features). In each case a window will appear giving you more options to fine-tune the generation process. Note that these are very approximate, so you may need to reroll a number of times to get the kind of map you want.

"Generate elements" - once you have either imported or generated the world map, you can use these buttons to add extra features to it.

"Other controls" - the "Properties" option here allows you to set the world's properties, such as its gravity, orbital characteristics, average temperature, and more. Note that you can set many of these properties to much more extreme values than would normally be generated randomly, allowing for the creation of worlds with exotic climates. By default, all the values are Earthlike, so if you want to force a world with Earthlike properties, you can do that here too. You can also turn off rivers, lakes, and deltas here if you don't want them to be generated.

When you have finished, click the "Finish" button. This finalises the terrain and then calculates rainfall, temperature, rivers, lakes, etc. When it is finished, the custom world will be displayed in the global map screen as usual, and you can view or save it like any other.

Known issues

The ability to resize the window is turned off, because it messes up the mouse tracking. (You can minimise it, of course.)

Saving and loading worlds is slow, but it works.

Occasionally, exporting maps doesn't work. Save the world, restart UW, load the world back in, and try again. I don't know why this happens or why restarting UW usually solves the issue.

Continents occasionally appear with straight sides. The cause of this is unknown too, but it is rare.

The climate simulation is imperfect - it should give generally reasonable results, but don't expect it to give a highly accurate model. However, a perfect climate simulation would require a lot more processing power and time than I have available!

Rivers and lakes occasionally go haywire. Known cause: lakes are the work of the devil.


About this blog

This blog describes what I've done and roughly how I've done it, and will keep track of future developments, following the example of Scott Turner's amazing Here Dragons Abound.

The backstory: I've always loved the concept of computer-generated landscapes, feeling somehow that places that don't actually exist are much more interesting than those that do. Somewhere that a computer has created is yet to be explored by anyone, making it somehow more intriguing and more "real" in a strange way than a fictional place that has been invented (and therefore fully known) by a person. Back in the day I spent many hours tinkering with Vista on the Amiga, which took an incredibly long time to produce results that seem very primitive today, but which seemed to offer small glimpses into whole worlds.

So I've had a go at making something of my own. Undiscovered Worlds is, or will be, the result. It's very much a work in progress. The next post describes what I'm trying to achieve with it and where the project is headed, while the rest of the blog documents the creation process and describes some of the terrain generation methods that I'm using. (Note: it took a lot of iterations and rewrites to get this project to the state it's in now, so a lot of the earlier parts of the blog are superseded by later ones!)

10 comments:

  1. Fantastic work Jonathan! I am absolutely blown away by your project :D I'm working on world generation myself (since one measly year), so I hope you don't mind if take some inspiration from your great work (of course with giving you credit and whatnot) :) Thank you for sharing your work and experience!

    ReplyDelete
    Replies
    1. Not at all, please feel free, and I'd love to see what you come up with too!

      Delete
  2. I love software like this. Unfortunately, the file is to large to be listed and when I just click the still displayed Download button, it fails due to detecting a virus.

    ReplyDelete
    Replies
    1. I'm sorry about that! It is a false positive (I have checked thoroughly) but I'm not sure how to resolve it.

      Delete
  3. Hi Jonathan, like NoName I love your job. The realism of your worlds is incredible.
    I was beginning the development of a 4X game and I was writing a code to generate worlds when I see yours. Now I think it's totally useless to code it myself, I will never reach the quality of your work.
    I would like to use it (with credit of course) but I've a request : Is it possible to isolate the world generation ? What I want is a linux command-line program which generate the result of the "export" function (a file with digits). I think that without the UI it's possible to make it easily work on linux.
    I'm trying to do it but you know your code better than me and I was wondering if you already had a command-line program.
    Congratulations again for your work :)

    ReplyDelete
    Replies
    1. Yes, please do - I'd love to see what you come up with. Unfortunately I don't have a command-line version, so I can't help you out on that score, but hopefully it should be fairly clear in the code how the world generation is distinct from the UI stuff. (All the UI is in main.cpp, the global terrain generation is in globalterrain.cpp, the global climate generation is in globalclimate.cpp, and the regional map generation is in regionalmap.cpp.)

      Delete
    2. Excellent - and do, definitely!

      Delete
  4. I need a tutorial to run UW please, the worlds aren't exporting

    ReplyDelete
    Replies
    1. Sorry to hear that! There is a bug with exporting maps - sometimes it just doesn't work. I haven't been able to identify the cause of this. It's usually possible to work around the issue by saving the world and then restarting UW and loading the world back in (or just re-generating it from the same seed, if it's not a custom world), and it should then be possible to export the maps. Let me know if you're still having issues...

      Delete
  5. Hi Jonathan,
    Stellar work, im a really facinated by what you have created.
    I am a solo indie dev, looking to make a game that features a procedurally generated map, and i would love to be able to use your algorithms and concepts in my game.
    I would have to port the concept and ideas to C#, but since the project is under a GPL-3 license, i need explicit permission from you to do this if i intend to use the code or any of the ideas/concepts in a closed-source, commercial project.
    I would of of course give proper credit.
    Let me know if you need some contact info for further details.

    ReplyDelete