Okay, so now I need to untangle the mess I made with the tiles and walls in the previous post. First, I’m getting rid of the “features” that I don’t want and need to redo differently. And then reimplementing the walls and doors doing their sprite visuals properly.

This means removing door “wall hinges”:

And going back to overlapping rooms by one tile:

And remove wall/side distinction to just having walls:

And that about reverts half the work I did before in about half the time.

Now, I need an actual wall tile setup that can overlap into the above tile, creating an illusion that there is a ‘top” for that wall. This just means that a tile world object has an extra tile sprite “above” it, which will visually look like a wall top:

And the tile’s overlay sprites “above” it are the same sort of setup as the previous wall top sprites were, but with a base sprite for wall top background:

I arrange these in the proper order for display:

And this works, except the draw order is all wrong, as the order is set for a tile that’s exactly at its coordinate, not some special offset sprites:

In fact, the wall top must even be above when objects move “behind” it. In other words, I need separate sorting handling for the main “side” bit and the “top” overlay sprites:

And that works fine, except the player can move way too far”below” the wall top, because it’s technically a free tile.

I will solve this simply by having the walls collide much farther with objects above it, so the player can only get slightly occluded by it:

This looks believable enough that I will go with it. And I’m definitely not redoing any collision or rendering logic at the moment.

And now I can do the same for doors without using weird hinge logic, but simply having an extra sprite. I will define it similarly to wall sprites, although I only need a single extra sprite here for now:

And if I similarly “restyle” vertical doors that are below walls to have the extra overlay sprites, I get the desired result:

Now that my doors are one tile wide, they need the same logic for their tops as the walls. Firstly, I need to align the sprite to be the “side” bit of the boor:

And then add the horizontal bit as the top bit also aligned:

And that makes the doors.

Except now I have a bunch fog of war issues (technically, I had even more issues with previous attempt). Here, the wall’s side part is rendered “next” to a tile that isn’t actually visible, that is, from the “other side” of the player:

I can fix this by having an additional flag for whether the wall’s side part has also been seen. I can set this seen only if the tile below it is seen (or, in other words, if the tile next to the side gets seen, so does the side of the wall). The tile world object then needs to sprite visibility controllers, one to use the main flag and the other the new side flag. And this works fine:

There’s another glitch with wall tops that “show” what the room layout is behind them:

Unfortunately, I would need to dynamically update the wall top individual corner sprite visibility and I won’t be doing that.

Anyway, time to sort out the open doors. Currently, they essentially disappear, as my open door sprite is just a floor. What I need is special sprite for the door only:

This does mean I need both horizontal and vertical open door versions and they must know how to transform to each other. Similarly to how closed doors work, I can do the open version:

I think this about wraps up my immediate wall and door sprite requirements.

I also though about destructible tiles and how to make them and it all boils down to needing way more art before I even get into coding all the cases of destroyed walls. In short, I am not going to do this. So my filler and bedrock tiles aren’t needed anymore.

In total, these are my tile sprites:

Yikes! That’s actually a lot looking at them like that compared to the previous “floor, wall, door”. Of course, these are ready to be “arted” and it also could have been a lot more if I wasn’t designing them properly, that is, minimizing the needed assets and programmatically arranging them. And I think that about does it for this “feature”. There’s a bunch of other fixes and tweaks I did in parallel that I haven’t mentioned. I already spent way too long on this and I need to work on something else before I go mad.

Related Posts

MicroRogue DevDiary #54 – Wall and door visuals
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *