Unity and JSON 2
Introduction
For the second sprint of our class project, I was tasked with continuing my work in creating data sets. Finding a method of storing a large set of stats/ data would be vital in this project that has the potential to contain several enemies and weapons. This involved a lot of research looking at different formats used to store data sets beyond the capabilities of the simple script I had created in sprint 1. Some of the formats that were suggested on Unity forums included JSON, CSV, and XML. I found multiple tutorials relating to each, however, I had difficulty finding tutorials relating to my goals. I decided to set up my 3 data sets in both a CSV and JSON format, and I will continue next sprint to try to get my scripts communicating with one of them, likely JSON. These data sets include 2 enemies, 7 weapons, and player stats: these sets have been filled with fields such as damage and health; only the bare necessities in order to keep scope down, at least for now.
Goals
- Research ways of implementing data sets for weapons, enemies, and player stats into unity
- Create scripts to determine whether I could call from a JSON or CSV file
- Have those scripts communicate with each other (eg. Calling upon a certain damage stat from a specific weapon that would apply damage to an enemy’s health)
Personnel
- Primary – Jed May
Technologies, tools, and resources used
- https://forum.unity.com/threads/how-do-you-store-game-data-damage-spell-data-etc.67332/
- https://dungeonsiege.fandom.com/wiki/Sword_List_(DS1)
- https://www.youtube.com/watch?v=OyQQ-7-22Hw
- https://docs.unity3d.com/ScriptReference/JsonUtility.html
- https://docs.unity3d.com/Manual/JSONSerialization.html
- https://forum.unity.com/threads/how-parse-json-data-in-unity-in-c.383804/
- https://answers.unity.com/questions/1473952/how-to-write-and-read-json-in-unity.html
Tasks undertaken
- Research into JSON, CSV, and XML implementation in Unity (2 hours)
- Attempted tutorials (1 hour)
- Create JSON and CSV files (45 mins)
- Created initial script that contains fields that will be filled from the JSON by selecting an ID number on whatever game object the script is applied to (45 mins)
- Create dev log update (30 mins)
What we found out
The tutorials and suggestions I found online lead in me in several different directions, I would start some tutorials only to realise that they weren’t what I was after mid-way through, leaving me with a half finished script that I didn’t know what it meant. So I decided to start back at the basics with what I did know, building it one step at a time. I’ve found the Unity API an extremely useful asset in what little I have scripted so far and will continue using it when I need to get something functioning.
Open issues/ risks
As said above, using tutorials lead to more confusion than solutions.
Recommendations
Continue using Unity API when moving forward as I continue to work on data sets next week.
SGD300 Dungeon Siege project
Status | Prototype |
Category | Assets |
Author | RevampedCobra73 |
Genre | Action, Adventure |
More posts
- Recreating Dungeon Siege opening cutsceneSep 25, 2019
- Polishing Unity cinematicsSep 19, 2019
- UI elements in Unity cinematicsSep 11, 2019
- Fixing Json and introduction to Unity cinematicsSep 04, 2019
- JsonUtilityAug 28, 2019
- LitJSONAug 21, 2019
- Unity and JSONAug 07, 2019
Leave a comment
Log in with itch.io to leave a comment.