RTS Save/Load
Hello, I wish to save the current level state using serialization.
I have watched Brackeys tutorial (https://www.youtube.com/watch?v=XOjd_qU2Ido) and can get it to work fine for one object but surely creating new save files for EVERY unit isn't the answer?
I'm making an RTS with possibly hundreds of units - how do I go about saving and loading all of that information? Obviously when loading the data, the enemies will not even be in the scene... Any help would be greatly appreciated.
public class EnemyData { float enemyTypeID, positionX, positionZ, rotationY, hitpoints; string currentTarget; }
Answer by Javey · Nov 29, 2019 at 09:07 AM
This tut may help you. https://www.youtube.com/watch?v=TdWNJFuSboQ It uses playerprefs to save objects in scenes.
A simple idea is building Lists to store all units' data for each factions.
Your answer
Follow this Question
Related Questions
Can't figure out how to serialize my save data... 1 Answer
Serializing name of the current level 1 Answer
Looking for a more efficient method of saving for mobile game. 0 Answers
How to Serialize or Save a List of GameObjects 1 Answer
.data serialize and deserialize work in editor but not in build 1 Answer