Jump to content

Save the Refactor, Save the World


Recommended Posts

  I think going forward on these updates I'm going to split them into two sections. Think of it like a mullet, we'll have business in the front, for anyone that only cares about that, and personal in the back where its just the things going on in my life. If you don't care about one side, don't read it, and if you don't care about either side then you've just saved yourself some time!

The Front

It took a strange amount of heavy thinking but I've managed to update the save system to be a lot cleaner! Now we have the concept of a UtilitySaveData class, utilities are classes that are neither SOs or Monobehaviors and will handle various needs of other classes. This is hardly revolutionary but like all my other naming structures the important thing is having some level of consistency. It is the fact that these are neither MB nor SO that makes them a "utility" class. And that mentality in the future will help me manage what is what easily without a lot of hovering.

These new classes can be utilized as easily as:

var USD = new UtilitySaveData(_keyArtifact.Value, _saveIndexArtifact.Value, _objectToSave);
USD.SaveState();

and

var USD = new UtilitySaveData(_keyArtifact.Value, _saveIndexArtifact.Value, _objectToLoad);
USD.LoadState();

Simply generate a copy of the USD and give it a go! This will read from shared artifacts between the behaviors that are creating these classes and that results in us never losing sync between our savers and loaders. It also means they don't have to be one monolithic class. You might say "Well, Oafkad, why is your Utility a monolithic class?" To that I say, its been a long month.

But also its still a pretty defined operation that doesn't require a lot of different events and communications with the outside world. The same is not true of the behaviors that are saving and loading. Those have a lot of moving parts outside of themselves and I want them to be simple and contained.

Plus I think this utility is darn near feature complete for now. We'll see as I use it!

We've got our savers and loaders setup in the scene for the main menu. So the next time I'm developing I'll need to hook those up to their neighbors. The loading system will be what determines if continue is clickable (and indeed what you see after you click it). The saving will be called by the player submission request, and following that save succeeding we'll transfer into the introduction of the game.

It's been a long and slow road for a month or two here, but I can see some level of progress on the horizon.

The Back

I'm a little bummed that I don't have a lot of mental energy lately. Which itself kind of feeds back into the problem where you are constantly in recovery mode. This does mean that doing work outside of work gets harder and harder. That's especially bad because then I end up feeling more tightly bound to work as that's the source of my income, and thus the few freedoms you can manage as an adult. But the more that happens then the harder it is to shut off from work and the cycle repeats.

I'm hoping that as I get back into fitness this will become less and less of a problem. I can already tell that the muscle soreness from my last routine has given me a bit more pep in my mental step. That might sound weird, I know a lot of people don't like to be sore, but I generally like it when I know why it happened. Soreness tells me that I really gave it my all with whatever I was doing.

And yet I hate headaches, so perhaps not all soreness is equal.

I'm going to probably get back into posting on my YT channel soon. Not because I expect anyone to watch but because that also makes me feel better. We'll have raw videos of gameplay, development, and fitness. Like these front and back posts, if any of it appeals to you, please check it out, but if none of it does that's fine too. The internet is a dark and scary place, and if I'm not able to give you a bit of levity then that's fine. We all gotta find what works for us.

Maybe after tomorrows workout I'll include what I did in the backend of the update for the day.

Link to comment
Share on other sites

×
×
  • Create New...