Jump to content

  • Log In with Google      Sign In   
  • Create Account

Network architecture discussion for a mobile game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Spidyy   Members   -  Reputation: 180

Like
0Likes
Like

Posted 11 February 2013 - 08:56 PM

Hello everybody.

 

I'm working at this time on a personal multiplayer android game project, involving robot battle like the ones in animes. It is a work on at least 1 year for commercial purpose.

 

I'm writting most of the compoung of the game, inspiring from irrlicht for the 3D part, SFML for the system and network part and I'll use FMOD for sounds and Bullet for physics.

 

My concern here is for the network part. I didn't made any MP game on my own, but I got solid concept and ideas from my previous job in a game company.

 

The plan!

 

Here is what I've planned so far for networking :

 

I'll have 4 entities to manage in my architecture :

- Multiple game clients

- Multiple dedicated server instances

- One master server

- One database (with timed backups)

 

I planned to manage the game like World of tanks, meaning :

- Each client only display the game in its current state and send player inputs.

- Each dedicated server manage physics, game states and player input altogether.

- Each dedicated server send resulting game states to the client on regular basis and more immediate game events (death, shots, impact, end game)

 

World of tanks is a PC game and allow 30 player by match, I'll restrict my game to 8 player per match to reducec networking traffic and CPU usage of the devices.

 

The master server will manage the client to dedicated server connection and usage, game statistics and player accounts.

 

The database will store the player accounts, match result and player assets as robots frame and customisation.

 

Now what?

 

I have my plan, but how to put it to use?

 

My issue is, I have no solid server-side knowledges to construct all this. I can't even know if my idea is viable, so here I come :

 

I want to know : Do you have some good books, tutorials or examples about the kind of architecture I'm doing? I don't even know how I'll implement the dedicated server instanciation, connection and run from the master server. :/

 

I want to expect : What kind of issue I should face with this kind of architecture? Do you have some technical numbers to share, like an acceptable amount of data to transit from the mobile device to the server? Among this number, what can 3G support? What can Wi-fi support?

 

I want to do : To send all the data, I'll need a solid contract with some network provider for a good bandwidth, but what about the server itself? Would it be better to buy my own rack so I can act directly on it, or should it be better to rent a server in a profesionnal company with all the technical support? Also, what about the database? What would be a good RDBM, good to manage thousands of account, assets and stuff with good security without using too complicated SQL request?

 

I want to... Know more! : If you have had an experience like this, would you give me some more advices on aspects I didn't mentionned yet?

 

With regards,

Spidyy


Edited by Spidyy, 11 February 2013 - 09:05 PM.


Sponsor:

#2 hplus0603   Moderators   -  Reputation: 5309

Like
0Likes
Like

Posted 12 February 2013 - 03:03 PM

There is no comprehensive tell-all bible of networked game server development. If you want to reduce risk, you have to hire people who have done it before. There are lots of bits and pieces documented around the web, and the forum FAQ has pointers to many of them.
Beware, though, that there are different kinds of games where different solutions work variously well. What works for a real-time strategy might suck for a FPS. What's good for an FPS may be way too expensive for a RPG. What's suitable for an RPG is probably not what you want for a turn-based game. Etc.

Six players per server process sounds like you'll need a lot of server processes. Do you know what the hosting cost of a server process is? Do the economics of your game pencil out? Or will you use player-hosted servers?
enum Bool { True, False, FileNotFound };

#3 Spidyy   Members   -  Reputation: 180

Like
0Likes
Like

Posted 12 February 2013 - 03:50 PM

I understand I can't have an all cooked solution right now, that's why I ask so many question. tongue.png

 

The game is closer of an FPS game type, as you will have multiple actor shooting at each other and fighting for goals or objectives. Bullets will be manages as dynamic object, not as a simple raycast like most of the Call of Duty games.

 

I want the game logic to be computed on an owned server to reduce cheat tendencies more easily, so no player hosting, or only as a LAN using one of the players' devices. Max 8 player by game.

 

when I'm speaking about instances, if one process can be used for several games at once, I can tend to this solution.

 

Oh yeah, to be understanded well :

8 players will play a match,

each match will be hosted on a distant server owned by myself or rented.

the server will have to manage multiple match including collission and physics computation.

One match will be managed as a process on the server, that's what I named dedicated server upward.

 

So to be clear, by dedicated server, I was speaking about multiple program instances running on at least one physical server.

 

The master server is also one huge program having the role of an interface between the database, the clients and the match process.

 

I don't have any economic information right now. I just know I'll need at least two server (one master and at least one for match instances), but I might have some funds to invest in server hardware.


Edited by Spidyy, 12 February 2013 - 03:52 PM.


#4 Spidyy   Members   -  Reputation: 180

Like
0Likes
Like

Posted 12 February 2013 - 04:12 PM

I made a little diagram to illustrate all this :

 

Deployment.png



#5 hplus0603   Moderators   -  Reputation: 5309

Like
0Likes
Like

Posted 12 February 2013 - 10:13 PM

...
The master server is also one huge program having the role of an interface between the database, the clients and the match process.
...

The entire architecture sounds reasonable, as far as it goes. It's the same kinds of large pieces that many other, successful games have used.
The devil is in the details, though :-)
enum Bool { True, False, FileNotFound };

#6 Spidyy   Members   -  Reputation: 180

Like
0Likes
Like

Posted 13 February 2013 - 09:49 PM

So let's go in the details.

 

First, quid of the OS. Right now, I'm setting up a netbook as a test server by installing linux ubuntu 12.10 desktop on it. I'll use a linux server, but what distribution should I use for the real thing? I readed that Debian based distribution are particularly good for game server, but it there a more specialized distribution for this?

 

Also, about the RDBM, I don't know wich one to chose. I'll need a secure and relatively fast for small table count and thousands of items (player accounts, usable items, statistics and achievements) I saw about PostgreSQL and SQLite, but I don't have a clue about wich one would be the most suitable. :/ Of course, I need it free for a start.


Edited by Spidyy, 13 February 2013 - 09:50 PM.


#7 hplus0603   Moderators   -  Reputation: 5309

Like
0Likes
Like

Posted 14 February 2013 - 01:58 PM

what distribution should I use for the real thing

Any distribution you are familiar with. We use Ubuntu at work. I use Arch at home. Some people like Red Hat. Others like Gentoo.
A distribution that has a "server" install that doesn't install an X server and desktop environment might be a slight improvement mainly because it gives you more options for server hardware out of the box.

about the RDBM, I don't know wich one to chose

SQLite is a single-user database. It falls over in a multi-user or networked environment, even if you funnel all requests through a single access point.
PostgreSQL or MySQL are both fine at this point. PostgreSQL is a little more "correct" and MySQL is a little more "fast" but the difference isn't huge these days.
"thousands" of items is not a problem. Our biggest MySQL table at work has almost a billion rows (!)

Note that your security should be enforced at the application/game server layer. You should never let a client talk directly to a data store of any kind except for trivial cases where documents like binary assets can be fetched read-only by anybody. A SQL database is never a trivial case :-)
enum Bool { True, False, FileNotFound };

#8 Spidyy   Members   -  Reputation: 180

Like
0Likes
Like

Posted 14 February 2013 - 10:31 PM

You should never let a client talk directly to a data store of any kind except for trivial cases where documents like binary assets can be fetched read-only by anybody. A SQL database is never a trivial case :-)

 

Of course, I already planned to allow network communication only through small custom messages between client and server with encryption for critical data ( player's login/password for game connection...)

 

I'm glad I asked about SQLite, I was about to go for this one. :x If MySQL can manage billion rows easily, I'll go for the "correct" aspect of PostgreSQL. I could have used phpMySQL for database management, but I won't install an apache server or whatsoever and I want to minimize the access solutions to avoid leakage.

 

All that's left to search is how I'll program the server process instantiation to be able to manage the different dedicated server process from the main server application. :]

 

Thanks a lot for all those useful informations!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS