Or even more generally, be a property of the “tile” that can be called, and will return a “connected to” value for multitile creatures, fields (this was a serious problem when designing the sludge crawler), vehicles, or even diagonal walls.
Alternately, like you said, I could just hack around multitile continues events by allowing them to only occur in cardinal directions. One way this could be achieved without (for example) limiting such creatures from moving diagonally, would be to have a “half” segment of some sort, that only appears when moving diagonally and only appears when there’s an open space for it to appear in. This solution isn’t the best for vehicles, admittedly, but it is something that could work with some tweaks. Let me demonstrate what I mean:
[tt]
3 unit long snake in a 5x5 field.
…
…o…
…o…
…o…
…
Snake moves 1 unit northeast - “half segement” is created"
Snake appears 4 tiles long, but it /works/. Only three of these segements are ‘real’, but one is created to ‘link’ two of the segments and will be discarded when it is no longer needed.
…o.
…oo.
…o…
…
…
Snake moves 1 unit east - “half segement” is maintained, preventing movement through the gap.
…oo
…oo.
…
…
…
Re-centered, with a wall with a diagonal gap placed to the east. (now 4x6)
…|
.oo…|
oo…|.
…|.
Snake moves a square to the east - since there’s no longer a diagonal translation between it’s body parts, the “half segment” is dropped.
…|
.ooo.|
…|.
…|.
Snake moves a square to the east
…|
…ooo|
…|.
…|.
Snake moves a square to the southeast
The half-step segement goes to place itself in the square to the sw, between the two segements, but since that square is already blocked it does now. It then tries to place the half-step segment to the east instead, but since that is also blocked, it just places nothing. If either of those become unblocked, we could have it pop in a snake segment.
…|
…oo|
…|o
…|.
Here’s an example of a snake turning a u-turn corner in a hallway:
|…| |.oo…| |.ooo.| |…oo.| |…|
|.o|…| |.o|…| |.o|o.| |…|o.| |…|o.|
|.o|…| |.o|…| |…|…| |…|o.| |…|o.|
|.o|…| |…|…| |…|…| |…|…| |…|o.|
[/tt]