October 5th, 2011, 05:53 AM
Is this the right architecture for our MMORPG mobile game?
These days I am trying to design architecture of a new MMORPG mobile game for my company. This game is similar to Mafia Wars, iMobsters, or RISK. Basic idea is to prepare an army to battle your opponents (online users).
Although I have previously worked on multiple mobile apps but this is something new to me.
We have decided to go with client-server model. There will be a centralized database on server. Each client will have its own local database which will remain in sync with server. This database acts as a cache for storing things that do not change frequently e.g. maps, products, inventory etc.
With this model in place, I am not sure how to tackle following issues:
- What would be the best way of synchronizing server and client databases?
- Should an event get saved to local DB before updating it to server? What if app terminates for some reason before saving changes to centralized DB?
- Will simple HTTP requests serve the purpose of synchronization?
- How to know which users are currently logged in? (One way could be to have client keep on sending a request to server after every x minutes to notify that it is active. Otherwise consider a client inactive).
- Are client side validations enough? If not, how to revert an action if server does not validate something?
I am not sure if this is an efficient solution and how it will scale. I would really appreciate if people who have already worked on such apps can share their experiences which might help me to come up with something better. Thanks in advance.
Client-side is implemented in C++ game engine called marmalade. This is a cross platform game engine which means you can run your app on all major mobile OS. We certainly can achieve threading and which is also illustrated in my flow diagram. I am planning to use MySQL for server and SQLite for client.
This is not a turn based game so there is not much interaction with other players. Server will provide a list of online players and you can battle them by clicking battle button and after some animation, result will be announced.
October 5th, 2011, 07:10 AM
I'm moving the thread to the lounge as it covers a number of areas and that's a place were people from all the other sub forums hang out. I'll leave a redirect in Project Help Wanted so you get people from there as well.
Quis custodiet ipsos custodes?
October 7th, 2011, 07:47 AM
I would say the 'best' model is probably that employed by the most successful MMORPG of all time: WoW.
- The client's resources include everything from item models / textures to the full game world, map, characters, everything
- The server maintains a database of characters and their progression (level, inventory, location, etc.)
- The character database fields are updated either instantly (location, level up, etc.), on user request (i.e. .save), or after a fixed time period according to network capability (every second, minute, etc.)
- Communication between the client and server is encrypted
- If the app terminates, the user may lose up to one second / minute of progress, depending on how often the client auto-updates the server with various activities
What you are describing won't need anywhere near the same level of sophistication as a full-blown PC / console MMORPG, but the same basic model stands.
October 7th, 2011, 08:08 AM
Originally Posted by Woohoooooo