Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Infrastructure "Add support for chunks in mutable overmap specials"
Purpose of change
Sometimes when designing a mutable overmap special it's difficult to deal with the fact that certain OMTs might be placed without space for others that ought to go with them.
Describe the solution
To work around this, allow a placement rule to place multiple OMTs together in a chunk. This ensures that there is sufficient space for all of them and their joins, or none will be placed at all. This makes the placement an all-or-nothing scenario, and we don't end up with unresolved joins due to half-placed pieces of the special.
I reverted #52007 (i.e. reinstated the placement errors) since those issues should now be solvable.
Solve the overmap placement issues with the mutable microlab. In the process of doing so I introduced some issues with the tile-level mapgen which I don't fell qualified to solve. @John-Candlebury perhaps you can fix those in a follw-up PR. In particular:
microlab_generic_hallway_end
mapgen is backwards and needs to be flipped 180°.hallway_blind_tee
,hallway_blind_straight
andhallway_blind_curve
overmaps in the special, which are potentially needed to cope with some obscure corner cases, but they are using the mapgen for their non-blind variants. They might need new / altered mapgen.Describe alternatives you've considered
Currently you need to define each OMT of the chunk separately in the special definition and then refer to them all in the placement rules as a chunk. This isn't ideal, but it does reflect the implementation. It would be nicer if a chunk could be defined in a similar manner to an overmap, but I think that can be added later as a QoL feature.
I haven't documented this yet. I hope to write those docs soon, but I wanted to get this PR out ASAP to help fix the microlab spawn issues.Documentation now written and pushed.Testing
I made a new test special
test_microlab
which uses this feature to solve the spawning issues the existing mutable microlab has had. Like the other test specials, it is able to survive 10000 attempted spawns in the test run.Additional context
Here's an example of a mutable microlab which spawned as intended:
Here's the sort of thing that can go wrong, but this failure is now handled gracefully. Here one corridor ran into the mine on the left, which led to some extra corridor off to the side. To resolve this without very verbose mapgen requires support for alternate joins, which is the next feature I plan to work on.