Level GUI
This week's update is focussed on making the GUI better work with the game.
Level GUI
Well, I thought I'd actually just 100% reuse the overworld GUI, as I'm not sure I want different UI as that might be confusing. Sure, the content of some elements is going to change, but the overall placement and style should be identical. You can see the results in the video above. An additional little fun thing was to add tweening support to the HP/MP/XP bars so that they animate towards new values. It's nicer, and was little effort to add.
Hovering refactor
When inside a map, I want to present information about the current tile we're on (what's the floor like? Is there liquid? Any items on ground?) and the tile we're hovering over (same info, but also: is it a blocker tile? are there any creatures or objects?). A bit of refactoring was apparently required, to ensure that we can get some nice presentable bits of info with very little code. I've added a bit of special functionality to "lock" on a hovered tile with the press of the middle mouse button, as the hover UI shows some tooltip-enabled elements, which ... need to be hovered over!
Game log
Hooked up the game log with the associated GUI element on the bottom left. Works fine, although the actual messages that appear are terrible at the moment and need improvement!
Melee and serialization
This was a nasty surprise. I realised that no entity could melee attack anymore. After a deep dive, I realised that there was some semantic serialization error: everything appeared normal but it reall wasn't. With MemoryPack, if I want to serialize a Foo object which is really a Bar object that inherits from Foo, the only way is to make Foo abstract. If that's not the case, well, there's no error, but it will silently serialize the Foo part, and when you deserialize you get a Foo object. And in this case, Foo was a "SingleTileCommand" that did nothing and "MeleeAttack" was the Bar object that never deserialized correctly from the cached configuration. Fun stuff! To prevent such future nonsense, I've improved a separate "CodebaseCrawler" project that inspects the code of the game and reporst warnings and errors with regards to serialization.
Continue
If you remember the Continue screen from an earlier post, well, now it works properly! It's populated dynamically, and does what it's supposed to. Loading times are pretty quick too, which is nice. I'll demonstrate it with a video some other time.
And that's all for this week! Next week is going to be busy, so probably low-key updates and design thought exercises, like the looming item refactor