Handling gaps in MoveArea

I realised recently that the MoveArea system was severely limited in respect to passageways from one area to the next (i.e. doorways). For example, in this image:

The room only one entry way. The reason why I couldn’t just create another one to the side was because I would have to split the room into segments. And if I did that, it will come out like this:

I’d have two separate movement areas, and no movement area at all at the centre of the room. The area worked on closed polygons whilst the border worked on individual segments. But for convenience, I didn’t want to draw twice.

What I thought I needed to do was to specify a vert that served as a gap, which means that no segment should connect to and from that gap. But how to identify it? I thought of using vertex indices and use the BorderLine naming convention, but it was too cumbersome, and not very visible in the editor.

So what I opted to do was the use of tag that indicate that a vert was a gap:

I added an in-editor label thanks to this tip.

This needs to be parented on the under the border line itself to indicate that this gap belongs to that area.

MoveArea computes the closest vert for that gap and breaks individual segments from connecting to and from that gap:

However, the Area is still intact, because it doesn’t really recognise the gap; it just continues on connecting the verts to close the polygon.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.