Settings, Sounds and Gradient Brushes
Mainly two areas of work this week, more settings and adding some juiciness to the editor.
Settings
Now we communicate to he player if we have any "dirty" settings that require application restart. I have a few of those unfortunately, but instead of spending way too much time to just ensure the changes are applied on the spot, we just make it clear that the application needs restarting in order for these settings to take effect. An example is MSAA setting, but a few more too.
I spent quite a bit of time trying to play around with changing resolution as well. It's possible to change the resolution of the game without the UI (with application restart), even though that's a last resort "I need the application to run faster". What was (and still is) hellish is to be able to scale UI elements for accessibility. Nothing works. There's an official example for multiple resolutions but it's honestly unusable, as they expose just the parameters with GUI and everything looks very wrong very quickly, instead of showing a "real" scenario with semi-complex node hierarchies and different UI scales. So that's work in progress that I really don't want to do anytime soon, but I'll have to, at least for fixing the aspect ratio (but that's the easiest part).
I got a nasty bug where the game would start without focus on the UI element that should be in focus, because of ??? and I had to add some forced window focus grabbing code when a particular node starts - all very "magical" in the wrong way.
And another fun little headscratcher is bindings for something as simple as cardinal directions. Remapping is supported, but I'm supporting one set of bindings for keyboard, one for mouse and one for joypad. But cardinal directions would really be useful to utilise a few keybindings (e.g. keypad if you have and regular arrow keys). Still undecided, but if I could somehow detect if the connected keyboard has a keypad, maybe that could be used to set some defaults.
Juice
Now to the fun part. Since I'm planning to share the editor, I wanted to make the experience slightly more playful and satisfying. And nothing beats extra visuals and audio. I decided to add the following:
- When mountains are drawn, they rise from the ground, playing a rumbling sound. I spent at least an hour looking for a sound, and at least 1 more hour for some weird mixing/fade logic, but at the end I think it works quite effectively.
- When vegetation changes (i.e. more or less dense per tile), it pops from the ground in a sort of bouncy way, also with a sound.
- When cities are placed, they also pop similarly
Well, I love this! It does cost a tiny bit of performance (a few extra buffers + some shader logic) but at least it can be enabled/disabled in settings. Have a look at the video!
Gradient brushes
I added some extra brush functionality to be able to paint gradients, with a peak/dip at the center and with some configurable falloff. The way it works is that, at the first mousebutton press when you start painting in this mode, a copy of the biome is created, so we can identify what is the range of changes we can do. Without freezing it like this, every frame that we're painting we would be modifying the underlying values. It works fine. I'm limiting it to temperature/humidity/vegetation density, as it's where it makes most sense.
That's it for now, have a nice weekend!
