Search Unity

Third Party Using a database with photon: Suggestions/docs?

Discussion in 'Multiplayer' started by MTracerStudios, Sep 1, 2011.

  1. MTracerStudios

    MTracerStudios

    Joined:
    Aug 24, 2010
    Posts:
    118
    I know what a database is, (table based system of storing information, generally optimized for industrial performance) but I don't know the basics of using one. I'm of the believe that while learning through mistakes is good, life's to short to make all the mistakes yourself. I don't want to start using a database backend that looks good at first sight, then turns out to be hard to understand and integrate. If you have suggestions as to which database backend would be most n00b friendly, please tell me.

    PS: I KNOW that there is no one click solution, but some solutions are easier/more painless/cheaper than others, please try to help.
     
  2. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    What do you want to use the database for?
     
  3. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    mysql is free and well documented, i don't know of any good tutorials on how to use it but it's very simple.
    if you also install phpmyadmin which is a web based management tool for the database you will learn how it works very fast.
     
  4. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Indeed... mysql, php, phpmyadmin and the WWW class in Unity are the way to go. If you don't have a LAMP stack webserver, you can download xampp for free to get started in a test environment.
     
  5. MTracerStudios

    MTracerStudios

    Joined:
    Aug 24, 2010
    Posts:
    118
    K, I should probably say some things here:

    My game is going to be match based, fully authoritative, with the match logic being handled completely server side, bandwidth wise it's a top-down action game, probably aimed at a smallish user base. I've started with photon but to be honest it's a pain in the butt. Should I be using Photon, Electro, SmartFox, or raknet? You guys seem to say raknet... is that actually what I should do? Thx...
     
  6. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    The room/room listing (matches) stuff for most of the middleware solutions is handled by the middleware, so you don't need a database for that.
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Photon LiteLobby actually does it basically out of the box

    Even more so if you use the new Photon 3 "Unity Networking" layer which works a lot like unity networking with Photon as "relay server" that removes any need for NAT Punchthrough etc.
    It has the concept of rooms too
     
  8. MTracerStudios

    MTracerStudios

    Joined:
    Aug 24, 2010
    Posts:
    118
    I'm not worried about rooms, I know that photon will do that, my question about raknet/photon was concerning performance. And I know I don't need a database for lobbies, there's other things in the game that will use the database.
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    well generally there is no database thats noob friendly, thats by definition a given thing as relational data modelling and querying is no beginner topic at all.

    For a beginner its impossible to "crap it" due to the database technology used so you can basically go with what you get in easiest. Due to licensing likely MySQL cause MSSQL and Oracle are in a price range where Photon is nothing ;)

    As for "crapping it" performance wise: the chances is significantly higher that you crap it cause the database isn't designed well or cause your queries are horrible in what they do / how they do it than that the database performance itself is responsible for it
     
  10. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    In that case, you can probably use anything you like. MSsql and other professional DBs are just that: professional. For thousands and millions of entries.

    In your case, i'd say the DB itself is less important than the "Abstraction Layer". This is what lets you use the DB, access the data. With those and a DB administration tool, you can more or less avoid learning SQL, if you want to. In C# we used Lightspeed from Mindscape. There's subsonic and nhibernate.

    For smaller projects, you should also look into Document Oriented Databases. These are simple to grasp, I'd say and probably don't need a abstraction. You just save your player data under some id. Make that the username and you're fine.
     
  11. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    I use mongodb :)