Data Manager: Effects and Thresholds
I'm Back!
An unexpected confluence of events led me to take a couple days away from the project. Strangely, none of them were due to the holiday of Thanksgiving. But now I'm back and ready to get to work on refactoring more stuff, ugh. This doesn't excite me, but hopefully it won't be too complex. I think the first thing to do is to determine exactly what I need to do here. So I started up a conversation with Gemini and talked through the issue and what I want to do.
I laid out my proposed approach and Gemini seemed to agree that it should work okay. So, the plan is to first update the data manager to handle effects loading internally using a similar method to the other custom resources. Once that is done, the next step will be to isolate the effect threshold data into its own custom resource in the same way as the rest, and add that processing to the data manager as well. Once that's all done it'll be time for the big work, refactoring the playerstats manager to depend on the data manager for effects and thresholds.
Getting To Work
I started by working backwards, creating my "get" function for effects data. That was an easy copy/paste/update of my cutscene getter. Then I started build the data processor myself. I followed the previously written functions, even though Gemini output the whole for me. There were differences between the way I have things, and the way it output the function that I didn't like, so I dug around a little bit until I got things just right.
That actually wasn't too bad, once I really dug in. There was a stupid hallucination from Gemini, but I fixed the code myself and now the data manager is successfully loading the effect definitions into it's own internal dictionary for reference. The next step will be a little harder, but I think I can handle it solo. It's going to be moving my effect threshold definitions into their own custom resource. Hmm, this one is actually a pretty simple structure, which may not be what I want anymore.
So, first step was to build the actual definition. That was the easy part, I think. Gemini actually had a useful suggestion to add an effect getter inside the threshold definition, but now I'm wondering if this definition is correct. Then Gemini made some suggestions for how to load the data into the definition but it started hallucinating again and gave me bad code. This made me step back and look over the way things are being handled and I think the effect threshold definition isn't right.
After reviewing the original setup for the effect thresholds I can see that the new definition should work. This is getting complicated, and Gemini is making things worse, I think. I've got the code in, but there's an issue surrounding data typing or something and the chat instance I'm using can't keep it's hallucinations differentiated from the actual script I'm uploading. Time to start a new chat instance!
All I did was feed the three files, my resource definition, the data manager script, and the JSON file I'm loading, and asked it to look for issues. It identified the issue right away and gave me a very simple solution to the problem, a slight modification to my JSON structure. Once that was in place, everything began loading without issue!
Next Time
But, it's time to wrap up for the day, I have placed to be. My partner is dragging me out to the mall again. I may actually come back to continue more afterwards, but I may wait until tomorrow. The next step is going to be ripping out all of the data loading from the playerstats manager and making it depend on the data manager for this stuff. Luckily, that shouldn't be too difficult to implement. Once that's done, then I have to go back to finish the whole reason for this refactor, consumables!
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
- Effects: Underwhelming3 days ago
- Inventory Manager: Quick Actions3 days ago
- Inventory: Updates5 days ago
- Planning at the Park6 days ago
- Inventory: Item Details7 days ago
- Item Slot: Pushing My Buttons7 days ago
- Inventory: Item Details8 days ago
- DAB: Interacting!10 days ago
- Dynamic: Action Button10 days ago
Leave a comment
Log in with itch.io to leave a comment.