10
\$\begingroup\$

I've seen that symmetry and coherance is important in RTS level design, but I'm lazy and want to do procedurally generated levels.

How can I ensure I generate a fair playing field when procedurally creating levels for an RTS?

\$\endgroup\$
3
  • 4
    \$\begingroup\$ It's gradually getting buried with age, but I'd recommend looking up info on how random map generation scripts worked in Age of Empires games. These were text files players could edit describing how to generate skirmish maps of different types. I recall they had methods to lay down patches and clusters of particular terrain/props, to fairly place things like resources so they'd be guaranteed to be available, and to carve paths through terrain to ensure players could reach each other. Learning how their recipes worked should give you some ideas for your own. \$\endgroup\$
    – DMGregory
    Jun 5 '16 at 0:29
  • 2
    \$\begingroup\$ You don't mention if your RTS is single person or multiplayer. If single person, some level balancing can be done by altering AI behavior to match the skill of the player. In other words, the AI may have access to more resources than the player, but the game adjusts how aggressively it uses those resources depending on how aggressive the player performs attacks or exploits his resources. \$\endgroup\$ Jun 5 '16 at 6:04
  • 1
    \$\begingroup\$ To add to what Mark said, what kind of balance are you looking for? What are you using the maps to accomplish? \$\endgroup\$ Jun 5 '16 at 13:42
26
\$\begingroup\$

Personally, I find symmetry in level design to be boring, and I don't think it's necessarily the case that it's needed for fair levels; symmetry is a way of ensuring that everybody has access to the same resources and the same bottlenecks by virtue of the level literally being mirrored for each player in some fashion. I think the important part is access to (roughly) the same advantages and disadvantages. Not so much the symmetry itself.

I also think that a game balanced such that all sides are of equivalent power and have equivalent opportunity is boring. You obviously don't want a total imbalance of those factors, but I think it can create an interesting play dynamic to offer each side slightly varying opportunities and roadblocks.

That's the sort of design context I'm thinking of as framing the actual answer to the question:


If the symmetry really matters to you, you can simply procedurally generate a chunk of level and then mirror that level across both axes. The chunk you generate is basically one quarter of the level and you mirror it so each quadrant is the same. For example, a procedural height map with randomly dispersed resource deposits:

enter image description here

But as I said above, that seems dull. A more interesting approach might be to generate the entire terrain procedurally, but when placing resources, make sure to constrain each quadrant to having the same number of each (within some tolerance to provide some variability). You may want to bias the placement of various resource types towards various areas (randomly, near the starting points, near the borders) based on the importance of the resources. For example:

enter image description here

You can perform analysis on the generated image to try to find feature edges -- narrow canyons, for example, which may be considered bottlenecks. You may decided to re-roll the terrain generation for a portion of the map if, for example, it has far more or far fewer bottlenecks or similarly detectable terrain features than others. You may also want to do similar terrain analysis to make sure each placed resource is, in some fashion, reachable.

For example, you may decide to re-roll the bottom-left quadrant because it has too much water (in red) or the quadrants containing the green because they are too tactically advantageous (potential canyon bottlenecks):

enter image description here

You can also opt to manually guide your feature generation; you can manually place certain elements, such as a river dividing the sections of the level or key resource deposits, and run the procedural generation afterwards such that it preserved the hand-placed key balancing features while still providing the interesting and organic variety you want out of procedural generation.

For example, a generated terrain that preserves a manually-placed river dividing the map in half and forested cover provided extra defense around the bases:

enter image description here

\$\endgroup\$
7
  • 2
    \$\begingroup\$ Thanks, this will work well with my chunk system. People seem confused by my "but im lazy" statement. Im no artist, and I find noise and mesh generation more interesting. \$\endgroup\$
    – James Pae
    Jun 5 '16 at 8:02
  • 2
    \$\begingroup\$ @JamesPae: "Im no artist" Level design is not about art. It's about gameplay. So the question is, do you like designing games? \$\endgroup\$ Jun 5 '16 at 13:39
  • 8
    \$\begingroup\$ @JamesPae if you can't handcraft a fun level, you will have a very difficult time making your procedurally generated level fun. I suggest you handcraft a at least one level so you can learn what will be fun before writing your generator \$\endgroup\$
    – Evorlor
    Jun 5 '16 at 14:46
  • 2
    \$\begingroup\$ @Evorlor he's saying he doesn't enjoy it, not that he can't do it. Why is everyone ignoring this point the entire time? \$\endgroup\$
    – Davor
    Jun 6 '16 at 8:15
  • 5
    \$\begingroup\$ Why does everyone take everything so literally? He was clearly making a joke with that statement. I understand the OP's point of view, yes they could hand craft a few levels, but then you still only have as many levels as you have created. If you spend that same effort making a good level generator, you have potentially infinite levels to use. People have different mindsets and opinions. Some might like to hand craft great levels, some might enjoy really getting deep into making a great level generator. \$\endgroup\$ Jun 6 '16 at 11:14
7
\$\begingroup\$

In some cases, it might be possible to rely on the players themselves to build balanced asymmetrical maps by using tile manipulation mechanics.

At one end of the spectrum, you can allow the players to create the map, either partially or entirely, by selecting & place map tiles. There are a bunch of different ways this could be tweaked:

  • players select from a common deck of tiles
  • layers select from a personal deck of tiles
  • tiles are selected via a drafting phase
  • some tiles might be fixed in advance via scenario (i.e. always spawns a bridged river across the middle of the map)
  • players purchase tiles from a central market with some resource
  • players may or may not be allowed to keep a hand of tiles

At the other end of the tile manipulation spectrum is allowing the players to manipulate map tiles. In this solution, the game start with an initial map. The initial map could be symmetric or might be 'fair enough' by using any of the other answers.

Next, a map manipulation phase occurs in which the players may do some of the following:

  • rotate a tile
  • swap tiles (adjacent or otherwise)
  • mirror a tile
  • push a row or column of tiles (tile that would fall off the edge wraps around)

These manipulations could be executed one at time, in which case one player would have a chance to react to another players manipulations, or the player might queue of a list of changes which get executed. Also, you could allow players to manipulate the entire map, or restrict things to their starting areas.

A drawback of this approach is it the final result needs to be guarded against undesirable outcomes - i.e. manipulating an impassible mountain range such that part of the map becomes inaccessible. Possible solutions for this drawback are:

  • checking potential moves & disallowing ones that lead to illegal outcomes
  • allowing all moves, but undoing anything that is illegal
  • building the tiles so that no moves are illegal
  • designing other game mecahnics (i.e movement) such that no moves are illegal
\$\endgroup\$
2
\$\begingroup\$

Have your map generation algorithm generate symmetric levels by generating a level, mirror it, and place each player on one side. A four-player map can be created by mirroring it on both the x- and y- axis.

That way the map will be equally good (or bad) for all players. A side-effect which you need to be aware of is that it means that the players are aware of the positions of the other players and of the layout of the other parts of the map after exploring their own.

Another option is to generate a map without this symmetry trick, but then show the whole map to the players and have each player pick their starting location freely.

\$\endgroup\$
1
\$\begingroup\$

One approach is to use other factors to balance the map. You might be able to automate this by using some map analysis algorithms & providing extra starting resources to locations that are deemed disadvantaged. Alternatively, you can use the players themselves for this step. A current example of this is the use of reverse auction in reveal mode in Offworld Trading Company (OTC) for founding your initial claim (i.e. picking a starting base location):

As time ticks by, the starting debt for founding early goes down. This will eventually turn into starting money if it takes a long enough amount of time for the last 2 players to found. Once there is only one player left who hasn't founded their HQ, the values stop changing and that player no longer gains from waiting to found.

I don't recall if it was the 3 Moves Ahead or Game Design Round Table interview, but in one of them Soren Johnson (the developer) says this mechanic essentially changes the map problem from "can I find the best location first" into "how good is the 2nd best location on the map."

A benefit is this solution allows highly asymmetric maps. A disadvantage is that the entire map is revealed to all players, at least at the beginning. The OTC approach also reveals player base locations. Other mechanics like blind bidding, might avoid revealing base locations.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.