Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'alternative joins' in mutable overmap specials #52103

Merged

Conversation

jbytheway
Copy link
Contributor

Summary

Infrastructure "Support 'alternative joins' in mutable overmap specials"

Purpose of change

Continuing to finish off the feature set of mutable overmap specials.

This is intended to be a solution to the 'fragmentary hallways` issue that could strike mutable microlabs, as seen in the screenshots of #52056.

Describe the solution

Add an alternatives feature in the overmap definitions for a mutable special which allows it to match a different type of join than the default for that edge.

Based on the mutable microlab use case, the desirable semantics seem to be that these alternatives can be used when the overmap is first placed, but not thereafter when joining with later placements.

Describe alternatives you've considered

When initially designing this I didn't expect the asymmetry in use, whereby the alternatives can only be used on first placement, but that does seem to be neater in practice. Given that revision, maybe alternatives is not the right name for this feature, but I haven't come up with a better one.

Testing

Adjusted the mutable microlab and its TEST_DATA variant to use the new feature and thereby made them neater.

Additional context

Here's a screenshot of a couple of placements that would have led to 'fragmentary hallways' in the old definition, but now the hallways are clean.
mutable-microlab-alternative-joins
The key is to arrange the phases such that all the hallway is placed first, with asymmetric joins ensuring it's not placed in a disconnected way, then place all the generic microlab tiles, using the new alternatives feature to ensure that they can be placed either next to the hallway or each other, without demanding new hallway.

@John-Candlebury thanks for being an early adopter. Hope you don't mind me messing with your special yet again. The microlab continues to inspire new features. But I think this might be the last one to resolve all the issues I was aware of.

A couple of these messages were unhelpful or invalid (e.g. passing the
wrong number of args for a format string).  Fix that.
Alternative joins allow an overmap in a mutable special to match an
existing join that they would not otherwise, without affecting the
requirement for onwards matching on other unresolved edges.  This is
particularly useful when spawning a collections of 'clumpy' overmaps
around some existing ones.  For example, the mutable microlab has a
hallway and then microlab terrains.  The microlab terrains should match
the hallway, but their unresolved edges should only match more
microlabs.
Take advantage of alternative joins (in different ways) in the mutable
microlab and the test variant of that.

This resolves the issues the mutable microlab would previously have when
not all its hallways could be placed properly, leading to other hallway
fragments.
@Maleclypse Maleclypse added Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map [C++] Changes (can be) made in C++. Previously named `Code` labels Oct 5, 2021
@John-Candlebury
Copy link
Member

I dont mind, I'm actually glad the labs could help you develop mutable specials further!

Also, many thanks for your help with fixing these.

@kevingranade kevingranade merged commit 1719eef into CleverRaven:master Oct 7, 2021
@jbytheway jbytheway deleted the mutable_special_alternate_joins branch October 8, 2021 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants