Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Quick & Easy: HUD Updates

Today it was finally time to get the HUD prefab connected to my data managers. I decided, because of the specifics of the changes being made, not to involve my main Gemini chat instance with any of the updates. I just opened a fresh chat window and told it exactly what I wanted. 

I started out by describing exactly what I was starting with, my HUD prefab placeholder script. I then told it what I wanted done at a high level, connecting this script to listen to other scripts' signals and update accordingly. I then went into details about the connections, which signals from which other scripts update which specific nodes. Along with all of that information, I fed it the scripts needed, the hud prefab placeholder itself, as well as the two other scripts it needed to listen to.

With that, it took my 48 line placeholder script and output an updated 170 line script that did exactly what I wanted. The only issue was how this new script referenced one of the other two. It was a simple change on my part though, from PascalCase to snake_case. With a few changes in the output I was able to get this new script in place and tested in no time.

And the results were exactly what I wanted. I now have in-game time displayed in my UI, along with the player's money, health, energy, and satiety. I've still got a lot of work to do when it comes to the UI, such as implementing the alert system (central display) and the notifications (level up, item acquired, etc). But this has been a huge step in the right direction. 

My next goal is a big one that will probably take a lot of planning and effort, the save/load system. I think there will be some other things I have to work on first, like finalizing my item definition. At the moment it is rudimentary, only handling static item definitions. Because I anticipate having unique, procedurally generated items in the game, I'd like those values to carry over between sessions, so I need a way to save them. And to save them, they need to be defined.

So now I'm trying to fight with Gemini to transfer the design knowledge to the new chat instance. Of course, I keep getting the same error, no matter what I say to Gemini. "Something went wrong". . .

Because of how quick and easy it was, I decided I wanted to get ahead of tomorrow's work. So, I started talking about my item definition and the need for saving unique, procedurally generated items. I was hoping I could pass along information directly from my original chat, but every attempt was met with that error again, "Something went wrong". I passed along as much information as I could from my memory, but I was really hoping the AI would help me with this too.

Edit: I decided that I wasn't done working on the game. So I went back and implemented new functionality I had planned for the HUD, the central message display. It's just two rich text labels that appear in the center of the screen. Not exactly sure how I'll use it yet, but I think it might be handy for tutorial hints or in-game warnings. 

I started talking to Gemini about how this would work without any intention of actually making changes today. But then once I'd refined what I wanted and figured out how it would be implemented, it was another quick and easy win! I fed a prompt (that I modified slightly) from my new main chat instance to a fresh and new chat, along with the gdscript for it to update, and it made the changes I wanted. 

But, I actually ended up making my own changes to other scripts surrounding this. I added a new public function in my UI Manager to make use of the central message display in the HUD, and I updated my debug overlay to force a message to appear at the press of a button. All of this was really easy to do, even the scripting I did on my own. And it just worked, which made me so happy!

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.