The spring cleaning continues, with a healthy dose of bug fixing and refactoring.

  • Consolidation of time-sensitive events. Previously I had a few different lists for different event types that were time-sensitive, e.g. show a sprite in 0.2 seconds or start a particle system in 0.5 seconds. I've consolidated those a bit to real-time message queue, and removed some cruft along the way.
  • Weight-based pushing and pulling. Push and pull are standard commands, but the implementation did not do many checks... You could push/pull exits to overworld, webs, and other non-sensical things. Now it's weight-based, using Strength, plus had to adjust some object weights.
  • Removing place-at sprite messages. Previously, when moving entities, I created two sprite events: one for the movement, and one slightly delayed for after the entity arrives at destination. This was because of slightly different data related to the sprite, e.g. which "animation" to play etc. This proved to be really problematic, because besides the fact that I had to do far more sprite updates, it also introduced several weird bugs that could only be fixed by inspecting the message queue often, which is problematic for performance. So, I've added a tiny bit more logic in the sprite shader, and remove that final message, so that a "move" sprite event is perfectly capable of displaying a sprite properly after the move is finished.
  • Liquid ambience. That's the feature that got into my head a while ago - I wanted to hear water in levels! After a bit of effort that's finally done. It uses just two sounds at the moment, "sea water" and "fresh water", but in the future I'd like to have more presets for e.g. still water in the cave vs out in the ocean. The system supports sounds for other liquid types like lava, blood and poison, but there's no use case for those yet.

That's it for now, have a nice weekend!

Water ambience in a level