Linux or Windows VPS?
#1 Members - Reputation: 100
Posted 04 February 2012 - 12:28 AM
I am looking to create a 2D tile-based multiplayer game (similar to the Pokemon games for Game Boy Advance) in C++ and host it on this (Debian) VPS service. My intention is to do most of the coding on my Windows 7 PC in Microsoft Visual C++ and then import the MSVC project onto the Linux VPS with Code::Blocks. I want the game to be compatible with Windows. I'm aware of the resource limitations with that particular VPS plan and intend to use it only as a test server at first with later upgrades to handle the playerbase when the project is finished.
The question I'm getting at here is this: would a Debian VPS such as this one be suitable and compatible for my needs or would I need to bite the bullet and spend the extra cash on a Windows VPS? Should I go with a Xen VPS or should Virtuozzo be fine?
Any and all help is appreciated, thanks.
#2 Members - Reputation: 146
Posted 06 February 2012 - 07:53 AM
* From my limited experience running the same set of software on both a linux and windows vps - linux vps with 256mb ram ran everything fine, windows with 768 was running out of memory and lagging.
#3 Members - Reputation: 100
Posted 06 February 2012 - 03:52 PM
turch, on 06 February 2012 - 07:53 AM, said:
* From my limited experience running the same set of software on both a linux and windows vps - linux vps with 256mb ram ran everything fine, windows with 768 was running out of memory and lagging.
Thank you very much. I'm quite new to all of this and so I wasn't sure whether or not I could develop a game for Windows on my Windows PC and host it on a Linux server. I'd rather avoid the high costs of the Windows VPS options.
#4 Moderators - Reputation: 1805
Posted 06 February 2012 - 04:07 PM
Second, running code on Linux is very different from running code on Windows, and the standard libraries behave differently. You will have to develop the code in parallel on both systems if you really want to run servers on both OS-es. Note that some code (GUI, say) could be explicitly only supported on one platform if you want -- but you have to make those decisions up front, and be very careful about writing modular code.
#5 Members - Reputation: 1507
Posted 06 February 2012 - 05:19 PM
You could also consider cloud services like Amazon Web Services, Windows Azure, etc. The advantage there is that you can grow and shrink the number of servers based on demand relatively easily (though, of course, your code and game design must account for it). That's probably something to consider for more long-term, but you can save some money by running (and paying for) fewer servers when only a few are needed, instead of paying for all servers all the time.
#6 Members - Reputation: 100
Posted 07 February 2012 - 07:41 PM
hplus0603, on 06 February 2012 - 04:07 PM, said:
Second, running code on Linux is very different from running code on Windows, and the standard libraries behave differently. You will have to develop the code in parallel on both systems if you really want to run servers on both OS-es. Note that some code (GUI, say) could be explicitly only supported on one platform if you want -- but you have to make those decisions up front, and be very careful about writing modular code.
I see. I may just simplify things and skip MSVC altogether and find a good Linux IDE.
My issue, though, is that I want to host the server on a Linux VPS for various reasons, of which pricing is not the least, but I want the game to be compatible with Windows. Linux is not my target OS; I suppose I'll try to make a Linux version at some point, but I intend to target Windows OS first and foremost. Linux server, Windows client, so to speak. Would this be feasible or too much of a hassle?
I'm very wet behind the ears here with game development and I've no idea if you can even host a Windows game on a Linux server or vice-versa, or if the server OS has to be the same as the target OS. If I want to make a Windows game, will I need a Windows server?
Ravyne, on 06 February 2012 - 05:19 PM, said:
I'll certainly look into those options, thank you.
#7 Senior Moderators - Reputation: 2448
Posted 07 February 2012 - 09:28 PM
Your real question ends up boiling down to:
"How hard is it to maintain a dual source tree for compilation of a game and server targeting different platforms?"
The answer is:
Pretty freaking annoying. You're going to want to share some code between the two projects, and developing a "Windows" application on linux, while doable, is not very healthy mentally. You'll also find that the networking technologies between windows and linux differ quite a lot once you get past the basic socket()/recv()/send() function calls. While this doesn't stop windows and linux machines from communicating, it can introduce some interesting debugging issues.
If you're running linux on your home platform then developing torwards linux, but with a mind for porting, wouldn't be a bad idea. There are plenty of libraries that can help reduce the porting effort, and general good architectural decisions can spare you a lot of headaches too.
If your server is expected to handle any decent load of players then you'll end up having to work with your platform of choice's native "IOCP" mechanism. In windows this is IOCP. On linux it's typically epoll. While BSD uses kqueue. Enjoy working through that mess
ScapeCode - Blog | SlimDX
#8 Members - Reputation: 100
Posted 07 February 2012 - 11:21 PM
Washu, on 07 February 2012 - 09:28 PM, said:
I've just stumbled across that myself. I'm sold.
Washu, on 07 February 2012 - 09:28 PM, said:
"How hard is it to maintain a dual source tree for compilation of a game and server targeting different platforms?"
Precisely, thank you. I was having a difficult time articulating that
Washu, on 07 February 2012 - 09:28 PM, said:
Pretty freaking annoying. You're going to want to share some code between the two projects, and developing a "Windows" application on linux, while doable, is not very healthy mentally. You'll also find that the networking technologies between windows and linux differ quite a lot once you get past the basic socket()/recv()/send() function calls. While this doesn't stop windows and linux machines from communicating, it can introduce some interesting debugging issues.
If you're running linux on your home platform then developing torwards linux, but with a mind for porting, wouldn't be a bad idea. There are plenty of libraries that can help reduce the porting effort, and general good architectural decisions can spare you a lot of headaches too.
If your server is expected to handle any decent load of players then you'll end up having to work with your platform of choice's native "IOCP" mechanism. In windows this is IOCP. On linux it's typically epoll. While BSD uses kqueue. Enjoy working through that mess
Thank you very much. That's exactly what I needed to know. I'll go with the free year of Windows AWS and ride that out until I'm confident enough to shell out the cash for a Windows server.
You've all been very helpful. Unfortunately, you're sure to see me around here again soon.
#9 Moderators - Reputation: 1805
Posted 08 February 2012 - 11:15 PM
For development, find a virtual machine solution that works for you. I like VMWare Workstation, but work pays for that :-) VirtualBox is a fee option, as is the free VMWare Player (if you can find a prepared image with Linux that you can run) This will let you build the same code on Windows and Linux at the same time, to find compiler and API differences. It also allows you to test client/server right on a single physical machine -- the Linux VM would be your server.
Also, for sharing source control between Linux and Windows, I suggest going through git or some other source control. Do not use cross-mounting across virtual machines, because performance is bad, and newlines and file uppercase/lowercase problems will get you.


















