The art of map generation

Ever noticed that most games don’t have randomized maps? There’s a reason for that.  Doing them very well is really hard.

Probably if I had to do it over again, I’d be tempted to not have random maps. But as a gamer, I just find random maps to be too important not to have. It’s a big issue with me that I feel like each game is a new game.

Since Stardock is closed for the 4th of July holiday, a few of us are just working on stuff that we enjoy.

My long time friend, Paul Boyer, who is in charge of art, is making cool new stuff for the Fallen this holiday.

As for me, I’m playing around with the random map generation which is admittedly in pretty rough shape (i.e. a LOT of hard coded values in there).  For instance, in your build, there are 40 goodie huts on a map. No more. No less. Regardless of size.  The bigger the map, the more boring it will get.

Of course, have too many goodie huts and it robs the game of challenge.  Too few and the game feels boring.

Same for resources. Starting location is just too important to live to chance. The area around a given player’s start MUST have some useful, balanced stuff around it (and in beta 3, there just isn’t).

The map generation and starting setup are things that I suspect I’ll be playing with for the next couple of years. It’s just something that can just keep getting better and more interesting over time.

79,933 views 36 replies
Reply #1 Top

Do you have any mathematicians on your team? You could probably start off my making a simple linear optimization problem with 2-3 constraints (min distance between players, # of goodie huts, starting resources) and then just build it up from there. Granted, you'll probably get something like a 500x500 matrix but hey it's a start right?

Reply #2 Top

I'm up for randomized maps, with a variety of good huts, and the ever important starting resources.

(Though I would give some gold to find out why I can't build a harbor when I have beach front property available. Cause that's kinda left me in a bizarre situation that I'm land locked (Large Map/Multiple Continents) and I'm the only one on it. And have 3 cities by the water, with beach front property and room to build it, but it as of yet will not let me do so.) And those are cities 5, 4, and 4.

Reply #3 Top

Frogboy, are values for the random NPCs and quest buildings also hardcoded? i noticed that on the "small" map size, there were several NPCs and quest givers (in addition to goodie huts) but on a larger map, i can barely find any.

Reply #4 Top

Quoting jecjackal, reply 3
Frogboy, are values for the random NPCs and quest buildings also hardcoded? i noticed that on the "small" map size, there were several NPCs and quest givers (in addition to goodie huts) but on a larger map, i can barely find any.

Reply #5 Top

Thank you for your dedication Frogboy

 

starting cities are very important so far from what I've been able to find. Though, that seems to make me feel like once I start up the game, my foot is on the gas and I can't let up else I will just get run over by the computer.  Is it possilble to have it so that there is a hunt for the right real estate (for both sides) prior to laying down roots? and to then set it so there are different sites with different 'good' qualities to start with, but not everything?

Reply #6 Top

When are rivers going back in?  They are an important strategic terrain feature that I miss.

Reply #7 Top

Random Maps:

I also read a post where Frogboy said it took about 5 minutes for "random" map to be generated that they liked. So, they ended up creating a bunch of custom maps by hand.

Why don't you guys get a machine, and have it build maps all day for a week? I'm not sure how many maps you would want to ship on a DVD (for space concerns) but if your random-map generator is as awesome as you make it out to be (with a few tweaks here and there so that you can randomly place goody huts or resources or starting locations or monsters for different games) then you really shouldn't have to really sanity check it very much. 

You could probably sanity-check and improve 10 maps in this fashion in the time it would take to craft another map purely by hand. 

Also, including the Random Map generator in a post-release patch would be great, even if it did take awhile to run. On the other hand, "Custom" premade maps are better for more competitive play so I'm kinda happy in some ways that there will be a finite set of maps.

Reply #8 Top

Same for resources. Starting location is just too important to live to chance. The area around a given player’s start MUST have some useful, balanced stuff around it (and in beta 3, there just isn’t).

*Wipes sweat off forehead*

 

Was a bit worried on this, since lately I find that my opponents will either block me off or contain the most valuable resources; playing as a diplomatic player is a bit hard when forced over these issues.  Especially since interaction with other civilizations is one of the best parts of any strategy game. (IMO)

 

However, does this mean that we will not be able to see anymore differing amount of resources on a map?  So there will always be only 50 resources on the map even after the game is released?

Reply #9 Top

From June 29:
"So we worked on the randomized map generation until we got something we liked except that each map took approximately 5 minutes to generate. It’s something we’ll probably release in the future still."

Please release it. I don't mind if it takes 5 or 55 minutes to generate a decent random map, as long as there is a time warning.


Reply #10 Top

i like randomized maps, keeps the game fresh. but cant there be a handfull of pre-made maps? also should be allowed to assign teams.... 1 vs many would make it challenging especially on a good map :grin:

Reply #11 Top

Anybody planning to do historical maps based on actual countries like Greece or Japan?

(I mean historical topography, ores & metals, but other goodies would be non-historical, but shards might go where historical temples & shrines were)

Reply #12 Top

The hardest part about this is that you probably won't know until 6 months after Elemental releases what the best kinds of terrain features, densities, and layouts are.  So you're pretty much building the map generator blindfolded. 

 

As for map resources, I think you should equally weight the size of the map and the number of players when determining the densities.  In other words, resource density should be most closely associated with player density.  A map that's twice as large but has the same number of players probably should only have ~50% more resources.  The reason for this is that players will have a lot more choice in expansion because there's less competition from other players nearby, and tend to build a little more sparsely anyways to cover more ground, so the map doesn't need nearly as many "great" city locations and can get away with some dead zones.  This also works in reverse; smaller maps with more players should have higher resource densities so everyone has some stuff to work with, and there's simply no room for a dead spot on such a map.

Now, goody huts to keep things interesting makes sense on bigger maps with smaller player counts, but resources do not need to extend that much. 

 

On the other hand, "Custom" premade maps are better for more competitive play so I'm kinda happy in some ways that there will be a finite set of maps.

Not always; random maps ended up being the most popular choices for competitive team games in Sins of a Solar Empire.  Of course, the random map generator was really solid in that game (not nearly as complex, though, seeing as it's really just placing tiny dots [planets] in a sea of empty blackness), so much so that the maps it created were usually better than the premade maps the game ships with.

Both randoms and premades have their place, and a good random map generator can often inspire future premades.  I know a lot of my creations for Sins of a Solar Empire have been influenced by interesting layouts I've encountered in random maps. 

+1 Loading…
Reply #13 Top

Quoting Darvin3, reply 12


As for map resources, I think you should equally weight the size of the map and the number of players when determining the densities.  In other words, resource density should be most closely associated with player density.  A map that's twice as large but has the same number of players probably should only have ~50% more resources.  The reason for this is that players will have a lot more choice in expansion because there's less competition from other players nearby, and tend to build a little more sparsely anyways to cover more ground, so the map doesn't need nearly as many "great" city locations and can get away with some dead zones.  This also works in reverse; smaller maps with more players should have higher resource densities so everyone has some stuff to work with, and there's simply no room for a dead spot on such a map.

Now, goody huts to keep things interesting makes sense on bigger maps with smaller player counts, but resources do not need to extend that much. 

I'd second this, but sort of the other way around: map size should matter more, then number of players. I think you pick more players to get a more crowded feel and therefore more competition so the additional resources should be linear but not in line with the number of players. You pick larger maps to extend the exploration and discovery phase, so the expansion of goodies should be more determined by this (but perhaps less so for resources to create the dead patches you propose). So the algorithm should focus first on size then number of players for people to know what they're getting. I assume though that this will not end up being hard coded (I really hope not), as I agree with you Frogboy that random maps kind of make this type of game. Knowing that a big map is an empty map is not an exciting prospect - it just means lots of walking.

It would also help to have some control of just how much water there is beyond the generic buckets of now.

Reply #14 Top

Quoting Lord, reply 11
Anybody planning to do historical maps based on actual countries like Greece or Japan?

(I mean historical topography, ores & metals, but other goodies would be non-historical, but shards might go where historical temples & shrines were)

No, but I am considering making a Tyria map (Guild Wars landmass in case you are wondering).

Reply #15 Top

I really enjoy random maps in strategy games, but you are very right about it, i definatly would not like to be put in a corner with no materials and the enemy is in the bottle neck lol

 

If you know anyone that worked on Heroes of Might and Magic 3, their random map generator was really good

Reply #16 Top

More goodie huts would be a good thing, but I would prefer dynamic goodie huts : while you play some of them may appear (for instance near a place where a spider lair has grown thanks to puny adventurers, or near a big forest that has been unexplored for long,anywhere that would make a little sense)

Or the ability to dig, you have a small %age to find something interesting from before the cataclysm.

Reply #17 Top

Did you ever play Kohan: immortal sovereigns and its stand alone expansion Ahrimans gift(KIS, KAG)? Its an old RTS that I still enjoy to this day, and the main reason is because the random map generator is so awesome. In their random map generator they have a slider that lets you choose how many Mines (Resources), Independent Cities and Lairs (goodie huts) you want to appear per game and it varies by the map size. Asides from this they also give you sliders to set how much terrain types the map will contain (Grass, Water, Forests, Deserts, Tundra, etc) which I think was really nice to add more variety to the maps,

I wouldnt know how hard to code it would be but I think that adopting the slider that determines the Cities, Lairs and Resource would be a welcome idea. This would be done at the start of the game when selecting map size and other options.

Reply #18 Top

In their random map generator they have a slider that lets you choose....

That's certainly interesting.  Never played the game, but sounds like it had a rock solid random map generator.

Reply #19 Top

Civ IV has a great random map generator, and some of the mods included even better ones (Fall From Heaven, which most people here probably played, did some great stuff with the Erebus mapscript).

Reply #20 Top

PLEASE LET US MOD THE MAP GENERATORS!

As chinesetalberts said, Civ IV allowed us to write mapscripts. Erebus is obviously great. My own tectonics and other mapscripts have been inserted in the latest patch.

I probably spent as much time playing with the random map generation coding as I did with actual Civ IV. I'd like to write a generator for Elemental. I know cephalo posted here, so you could also get the Erebus map maker to make scripts for Elemental. Considering you've got limited engineering resources, I think it would help you a lot if you let us make map scripts because, frankly, there are modders out there that know how to make professional quality map scripts and have a lot of experience with them (my first map scripts were for the Clash of Civilization and I think I coded them 8 years ago, toyed with that for one or 2 years, then spent 2 or 3 years toying with Civ IV map scripts).

Reply #21 Top

As for me, I’m playing around with the random map generation which is admittedly in pretty rough shape (i.e. a LOT of hard coded values in there).  For instance, in your build, there are 40 goodie huts on a map. No more. No less. Regardless of size.  The bigger the map, the more boring it will get.
Of course, have too many goodie huts and it robs the game of challenge.  Too few and the game feels boring.

Reply #22 Top

I have to say that this should be as high a priority as the AI, as a very strong AI and a very strong random mapmaking function is needed for longevity.

 

Maybe allow players to customize the # of features that show: low, medium, high, or custom?

 

I'd also let the AI know the amount of custom featues (the player knows) and adjust its opening priorities based on that.  (no cheats, just tweaking AI values some)

Reply #23 Top

Froggie....just a note: The starting locations of the players on the random maps must be balanced somehow, or the multiplayer games will be imbalanced. Example: It wouldn't be good if player X would start near 3-4 special resource sites, while the first special site for player Y would spawn 20 tiles away from the starting location.

Reply #24 Top

Keep up the good work! 

As another mentioned, I would have no problem waiting for a random map.  The map generator you mentioned in the past could run independantly. Just make a few maps while the coffee is on and come back later and enjoy.

 

Reply #25 Top

Back when civ4 was eating my hours away, some one released a massive random map script..SmartMap or something along those lines. It allowed for massive, massive detailed and balanced maps with unique features, they could be as realistic, or as crazy as you could want. My favorite variants were maps stretched along one axis(24x220) effectively creating a ring world, or long corridor. That map script alone added as much gameplay changing elements as most of the other full on mods.

If Elemental went with out the ability to pull that off as well...that'd be a sad day for TBS fans.