Screen Strategy: The Conceptual Challenges


I'm preparing for a long bout of travel, so I really didn't want to dig into anything too intense today. Yesterday's session also left me with a few concerns and ideas, so I decided to just have a discussion with Gemini about the UI Manager I'm going to be implementing. I wanted to make sure I understood how it will work and what challenges I'll face. It's going to be a big undertaking, and because of my travel it is going to be a few days before I can even dive in.

First, I had to understand how Godot will deal with the UI Manager scene, and luckily it's not a big deal. But there will be some things I have to keep in mind, like layering with multiple UI elements. Nothing too complicated, but I'll just have to keep this in mind as I add new stuff to my UI.

Another thing that concerned me was the approach to loading and showing the different UI elements. Currently, everything I do is just instantiated as needed and freed up once it's done. This is not a good approach, especially for things I've yet to build. There will probably be some process intensive UI stuff later on, such as the character menu and inventory, and instantiating those every time the player accesses them would be really bad.

But, rolling everything into the UI Manager will help with this. The UI Manager brings it all together at once, during a loading screen to hide all the inner workings (and the process locks!) and then just show and hide them as needed. Some things will be their own scenes, others will just be part of the main HUD. But they'll all be controlled from a central place, which is dictated by my game manager's state.

I decided now was the best time to try to lay out the actual UI elements. A general map of where everything lives on the screen. Time and date display in the top right, player stats (with buffs and debuffs) in the top left. Popup notifications, such as item acquisition, in the bottom left, and maybe even a mini-map in the bottom right corner. Important notifications such as tutorial hints, dead center (don't want the player missing those!) with objectives off to the left. Some scenes may have a hotbar or activatable abilities, so bottom center for those, with target info top center. I'm going to leave interaction prompts in the world space, at least for now, attached to the interactable.

Of course, all of this is going to require a huge refactor of the way the game manager works. I'll be removing functionality and moving it to the UI Manager, and I'll be changing how it deals with the existing states. Currently, I only track the current and previous state, but with the changes for the UI Manager, the game manager will need to know even more about the past, so I'll have to build out functionality around an array of states.

It will also be a big change with how nearly everything else in the game works currently. Changes to everything, the main menu, the settings screen, the load dialog, the pause menu. . . Pretty much everything done so far. Maybe this is what git branches are for? Or maybe it's not that important, since I can just roll it back to before I begin working on these changes. I'm not that great with versioning yet, don't have a full grasp of how to use it beyond a "backup". I know, I know!

But, even with how challenging the refactor is going to be, it is important. And it's the best time to do it. Well, the second best, the best time to do it would have been before I built any UI. But if I wait any longer and build any more UI, it just gets even harder to do. So, I think and plan and prepare for the inevitable. And when I finally get done travelling, I'll be ready to dive in. And I know it's going to be tough, especially given how hard some of the simpler changes have been.

Leave a comment

Log in with itch.io to leave a comment.