- Home /
Saving gameobjects' properties for Dynamically growing prefabs
I intend to create a Scenario where the User can actually decorate his or her Park using Unity3d. This is what I need - 1. user selects the objects which he wants - tractor,benches,chairs, ponds etc. 2. he places them across the screen in any position. 3. The user then presses the Save button which would store the gameobjects and their locations online in MySql database. 4. When the user opens the app again, it will load his park exactly like how he left it.
I have looked into every Wiki and Thread Posts which are used for Dynamically loading the position and properties of the gameobjects. I figured out that I can actually store the data of each gameobject in MySql and then convert them into XML file. I can then read the XML file using the Code posted in Wiki.
But this is enough if the data stored is not too large or if the number of gameobjects are fixed. The problem is the number of gameobjects will be increasing tremendously over the age and I am looking out for a solution to actually build a game such that I can link the prefabs as new objects are added.
Will these tools help me with what I need. If not, please let me know why -
Asset Server - I am still trying to figure out what it does and if it will help me out. EZ Game Saver - This saves the player profile. but will it save the properties of each and every object that gets loaded?
Also for the Mysql/XML solution - I have trouble generating the XML and reading it online using the current Wiki for XML. Should I instead use the WWW tag to download the XML and then load the gameobjects on the screen? Is there a better solution as I feel eventually the server may run out of memory.
Thanks.
does you find anything on this subject?
the thing about reading from your database and then start building a runin scene?
Answer by Tetrad · Jul 12, 2010 at 10:51 PM
Asset Server is only for version control/source control of your project. It doesn't really have anything to do with the back end.
Also you don't necessarily need to use XML. There are other ways of serializing your data. For example, you could set up some table where each prefab has a unique ID, and then write to a binary stream the ID of the prefab, the x/y/z of the position, and the x/y/z/w of the rotation. Then store that as a binary blob in your database.
Your answer
Follow this Question
Related Questions
Avoid altering prefab at runtime 1 Answer
Creating/Saving prefabs during runtime? 7 Answers
Questions about XML save/load 0 Answers
XmlException: unexpected end of file. Current depth 1 Answer
create prefab at runtime 0 Answers