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

  1. Research ways of implementing data sets for weapons, enemies, and player stats into unity
  2. Create scripts to determine whether I could call from a JSON or CSV file
  3. 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

Tasks undertaken

  1. Research into JSON, CSV, and XML implementation in Unity (2 hours)
  2. Attempted tutorials (1 hour)
  3. Create JSON and CSV files (45 mins)
  4. 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)
  5. 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.

Leave a comment

Log in with itch.io to leave a comment.