Skip to content

Commit b3ac9fc

Browse files
feat: update worldgen graphs documentation
1 parent 35ed748 commit b3ac9fc

20 files changed

Lines changed: 172 additions & 38 deletions

content/docs/en/official-documentation/worldgen/worldgen-tutorial/graphs-system.mdx

Lines changed: 172 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ A parallel to using Graphs would be the Position Cell Noise Density (PCN), so I
3434

3535
This is my [BiomeSpheres Example](#biome-spheres) with a “Biome” per Node with random Edges connecting them! The density, materials, and props were all done through the graph system!
3636

37+
Hytale has also included a few [Examples to try out!](#hytale-examples)
38+
3739
</div>
3840
</div>
3941

@@ -233,17 +235,11 @@ While defining specific Content per Nodes is cool, we’re here to create some w
233235

234236
![Edges Example](/assets/official-documentation/worldgen/graphs/edges-example.webp)
235237

236-
<Callout type="warning">
237-
This tech is still new and creating Content for too many Edges or not using a
238-
YOverride can create a huge performance loss, so use sparingly for now or else
239-
your World will timeout and crash!
240-
</Callout>
241-
242238
There are 2 ways to define Content along Edges:
243239

244240
#### **Splitter EdgeAction**
245241

246-
The first way is to use the **Splitter EdgeAction**. This will create Nodes along the selected Edges that you can then define Content for.
242+
The first way is to use the **Splitter EdgeAction**. This will create Nodes along the selected Edges that you can then define Content for. In between each Node, a new Edge is also created.
247243

248244
![Splitter EdgeAction](/assets/official-documentation/worldgen/graphs/pass-content-splitter.webp)
249245

@@ -261,9 +257,21 @@ The second method utilizes the new **DistanceToGraphEdge Density**. This density
261257

262258
What’s really cool about a lot of these Actions, is you can select which nodes or edges to perform these actions on based on a whole set of **Selector** operations.
263259

260+
#### **All Selector**
261+
262+
Selects All Nodes/Edges. Useful for the ProximityConnector if you want to connect all your nodes together!
263+
264+
![Selector All](/assets/official-documentation/worldgen/graphs/selector-all.webp)
265+
266+
#### **Random Selector**
267+
268+
Selects a random subset of Nodes/Edges based on the Seed and Chance.
269+
270+
![Selector Random](/assets/official-documentation/worldgen/graphs/selector-random.webp)
271+
264272
#### **Node: ConnectionCount**
265273

266-
Selects Nodes with a certain amount of Edges, like in this example, above 1 Edge.
274+
Selects Nodes with a certain amount of Edges, like in this example, more than 1 Edge.
267275

268276
![Selector ConnectionCount](/assets/official-documentation/worldgen/graphs/selector-connectioncount.webp)
269277

@@ -293,99 +301,225 @@ In this example, I’ve combined 2 Selectors! Any Edges that are more than 50 bl
293301

294302
![Selector Neighbors](/assets/official-documentation/worldgen/graphs/selector-neighbors.webp)
295303

296-
The “SelectedNeightborsThreshold” is how many nodes/edges are needed to pass this condition. If set to “-1”, all Neighbors must satisfy their **Selector** Conditions. These Neighbor Checks are very useful for creating transitionary Nodes and Edges based on what the Content is of neighboring/connected Nodes like removing Ice Caves connected to Lava Caves or creating Lush tunnel transitions towards Lush Cave Biomes.
304+
The “SelectedNeighborsThreshold” is how many nodes/edges are needed to pass this condition. If set to “-1”, all Neighbors must satisfy their **Selector** Conditions. These Neighbor Checks are very useful for creating transitionary Nodes and Edges based on what the Content is of neighboring/connected Nodes like removing Ice Caves connected to Lava Caves or creating Lush tunnel transitions towards Lush Cave Biomes.
305+
306+
#### **And / Or / Not Selectors**
307+
308+
Finally the logic isn't complete without these Selectors! Use them in combination to be as specific in your selections as you need!
309+
310+
![Selector Logic](/assets/official-documentation/worldgen/graphs/selector-logic.webp)
297311

298312
### Node/Edge Actions
299313

300-
Actions aren't limited to creating new Edges, defining Content, and Splitting Edges. Here's a list of some other useful Actions! (Not all Actions are listed like Move or Jitter as they seemed self-explanatory.)
314+
Actions aren't limited to creating new Edges, defining Content, and Splitting Edges. Here's a list of some other useful Actions!
301315

302316
#### **Node: Spawner**
303317

304-
This Action creates Content from new Nodes within a cluster around the central Node. This can be similarly attributed to the Cluster PositionProvider. You can also select to “CreateEdges” connecting these clustered Nodes.
318+
This Action creates new Nodes within an area around the central Node. This can be similarly attributed to the Cluster PositionProvider. You can also set the new Nodes' Content or set “CreateEdges” to connect these new Nodes to the Central Node.
305319

306320
![Action Spawner](/assets/official-documentation/worldgen/graphs/action-spawner.webp)
307321

308322
#### **Node: Connected Nodes/Edges**
309323

310-
This Action will select ConnectedNodes to perform their own actions. (I’m not too sure what the Ratio value does in this situation.)
324+
This Action will select Nodes connected by an Edge or Edges connected to this Node to perform their own actions. The Ratio value determines the amount of Connected Nodes or Edges to perform the Action on. The Seed will randomize which ones are selected if the Ratio is set between 0 and 1.
311325

312326
![Action Connected](/assets/official-documentation/worldgen/graphs/action-connected.webp)
313327

328+
#### **Node: ContentCopy**
329+
330+
Content Copy will spread the Content listed to Nodes connected by an Edge. If there's a tie of, for example, "IceCave" and "LavaCave" both connecting to the same Node, the seed will randomize which one wins.
331+
332+
![Action ContentCopy](/assets/official-documentation/worldgen/graphs/action-contentcopy.webp)
333+
334+
Based on all the Nodes so far, there's 3 ways to "spread" out content based on connected Edges.
335+
314336
<table>
315337
<tbody>
316338
<tr>
339+
<td>NeighborNodes NodeSelector</td>
317340
<td>
318-
This is an example of expanding an IcyCave Content to its Connected
319-
Nodes!
341+
![Connected
342+
Example](/assets/official-documentation/worldgen/graphs/action-connected-example-alt.webp)
320343
</td>
321344
</tr>
322345
<tr>
346+
<td>ConnectedNodes NodeAction</td>
323347
<td>
324-
![Connected
348+
![Connected Alt
325349
Example](/assets/official-documentation/worldgen/graphs/action-connected-example.webp)
326350
</td>
327351
</tr>
352+
<tr>
353+
<td>ContentCopy NodeAction</td>
354+
<td>
355+
![Connected Alt 2
356+
Example](/assets/official-documentation/worldgen/graphs/action-contentcopy.webp)
357+
</td>
358+
</tr>
328359
</tbody>
329360
</table>
330361

362+
#### **Edge: Proxy**
363+
364+
Edge Proxy is a good way to create offset Nodes from pre-existing Nodes to for example create bridges across islands.
365+
366+
![Action Proxy](/assets/official-documentation/worldgen/graphs/action-proxy.webp)
367+
331368
<table>
332369
<tbody>
333370
<tr>
334371
<td>
335-
Based on the Previous NodeSelectors section, this setup would work as
336-
well!
372+
Before ![Action Proxy
373+
Before](/assets/official-documentation/worldgen/graphs/action-proxy-example-before.webp)
374+
</td>
375+
<td>
376+
After ![Action Proxy
377+
After](/assets/official-documentation/worldgen/graphs/action-proxy-example-after.webp)
337378
</td>
338379
</tr>
339380
<tr>
381+
<td>Image credit to Ams of Hypixel Studios</td>
382+
</tr>
383+
</tbody>
384+
</table>
385+
386+
#### **Other Actions**
387+
388+
Quick fire round as these are mostly self explanatory especially if you've been messing around with other WorldGen features!
389+
390+
<table>
391+
<tbody>
392+
<tr>
393+
<td>**Move NodeAction**</td>
394+
<td>Moves selected Nodes based on a Vector Provider</td>
395+
</tr>
396+
<tr>
397+
<td>**Jitter2D/3D NodeAction**</td>
340398
<td>
341-
![Connected Alt
342-
Example](/assets/official-documentation/worldgen/graphs/action-connected-example-alt.webp)
399+
Jitters the Position of selected Nodes same as the Jitter Position
400+
Provider
401+
</td>
402+
</tr>
403+
<tr>
404+
<td>**Weighted NodeAction**</td>
405+
<td>Selects a random Action to exectute per Node based on the Seed</td>
406+
</tr>
407+
<tr>
408+
<td>**Empty Node/EdgeAction**</td>
409+
<td>
410+
A placeholder to do nothing. Most often used with a Weighted NodeAction
411+
</td>
412+
</tr>
413+
<tr>
414+
<td>**Delete Node/EdgeAction**</td>
415+
<td>Removes the Node/Edge from the Graph</td>
416+
</tr>
417+
</tbody>
418+
</table>
419+
420+
### New Position & Vector Providers
421+
422+
This section includes a look at some of the new Position and Vector Providers also included in this pre-release that may be useful in your Graph creating Journey!
423+
424+
The list is far too long to include here, but I've included an example of using them to set the Y-Value of Positions. This is useful for setting either the Position of Nodes on Graphs or the Positions of Props to the top of your World (without needing a Scanner Prop which is useful for optimization!)
425+
426+
![New Providers Example](/assets/official-documentation/worldgen/graphs/newproviders-example.webp)
427+
428+
We also have the new **OpposedToGraphEdges** VectorProvider! This Provider gives you the Vector that is furthest from all the Connected Edges' Vectors,
429+
so for this example of a triangular pyramid, each Node will be pushed further outwards, away from the other Nodes.
430+
431+
![OpposedToGraphEdges VectorProvider](/assets/official-documentation/worldgen/graphs/newproviders-graphedges.webp)
432+
433+
<table>
434+
<tbody>
435+
<tr>
436+
<td>
437+
Before ![VectorProvider
438+
Before](/assets/official-documentation/worldgen/graphs/newproviders-graphedges-example1-before.webp)
439+
</td>
440+
<td>
441+
After ![VectorProvider
442+
After](/assets/official-documentation/worldgen/graphs/newproviders-graphedges-example1-after.webp)
343443
</td>
344444
</tr>
345445
</tbody>
346446
</table>
347447

348-
#### **Node: ContentCopy**
448+
However, on the edge case that the Node is connected on a straight line where the Opposed Vector could be one of many varieties, the results are inconsistent depending on orientation.
449+
450+
<table>
451+
<tbody>
452+
<tr>
453+
<td>
454+
Before ![VectorProvider EdgeCase
455+
Before](/assets/official-documentation/worldgen/graphs/newproviders-graphedges-example2-before.webp)
456+
</td>
457+
<td>
458+
After ![VectorProvider EdgeCase
459+
After](/assets/official-documentation/worldgen/graphs/newproviders-graphedges-example2-after.webp)
460+
</td>
461+
</tr>
462+
</tbody>
463+
</table>
349464

350-
(Not tested yet, will update with info later)
465+
## Hytale Examples
351466

352-
![Action ContentCopy](/assets/official-documentation/worldgen/graphs/action-contentcopy.webp)
467+
### River Drainage
353468

354-
#### **Edge: Proxy**
469+
This Graph includes an example of an iterative Selection approach to create river branches that branch out from a coast line!
355470

356-
(Not tested yet, will update with info later)
471+
You can find this Example as `HytaleGenerator/BiomeAsset/Examples/Example_Graph_River`
357472

358-
![Action Proxy](/assets/official-documentation/worldgen/graphs/action-proxy.webp)
473+
![Rivers Showcase](/assets/official-documentation/worldgen/graphs/examples/river-1.webp)
474+
![Rivers Nodes](/assets/official-documentation/worldgen/graphs/examples/river-2.webp)
359475

360-
### New Position & Vector Providers
476+
### City Roads
361477

362-
This section includes a look at some of the new Position and Vector Providers also included in this pre-release that may be useful in your Graph creating Journey!
478+
This Graph continues off of the previous example by adding Buildings that spawn next to roads near city centers and making sure Road connections don't enter the areas indicated by Bedrock!
363479

364-
The list is far too long to include here, but I've included an example of using them to set the Y-Position of Positions (or Nodes for Graphs) to the top of the World without for example for Props requiring a Scanner!
480+
You can find this Example as `HytaleGenerator/BiomeAsset/Examples/Example_Graph_Road_Layout`
365481

366-
![New Providers Example](/assets/official-documentation/worldgen/graphs/newproviders-example.webp)
482+
![Roads Showcase](/assets/official-documentation/worldgen/graphs/examples/roads-1.webp)
367483

368-
We also have the new **OpposedToGraphEdges** VectorProvider which is also on my list of Nodes I have yet to test so new info will be included here soon!
484+
### Mountain Erosion
369485

370-
![OpposedToGraphEdges VectorProvider](/assets/official-documentation/worldgen/graphs/newproviders-graphedges.webp)
486+
This Graph utilizes the Density Gradient of the Terrain to only include certain Edges that run alongside the mountain slope and then uses Move Actions with a Simplex noise pattern to create a wavy pattern as the Edges head downwards.
487+
488+
You can find this Example as `HytaleGenerator/BiomeAsset/Examples/Example_Graph_Erosion`
489+
490+
![Erosion Showcase](/assets/official-documentation/worldgen/graphs/examples/erosion-1.webp)
491+
![Erosion Nodes1](/assets/official-documentation/worldgen/graphs/examples/erosion-2.webp)
492+
![Erosion Nodes2](/assets/official-documentation/worldgen/graphs/examples/erosion-3.webp)
493+
494+
### Roots
495+
496+
This Graph uses a technique of starting off only creating 1 Node then creating new Nodes by iteratively using the Spawner Action from previous Nodes. It also halfway through switches the Density defined in the Content to be smaller.
371497

372-
## Examples
498+
You can find this Example as `HytaleGenerator/BiomeAsset/Examples/Example_Graph_Roots`
499+
500+
![Roots Showcase](/assets/official-documentation/worldgen/graphs/examples/roots-1.webp)
501+
![Roots Nodes1](/assets/official-documentation/worldgen/graphs/examples/roots-2.webp)
502+
![Roots Nodes2](/assets/official-documentation/worldgen/graphs/examples/roots-3.webp)
503+
504+
## Community Examples
373505

374506
### Biome Spheres
375507

376-
This is a showcase example of creating a “Biome” per Node with random Edges connecting them! The density, materials, and props were all done through the graph system! [Link to GitHub Repository.](https://github.com/RedstoneEngine/Hytale-WorldGen/blob/main/Examples/Graphs/BiomeSpheres.json) (Warning for testing this example in that the Edges create a huge hit on performance and may timeout the World!)
508+
This is a showcase example of creating a “Biome” per Node with random Edges connecting them! The density, materials, and props were all done through the graph system!
509+
510+
[Link to GitHub Repository](https://github.com/RedstoneEngine/Hytale-WorldGen/blob/main/Examples/Graphs/BiomeSpheres.json) `- Credit to RedEng Developer`
377511

378512
![Biome Spheres Showcase](/assets/official-documentation/worldgen/graphs/examples/biomespheres-1.webp)
379513
![Biome Spheres Nodes](/assets/official-documentation/worldgen/graphs/examples/biomespheres-2.webp)
380514

381-
### River Drainage
515+
### Dungeon
382516

383-
**This Example is brought to us by Ams of Hypixel Studios.**
517+
This is a Graphs setup for generating a dynamic Dungeon! This Graph contains multiple techniques to get the Dungeon to generate its paths and props, too much to list here right now, but feel free to replace with your own prefabs or define your own pathing GraphPasses!
384518

385-
It includes an example of an iterative Selection approach to create river branches that branch out from a coast line! Feel free to download and experiment! This example will be included in a future pre-release. [Link to GitHub Repository.](https://github.com/RedstoneEngine/Hytale-WorldGen/blob/main/Examples/Graphs/Example_Graph_River.json)
519+
[Link to GitHub Repository](https://github.com/RedstoneEngine/Hytale-WorldGen/tree/main/Examples/Graphs/DungeonGenerator) `- Credit to RedEng Developer`
386520

387-
![Rivers Showcase](/assets/official-documentation/worldgen/graphs/examples/river-1.webp)
388-
![Rivers Nodes](/assets/official-documentation/worldgen/graphs/examples/river-2.webp)
521+
![BigRoom Dungeon Showcase](/assets/official-documentation/worldgen/graphs/examples/dungeon-bigrooms-1.webp)
522+
![BigRoom Dungeon Rooms Showcase](/assets/official-documentation/worldgen/graphs/examples/dungeon-bigrooms-2.webp)
389523

390524
---
391525

21 KB
Loading
29.6 KB
Loading
109 KB
Loading
86.7 KB
Loading
429 KB
Loading
82.6 KB
Loading
41.1 KB
Loading
2.48 MB
Loading
69.7 KB
Loading

0 commit comments

Comments
 (0)