Preview v0.0-38


[rattling chain sounds]!

Today's build includes a bunch of under the hood refactoring.

https://files.mastodon.social/media_attachments/files/104/810/652/401/238/250/original/055f24c443ae07f8.png

The biggest changes are that the settings screen is now dynamically generated by settings definitions that also allow for the majority of the game's settings to be set, stored, loaded, and updated without setting-specific code.

By declaring settings with a Dictionary of Dictionaries that looks something like this, UI widgets can be automatically generated based on the defined type (a checkbox for boolean values, dropdown option buttons for string arrays, etc.).

At startup, the setting name is inserted into the setting's dict under the "name" key, and runtime settings are retrieved from there. For things that need code to be run once a setting has been updated, the game will call an "apply_func" if defined, or will look for any function that matches the setting name prepended with "set_" (like set_fullscreen()).

If the setting value needs to be tweaked before being displayed to the user (like the volume settings being displayed as a percentage, or latency offset as a mm:ss.ss string), a "user_value_func" can be defined to generate that.

    "video":{
        "fullscreen":
        {
            "type": TYPE_BOOL,
            "default": false,
            "hint": "Toggles fullscreen mode"
        },
        "antialiasing":
        {
            "type": TYPE_STRING_ARRAY,
            "values": [
                        {"value": "Disabled", "meta": Viewport.MSAA_DISABLED},
                        {"value": "2X", "meta": Viewport.MSAA_2X},
                        {"value": "4X", "meta": Viewport.MSAA_4X},
                        {"value": "8X", "meta": Viewport.MSAA_8X},
                        {"value": "16X", "meta": Viewport.MSAA_16X},
                    ],
            "default": Viewport.MSAA_4X,
            "hint": "Sets the amount of antialiasing",
        }
    },

It's not particularly fancy, but abstracting this stuff as much as possible and generating UI means that adding future settings can just be a matter of adding a definition. Centralising typos Centralising this stuff means that things only need to be added once, and in one place. Maintainance becomes a little easier, and if there's a bug, then it'll be more likely to manifest broadly and be immediately noticeable than be constrained to some rarely looked at button at the bottom of a menu somewhere.

If I want to later change the visual representation of the settings menu into some kind of diagetic scratched-into-the-bleeding-bark-of-trees-by-the-last-physical-manifestations-of-the-tormented-souls-that-haunt-the-forest thing, then the only thing that changes is the UI generation code, which is all compartmentalised and independent of everything else. Nice.


Nemoder's been working on some placeholder audio effects, and while they're still very placeholder, they're going to be an important part of nailing down the core game and making sure that we've got all the different moving parts functioning as they need to.


This build also contains a fix for the game hard locking when returning to the menu after dying. I'm sure that bug wasn't there when I was testing the previous builds before release. They might be possessed.


Full changelog:

  • Added functionality for applying and storing config settings when changed
  • Added functionality for getting user friendly strings for config values (percentages for volume, mm:ss.ss format for latency offset, etc.)
  • Added error output when cursor mode does something that it shouldn't
  • Added file logging (~/.local/share/darkgroove)
  • Added placeholder sound effects for hits, misses, enemy attacks, win and lose
  • Added audio bus for music
  • Added audio bus for sounds
  • Added master volume setting
  • Added music volume setting
  • Added sounds volume setting
  • Added fullscreen setting
  • Added antialiasing setting
  • Added debug_shortcuts setting
  • Added version to settings file
  • Added reset and close buttons to settings screen
  • Moved configFile to Globls
  • Moved settings definitions into Globals
  • Moved store_setting() and retrieve_setting() to Globals
  • Updated developer shortcuts to not be checked when debug_shortcuts is distabled
  • Updated sfx players to be dynamicaly instantiated based on fxPlayerCount const
  • Removed cancel and save buttons now that settings are automatically stored on change
  • Refactored setting name handling to store setting name both as key in category dict, and as name field of setting itself
  • Refactored generation to more easily allow for dusplaying separate screens per category in the future
  • Updated range widget generation to allow min, max and step to be set in settings definitions
  • Fixed crash when exiting while settings screen is open
  • Fixed hard lock when returning to the main menu after dying
  • Fixed version number not being loaded correctly in release builds

Files

darkgroove-forest-linux-v0.0.zip 18 MB
Version v0.0-38-g8a9ef8cf Sep 05, 2020
darkgroove-forest-mac-v0.0.zip 18 MB
Version v0.0-38-g8a9ef8cf Sep 05, 2020
darkgroove-forest-windows-v0.0.zip 17 MB
Version v0.0-38-g8a9ef8cf Sep 05, 2020

Get Into Darkgroove Forest

Buy Now$5.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.