Project Bolero Devlog 9

Work Since Last Devlog

  • Wrapped tileset and spritesheet loading calls, removed hardcoded tileset header info.
  • Added collectible coins, ostensibly to test spawning actors from map data. Not sure if I’m going to keep them. As a player, I don’t really like tons of trinket-collecting in my platformers, but as the doofus staring at the map editor, I want to fill the damn thing with shiny coins. A friend suggested magnetizing the coins, which would ease collection and could also allow for some interesting puzzle mechanics if the coins maintain collision detection against obstacles. In any case, they’re there, they animate, and they disappear when you touch them.
  • Added some basic spikes that send the player back to their spawnpoint upon collision.
  • Added checkpoints that update the spawn xy position of the player.
  • Added actor spawnpoint offsets for better placement when spawning from a less granular map array.
  • Added WIP music that I started back in 2018. Started throwing together some sound effects in MilkyTracker as I never actually started that leg of the project until now. Added in what I have.
  • Pulled most of the game logic out of love.update() and placed it into a separate function. This allows love.update() and love.draw()’s variable timestep to co-exist with a more deterministic fixed interval for game logic. Glenn Fiedler’s Fix Your Timestep article describes some methods of doing this. When making a throwback 2D platformer, you absolutely want objects that, given the same inputs, behave the same way every time, as much as possible. No one likes a platform game where the player can only make a certain kind of tight jump only most of the time. Instead of interpolating between frames as recommended at the end of the article, I’ve set the game logic interval rate to a rather excessive 256 ticks per second. A quick glance at System Monitor shows roughly 1-3% CPU usage, and I’ll need to test this under heavier loads and on some slower systems to ensure that this is acceptable.
  • Started work on splitting large displacements into multiple smaller checks depending on the size of the bounding box being moved. This only applies to the player against map obstacles for now, and only kicks in if the player’s movement is going to be larger than the smallest of a) the player’s size along that axis or b) the size of the map cells, divided by 2. Basically this is a last-resort attempt to prevent the player from being blasted out of the bounds of a map, and would only be invoked if the player is moving extremely fast.
  • With LÖVE’s image font object, I threw in a simple HUD that shows the player’s current stats (altitude, highest point reached, number of coins collected). I’m using a rather ugly rasterization of a system font that I need to replace as soon as possible. The font itself is fine, it was just never designed for 12×12. I ran into a bit of trouble, as LÖVE uses the upper-left pixel as an RGB key for spacing the font, and I have been using that same pixel as an alpha key (long story short: GraphicsGale through Wine doesn’t seem to be able to create alpha channels, so I use Python + Pillow to set alpha on all spritesheets and fonts before launching the game.) So I added some parameters to my build script to also specify an XY coordinate of an alpha key for a given image.

Thoughts

Still a ways to go, but the codebase is a fair bit cleaner now. I don’t have an animation or hitbox editor yet, but if I want to add another actor entity, I know the steps to define their template, define an animation, spawn them on a map, and where to place their update logic. It’s beginning to feel a little less like a prototype and a little more like a real game.

While working on sound, I’ve noticed some pretty substantial audio latency at times. Rebooting seems to resolve it. I’ve been experiencing the issue in other programs as well, not just LÖVE. I guess I’ll look into that later on.

I’m beginning to be tempted by mission scope creep: I’m feeling like adding bodies of water to swim and float through as well.

Plans For Next Post

  • Heck, I’m not sure. Should I stay on the road I planned out originally and just get something released, or do what is needed to make the core engine more robust for future projects?
  • In any case, replace that font with something better!

 

(edit 7/Mar/2019: Spelling)

Leave a Comment