Dev Journal: Conquering Infinite Worlds in the RMG

Among all the beta madness, we found some time to prepare a new development journal. One of the things we’re tweaking in this beta phase is the Random Map Generator (RMG).  In this journal, programmer Lascha Lagidse will tell you how the RMG is constructed and what considerations have been made.

RMGSetup1

The Quick Start Settings in the Front End

Our Goals with the RMG Hi! Random Maps Generation has always been a much wished for feature, yet in the Age of Wonders series the RMG wasn’t added until the stand-alone expansion Shadow Magic was released.  For Age of Wonders III we wanted to add the RMG while the main game was still in development, so we could take the random generation process into account when developing the game and spend enough time on it. On and off, the RMG was written over a period of 18 months!   Our goals for the RMG are:

  • Give you the sensations of truly exploring and conquering varied uncharted worlds; both in single player and in multi-player.
  • Support for multiple, vastly different, Map Types;   Land based maps, Island Maps, Underground Maps, etc.  In the previous game you could sort of predict the lay of the land once you generated a bunch of levels. Now we wanted to add more variation at the core.
  • Good flow and balance; e.g. ensuring that player’s don’t start right next to hostile high level structures like a Dragon’s Peak with raiding dragons.
  • Support for randomly selected AI players, so you don’t know who you’ll be encountering.
  • A Quick start Option allowing tweaking of the core settings, like size, # players and starting power.
  • Advanced options with filters allowing experienced players to tweak every detail like the abundance of forest or the exclusion of a particular race and the flow of the map.
  • And last but not least, the lands should look natural, with locations fitting in their natural surroundings. Rivers flowing into seas, etc approaching the look of a hand crafted map

 

RMGGameMap1 The Starting Area for an Archdruid player as Generated by the RMG

The Generation Process Central to the generation process is tool that allows us to define generation passes. Each generation pass has the responsibility of generating a part of the world. While a generation pass is being generated it must meet a special set of generation rules which are configured by us. For example, here are some rules for a generation pass for Shrine of the Fickle Mermaid water structure: – It should always be generated in the water. – It should not be generated too near to the shores, unless there’s no better place. – It should not be generated near other shrines of the same type, unless there’s no better place. – It should never be placed within a 10-hex distance from a player starting point. – It should never be placed within a 6-hex distance from the map borders. After creating the rules, we made sure it had sufficient randomness in the values of the rules. This is important; otherwise the maps will become too predictable! But also don’t allow it to have too much randomness, or it won’t be fair! Tweaking these values is extremely important for finding a balance between fairness and randomness. When the configuration of the generation pass was finished, we added the whole thing to a generation group.  At the moment there is a generation group for each map type, namely Land, Continents and Islands. And there is another generation group for Underground. Either of these groups can be given to the generator and the generator will return a randomly generated map by processing each generation pass in the group in order.

RMGSetup3One of the  Advanced Setting tabs in the Front End.

Generation Pass Types We have many types of generation passes and each type has its own specialized way of changing the world. The most important ones are:
- Object Generation Pass: Can generate objects such as structure, pickups, unit stacks and props.
- Area Generation Pass: Can generate terrain area of a given theme and/or clime.
- Continent Generation Pass: Same as Area Generation Pass, but is more shaped like continents and scales better with different map sizes.
- Cluster Generation Pass: A generation pass that can contain a sub-group of generation passes. This recursive generation pass is very powerful. I’ll leave it to you to imagine the possibilities.
- Path Generation Pass: Can create paths from an object to another object. This pass can be used to create road paths, or to simply break down mountains in order to create a passage.
- Player Spawn Generation Pass: Responsible for finding player spawn positions while making sure the distribution is fair.
- River Generation Pass: Responsible for generating random rivers (can also be used for lava rivers!).
- Layer Connector Pass: Makes sure that objects such as cave entrances/exits are placed correctly. This allows units to travel from the surface map to underground map. RMGToolSettings

First Prototype

We wanted fair random generated maps, but this way of generation was completely new to us; we could not find another strategy game that used a similar approach. Would this approach even work? I had a strong feeling it would, but no guarantee. The initial implementation of the RMG (prototype) was actually way too complex that it became difficulty to work with. At one point I decided to rewrite it, but keep the good parts. The result was a new prototype application (2D) of which a screenshot can be seen below. The left contains the resource objects, such as generation passes. The currently selected generation pass is [Mountains], for which the rules can be configured in the center panel. I would have to write a book to explain each of the values in the center panel, so I’ll leave that explanation out. On the right side is a random generated level based on my currently configured values. So in short, this prototype application allowed me to test faster; I had a simpler overview of the map but most importantly I did not have to wait for the whole game to launch (takes precious time). When I felt that the generator was stable enough I converted all the code to the Age of Wonders 3 codebase. And this is when the rest of the developers were also able to generate random maps for themselves.

The Random Map in the Game

And here are some results of the game. As you can see there’s quite some variety in geography.  At this points we’re tweaking the results and adding some beatufication passes like smart prop placement. (flowers and butterflies around Sylvan Court’s for example)

RMGMap1An Overview showing a Land style map. Note features like rivers and lakes segmenting the world.

RMGMap2

A Continent Style Map. All Players have about the same size expansion area.

RMGMap4

Underground Layer,  Note the rivers of water and lava.

RMGMap3

An Isles Map. All Players start with a Harbor. Seafaring is essential in this map.

RMGGameMap2

Another in-game shot. Note the cluster of resources and an Indie town placed in a bottleneck. This creates an area of heightened strategic interest.

  Thanks for reading, and please let us know what you think in the comments below! Lascha Lagidse

The following two tabs change content below.

Lascha

Latest posts by Lascha (see all)

Home Forums Dev Journal: Conquering Infinite Worlds in the RMG

This topic contains 62 replies, has 45 voices, and was last updated by  rohirrimelf 8 months, 1 week ago.

Viewing 30 posts - 1 through 30 (of 63 total)
  • Author
    Posts
  • #27826

    Lascha
    Moderator

    Among all the beta madness, we found some time to prepare a new development journal. One of the things we’re tweaking in this beta phase is the Random
    [See the full post at: Dev Journal: Conquering Infinite Worlds in the RMG]

    Programmer by day... Deadly ninja by night.
    #27823

    Piko LV
    Member

    Awesome how detailed these random maps are, and how many customization options RMG have. Really looking forward for this game! :)

    #27834

    Arioch
    Member

    It’s an excellent and important feature, and it looks like it’s been thoughtfully and effectively implemented. Thanks for sharing this info!

    I wasn’t even aware that this feature existed in Shadow Magic.

    #27837

    Motasa
    Member

    Very interesting read. Truly awesome maps, looks very natural to me.

    Are these maps – say the Land style one, shown on top – the largest map size available? They look really large.

    Second question: how many players can be put on the largest map size?

    #27859

    davis14
    Member

    very nice one of the problem I’ve had with similar map system like this is that there isn’t a large variety

    #27899

    Lennart Sas
    Keymaster

    Random Maps support sizes up to XL, (I think that’s larger then the ones pictured) with 2 map layers and up to 8 player sides.

    #27909

    Motasa
    Member

    Thanks for the detailed response Lennart. :)

    #27910

    mrXD89
    Member

    Is it possible to have 8 players even on the smallest map? E.g. for fast clash.

    #27922

    Leon Feargus
    Member

    NICE WORK!

    #27923

    Is it possible to have 8 players even on the smallest map? E.g. for fast clash.

    Yes.

    #27925

    vfxrob
    Member

    I love that the map is a map! beautiful work guys!

    #27926

    achilleas
    Member

    Hello,

    I’ve been following the updates for a long while now, like most of us anticipating the release of AOW III.
    The issues you bring up here are very interesting and I would like to mention one untouched in your journal.

    Wizard’s Throne and Shadow Magic brought various significant changes to mechanics. One of them was the pioneer and it’s ability to create new outposts. This brought a new dimension on strategy. Climaxing with SM’s final instance, you needed to both battle the NPC back, while at the same establishing new cities of your own for the best and fastest result.
    This worked very well in the scenarios where the enemy was already established and special mechanics were in places. Again I’ll refer SM’s final instance teleports from the shadow world to the mainland and caverns, where the continuously stronger enemy armies are on par(for a good while at least) with your continuously expanding empire.

    However, when coming to any large and not heavily populated maps where enemies were not yet established, it made the game very one dimensional, since there was very little incentive to interact with the map. Gains were far greater if you focused on establishing cities of your own until you gained enough of an army to just sweep anything in your wake.
    Even in maps were almost all options were set to heavy population, I found few gains into trying to take down heavily fortified independent buildings and cities, yet more than enough space to found my own.

    Hoping I have been somewhat making sense so far I’ll try to summarize my argument. While on regular scenarios there was a balance between your growth and the computer’s, in large RGM’s the pace of your growth was exponentially faster than that of the computer and that was largely due to your ability to found your own cities relatively unhindered(while the computer didn’t).

    I very much like how you are trying to set variables that will make such RMG’s feel both fair yet unique. Shadow Magic was a very satisfying game overall, but it would be great if that aspect was improved to offer better gameplay in the large random maps.

    #27987

    Hunter
    Member

    Looks very good.

    Can you save and share favourite random maps? (with a seed for example?). I assume there is also a map editor for us to make more hand-crafted maps?

    #28010

    squeezing
    Member

    This looks fantastic, but a question.

    There seems to be an awful lot of mountains in all the generated maps. Come to think of it I seem to remember a whole lot of mountains in the screenshots too.

    Why is this? Is this a concious choice and if so, why? To reduce exploitable space or reduce resource intensity or just to create chokes?

    I love the Idea of mountaneous (is that a word?) regions. But I would like to be able to play in lush open forest and grasslands types of regions too. Perhaps with mountain ranges passing through them but not as path-limiters.

    #28014

    gnasen
    Member

    There seems to be an awful lot of mountains in all the generated maps.
    [...]
    I love the Idea of mountaneous (is that a word?) regions. But I would like to be able to play in lush open forest and grasslands types of regions too. Perhaps with mountain ranges passing through them but not as path-limiters.

    Exactly my thoughts. However if I understand it right, I could reduce the amount of mountains, in comparison to SM where the options for the RMG were very few?

    I didnt know that ships have become more important, I really like that. In the previous titles I had maybe 3 or 4 sea battles at all. Only 2 kind of ships and an AI with a phobia of the sea…

    #28040

    wilendar
    Member

    OK ! Now I know I’m pre-ordering this game asap, when you give me that option ! I was waiting for that info! there is no better tool like RMG which gives hundreds or even thousands of gameplay hours, THANK YOU !

    #28068

    vicwaberub
    Member

    Wizard’s Throne and Shadow Magic brought various significant changes to mechanics. One of them was the pioneer and it’s ability to create new outposts. This brought a new dimension on strategy.

    Yes, the strategy of city spam ;) I hope we can disable pioneers in AoW3 as option for random maps and multiplayer games.

    The maps are very cool and big. How much time did it need, to move from one side to the other?

    Lava meets water? …zzzschhhh…

    There seems to be an awful lot of mountains in all the generated maps. Come to think of it I seem to remember a whole lot of mountains in the screenshots too.

    I love the possibility of bottlenecks, but the maps seems inspired by HoMM: A map of ways.
    The problems are strong independent guardians, one-way-out-startpoints and dwarfes on the mountains as highwayman and sword of damokles. In these maps is flying one of the most important propertys.

    Can a normal unit see over the mountains?

    Can we build donuts and east-west-maps?

    #28089

    Gamling
    Member

    I like this a lot, this will gives the game infinite replayability. I also like how the mountains divide up the maps. I usually find too open maps boring.

    I love the cloth map view too, they remind of the fantasy maps I used too draw as a kid dreaming away. :-D

    #28097

    Wow this looks good. I am surprised so see such dedicated work has gone to the RMG and it promises to be good!

    Looking at the screens the many roads seem to be well connected while at the same time they give a ‘natural randomness’ to it. Together with impassable mountains it seems the maps provide interesting bottlenecks. Also interesting to see the Continents and Isles Style map, implying water, ships ed. becoming important.

    At the end Lascha wrote: At this points we’re tweaking the results and adding some beatufication passes like smart prop placement. I think this beautification is very important; it will make the map alive (in contrast to the RMG in AOW:SM tbh).

    Take note this was posted on a Sunday, from which I infer the devs work weekends to get us informed! THX!

    I hope we can disable pioneers in AoW3 as option for random maps and multiplayer games.

    I hope so too.

    #28117

    Edi
    Member

    Lascha, how about explaining what Game Flow means? The entry is excellent and mostly new info also to us beta testers, but that one (which is one of the easier and obvious bits for anyone who has tried the RMG) is not mentioned at all in the post. It’s bound to generate questions.

    #28122

    Arlow
    Member

    thanks again, the wonderful updates help pass the time…. almost here, almost here :)

    #28142

    mrXD89
    Member
    #28143

    Ericridge
    Member

    Hmm, now only time can tell whether Age of Wonders 3 has succeeded in coming up with a good map script that can defeat the modded map script I have for Civ 5.

    I have my doubts because the modded map script i have is probably the best one I’ve ever seen in years of strategy turn based gaming. Because I literally cannot predict what the world will be ever at all.

    I once got a map where the ocean I’m based on only connects to the 1/4 of the world. I had to set up an bunch of island fortresses in thinnest land mass just to establish naval control to reach and explore the remaining 3/4 and hurt the AIs. And that is on the biggest map setting xD

    Cannot wait to give your RMG a spin and see how interesting the worlds can be.

    #28150

    vicwaberub
    Member

    Hmm, now only time can tell whether Age of Wonders 3 has succeeded in coming up with a good map script that can defeat the modded map script I have for Civ 5.

    Can you show us a screenshot of your maps, so we can take a look?

    #28183

    Tawni
    Member

    AWESOME!!!!!!!!!!!!!!

    RMG done right :D

    #28187

    Ericridge
    Member

    AWESOME!!!!!!!!!!!!!!

    RMG done right :D

    Sure thing, Will take care of the screenshots for the 1/4 accessible by my capital after I get back later today.

    But here’s this for now.

    http://forums.civfanatics.com/showthread.php?t=503954

    Edit: oh I almost forgot.. there’s several more screenshots on 2nd page.

    #28189

    Lascha
    Moderator

    @achilleas You make very valid points. It’s a really cool idea imo. I’ve discussed it with other devs, including the big boss. But since it is an unplanned feature it is too late to add at this moment of the development stage ; we will look at it after release. I hope this is a reasonable answer. :)

    Can you save and share favourite random maps? (with a seed for example?). I assume there is also a map editor for us to make more hand-crafted maps?

    At the moment there’s no feature to save random maps. There’s a seed but it’s a little more complicated than that. We have this feature on our todo-list, but at the moment we are prioritizing bugs over new features. We’ll try to get it in before release (initial plan), but again, we’re really busy, so if it doesn’t make it then it’ll be there in a patch a little after release :) And yes, there’s a map editor. Yay! :D

    Lascha, how about explaining what Game Flow means? The entry is excellent and mostly new info also to us beta testers, but that one (which is one of the easier and obvious bits for anyone who has tried the RMG) is not mentioned at all in the post. It’s bound to generate questions.

    Game flow is a term that describes a collection of settings that have a direct impact on the generation of ‘game objects’. These settings allows control over stuff like amount of independent cities, resource sites, pickups, roads, (relative) distance between player spawn points, start with pioneer or a large city, etc, etc. You can modify them all in the advanced options OR you can select a pre-configured one in the quick-start menu (Normal, Adventure, Empire Building, Battle).

    This looks fantastic, but a question.

    There seems to be an awful lot of mountains in all the generated maps. Come to think of it I seem to remember a whole lot of mountains in the screenshots too.

    Why is this? Is this a concious choice and if so, why? To reduce exploitable space or reduce resource intensity or just to create chokes?

    I love the Idea of mountaneous (is that a word?) regions. But I would like to be able to play in lush open forest and grasslands types of regions too. Perhaps with mountain ranges passing through them but not as path-limiters.

    I chose to do this so that distribution of other objects make more sense; if it’s all plains then there’s too much freedom from e.g. point A to B; making it much easier to reach point B from point A which in turn influences lots of the gameplay. But there’s always the mountain slider which should reduce the amount of mountains significantly :)

    PS. There’s still an internal task for generating big areas of a specific type, e.g. big forests with e.g. a fairy dwelling, big deserts with an oasis (which in its area contains rarely any mountains), etc. etc. I think this is what you mean, but it’s not certain yet if this will make it in the game before release.

    The maps are very cool and big. How much time did it need, to move from one side to the other?

    Last year I started moving from the left edge of the map towards the right side of the map. I think I’m almost halfway now.. :D But no really, on an XL map I’d say about 40-50 turns from left to right.

    Can a normal unit see over the mountains?

    Yes, there is no line of sight checking going on.

    Can we build donuts and east-west-maps?

    Mmmm.. donuts :)

    vicwaberub wrote:

    I hope we can disable pioneers in AoW3 as option for random maps and multiplayer games.

    I hope so too.

    Yes, we can!

    Programmer by day... Deadly ninja by night.
    #28201

    ZombieEater
    Member

    Kudos for getting started early on the RMG! The maps look pretty good, in terms of balance.

    I hope one of your passes will also check races and terrain compatibility. The AOWSM RMG had the knack for dropping you an elven city or a windmill on undead wasteland and such.

    #28203

    vicwaberub
    Member

    <div class=”d4p-bbt-quote-title”>vicwaberub wrote:</div>
    The maps are very cool and big. How much time did it need, to move from one side to the other?

    Last year I started moving from the left edge of the map towards the right side of the map. I think I’m almost halfway now.. :D But no really, on an XL map I’d say about 40-50 turns from left to right.

    From Hobbiton to Mordor in only 50 turns… Seems to be a long game!

    #28211

    achilleas
    Member

    @achilleas You make very valid points. It’s a really cool idea imo. I’ve discussed it with other devs, including the big boss. But since it is an unplanned feature it is too late to add at this moment of the development stage ; we will look at it after release. I hope this is a reasonable answer.

    With the game being between beta and gold, no overhaul is expected. It’s still very nice to get a swift reply and perhaps we might see the matter addressed at a later time :)

Viewing 30 posts - 1 through 30 (of 63 total)

You must be logged in to reply to this topic.