Search Unity

Database Suggestion

Discussion in 'Game Design' started by unity_3PDN9CO05zAITQ, Jan 22, 2019.

  1. unity_3PDN9CO05zAITQ

    unity_3PDN9CO05zAITQ

    Joined:
    Jan 22, 2019
    Posts:
    5
    Good day fellow creators!

    Our team is on a school project of creating a mini android mobile RPG, however we don't know how we can create Database for Users. If you are familiar with Plants Vs Zombies, you can play it offline and still have ability to create a new user, save its progress or load a different user. We are open to using any third-party softwares so long they have free version, lol.

    Thank you in advance!
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,508
    JoeStrout likes this.
  3. martinasenovdev

    martinasenovdev

    Joined:
    May 7, 2017
    Posts:
    64
    Couple of possibilities:
    1. Server database. This requires a server and running some free database (such as MySQL, Postgres, etc). That way any client started anywhere will be able to fetch or switch to any given user and any user can be persisted to the database. Unfortunately this scenario also requires an application server to handle the data and persist to the database. This is the the most complex but offers the greatest flexibility and progress/users data can be hardly lost.
    2. PlayerPrefs - there is a class in Unity to set floats, booleans, ints and strings to a local storage on whatever device is running your application. I use it for lots of things and it is good enough for just client side data. Also you need to know same data can't be replicated on multiple devices with this method, it is just on the device it was stored. So saving a user on device 1 and then loading it on device 2 is not good with this method.
    3. Saving file on disk - you can manually create files on the disk and write in them, but I don't recommend it. It is much more complex and error prone than PlayerPrefs.
     
  4. TenKHoursDev

    TenKHoursDev

    Joined:
    Nov 9, 2014
    Posts:
    1,040
    If you really need a database try Firebase. It can use many different forms of authentication including Google, & Facebook.Its pretty easy to set up too. Its free.