Search Unity

Data collection help

Discussion in 'Multiplayer' started by HelloJinxie, Dec 5, 2019.

  1. HelloJinxie

    HelloJinxie

    Joined:
    Nov 7, 2019
    Posts:
    20
    I was considering creating a MySQL server to collect data (win rates, pick rates etc.)
    I wondering if this would be easy and how would I go about doing it?
     
  2. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Your question is too generic. "Easy" is relative to how much experience you have with something. If you have never touched MySQL it will take time to learn how to use a relational DB and integrate it in your game. You also need a server side application that will sit in between your game client and the DB, maybe built in PHP, C# or similar.

    The alternative would be to look into a BaaS service such as GameSparks or equivalent, to avoid spreading yourself too thin while also developing the game.
     
    Joe-Censored likes this.
  3. HelloJinxie

    HelloJinxie

    Joined:
    Nov 7, 2019
    Posts:
    20
    I have SQL experience but only in UE4. I have no idea how its done in Unity
     
  4. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    SQL is the query language. You want a server to send SQL queries.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The typical approach to using MySQL with a Unity project is to use a PHP web server front end and UnityWebRequest to talk to this front end. If you understand SQL queries, the PHP language, how to defend a database against unintended access and threats like SQL injection, and how to make web requests, then this solution is probably pretty easy and even bordering on trivial. If you have to learn all that first, then I'd say it is not so easy.

    It is also not a good idea to have client devices directly talk to your PHP front end, especially if you're doing writes to the DB, because it just opens up the potential to exploit your DB significantly. Capturing web requests made to the web server is pretty trivial, and modifying them in transit or even just banging on your web server in a browser is pretty easy. So have some other server your client device talks to instead of talking directly to the web server.