• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Vincent_M

Hosting Online Game

10 posts in this topic

I've got a few years of experience with the fundamentals of the BSD socket API, and LAMP servers in general. It really interests me, and I've built some little "online game" projects. With that said, if I wanted to build a matchmaking server for a game I'm working on, I'd probably build the matchmaking server as a daemon in C using BSD sockets on my configured LAMP server, then use Apache + PHP to form a login system for my game client to allow players to log into their accounts that are stored on a MySQL database. This is what I've done in the past for school projects, and one game I launched years ago.

 

Now, assuming that this is a practical approach, what would be a decent service for hosting my matchmaking server publicly? I'm thinking that a cloud service would be best where I have access to my own virtual machine. Once the VM's hardware specs are defined, I'd set it up as a LAMP server, upload my production build of my matchmaking server, as well as the the database and PHP scripts.

 

Does anyone have any recommendations for a cheap-ish cloud-based solution where I'd have access to my own VM?

0

Share this post


Link to post
Share on other sites

I'm also currently comparing host services for a matchmaking server. So far I've looked at Amazon EC2, Google AppEngine and some local cloud provides. Pricing is highly dependent on CPU, memory, and bandwidth needs, and I'm not able to compute costs yet because I'm still deciding what needs to be done on the server and what can by done by the clients or using a peer-to-peer scheme. AppEngine seems simpler to use (no OS admin), but doesn't allow UDP servers (yet?). Amazon has a lot of nice extra services, like database and storage services, that can potentially make the solution more scalable (but the pricing gets more complicated). The local cloud providers simply give you a virtual server and a some virtual storage for a fixed monthly fee.

 

So no conclusions yet, I will have to continue working out the architecture before I decide.

1

Share this post


Link to post
Share on other sites
I was also in the same situation as you are now. I also checked what Amazon and others are offering. It doesn't work for me because figuring out what my expenses will be is really messy, impossible to predict at my current development state.
 
Right now I'm using Gamedonia, a cloud service for game development. I contacted them via email and they granted me access to their beta matchmaking based on an ELO system. It was easy to integrate it in my game.
 
Their pricing is independent from API requests and other variables. It's free to use during development, so it fits perfectly my current needs.
0

Share this post


Link to post
Share on other sites

Amazon has lots of services that can make development and management convenient. Amazon can also get very expensive in a hurry if you're not paying attention.

 

If you're building most things yourself (and using open source for the rest) then the simplest option is likely a simple virtual private server to host things on. $6/month from www.interserver.net is a good candidate (there are others, including linode, dreamhost, Amazon micro instances, etc -- verify how much you'll be paying for bandwidth in addition to the server!)

1

Share this post


Link to post
Share on other sites

I've looked at Amazon and Rackspace before posting, but hplus0603 has given me some great leads I'd like to check out! Amazon looks like it's got quite a bit of tools, but I'm pretty new at this, and it'd be way too much tech to start out with. Especially since it looks like pricing can be high and complicated to figure out.

 

Felix brought up a really good point about CPU and memory. I could predict how much memory would be needed based on connections (typically program overhead + approximately 48 bytes per connection), but then there's the CPU... Also, how would cloud systems handle thousands of connections. Say, 10,000 users were connected to my VM on the cloud, and I'm iterating through them constantly trying to create matches, then idling when there are none, how does VM manage so many connections at once? I understand that each connection would have its own socket handle, but how would the virtual network card/OS stack up against so many connections with a VM cloud environment? I'd think it'd do better than a bare-metal server sitting in my room lol.

 

Would Ubuntu Server or Free BSD be the way to go for my VM's OS? Btw, I checked out www.interserver.net, and it's looking pretty good to me. Will I have full access to my VM so I could build and run software on it, configure a LAMP server, etc? I noticed that it mentioned you could install dashboards like cPanel on it, but it looks optional.

0

Share this post


Link to post
Share on other sites


Would Ubuntu Server or Free BSD be the way to go for my VM's OS?

 

Most providers providers give you full control to configure and build the OS as you please. Amazons own Linux image seems based on Red Hat, I think I would go with that one if I would choose Amazon. So I'm currently experimenting with a CentOS setup in VMware. OTOH, choosing another distro doesn't seem like a big deal, more a matter of taste.

0

Share this post


Link to post
Share on other sites

Say, 10,000 users were connected to my VM on the cloud, and I'm iterating through them constantly trying to create matches, then idling when there are none, how does VM manage so many connections at once?


In general, the guest OS uses a paravirtualized bridge device, which then talks to the host hardware device. In proper implementations, there is negligible overhead compared to using the raw hardware directly. I can't guarantee that all VM hosts in the world are properly implemented/configured, but I have personally not found a problem with this.

Also, 10,000 connections is not terribly much for a modern CPU / OS, assuming you use a modern networking API (boost::asio, epoll, I/O Completion Ports, or whatever.)

And, finally, if you have 10,000 users all trying to match at the same time, count yourself lucky! If 5% of those users pay you $5 per month, you have more than enough money to pay for really fancy server hardware :-)
0

Share this post


Link to post
Share on other sites

Haha, I like your thinking. I always thought that'd be difficult. I was just watching a video on the PS4 unboxing where one of the Sony engineers was talking about the PS4 having a second low-power CPU just to handle network traffic. They'll have their own custom Linux-based firmware, so I was wondering how a typical desktop VM like Ubuntu Desktop (not server) would stack up.

 

The only network programming I've done are BSD sockets, which I find fun, but there is quite a bit of babysitting going on there. I've learned from some research that games typically rely exclusively exclusively on UDP "connections" instead of reliable TCP sockets (even in P2P file sharing protocols) because TCP's reliability can be emulated with UDP pretty well. I've wanted to experiment with the enet library, but I just haven't dived into that yet.

0

Share this post


Link to post
Share on other sites

First person shooters mainly use UDP, because it's better to lose one packet and have the next one arrive timely, than to have to wait for the lost packet to get re-transmitted before getting the next packet.

 

Turn-based games, strategy games, MMOs, and many other kinds of games just use TCP. It works fine for most kinds of games. For example, World of Warcraft uses TCP.

0

Share this post


Link to post
Share on other sites

Does it now? I was thinking about that last year, but over the Spring this year, I was reading up on how games typically use UDP exclusively. In fact, having a TCP connection could actually slow down UDP. This, of course, sounds interesting when considering that the computer's/device's OS usually has many ports open for various processes --both TCP and UDP. I always thought that using UDP for updating player positions/animation states would be the best way to go, but then use TCP for important events, such as getting a kill in a deathmatch, firing a weapon, change in health, etc.

0

Share this post


Link to post
Share on other sites

TCP is often prioritized over UDP traffic. If you can build a simple reliable protocol over UDP, it'll be easier in the long run, especially with NAT negotiation, and not having to deal with multiple sockets. 

 

Building a reliable in-order messaging system on top of UDP isn't that hard, and you can keep it simple, if you don't care about latency (your messages arriving a few fraction of a second later). And in general, you will already have some sort of protocol to establish and maintain connectivity with your clients, which would roughly mimic a TCP-IP state machine. 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0