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

Post edit history

Some map design theories and their use in Random Crags

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
9/23/2020 1:27:11 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:27:11 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:19:19 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:10:09 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:04:20 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:04:11 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:03:38 PMEErankAdminAnarchid before revert after revert
9/22/2020 2:01:10 PMEErankAdminAnarchid before revert after revert
9/22/2020 1:51:49 PMEErankAdminAnarchid before revert after revert
Before After
1 [i](at least what i remember about them since august 2019)[/i] 1 [i](at least what i remember about them since august 2019)[/i]
2 \n 2 \n
3 [u][b]Intro[/b][/u] 3 [u][b]Intro[/b][/u]
4 \n 4 \n
5 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 [i]places[/i]. It also mostly produces maps that are either meh, or meh. 5 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 [i]places[/i]. It also mostly produces maps that are either meh, or meh.
6 \n 6 \n
7 Random Crags takes an entirely different [i]design-first[/i] approach. The results are much less natural looking, but also vary from [i]okay[/i] to [i]how do I save this map?[/i]. 7 Random Crags takes an entirely different [i]design-first[/i] approach. The results are much less natural looking, but also vary from [i]okay[/i] to [i]how do I save this map?[/i].
8 \n 8 \n
9 Let’s discuss how RC generates that design, using what rules, and how were those rules themselves derived. 9 Let’s discuss how RC generates that design, using what rules, and how were those rules themselves derived.
10 \n 10 \n
11 [u][b]The theories[/b][/u] 11 [u][b]The theories[/b][/u]
12 \n 12 \n
13 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. 13 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.
14 \n 14 \n
15 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. 15 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.
16 \n 16 \n
17 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. 17 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.
18 \n 18 \n
19 [u][b]Seeing boundaries[/b][/u] 19 [u][b]Seeing boundaries[/b][/u]
20 \n 20 \n
21 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). 21 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).
22 \n 22 \n
23 [spoiler]I did a fairly thorough but unfinished attempt to port BWTA2 to ZK with some enhancements. This is what it produces so far:[img]https://media.discordapp.net/attachments/278923144671264768/639166936739217418/unknown.png?width=732&height=732[/img]
24 [/spoiler]
25 \n
23 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. 26 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.
24 \n 27 \n
25 Let’s call the flat segments “areas” and the boundaries, well, boundaries. Additionally, some thick boundary zones can have [i]no[/i] “area” inside of them; let’s call them igloos. 28 Let’s call the flat segments “areas” and the boundaries, well, boundaries. Additionally, some thick boundary zones can have [i]no[/i] “area” inside of them; let’s call them igloos.
26 \n 29 \n
27 Here is a picture from around the time this was discussed in #zkmap that shows the application of this theory to Wanderlust: 30 Here is a picture from around the time this was discussed in #zkmap that shows the application of this theory to Wanderlust:
28 \n 31 \n
29 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/610483277731594271/unknown.png?width=1217&height=732[/img][/spoiler] 32 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/610483277731594271/unknown.png?width=1217&height=732[/img][/spoiler]
30 \n 33 \n
31 [b][u]Learning from boundaries[/u][/b] 34 [b][u]Learning from boundaries[/u][/b]
32 \n 35 \n
33 Once you apply this model to good and bad maps in ZK, some generalities seem to emerge: 36 Once you apply this model to good and bad maps in ZK, some generalities seem to emerge:
34 \n 37 \n
35 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. 38 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.
36 \n 39 \n
37 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). 40 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).
38 \n 41 \n
39 [b][u]Seeing leylines[/u][/b] 42 [b][u]Seeing leylines[/u][/b]
40 \n 43 \n
41 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: 44 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:
42 \n 45 \n
43 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/610422450446008322/23799b46-93cf-11e5-8761-e92bacbf0763.png[/img][/spoiler] 46 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/610422450446008322/23799b46-93cf-11e5-8761-e92bacbf0763.png[/img][/spoiler]
44 \n 47 \n
45 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 [i]economic[/i] value. 48 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 [i]economic[/i] value.
46 \n 49 \n
47 In particular, these objects seem to have salient strategic importance: 50 In particular, these objects seem to have salient strategic importance:
48 \n 51 \n
49 [b]The Direct path[/b] 52 [b]The Direct path[/b]
50 \n 53 \n
51 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 [i]time[/i] strategy. 54 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 [i]time[/i] strategy.
52 \n 55 \n
53 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. 56 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.
54 \n 57 \n
55 [b]The Equidistant line[/b] 58 [b]The Equidistant line[/b]
56 \n 59 \n
57 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. 60 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.
58 \n 61 \n
59 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. 62 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.
60 \n 63 \n
61 [b]The Corners[/b] 64 [b]The Corners[/b]
62 \n 65 \n
63 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. 66 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.
64 \n 67 \n
65 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. 68 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.
66 \n 69 \n
67 [b]Controlling leylines[/b] 70 [b]Controlling leylines[/b]
68 \n 71 \n
69 While every ZK map is going to have an equidistant and direct lines, and 4 corners, these lines can be [i]rotated[/i] by changing the position of starting points. Additionally, they can be [i]warped[/i] by terrain if players pick non-aircraft factories. 72 While every ZK map is going to have an equidistant and direct lines, and 4 corners, these lines can be [i]rotated[/i] by changing the position of starting points. Additionally, they can be [i]warped[/i] by terrain if players pick non-aircraft factories.
70 \n 73 \n
71 Additionally, the inherent strategic value of the lines can be either disrupted or enhanced by the economical value of the space which they cross. 74 Additionally, the inherent strategic value of the lines can be either disrupted or enhanced by the economical value of the space which they cross.
72 \n 75 \n
73 Here is a picture of an attempt to see the leylines on Wanderlust using typical mirrored start positions. 76 Here is a picture of an attempt to see the leylines on Wanderlust using typical mirrored start positions.
74 [spoiler][img]https://images-ext-2.discordapp.net/external/zQ8RUaHEpDnzq0CWdE0H14RcQv_JKeKo8XD0PBEcIoQ/%3Fwidth%3D400%26height%3D256/https/media.discordapp.net/attachments/283160287891423233/555354844588802058/unknown.png[/img] 77 [spoiler][img]https://images-ext-2.discordapp.net/external/zQ8RUaHEpDnzq0CWdE0H14RcQv_JKeKo8XD0PBEcIoQ/%3Fwidth%3D400%26height%3D256/https/media.discordapp.net/attachments/283160287891423233/555354844588802058/unknown.png[/img]
75 The gray line is the terrain-agnostic direct path; the brown is terrain-agnostic equidistant. Red and black, similarily, represent these lines as warped by the terrain for non-spider mobility. 78 The gray line is the terrain-agnostic direct path; the brown is terrain-agnostic equidistant. Red and black, similarily, represent these lines as warped by the terrain for non-spider mobility.
76 Interestingly, wanderlust seems to provide two “direct” lines that clip two of the critical center mexes, and a warped “equidistant” that clips one of them – but no mex is clipped by [i]both[/i] of these lines. 79 Interestingly, wanderlust seems to provide two “direct” lines that clip two of the critical center mexes, and a warped “equidistant” that clips one of them – but no mex is clipped by [i]both[/i] of these lines.
77 [/spoiler] 80 [/spoiler]
78 \n 81 \n
79 [b][u]Learning from leylines[/u][/b] 82 [b][u]Learning from leylines[/u][/b]
80 \n 83 \n
81 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. 84 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.
82 \n 85 \n
83 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. 86 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.
84 \n 87 \n
85 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. 88 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.
86 \n 89 \n
87 [b][u]The Skasi principle[/u][/b] 90 [b][u]The Skasi principle[/u][/b]
88 \n 91 \n
89 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. 92 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.
90 \n 93 \n
91 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. 94 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.
92 \n 95 \n
93 Simple enough; and if you look at it, every good map in ZK follows this principle. 96 Simple enough; and if you look at it, every good map in ZK follows this principle.
94 \n 97 \n
95 [b][u]How Crags Does It[/u][/b] 98 [b][u]How Crags Does It[/u][/b]
96 \n 99 \n
97 Now that we have all this analytical baggage, let’s see how Random Crags (maybe) applies these ideas. 100 Now that we have all this analytical baggage, let’s see how Random Crags (maybe) applies these ideas.
98 \n 101 \n
99 [i][size=1](it probably does more, less, or not exactly this - @GoogleFrog should know more. I’m however mainly talking about the ideas, not implementations, and using Crags as an illustration)[/size][/i] 102 [i][size=1](it probably does more, less, or not exactly this - @GoogleFrog should know more. I’m however mainly talking about the ideas, not implementations, and using Crags as an illustration)[/size][/i]
100 \n 103 \n
101 [b]I: Generate the terrain.[/b] 104 [b]I: Generate the terrain.[/b]
102 \n 105 \n
103 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. 106 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.
104 \n 107 \n
105 1) Generate a symmetric voronoi cell layout. The insides of the cells are Areas. The edges of the cells are Boundaries. Simple enough. 108 1) Generate a symmetric voronoi cell layout. The insides of the cells are Areas. The edges of the cells are Boundaries. Simple enough.
106 \n 109 \n
107 2) Decide on how strong each boundary is while maintaining vehicle accessibility to every cell. 110 2) Decide on how strong each boundary is while maintaining vehicle accessibility to every cell.
108 \n 111 \n
109 3) While at it, designate vertices of the layout whose linked edges are all flat to contain igloos. 112 3) While at it, designate vertices of the layout whose linked edges are all flat to contain igloos.
110 \n 113 \n
111 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: 114 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:
112 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/615778326195339303/unknown.png[/img][/spoiler] 115 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/615778326195339303/unknown.png[/img][/spoiler]
113 \n 116 \n
114 RC also does some smoothing and such to hide the underlying unnaturalness of the voronoi. But that’s not really that relevant. 117 RC also does some smoothing and such to hide the underlying unnaturalness of the voronoi. But that’s not really that relevant.
115 \n 118 \n
116 [b]II: Ley out the mexes.[/b] 119 [b]II: Ley out the mexes.[/b]
117 \n 120 \n
118 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. 121 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.
119 \n 122 \n
120 5) Place an appropriate amount of mexes on the start position cells. 123 5) Place an appropriate amount of mexes on the start position cells.
121 \n 124 \n
122 6) Give each cell the default value [b]v[/b] equal to the (abs) difference between player vehicle graph distances to that cell. This distances themselves look somewhat like this: 125 6) Give each cell the default value [b]v[/b] equal to the (abs) difference between player vehicle graph distances to that cell. This distances themselves look somewhat like this:
123 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/616368418035073044/unknown.png[/img] 126 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/616368418035073044/unknown.png[/img]
124 Note that this results in vehicle-unreachable areas containing no mexes, and significantly reduces the chance of mexes being generated on the Equidistant. 127 Note that this results in vehicle-unreachable areas containing no mexes, and significantly reduces the chance of mexes being generated on the Equidistant.
125 [/spoiler] 128 [/spoiler]
126 \n 129 \n
127 7) Substract 2 from value of cells that are on the Direct line 130 7) Substract 2 from value of cells that are on the Direct line
128 \n 131 \n
129 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. 132 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.
130 \n 133 \n
131 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: 134 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:
132 \n 135 \n
133 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/616375526143295488/unknown.png[/img][/spoiler] 136 [spoiler][img]https://media.discordapp.net/attachments/283160287891423233/616375526143295488/unknown.png[/img][/spoiler]
134 \n 137 \n
135 \n 138 \n