User Config Refactor: Continued
Back At It Again
Got my work (work work) done for today, so it's time for my personal project, Xenodochium! Picking up from yesterday's session I had to kind of refresh my memory of what was done and what needs to be done next. After review, I decided the best next step was to continue working in the savegame manager, updating the existing code surrounding the ConfigFile to use the new methods I built yesterday. So I started by feeding the updated script into Gemini to validate my changes from yesterday and to determine what is left to do.
It all started with updating the function that returns data from the ConfigFile. I just had to erase a few lines of code and update a variable name in there. Then it was time to move on to the function that was originally set to save the ConfigFile data. This was a similar change in that I had to just remove some lines of code and update variable names. There was a little more needed though, I had to denote my settings data was dirty by setting a variable.
After that, it was a matter of making changes to the function that actually saves my player's game data. This one was a bit of a monster, so I asked Gemini to just make all the changes for me so I could validate them. I could have just followed along with the instructions it gave me, but I find it easier to just take the entire function and compare the differences. Of course, Gemini didn't follow instructions, at all. Instead of outputting only the updated save_game function it output the entire savegame manager. And it also decided to start hallucinating, adding in references to code that didn't exist while stripping out nearly all the functioning code.
So I asked it to try again, output just the updated function. I supplied it with a current copy of just the function too. Wanna guess what it did? If you said "Output the entire savegame manager again" you'd be right. Although, this time it didn't erase a bunch of working code and replace it with hallucinations. While comparing the new code to the old, I found a remnant of save versioning I had begun implementing but never quite finished. This led me down a bit of a rabbit hole where I found out about the project setting "Version" that I hadn't known about.
In the end I made some updates to the code myself, then worked through the changes suggested by Gemini. It was at this point where I realized I was saving the player's name in the ConfigFile but not actually loading it anywhere that it mattered. The fix for this was actually pretty simple, I just had to add a call to my new function to get the correct ConfigFile value inside my load game function. Oops, actually I was wrong. I did already implement loading the player's name. I did make one small correction though, to force it to use the correct default value if the player's name isn't actually set yet.
But this still didn't get my save game function updated. I went back and forth with Gemini trying to make sure everything worked properly but every time it responded it didn't seem to understand my concern. Finally it ended up doing the complete opposite of what was intended so I just made the necessary changes to the code myself. Luckily, it really wasn't all that hard to do.
Once that was completed the next step was to connect the savegame manager to my game manager's state change signal. That was an easy one though. I just copied the setup I already had in my UI manager and made some slight modifications. An intermediary function receives the signal from the game manager when the state changes and if the settings are dirty it commits them to disk. Once that was done, I fed the script back into Gemini again for validation and it started hallucinating again telling me my function was missing parameters that it wasn't.
Next Time
At this point I was done dealing with Gemini for the day. There's still a bit more to do for this refactor, I have to update my audio handler and load game dialog to use the savegame manager for access to my ConfigFile. Those two updates shouldn't be too hard, hopefully. But I just don't have the brainpower to continue today. So far so good though, I'm really happy with the progress here and know it will have some seriously good impact going forward.
Xenodochium
The future is what you make of it!
| Status | In development |
| Author | Munchmo |
| Genre | Role Playing |
| Tags | 2D, Cozy, Godot, Indie, Life Simulation, Pixel Art, Sci-fi, Singleplayer |
| Languages | English |
More posts
- User Config Refactor: Planning1 day ago
- Virtual Joystick: Configuring2 days ago
- Virtual Joystick: Plugging In3 days ago
- Fixing Bugs at the Mall4 days ago
- Let's Talk: Taking a Break10 days ago
- Inputs: Handled13 days ago
- Item Acquisition: Quest Complete14 days ago
- Quest Manager: Item Acquisition15 days ago
- Dialogue: Wrapped16 days ago
Leave a comment
Log in with itch.io to leave a comment.