tutorial:1.15:jigsaw
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tutorial:jigsaw [2020/08/06 23:26] – Added repo link for 1.16 emmanuelmess | tutorial:1.15:jigsaw [2020/08/15 12:46] – [Jigsaws] emmanuelmess | ||
---|---|---|---|
Line 2: | Line 2: | ||
Jigsaws are good for advanced structures such as dungeons & villages, and allow you to spend more time on actually building content vs. messing with procedural generation code. | Jigsaws are good for advanced structures such as dungeons & villages, and allow you to spend more time on actually building content vs. messing with procedural generation code. | ||
- | A repository with finished code can be found [[https:// | + | A repository with finished code can be found [[https:// |
+ | |||
+ | ===== Creating a StructureFeature ===== | ||
- | ==== Creating a StructureFeature ==== | ||
A '' | A '' | ||
Line 117: | Line 118: | ||
* turns into | * turns into | ||
- | {{https:// | + | {{ https:// |
When thinking about this as a puzzle, the target pool is the group of puzzle pieces you can search through. If you have a total of 10 pieces, one target pool may have 7 of the total pieces. This field is how a jigsaw specifies, "Hi, I'd like a piece from group B to connect to me!" In the case of a village, this may be a road saying, "Give me a house!" | When thinking about this as a puzzle, the target pool is the group of puzzle pieces you can search through. If you have a total of 10 pieces, one target pool may have 7 of the total pieces. This field is how a jigsaw specifies, "Hi, I'd like a piece from group B to connect to me!" In the case of a village, this may be a road saying, "Give me a house!" | ||
Line 127: | Line 128: | ||
Here's an example implementation: | Here's an example implementation: | ||
- | {{https:// | + | {{ https:// |
Our finalized structure will consist of multiple colored squares connecting to each other. It will have a white or a black square in the center, and orange, magenta, light blue, and lime squares branching off on the sides randomly. Here is the setup of our 2 initial squares: | Our finalized structure will consist of multiple colored squares connecting to each other. It will have a white or a black square in the center, and orange, magenta, light blue, and lime squares branching off on the sides randomly. Here is the setup of our 2 initial squares: | ||
- | {{https:// | + | |
+ | {{ https:// | ||
This jigsaw will ask for any other jigsaw that: | This jigsaw will ask for any other jigsaw that: | ||
Line 138: | Line 140: | ||
For demo purposes, we've made 2 starting platforms: one is white, and one is black. The only difference is what they turn into. We'll save these as structure files using structure blocks: | For demo purposes, we've made 2 starting platforms: one is white, and one is black. The only difference is what they turn into. We'll save these as structure files using structure blocks: | ||
- | {{https:// | + | |
+ | {{ https:// | ||
For our randomized edge platforms, we've made 4 extra squares of different colors. Again, despite being used for a different purpose, the jigsaw construction is //the same// aside from the "turns into" field. | For our randomized edge platforms, we've made 4 extra squares of different colors. Again, despite being used for a different purpose, the jigsaw construction is //the same// aside from the "turns into" field. | ||
- | {{https:// | + | |
+ | {{ https:// | ||
We now have 6 saved '' | We now have 6 saved '' | ||
- | {{https:// | + | |
+ | {{ https:// | ||
For usage, we'll move these to '' | For usage, we'll move these to '' | ||
- | {{https:// | + | |
+ | {{ https:// | ||
The setup is complete! We now have 6 total squares. Let's briefly recap the goal: | The setup is complete! We now have 6 total squares. Let's briefly recap the goal: | ||
Line 263: | Line 269: | ||
=== Finished! === | === Finished! === | ||
As you can see, we have a single white square in the center, with boxes going off the edges. Note that the radius in this screenshot was increased to 14 instead of the 7 used in the tutorial. | As you can see, we have a single white square in the center, with boxes going off the edges. Note that the radius in this screenshot was increased to 14 instead of the 7 used in the tutorial. | ||
- | {{https:// | + | |
+ | {{ https:// | ||
=== Jigsaw Tips === | === Jigsaw Tips === | ||
Ideally, you do not want structure pieces to be bigger than 32x32x32, so breaking them into chunk-sized pieces is the best option. | Ideally, you do not want structure pieces to be bigger than 32x32x32, so breaking them into chunk-sized pieces is the best option. | ||
You cannot generate other structure pieces of the same pool through jigsaws. So, if you have a piece in pool A and you try to generate another piece, you will have to have another pool. | You cannot generate other structure pieces of the same pool through jigsaws. So, if you have a piece in pool A and you try to generate another piece, you will have to have another pool. |
tutorial/1.15/jigsaw.txt · Last modified: 2021/12/28 19:44 by banana