With doorways, any chance you can count a wall as a sub-part, so you have 24 master parts, with an occasional wall replaced with a doorway-wall as required?

That way you could have secret doors, changing maps etc, where you are only changing sub-parts, not the whole square.

thinking about it, this may not help, as a wall could be full edge, or have one corner adjoining, or two corners adjoining, and where corners adjoin other walls, you would need a different edge to the wall. - so that makes 3 wall sub-parts, and 3 door-wall subparts. I guess you'd then use those 6 definitions on top of ground sub-parts, within your 47 total parts. (24 + 24 {-1 with no walls} )

I like the start of your project, keep up the great work!

Don
have a great day