Hi guys,
Currently I am working on a simple casual game that I want to test with an online function. The game is played individually and is based on a singleplayer game (as there is no direct contact between players in terms of gameplay. Players cannot influence each others game).
A player plays a game (based on a specific gameseed) and sets an individual score. Another player can then play the same game (with the same gameseed) and in the end both scores will be compared. The way the online multiplayer works is very similar to Wordfeud (aside from the part in which both players influence the same game). The basic idea is as follows:
- Player starts and finishes an individual game (and sets a score)
- Game (stats / settings) gets queued in a public gamelist.
- Other (random) player starts a game and gets the first game (settings / gameseed) in the public gamelist.
- Other (random) player gets the same game (gameseed) as player.
- Both set a score, scores get compared, win/loss is distributed.
There are a few little variations on this principle (i.e. when a player challenges another player), but this is the basic premise.
I’ve been looking into this for a few days now (dev-time is limited, so I don’t want to try out five different solutions), and the best (suggested) way is to have a database (MYSQL) for the public gamelist (and players and chat / stats / etc) and let the game do basic calls to and from this database (through PHP for example). I too see this as the most viable option, however, I really have no proper experience with building an PHP interface or the time and resources for maintaining a dedicated server. I’d rather use something out-of-the-box.
I’ve experimented with Photon and this worked within 5 minutes, however it did not provide a logical way to tacle my problem (Photon works with rooms and is mostly for real-time connection).
My question is: is there an out-of-the box solution for my (simple) problem? I’ve seen a lot of solutions so far, but I can’t really see the forest from the trees anymore.
Attatched some visuals of my needed data-flow (in links cause images are rather large in dimensions):
http://oneuppedgames.com/unity/1.-populate-game-data-from-server.png
http://oneuppedgames.com/unity/2.-player-starts-a-random-game.png
http://oneuppedgames.com/unity/2a.-run-new-public-game.png
http://oneuppedgames.com/unity/2b.-run-existing-public-game.png
http://oneuppedgames.com/unity/3.-player-starts-new-versus-game.png
http://oneuppedgames.com/unity/4.-a-game-gets-finished.png