2 min read
Windows & Drawbridges

In FTL, blast doors and doors alike allowed the player to deal with fire and stop boarders. In Skymagi, environment hazards like a room flood also need to be dealt with. How do you un-flood a room? Open a window, let the water drain out.

Windows are effectively just doors with different artwork, but with no automatic close/open.

windows

The Drawbridge

It’s not quite a flying castle without a drawbridge for docking. This sigil’s job is to protect the castle from land invaders and to provide a method to dock and exit the castle.

It’s similar to a door/window where it can open/close, but it has to be walkable. Area is a flexible component used for any navigable area, but… out of the box there’s a lot of jank.

So much jank.

  • Pathfinding between areas isn’t well supported.
  • Navmesh persists when the door is open or closed.
  • Drawbridge acts like a door, but closes when the unit walks past the portcullis.
  • I had to make it a half wall because the original sprite hid units too much.
  • The zIndex of the half wall overlaps with the castle improperly.

Though I didn’t solve all of these issues, I was able to fix most issues by resizing the static collidable when the drawbridge was closed to cover the entire area.

The zIndex issue is more complicated than it seems. Mages should be on top of the drawbridge, so it’s like a background tilemap. However, the castle walls should be beneath it. No single z-sort solves both of these issues.

Sometimes, programming isn’t the right answer. I resized the wall sprites. Done.

Quick and easy

Now players can exit their castle and explore!