Halo forums!
I got some questions about multiplayer setup and hoping someone experienced with the different solutions can confirm some things.
(HEADS UP: This is NOT an MMORPG!!)
So I have a multiplayer game built with PUN, and just decided to remake it. I’m still on the move often so it’ll have to wait before I can get on it again. For now I’m still planning the whole design because I can’t sit still until I know at least which BaaS to use and what not.
One of the main reason for the remake is it’s currently fast-paced, and together with the “Geo Data” (explained below), the network part gets too complicated. So “Fast-paced” will have to be dropped.
Right now I’m leaning towards GameSparks for the backend including storage/database/server side, and wondering if I should still use PUN for the realtime part. For GS’s database, I’m still not 100% if global game data can be saved/updated often. I mostly see PlayerData.
Game is kinda real time (“turns” are per second, so a user will contribute a packet that has to be decided before each second, otherwise he’s idle for that second).
It’s grid based so like FinalFantasy Tactics/turn based RPG. It needs 2 tables: 1 for items/player skill objects/traps that remains in the room, and the Geo Data.
http://www.jgallant.com/2d-liquid-simulator-with-cellular-automaton-in-unity/
The “Geo Data” is just array of 6 int, 0 to 10. Grid res will be at least 10x10 and up to 200x200.
Game simulation will be deterministic, so any client will be given the current total stage data, then simulate the “flows” of each grid, like so but 1 iteration/second instead of 20 or more. Yes things will feel pretty slow at first:
Other player’s contribution to the stage will be calculated on top of the deterministic simulation
Player input in the room are time stamped so if there’s a user that sent a VALID action for a previous turn but late due to latency or unsync’d clock, other users can “roll back” a few turns and insert that input there and fast forward again.
This is basicly networked deterministic Physics design, but just making it per second.
Extra:
PUN cloud has MasterClient model but still got host in certain regions. GameSparks is similar?
Anyways, I do plan to make just 1 single world instance where all the players meet, but this “Room” will have a player limit.
Any extra player trying to join can open the game scene and just receive the active player’s input to be applied in their local client (so, watching a game room basicly).
But there’s no point limiting the amount of player to, say 10 at any given time, in this single room.
So I guess players making their own room and fill it up with other players and play is also possible (it’s what PUN and GS provides).
But what’s important is the MAIN room will have its game stage data always updated, and any other “BRANCH” room will start the grid’s parameters referring to how the MAIN was, last seen by any player.
PUN’s “MasterClient” stuff means a session is Live when at least 1 player is in the room, and this is fine. As long as the snapshot of the MAIN gets saved before every player logs out, so the next player can fetch the last state and continue.
So based on some of these network sides, what should I use? Only GameSparks + their RT?
The “1 player input packet per second” is gonna be small, but not as often as REAL real time.
I don’t have problem implementing something like this with just PUN, but because the MAIN room’s grid will need to be referred by players creating their own room, the MAIN’s grid data will have to be accessible in GS’ Database.
Therefore, should I make each client write to this grid data per second?
I did check about the data persistence, and wondering which one to use in this case
https://docs.gamesparks.com/tutorials/database-access-and-cloud-storage/managing-data-persistence.html
Perhaps redis (fast small data), and then every 10 moves, write to runtime collection? And so every player(in the Main room and in the lobby) will read that upon initialization.
Since I’ve never tried GS, the way I’d do this with what I know now is just use SQL for the MAIN’s grid, update every 10 secs. I don’t even need GS if not for the database. All the account system and all that, I wasn’t planning to have real accounts like that.
Currently 1 computer == 1 account and saved in playerPref and that works just fine.
I don’t need complex account data/inventory (a game session is like chess, and if you log out as long as the “generation” of the MAIN room is still the same as your last saved session, you can continue the character. Otherwise start from lv 1). In terms of account and keeping track of who you are, this game’s super casual.
So I’m wondering if this whole concept is doable (should be…) and which of the available BaaS and/or real time solution to use. Or perhaps setting up own free database is a better choice? And I’m not only looking for free solutions.
Cheers, would appreciate the feedback!