Elaborate Saving System with Blueprints
I have halted work on my prized project because I can't figure out a few things. This may get lengthy, so thank you in advance to all of those who listen to the end :)
I feel that progression should include every aspect of the class of items you are focusing on, and I also feel that progression should be differentiated from item to item and class to class. This is very difficult to achieve, but it is fun for me and has been a wild ride of learning more and more about Unreal every day.
The system that I already have is this: Each weapon is created under a parent Actor Class called "Weapon Master". Each child I create for each weapon is titled "Weapon_[Weapon Name]" for easy organization and access. When a bullet is fired, it creates a physical bullet and sets all of its damage, speed, rotation, and so much more on Begin Play by casting to the bullet. This way, all values are controlled by the weapon, and the weapon changes the bullets with that information. Each bullet can have its own settings different from the previous fired. Having physical bullets allows for easy access for damage types like Flare, Poisoning, Bleeding, and more, and you can easily control if bullets have cameras and can be controlled or not. The weapon houses variables, the following being only some: Clip Current, Clip Capacity, Reload Speed, Damage, Damage Boost, Accuracy, Range, Fire Rate, Bullet Speed, Weight, Rarity, Bleed Chance, Bleed Damage, Bleed Duration, Firing Mode, Round Burst, Firing Mode, Bullet Type, Weapon Type, Weapon Class, Weapon Enhancements (Array of Available upgrades for weapon to be listed in Weapon UI), Fatal Blow Chance, and literally almost 100 more and more yet to come.
The weapons save the same as the player, in their own individual save file in the SaveGames folder. Here are the main issues with this: Buildables, Craftables, Chests, Players, and everything else saves this way, so you wind up having 40 to 200 save files in 40 minutes of gameplay. The system works amazing, and it really has allowed me some headway, and with what I have seen I know that it is possible to do with the right knowledge of BP, Functions, and Macros. The Load this and Save that gets a bit grueling to keep track of this way. I also feel as though eventually, these save files will grow to be so many, that it will slow the game down or take up unnecessary space on the users computer; neither of these outcomes are alright. There are RPG games with Slotted weapons that can be upgraded or broken down, and they save like this. My question is, how do I get started in the right direction to get a system crafted that will alow me to save so many different values within one or very few files and not become limited by any walls or barriers that I don't have now. Of course how I am doing it isn't picking daisies, but I don't expect the result of this question to be any easier. I am up for a challenge, and I would really like to get this system working so I can continue work on my game, and finish work on a game I am now currently working on, an FPS style Tower Defense.
Again, thank you in advance for any help!
EDIT: I am also using customized Components to do Health and Shield, Stamina and Energy, Currency, and Progression.
There are alternatives to Unreal's save object system. You could store it in a JSON string or a SQLite database for example, but you'll have to use plugins or roll your own with a lot of the alternatives.
In a game I made using another engine, I saved everything using SQLite queries.
I believe Unreal also has a built-in way to manage .ini files for saving data about multiple objects within the same file. Something like "configuration variables" or something like that.
On the other hand you could continue using the same save object system and just pack the info differently so it all lands in the same file.
In order to actually reduce the space taken, and not just the number of files though, you'll have to see if there's anything being duplicated across files without need.
If you are trying to keep track of every individual crafted thing, you might be doing the best thing possible already, as long as you're not tracking individual instances (that would be duplicating without need, unless each instance can change and needs to remember how it changed).
There might be a more compact format or structure possible but I'm not sure how your save files look.
answered May 02 '18 at 05:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here