Version 1.49 - Maximum Oversave
I’ve done it, I finally got the saving backend completely working.
Tragically, despite the improvements I made earlier, saving still caused awkward stuttering around the 500-word mark. Incidentally, that’s roughly how many words I’ve mastered (about 800 now!), so I couldn’t even finish my own game because it was getting too clunky, especially on mobile!
After a two-month break, I needed to take a long step back and squint at the code. I had to really narrow down how to make saving perfect—scalable to at least 1,000 elements and quick as a bullet.
I spent countless hours crafting a new solution to the saving problem. By storing each word in an individual field in Firebase, it should theoretically allow Firebase to upload only the changes. Since Firebase couldn’t store these fields in Korean, I had to create an entire mechanism to sanitize the output into English beforehand.
It didn’t work.
The sanitation process consumed too much computational power, negating any benefits of saving words as individual fields.
So, I embarked on another multi-hour journey. This time, I decided to store each word as a collection, with each collection containing a document representing one word. I’d read that Firebase can easily handle thousands or even millions of words this way.
It didn’t work.
You can’t create collections this way from Godot—something I only figured out after spending quite some time trying to make it work.
Back to the basics, I revisited my original saving schema and realized the true culprit was saving the large word database, the dictionary of dictionaries. Firebase can’t just update one element in a dictionary; it has to rewrite the entire hundreds-of-elements dictionary every save.
But then I remembered I had a second dictionary uploaded that only contained the Korean words and their associated experience points. Instead of uploading the player’s current and mastered words, could I just look at the exp_point values and reconstruct the player’s word bank?
Unfortunately, the saving structure had become bogged down with my prior experiments. Even without all that clutter, saving and loading heavily relied on grabbing the saved word bank. Still, I worked diligently to refactor it all. And by "I," I mostly meant leveraging the new ChatGPT-o1 version to handle most of the heavy refactoring work for me. The hardest part was specifying the requirements and double-checking the output, but that saved me hours of tweaking the code to fit the new schema.
Long story short, saving and loading have never been faster. Stuttering is completely eliminated, and I refined a few other aspects here and there—some word definitions, experience calculations, particle emissions, and other boring stuff like that.
I still don’t want to spend too much time adding more features until I beat my own game, but I do have something planned soon: an overdue, elegant way to track your progress toward mastering a word. Hopefully, it’ll be ready within the next week or two if my schedule cooperates.
Files
Get Master 1000: Korean Words
Master 1000: Korean Words
Learn 1000 of the most common words in Korean!
More posts
- Version 1.52 - Glowier Mastery13 days ago
- Version 1.51 - Victory Lap16 days ago
- Version 1.50 - Stars Aligned!23 days ago
- Version 1.44 - Saving ImprovementsJul 21, 2024
- Version 1.40 - Saving Efficiency UpgradeJul 19, 2024
- Version 1.38 - Saving ReliabilityJul 18, 2024
- Version 1.35 - Quicker TopicsJul 16, 2024
- Version 1.32 - Making it CountJul 15, 2024
- Version 1.31 - The Adjective UpdateJul 13, 2024
Leave a comment
Log in with itch.io to leave a comment.