Map generation – first working version

So, even, if many items still need to be set, I have worked on my map generation script and have a first good working version of it – a first terrain generator – map generator.

You can see here a few generated maps.

I’m quite happy with the results – notably as it takes perhaps a second to generate the map.

You can see:

  • Mountains
  • Rivers
  • Lake and ponds
  • Forest and isolate woods
  • Villages – with a minimum distance factor
  • Resources (Red Green Blue) – with a minimum distance factor.

I’m going to look into adding swamps (near river, lake or ponds) and hills (independents and near mountains). I may also make some coastal maps, and perhaps look into adding some maritime, ocean transport and vessels.

Most of these are linked to criteria such as density, size, direction…

Some of the adjustable variables in Unity inspectors –

Printscreen of my map generator, map generation, level generation script - taken from the unity editor.

The main map background is a plane and the tiling systems using a coordinate list – this enables me to keep the game objects down to a minimum.

For example in the below map:

An image of a map generated in my logistics game by the map generator made in unity

992 objects were generated – this is a fraction of the 10,000 tiles I would have needed for a 100×100 map list this one.

I’m sure, my map generation script will need to be reworked in the future but it is good enough for now and I’m happy with its performance and feel.

I’ll now be able to use this to start on some game mechanics.

A short video of some random generated maps:
(I find it somewhat soothing to just click my generation button and see a new map pop up).

Curious on where this project goes?

Please subscribe to my newsletter on the homepage or follow me on youTube or twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *