2 min read

Slamming Doors and Starting Devlogging

Slamming Doors and Starting Devlogging

Welcome to the first [official] devlog! I've been posting updates between Threads and Bluesky but decided it would be better to create a dedicated devlog where I can get into more detail rather than worrying about post size limits.

With a lot of the tooling and core functionality of the game complete, I started work on the first environmental hazard of the game; the slamming doors. In true indie fashion, I under estimated the challenges this would actually introduce. I initially expected to be done with them in 1-2 hours but spent a good 8 hours modelling and coding in the end.

They work much like the name suggests - the doors open and shut automatically, if you get caught in them when they are slamming shut... you'll start to resemble Flat Stanley (understanding that reference will probably show your age).

The first of the main two hurdles to overcome was one that has been a constant issue when designing mechanics for this game, given the top-down view - not being able to abuse clipping to hide things. This meant the doors sliding open couldn't just hide within the walls it is attached to, instead the doors needed to scale down with the origin point being where they attach to the frame.

The other hurdle was dealing with the squashing / respawning routine. Setting up a respawn point in itself wasn't a huge deal. As you can see in the screenshot below - I created an item that can be added to the map to signify where the player should respawn and that was that; the real problem came with how the respawn process is carried out.

When the player is squashed, the scale property is used to achieve the visual effect, however, some equippable items are children of the mesh that is scaled. The reason this was a problem is because, ideally, you should not scale collision shapes in Godot [the game engine being used], as it can cause unexpected behaviour and bugs in physics calculations.

In the end, the method I settled on (which I feel is the cleanest) was to instantiate a new player, copy the relevant properties that need to persist through the respawn process and then move the newly created player to the respawn zone whilst discarding the previous player object.

It took a lot of bug hunting and tweaking, but the doors are now working as expected and the respawn points now also work! 🙂

0:00
/0:07