Woohoo, I'm back!
Got caught up with work that I could barely make any progress in the last few weeks. Now that everything is settled (hopefully), I'm back to working on "Tracking" again, which means there is a new update:
Update #7: Mail Inbox Save/Load System
Instead of building a whole save/load system for everything, I guess it would be better if I make different save systems for different features in the game. Starting with the MailMe inbox.
Problems
For someone who has just started learning Unity for not too long, I was struggling with how to build a system that could at least keep the emails persistent through different sessions. And so I decided to hopped on YouTube to search for some tutorials, and joined some unity-related forums to ask for help.
- Email data would be cleared whenever the inbox is closed. So when players receive an email, its email data will be pushed to the inbox, which will handle how the email is displayed and presented to players. However, as soon as it is closed, the email data would vanish and the inbox is rendered empty.
- Some important emails are duplicated. Since the important emails that serve the main story plot are handled by a separate system, their trigger point is unstable and would spawn an email twice or even more, depending on how many times players "accidentally" activate it.
- Notification sound glitch. Apparently, since the trigger point is unstable, it would spawn a new email and every time a new email is spawned, the notification sound would set off. But even if I manage to stop the triggered email from spawning, the sound would keep on ringing still.
- Save system became unstable. For my attempt of creating a basic save system for the email data, I managed to have it loaded the saved email data. However, for some reasons, it only loaded ONE email data while the rest failed to get pushed to the inbox.
- Read/unread state of emails is unsaved. Not really a significant issue but it's annoying.
- Email data is saved, loaded but not visibly. This happened when I tried to "upgrade" my save system so that it could record the read/unread status of each email. Weird, annoyingly weird.
Solved?
In simple words, all I had to do was to have all the email data saved into a json file and get it loaded up whenever the inbox is opened (but it's not that easy for a beginner like me, life is hard 😭). I managed to get my save system working:
- Email data is grouped in a list and handled by another separate system which will record the email data that is pushed to the inbox. The recorded data is checked for duplicate to prevent it from spawning more than twice.
- Another system is added to handle the loading. So to make the matter worse, I divided the whole thing into two parts: one is for recording email data, and the other is for loading the saved data. Might need to utilize them in the future some way, somehow.
- Read/unread status is now recorded as well. Not really a significant issue, but got it fixed anyway.
Conclusions:
- The save system needs to be tested for a few more days before I can move on to the next part of development.
- At least it's stable as of now. I will work on utilizing the system more.
- Other save systems in the future might have to be saved into a different json file...?
Thanks for reading!















