Project Bolero Devlog 11

Work Since Last Devlog

  • Replaced the UI font, and spent way too much time making additional ASCII bitmap fonts of varying legibility. I grabbed a copy of the public domain 8×14 bitmap font that DOSBox uses for text mode, and also added one BMFont using Hiero to convert a vector font to BMF format, just to confirm that the process works on my system. BMFont is recommended over LÖVE’s ImageFont object for preserving kerning information from vector fonts, though ImageFont is still fine for small amounts of pixel-art text, and for arranging HUD widgets.
  • Added wrappers for Lua math functions to calculate angles and XY offsets between actors. The magnetized coins now move directly towards the player, instead of sliding along the X and Y axis independently. (For an example of the latter, Ninja Gaiden’s infamous second-to-last boss shoots homing projectiles that behave this way.)
    • Then I demagnetized the coins 🙁
  • Added a draw priority value for actors. Actors with higher values are drawn in a subsequent loop. My implementation is not optimized, but I don’t see the overhead being an issue in a game with about 100 actors active at any given time. I’ll certainly revisit this if it becomes a problem. Maybe in the future I’ll add the option to draw actors behind the map, or to give every map celldef its own draw priority.
  • Reviewed the Lua global variable table (_G) and changed several short-lifespan variables (loop index variables, “retval”, etc.) from global to local. Oops.
  • Tried making some additional actor types and sub-types: moving platforms that travel vertically, or in a circle clockwise or counterclockwise; a small “bump” impact effect that plays when the player actor jumps into a ceiling; a small flash when collecting a coin. For now, to spawn actors with custom parameters, I’m defining indirect spawner actors that just add the correct actor to the scene, set what needs to be set, and then self-remove. That’s not optimal at all, but it will do for one game. Tiled may have a solution to this that I missed.
  • Started sorting the source files into subdirectories to help separate the core and project. Separated the object behavior definitions further by dumping each behavior set into its own source file. Added an optional actor “draw” behavior to override the default drawing call, so that text widgets and debug tools can be slapped together without mucking up the core engine loop.
  • Scenes now have a default background music index which will play upon entering. Special cases:
    • If the index is nil, or if the index is already playing, keep playing whatever is currently playing and don’t reset its current position.
    • If index is “NO_MUSIC”, stop all music.
  • Added mute toggle keys for sound effects and music
  • Tore out the remaining references to the “player” actor within the core files. Actors should not get special treatment within the core just because they’re an arbitrary kind. Special cases should be handled by flags describing the actor’s needs. Working on moving gravity, platformer state variables, etc, out of the actor’s engine variables and into the user data table.
  • Did some light graphical work on the tileset, sprites and map, which I haven’t really touched since the project went cold in 2018. I threw together a few small platforming challenges (hopping onto moving platforms over spikes for the most part) and have noticed some strange errors related to object processing order, but I’m deferring work on that until I feel better about the core engine and toolkits.
  • Scenes with no assigned map or actors can now be initialized and accessed.

Thoughts

Geez, this is starting to feel like something tangible.

I’m feeling a bit lost regarding how to refine the engine. I think I’ve severed the majority of the project’s tendrils latching into the core (though every time I say something like this, I find something else that should be shuffled around.) Now I want widgets, an animation editor, a map and matte background editor, a simpler interface for building up actors, and things like angled floors. Tiled is excellent, but something more integrated into the engine would also be nice for workflow reasons.

I’m torn between 1) finishing Up High, and once it’s out the door, stripping out everything specific to that project and making the core a strictly separate entity, and 2) just working on the engine and building up those things I mentioned in the previous paragraph.

Plans For Next Post

I am once again cutting this post too close to the scheduled deadline. I guess I still need to think about which path I want to take here.