Age of Wonders: Planetfall - Dev Diary #37: Planet Generation Part I

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

LennartGS

Managing / Game Director @ Triumph
Paradox Staff
16 Badges
Jun 12, 2018
370
786
  • Crusader Kings II
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Gettysburg
  • Heir to the Throne
  • Magicka
  • Naval War: Arctic Circle
  • Sword of the Stars II
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Prison Architect
Hi there, today we return with the Planetfall Dev Journals, in a two-part series about the about Planet Map Generation, often referred to as the “Random Map Generation”

Procedural Maps were first introduced in Age of Wonders: Shadow Magic, became more prominent in Age of Wonders III and for Planetfall they have gotten even more important insofar that even Campaign Maps are now procedurally generated.

The tools have gotten so powerful that level designers (and soon modders) have a tremendous amount of control over the planets that are generated, from overall world layout, to starting positions, and unique sector definitions. Further systems allow designers to embed deep story events into the planets. So, it’d be wrong to call our maps “Random Map” as it implies map bereft of human design.

Tech Programmer Lascha is the main architect of the systems described here and he contributed to writing this journal.

PlanetSelect.jpg

Planet Type Selection, note this sphere isn't showing the actual planet map, as it hasn't been generated yet!

Map Generation Principles

First some starting goals for our Planet Generator:
  • Produce Great Variety in Worlds, that produce great gameflow and feel natural
  • Systems driven design tied to Economic and AI mechanics
  • Sector Based, with each sector being themed or telling a “story” through its composition and name.
  • Modding Friendly, players can customize planet layouts, generation profiles and individual sector designs.
  • Integrated with scripting and quest engines.
  • Used by the Campaign, so campaign gameplay is compatible and adheres to the same rules as the regular meta game. Adds replayability.


Generation Overview

The generator does a lot of things and is influenced by a lot of things. Without going into details, it does roughly this:

  1. Start with an empty map.
  2. Generate positions for players, dwellings, landmarks, etc.
  3. Generate sectors by using the generated positions.
  4. Generate continents, pangea, lakes, etc. based on map type.
  5. Generate sector flavors (empty sectors, valuable sectors, uninhabitable sectors)
  6. Generate large sectors by combining smaller oceans, deserts, lakes, taking flow into account.
  7. Generate climes (arctic, arcadian, etc) based on slider settings, clime layout, economics etc.
  8. Generate overlays (forests, mountains, etc) based on sliders settings.
  9. Generate rivers and chasms
  10. Generate structures, hazards, pickups, etc.
  11. Generate teleporters
  12. Generate NPC factions
  13. Generate roads
  14. Generate beautification props
ocean_with_ui.jpg

Ocean Sectors as well as large uninhabitable deserts are merged together into larger sectors. These buffer areas break up the patchwork.

Player Placement

Player starting positions (and therefore the number of players) are a big factor of the general balance and pace of the game. In the map generation it is the first type of sector whose positions are determined.

In AoW3 the players positions form a sort of circle pattern (actually an ellipse since the maps are not square). But Planetfall introduces wrapping maps. As you can imagine a circle pattern will not suffice anymore as there is no single ‘center point’ anymore.

Instead of coming up with a fancy new algorithm, we use Player Position Templates. The generator picks a template at random given the number of players on the map. Each template determines the relative positions of players on the map, with various configurable settings, fixed team placement support for multi-player, and preview options.


3_player_position_template.jpg

Player Start template with randomization

The image should be read as follows:
  • Green Dots: Starting positions of each player
  • Red Dots: All starting positions can be moved equally across the corresponding line to create variety in starting positions
  • Circle: Safety zone to prevent players from starting too close to each-other
Sector Generation

When life gives you sectors, make sector generators. And so, we did! The requirements were mainly having control over sector shapes, sector sizes (landmarks, large oceans) and sector placement (especially distances between important sector types!).

The sector generator in Planetfall has really evolved over time, but this illustration is a good example of how it all started in early development: Add balls into a box (with collision) and when it is full, change them to sectors.

sector_gen.gif

Sector Placement Visualzied
  1. Size of the sector is controlled by changing the size of the ball.
  2. Shape of the sector is controlled during the conversion phase at the end.
  3. Placement of the sector is controlled by:

    1. Making it possible to insert the ball anywhere.
    2. Making it possible to give each ball a different mass.
    3. Making it possible to attach a spring to a location and/or other balls.
Sector Definitions

  • Designers build up sector definitions, they very from wilderness sectors, to barren “deserts” acting as buffer areas, to definitions for special naturals to River deltas. These definitions are closely tied to economic system as the distribution of climes and features dictate economic potential. While we were prototyping the economic system, it was super helpful to do this alongside the map generator as changes could be immediately reflected in the generation procedures. This way planet templates and campaign maps could be automatically updated. In AoW3 we had to totally redo some of the campaign maps because of systems changes.

  • Designers can associate particular features and secondary structure to landmark sectors. So in the case of a Promethean Vault Sectors, designers can set it to only appear on volcanic, and arid lands. Have chasms and mountainous features and have a set of secondary high powerful Imperial Defensive in the sector fitting a theme. They can add decorative markers, like littering the sectors with impact craters for nice post-apocalyptic touch. Further logic describes the distance such a sector has from other sectors.
sector_definitions.jpg

Sectors Definitions link to name sets. The size of the list depends on the frequency sectors occur (so lots for wildernesses and fewer for rarer landmarks). Of Campaign or Custom scenarios can have unique names.


SpacePort.jpg
The above Space Port Sector has been defined to always spawn in a sector with city ruins, contain charge and repair station station sites, always be adjacent to the player's starting position and always have a quest associated.

Please return next week for part II, where we’ll look at Planet Setup, Geography Types, Advanced settings and campaign planets.
 
This really looks great, the way the "random" maps are generated is interesting, especially the sectors one. Since i play Stellaris, sector can be a fearsome word :p

What kind of maps can be get? Diverse earth-like, desert, forest, cities, mountains and oceans, single biome planets, desert, forest, cities, mountains or oceans? What really would be great is a ruined ecumenopolis like map, just buildings, neighborhoods for sector, crumbling ruins for forts and just the minimal nature in the parks only. The ruined city ravaged by war is a really lovely stage for another war and that kind of maps are not usual in games. A complete map of nothing else than urban warfare is pretty rare in almost any game, but its addition in Planetfall make sense lore-wise. Your Commander could be returning to one of the main Star Union planets and then encounter just ruins and war. Emerging story-line everywhere :)
 
generating a map looks like playing lotto.
RELEASE THE BALL MACHINE!
 
Holy cow, now THAT is a developer diary! What a cool look into the map. I especially like the use of... random ball theory? ... to keep sectors equal but slightly different.

On that note, is there an option to generate oddly shaped sectors? Throw a banana or a half-moon in there too?
 
On that note, is there an option to generate oddly shaped sectors? Throw a banana or a half-moon in there too?

We would like to make more sector variation, but rules like minimum# connecting sectors for provinces, minimum center area width, makes this less easy as it might sound.
There are already variations - like large sea sector or the elongated "Cargo Crest" sector in the desert screenshot.
 
We would like to make more sector variation, but rules like minimum# connecting sectors for provinces, minimum center area width, makes this less easy as it might sound.
There are already variations - like large sea sector or the elongated "Cargo Crest" sector in the desert screenshot.

So we will not get a map with six sectors shaped like the word "SECTOR"? :(
 
"Phoenix Vaults, Dark Sanctum, Xenoplague Cryo Tomb Ruins, Cryo Tomb, Elysium Parks Ruins, Elysium Parks, Government Palace Ruins, Government Palace, Voidtech, Celestian, Spaceport, Artificial, (Pre-Specialization Bases) Imperial Energy Complex, Imperial Mining Complex, Imperial Research Center, Imperial Biodome Compound, Imperial Sunken City"

I don't know if this is a complete list of Landmarks, but they sound pretty cool.

I'm curious as to the difference between Government Palace vs Ruined Government Palace, Elysium Parks vs Elysium Parks Ruins, and Cryo Tombs and Cryo Tomb ruins? Do you first have to rebuild the ruin versions before using? Is it just the Bronze version of Landmarks?
 
Nice to see how all this works and what logic generates the maps. And wait, wraparound maps? So you go in one side, you come out the other? That's a great idea! Have not seen that in a strategy game yet! (though, flat earthers will be pissed. ;) )
 
Will there be a built-in map editor? I'm also assuming maps will be highly moddable Seriously, the thing that first got me into wandering around the Steam workshop was maps for Portal 2.