Skip to content

Commit 01a7d29

Browse files
committed
Deploying to gh-pages from @ ba9d9dc πŸš€
1 parent 97503b8 commit 01a7d29

2 files changed

Lines changed: 142 additions & 142 deletions

File tree

Lines changed: 141 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,4 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/modules/procedural_mapping/README.txt - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a></header><main><h1>code/modules/procedural_mapping/README.txt <a href="https://github.com/MrMelbert/MapleStationCode/blob/ba9d9dc68e323b6cce774e4ed8505dd533ebf14a/code/modules/procedural_mapping/README.txt"><img src="git.png" width="16" height="16" title="code/modules/procedural_mapping/README.txt"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><pre><code>by RemieRichards
2-
3-
//////////////////////////////
4-
// CODER INFORMATIVE README //
5-
//////////////////////////////
6-
(See below for Mapper Friendly Readme)
7-
8-
mapGenerator:
9-
Desc: a mapGenerator is a master datum that collects
10-
and syncs all mapGeneratorModules in it's modules list
11-
12-
defineRegion(var/turf/Start, turf/End, replace = 0)
13-
Example: defineRegion(locate(1,1,1),locate(5,5,5),0)
14-
Desc: Sets the bounds of the mapGenerator's &quot;map&quot;
15-
16-
defineCircularRegion(var/turf/Start, turf/End, replace = 0)
17-
Example: defineCircularRegion(locate(1,1,1),locate(5,5,5),0)
18-
Desc: Sets the mapGenerator's &quot;map&quot; as a circle, with center in the middle of Start and End's X,Y,Z coordinates
19-
20-
undefineRegion()
21-
Example: undefineRegion()
22-
Desc: Empties the map generator list
23-
24-
checkRegion(var/turf/Start, turf/End)
25-
Example: checkRegion(locate(1,1,1), locate(5,5,5))
26-
Desc: Checks if a rectangle between Start's coords and End's coords is valid
27-
Existing Calls: mapGenerator/defineRegion(), mapGenerator/defineCircularRegion()
28-
29-
generate()
30-
Example: generate()
31-
Desc: Orders all mapGeneratorModules in the modules list to generate()
32-
33-
generateOneTurf(var/turf/T)
34-
Example: generateOneTurf(locate(1,1,1))
35-
Desc: Orders all mapGeneratorModules in the modules list to place(T) on this turf
36-
37-
initialiseModules()
38-
Example: initialiseModules()
39-
Desc: Replaces all typepaths in the modules list with actual /datum/map_generator/Module types
40-
Existing Calls: mapGenerator/New()
41-
42-
syncModules()
43-
Example: syncModules()
44-
Desc: Sets the Mother variable on all mapGeneratorModules in the modules list to this mapGenerator
45-
Existing Calls: initialiseModules(),generate(),generateOneTurf()
46-
47-
48-
mapGeneratorModule
49-
Desc: a mapGeneratorModule has spawnableAtoms and spawnableTurfs lists
50-
which it will generate on turfs in it's mother's map based on cluster variables
51-
52-
sync(var/datum/map_generator/mum)
53-
Example: sync(a_mapGenerator_as_a_variable)
54-
Desc: Sets the Mother variable to the mum argument
55-
Existing Calls: mapGenerator/syncModules()
56-
57-
generate()
58-
Example: generate()
59-
Desc: Calls place(T) on all turfs in it's mother's map
60-
Existing Calls: mapGenerator/generate()
61-
62-
place(var/turf/T)
63-
Example: place(locate(1,1,1))
64-
Desc: Run this mapGeneratorModule's effects on this turf (Spawning atoms, Changing turfs)
65-
Existing Calls: mapGenerator/generate(), mapGenerator/generateOneTurf()
66-
67-
checkPlaceAtom(var/turf/T)
68-
Example: checkPlace(locate(1,1,1))
69-
Desc: Checks if the turf is valid for placing atoms
70-
Existing Calls: place()
71-
72-
73-
////////////////////////////
74-
// MAPPER FRIENDLY README //
75-
////////////////////////////
76-
77-
Simple Workflow:
78-
79-
1. Define a/some mapGeneratorModule(s) to your liking, choosing atoms and turfs to spawn
80-
#Note: I chose to split Turfs and Atoms off into separate modules, but this is NOT required.
81-
#Note: A mapGeneratorModule may have turfs AND atoms, so long as each is in it's appropriate list
82-
83-
2. Define a mapGenerator type who's modules list contains the typepath(s) of all the module(s) you wish to use
84-
#Note: The order of the typepaths in the modules list is the order they will happen in, this is important for clusterCheckFlags.
85-
86-
3. Take notes of the Bottom Left and Top Right turfs of your rectangular &quot;map&quot;'s coordinates
87-
#Note: X,Y AND Z, Yes you can created 3D &quot;maps&quot; by having differing Z coords
88-
89-
4. Create the mapGenerator type you created
90-
91-
5. Call yourMapGeneratorType.defineRegion(locate(X,Y,Z), locate(X,Y,Z))
92-
#Note: The above X/Y/Zs are the coordinates of the start and end turfs, the locate() simply finds the turf for the code
93-
94-
6. Call yourMapGeneratorType.generate(), this will cause all the modules in the generator to build within the map bounds
95-
96-
Option Suggestions:
97-
98-
* Have separate modules for Turfs and Atoms, this is not enforced, but it is how I have structured my nature example.
99-
* If your map doesn't look quite to your liking, simply jiggle with the variables on your modules and the type probabilities
100-
* You can mix and map premade areas with the procedural generation, for example mapping an entire flat land but having code generate just the grass tufts
101-
102-
103-
Using the Modules list
104-
105-
Simply think of it like each module is a layer in a graphics editing program!
106-
To help you do this templates such as /mapGeneratorModule/bottomLayer have been provided with appropriate default settings.
107-
These are located near the bottom of mapGeneratorModule.dm
108-
you would order your list left to right, top to bottom, e.g:
109-
modules = list(bottomLayer,nextLayer,nextNextLayer) etc.
110-
111-
112-
Variable Breakdown (For Mappers):
113-
114-
mapGenerator
115-
map - INTERNAL, do not touch
116-
modules - A list of typepaths of mapGeneratorModules
117-
118-
mapGeneratorModule
119-
mother - INTERNAL, do not touch
120-
spawnableAtoms - A list of typepaths and their probability to spawn, eg: spawnableAtoms = list(/obj/structure/flora/tree/pine = 30)
121-
spawnableTurfs - A list of typepaths and their probability to spawn, eg: spawnableTurfs = list(/turf/unsimulated/floor/grass = 100)
122-
clusterMax - The max range to check for something being &quot;too close&quot; for this atom/turf to spawn, the true value is random between clusterMin and clusterMax
123-
clusterMin - The min range to check for something being &quot;too close&quot; for this atom/turf to spawn, the true value is random between clusterMin and clusterMax
124-
clusterCheckFlags - A Bitfield that controls how the cluster checks work, All based on clusterMin and clusterMax guides
125-
allowAtomsOnSpace - A Boolean for if we allow atoms to spawn on space tiles
126-
127-
clusterCheckFlags flags:
128-
CLUSTER_CHECK_NONE 0 //No checks are done, cluster as much as possible
129-
CLUSTER_CHECK_DIFFERENT_TURFS 2 //Don't let turfs of DIFFERENT types cluster
130-
CLUSTER_CHECK_DIFFERENT_ATOMS 4 //Don't let atoms of DIFFERENT types cluster
131-
CLUSTER_CHECK_SAME_TURFS 8 //Don't let turfs of the SAME type cluster
132-
CLUSTER_CHECK_SAME_ATOMS 16 //Don't let atoms of the SAME type cluster
133-
134-
CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster
135-
CLUSTER_CHECK_DIFFERENTS 6 //Don't let any different types cluster
136-
CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types
137-
CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types
138-
139-
CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all
140-
</code></pre>
141-
<h1 id="procedural-mapping">Procedural Mapping</h1><h3 id="with-regards-to-remierichards"><em>With Regards To RemieRichards</em></h3>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/modules/procedural_mapping/README.md - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a></header><main><h1>Procedural Mapping <aside>code/modules/procedural_mapping/README.md</aside> <a href="https://github.com/MrMelbert/MapleStationCode/blob/ba9d9dc68e323b6cce774e4ed8505dd533ebf14a/code/modules/procedural_mapping/README.md"><img src="git.png" width="16" height="16" title="code/modules/procedural_mapping/README.md"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h3 id="with-regards-to-remierichards"><em>With Regards To RemieRichards</em></h3>
1422
<hr />
1433
<h2 id="coder-informative-readme">Coder Informative Readme</h2><h3 id="mapgenerator">mapGenerator:</h3>
1444
<p>Desc: a <em>mapGenerator</em> is a master datum that collects and syncs all <em>mapGeneratorModules</em> in its modules list.</p>
@@ -277,4 +137,144 @@ <h3 id="clustercheckflags-flags">clusterCheckFlags flags:</h3>
277137
CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types
278138

279139
CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all
140+
</code></pre>
141+
<pre><code>by RemieRichards
142+
143+
//////////////////////////////
144+
// CODER INFORMATIVE README //
145+
//////////////////////////////
146+
(See below for Mapper Friendly Readme)
147+
148+
mapGenerator:
149+
Desc: a mapGenerator is a master datum that collects
150+
and syncs all mapGeneratorModules in it's modules list
151+
152+
defineRegion(var/turf/Start, turf/End, replace = 0)
153+
Example: defineRegion(locate(1,1,1),locate(5,5,5),0)
154+
Desc: Sets the bounds of the mapGenerator's &quot;map&quot;
155+
156+
defineCircularRegion(var/turf/Start, turf/End, replace = 0)
157+
Example: defineCircularRegion(locate(1,1,1),locate(5,5,5),0)
158+
Desc: Sets the mapGenerator's &quot;map&quot; as a circle, with center in the middle of Start and End's X,Y,Z coordinates
159+
160+
undefineRegion()
161+
Example: undefineRegion()
162+
Desc: Empties the map generator list
163+
164+
checkRegion(var/turf/Start, turf/End)
165+
Example: checkRegion(locate(1,1,1), locate(5,5,5))
166+
Desc: Checks if a rectangle between Start's coords and End's coords is valid
167+
Existing Calls: mapGenerator/defineRegion(), mapGenerator/defineCircularRegion()
168+
169+
generate()
170+
Example: generate()
171+
Desc: Orders all mapGeneratorModules in the modules list to generate()
172+
173+
generateOneTurf(var/turf/T)
174+
Example: generateOneTurf(locate(1,1,1))
175+
Desc: Orders all mapGeneratorModules in the modules list to place(T) on this turf
176+
177+
initialiseModules()
178+
Example: initialiseModules()
179+
Desc: Replaces all typepaths in the modules list with actual /datum/map_generator/Module types
180+
Existing Calls: mapGenerator/New()
181+
182+
syncModules()
183+
Example: syncModules()
184+
Desc: Sets the Mother variable on all mapGeneratorModules in the modules list to this mapGenerator
185+
Existing Calls: initialiseModules(),generate(),generateOneTurf()
186+
187+
188+
mapGeneratorModule
189+
Desc: a mapGeneratorModule has spawnableAtoms and spawnableTurfs lists
190+
which it will generate on turfs in it's mother's map based on cluster variables
191+
192+
sync(var/datum/map_generator/mum)
193+
Example: sync(a_mapGenerator_as_a_variable)
194+
Desc: Sets the Mother variable to the mum argument
195+
Existing Calls: mapGenerator/syncModules()
196+
197+
generate()
198+
Example: generate()
199+
Desc: Calls place(T) on all turfs in it's mother's map
200+
Existing Calls: mapGenerator/generate()
201+
202+
place(var/turf/T)
203+
Example: place(locate(1,1,1))
204+
Desc: Run this mapGeneratorModule's effects on this turf (Spawning atoms, Changing turfs)
205+
Existing Calls: mapGenerator/generate(), mapGenerator/generateOneTurf()
206+
207+
checkPlaceAtom(var/turf/T)
208+
Example: checkPlace(locate(1,1,1))
209+
Desc: Checks if the turf is valid for placing atoms
210+
Existing Calls: place()
211+
212+
213+
////////////////////////////
214+
// MAPPER FRIENDLY README //
215+
////////////////////////////
216+
217+
Simple Workflow:
218+
219+
1. Define a/some mapGeneratorModule(s) to your liking, choosing atoms and turfs to spawn
220+
#Note: I chose to split Turfs and Atoms off into separate modules, but this is NOT required.
221+
#Note: A mapGeneratorModule may have turfs AND atoms, so long as each is in it's appropriate list
222+
223+
2. Define a mapGenerator type who's modules list contains the typepath(s) of all the module(s) you wish to use
224+
#Note: The order of the typepaths in the modules list is the order they will happen in, this is important for clusterCheckFlags.
225+
226+
3. Take notes of the Bottom Left and Top Right turfs of your rectangular &quot;map&quot;'s coordinates
227+
#Note: X,Y AND Z, Yes you can created 3D &quot;maps&quot; by having differing Z coords
228+
229+
4. Create the mapGenerator type you created
230+
231+
5. Call yourMapGeneratorType.defineRegion(locate(X,Y,Z), locate(X,Y,Z))
232+
#Note: The above X/Y/Zs are the coordinates of the start and end turfs, the locate() simply finds the turf for the code
233+
234+
6. Call yourMapGeneratorType.generate(), this will cause all the modules in the generator to build within the map bounds
235+
236+
Option Suggestions:
237+
238+
* Have separate modules for Turfs and Atoms, this is not enforced, but it is how I have structured my nature example.
239+
* If your map doesn't look quite to your liking, simply jiggle with the variables on your modules and the type probabilities
240+
* You can mix and map premade areas with the procedural generation, for example mapping an entire flat land but having code generate just the grass tufts
241+
242+
243+
Using the Modules list
244+
245+
Simply think of it like each module is a layer in a graphics editing program!
246+
To help you do this templates such as /mapGeneratorModule/bottomLayer have been provided with appropriate default settings.
247+
These are located near the bottom of mapGeneratorModule.dm
248+
you would order your list left to right, top to bottom, e.g:
249+
modules = list(bottomLayer,nextLayer,nextNextLayer) etc.
250+
251+
252+
Variable Breakdown (For Mappers):
253+
254+
mapGenerator
255+
map - INTERNAL, do not touch
256+
modules - A list of typepaths of mapGeneratorModules
257+
258+
mapGeneratorModule
259+
mother - INTERNAL, do not touch
260+
spawnableAtoms - A list of typepaths and their probability to spawn, eg: spawnableAtoms = list(/obj/structure/flora/tree/pine = 30)
261+
spawnableTurfs - A list of typepaths and their probability to spawn, eg: spawnableTurfs = list(/turf/unsimulated/floor/grass = 100)
262+
clusterMax - The max range to check for something being &quot;too close&quot; for this atom/turf to spawn, the true value is random between clusterMin and clusterMax
263+
clusterMin - The min range to check for something being &quot;too close&quot; for this atom/turf to spawn, the true value is random between clusterMin and clusterMax
264+
clusterCheckFlags - A Bitfield that controls how the cluster checks work, All based on clusterMin and clusterMax guides
265+
allowAtomsOnSpace - A Boolean for if we allow atoms to spawn on space tiles
266+
267+
clusterCheckFlags flags:
268+
CLUSTER_CHECK_NONE 0 //No checks are done, cluster as much as possible
269+
CLUSTER_CHECK_DIFFERENT_TURFS 2 //Don't let turfs of DIFFERENT types cluster
270+
CLUSTER_CHECK_DIFFERENT_ATOMS 4 //Don't let atoms of DIFFERENT types cluster
271+
CLUSTER_CHECK_SAME_TURFS 8 //Don't let turfs of the SAME type cluster
272+
CLUSTER_CHECK_SAME_ATOMS 16 //Don't let atoms of the SAME type cluster
273+
274+
CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster
275+
CLUSTER_CHECK_DIFFERENTS 6 //Don't let any different types cluster
276+
CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types
277+
CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types
278+
279+
CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all
280280
</code></pre></td></tr></table></main><footer>maplestation.dme <a href="https://github.com/MrMelbert/MapleStationCode/tree/ba9d9dc68e323b6cce774e4ed8505dd533ebf14a">ba9d9dc</a> (master) β€” <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>

β€Žindex.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
Β (0)