Loading...
  OR  Zero-K Name:    Password:   

Some map design theories and their use in Random Crags

11 posts, 935 views
Post comment
Filter:    Player:  
sort
(at least what i remember about them since august 2019)

Intro

There are two working map generators in ZK: Random Crags and RandomMapGen12x12. The second takes a terrain-first simulationist approach: it does erosion, and it ends up with maps that look like places. It also mostly produces maps that are either meh, or meh.

Random Crags takes an entirely different design-first approach. The results are much less natural looking, but also vary from okay to how do I save this map?.

Let’s discuss how RC generates that design, using what rules, and how were those rules themselves derived.

The theories

As far as I know/remember/can tell, there are two major theoretical influences behind RC. These are the “boundary” theory, and the “leyline” theory. The boundary theory ends up controlling the terrain of the map; the leyline theory ends up controlling its resource layout.

Both of these are derived from some observations of what good ZK maps tend to be, and how they can be analysed; then this analysis is applied to generation.

Additinally there’s a mex layout rule that we can call the Skasi principle if so inclined, because that’s the guy who ranted most against its violations back in the ancient days.

Seeing boundaries

The boundary theory starts with observing that most of the faved ZK maps can be seen as a set of flat areas connected (or separated) with boundaries. This is not very different to what automatic map analysis tools do for BroodWar maps (e.g. see the BWTA2 terrain decomposition library).

[Spoiler]

In ZK, these boundaries can be of various degree of passability: some will slow down hovercraft, some will block vehicles, some will block bots, etc.

Let’s call the flat segments “areas” and the boundaries, well, boundaries. Additionally, some thick boundary zones can have no “area” inside of them; let’s call them igloos.

Here is a picture from around the time this was discussed in #zkmap that shows the application of this theory to Wanderlust:

[Spoiler]

Learning from boundaries

Once you apply this model to good and bad maps in ZK, some generalities seem to emerge:

1) Most good maps tend to have an area-to-boundary ratio that favors “area”. A map that is almost entirely “boundary” tends to be bad – like Zion, or Melt. A map that is almost entirely “area” with minimal boundary tends to be okay – consider most Comet clones, Titan Duel, etc.

2) Good maps tend to allow the maximum possible amount of factories, so all or almost all of their areas tend to be connected with vehicle-accessible ramps – even if from a lesser amount of sides than you’d get with bots or spiders (or air).

Seeing leylines

The “leylines” theory is a development of a core insight that powered the ZKGBAI: because ZK boundaries are much more permeable than the boundaries in another games, the mex layout ends up being what matters most. That is, all strategic value is the economic value, and all economic value is in the mex layout. Consequently, this is how ZKGBAI used to see the world:

[Spoiler]

The leyline theory expands on this insight by observing that actually, it turns out that some areas of the map have strategic value even if they have no direct economic value.

In particular, these objects seem to have salient strategic importance:

The Direct path

Consider a map with two start positions that is perfectly flat. Now draw a line between those start positions. This is the line that any unit aiming to apply violence to the denizens of the other starting position will want to travel, because it’s the quickest path and our game is a real time strategy.

Consequently, all points on this line have strategic value. Any unit on this line is as close as possible to the enemy when attacking, and any defensive unit on this line makes the enemy either have to fight it, or have to go around, costing time.

The Equidistant line

Consider the line that bisects the Direct straight in the center, and is perpendicular to it. On a flat plane, this is the line on which both start positions are equally far. Holding any position on this line equals to projecting influence into the enemy side of the map and preventing the enemy from doing the same.

The equidistant has less strategic value than the Direct, but it still has quite some. Additionally, because it necessarily intersects the Direct, it creates a point – the center of the map – that has even higher inherent strategic value.

The Corners

All zk maps are necessarily rectanglar. This means, that all of them have corners – even though some try to hide them away. However, on a flat map, the corners also create strategic gradients: they are extremely easy to defend compared to any other point on the map, because while other points can be approached from 360 degrees, the corners are only approachable from 90 degrees. A corner is a chokepoint even in absence of any nonflat terrain and economical value.

On their own, corners are less valuable then either of the lines, but they are still more valuable than flat space not on the lines.

Controlling leylines

While every ZK map is going to have an equidistant and direct lines, and 4 corners, these lines can be rotated by changing the position of starting points. Additionally, they can be warped by terrain if players pick non-aircraft factories.

Additionally, the inherent strategic value of the lines can be either disrupted or enhanced by the economical value of the space which they cross.

Here is a picture of an attempt to see the leylines on Wanderlust using typical mirrored start positions.
[Spoiler]

Learning from leylines

It seems that in general maps that result in interesting gameplay tend to slightly shy away from placing mexes on areas that are already strategically important; when they do so, they try to warp the lines using local terrain, as in the wanderlust image above. You can see similar warps applied to corner mex clusters on titan duel.

Having a non-45-degree-aligned line between the start positions also tends to result in the lines not crossing the corners, which in turn prevents the corner value from spiking.

Maps that place mexes straight in the middle of the map – either the equidistant, or the center - tend to devolve into whoever can reach and porc up this critical position first. Maps that have defensible corners with economical value in them tend to have people skip-hop their expansion towards these positions.

The Skasi principle

Any territory that contains mexes is worth holding, and ZK has powerful defenses. Therefore, in a long enough game, any point on the map that has a mex will be porced.

Consequently, if you want a map that plays with mobile units and is generally interesting, it’s a good idea to avoid having mexes in every “area” of the map. Maps that violate this principle tend to be quite bad – see Koom Gorge.

Simple enough; and if you look at it, every good map in ZK follows this principle.

How Crags Does It

Now that we have all this analytical baggage, let’s see how Random Crags (maybe) applies these ideas.

(it probably does more, less, or not exactly this - AUrankAdminGoogleFrog should know more. I’m however mainly talking about the ideas, not implementations, and using Crags as an illustration)

I: Generate the terrain.

This step basically reverses the boundary theory. Instead of using it to analyse the map, it creates a layout of areas, boundaries, and igloos, and then converts it into a heightmap.

1) Generate a symmetric voronoi cell layout. The insides of the cells are Areas. The edges of the cells are Boundaries. Simple enough.

2) Decide on how strong each boundary is while maintaining vehicle accessibility to every cell.

3) While at it, designate vertices of the layout whose linked edges are all flat to contain igloos.

4) Pick two mirrored cells and declare them to be the players’ start positions. At this point the basic layout is done, and the map can be rendered (converted to a heightmap), resulting in a terrain that looks something like this:
[Spoiler]

RC also does some smoothing and such to hide the underlying unnaturalness of the voronoi. But that’s not really that relevant.

II: Ley out the mexes.

This generates a mex layout that attempts to not be too degenerate. The actual algorithm is probably modified from this sequence that I trawled out of discord history; however I expect it to be roughly similar. The algorithm attempts to avoid placing mexes on areas that are already strategically imporant, but sometimes will do so – intentionally and with less value. The bonus cell mechanism attempts to result in clustering of mexes and the creation of some no-mex cells.

5) Place an appropriate amount of mexes on the start position cells.

6) Give each cell the default value v equal to the (abs) difference between player vehicle graph distances to that cell. This distances themselves look somewhat like this:
[Spoiler]

7) Substract 2 from value of cells that are on the Direct line

8) Pick a cell and roll a v-sided die for it. Integer-divide by 2 to decide how many value-2 mexes to place. If you roll 1, don't place any and instead mark the cell as bonus cell.

9) Continue for all other cells, except if a bonus cell is present nearby, add +2 to value before rolling. Applied to the above image, the results look somewhat like this:

[Spoiler]

+21 / -0

3 years ago
I never thought that maps have so much theory. There must be a balance of the sides, usually a mirror map. Not many mountains, some mexes, it is located somewhere, the actual map is ready
+0 / -0
Feels like the strategic value of height is missing from all of that. A tall location is easier to defend and lets you project power on the surrounding area. For example, some maps have central mex clusters within depressions or with nearby hills, which makes them a lot harder to control than if they were level or, worse, on a hill.
+2 / -0
quote:
Feels like the strategic value of height is missing from all of that. A tall location is easier to defend and lets you project power on the surrounding area. For example, some maps have central mex clusters within depressions or with nearby hills, which makes them a lot harder to control than if they were level or, worse, on a hill.

If you want to pay attention to that, you could consider boundaries to be themselves directed. Would be interesting to see what kind of insights you can extract from reading the maps that way.

Additionally, any elevation is something of an economical resource in ZK because it affects wind output. My perception though is that this matters much less than metal.

I guess if you then convert these thoughts here into prescriptive guidelines, then you should also bias against placing mexes on high terrain, because they will both be defensible, and immediately hyper-overdriven by a windfarm.
+1 / -0

3 years ago
Quite a few player start positions are both up high and have significant metal on them, in many maps.

I suspect this is not accidental, because of the properties you describe :)
+2 / -0
3 years ago
quote:
you could consider boundaries to be themselves directed
I'm not understanding this sentence. Directed in what way?

I'd think hills/craters would alter the path of the leylines, although it would be hard to determine exactly by how much.

I'd say LLTA Complex is a good example of a map where height is a sufficiently important factor to make the theory largely invalid on itself. The center of the map is not strategically important because its in the shadow of massive hills, specially near the top, which make it an unviable position to hold. Combine that with the fact that its not economically important either, and its easy to see why its such a porcy map.

But if you ignore the height factor, it would seem like a mostly flat map with a few boundaries and a few igloos, and seemingly obeying most of the rules of a good map.
+1 / -0
quote:
I'm not understanding this sentence. Directed in what way?

In the sense of forming a directed graph, and their sides being unequal in meaning. E.g. consider this visual language of circles:


The boundaries here are directional - one is an inwards boundary, and another is an outwards boundary.

quote:
I'd say LLTA Complex is a good example of a map where height is a sufficiently important factor to make the theory largely invalid on itself. The center of the map is not strategically important because its in the shadow of massive hills, specially near the top, which make it an unviable position to hold. Combine that with the fact that its not economically important either, and its easy to see why its such a porcy map.

Good point. I'll ponder about how to formalize this.
+2 / -0

3 years ago
Here's a different example with directional (lower < higher) boundaries using the map from the first post
[Spoiler]
+2 / -0
EErankAdminAnarchid you are missing part of the terrain generation. I generate smooth terrain (that sort of looks like a place) by adding and multiplying a bunch of randomly generated mirror and rotationally symmetric functions. The cells are assigned tiers based on the height of the underlying map at their centres. If you inspect the heightmap of Random Crags you'll see that it is rarely actually flat. This is because the underlying smooth heightmap is scaled down (so as to not affect path-ability) and added to the tiered heightmap at the end.

I might go into more detail later.
+0 / -0


3 years ago
quote:
EErankAdminAnarchid you are missing part of the terrain generation

Admittedly and explicitly:

quote:
(it probably does more, less, or not exactly this - AUrankAdminGoogleFrog should know more. I’m however mainly talking about the ideas, not implementations, and using Crags as an illustration)


More details would be absolutely awesome.
+0 / -0


3 years ago
Looks like I'm doing something else for now: https://www.patreon.com/posts/what-should-i-on-41957787

(In progress, but it's not looking good for random maps)

I'd have to delve back into it to generate more of a description.
+0 / -0