Jump to content
  • Advertisement
Sign in to follow this  
Delanovember

Linux or Windows VPS?

This topic is 2498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, all.

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.

Share this post


Link to post
Share on other sites
Advertisement
A linux VPS with the same hardware as a Windows VPS will generally be a good bit cheaper. You'll also have less overhead with linux than windows*. Unless you have to use Windows, I'd stick to linux.
* 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.

Share this post


Link to post
Share on other sites

A linux VPS with the same hardware as a Windows VPS will generally be a good bit cheaper. You'll also have less overhead with linux than windows*. Unless you have to use Windows, I'd stick to linux.
* 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.

Share this post


Link to post
Share on other sites
First: I would not try to use code::blocks to read MSVC projects, and expect it to work well. Instead, I would use something like cmake, and generate MSVC projects and Makefiles from the same project tree.

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.

Share this post


Link to post
Share on other sites
Target Linux for the server. If it makes sense, consider splitting the two projects cleanly, and implement the core, common functionality as a library. Windows server costs are going to add up if you're successful enough to scale your game up.

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.

Share this post


Link to post
Share on other sites
[size=2]

First: I would not try to use code::blocks to read MSVC projects, and expect it to work well. Instead, I would use something like cmake, and generate MSVC projects and Makefiles from the same project tree.

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?

[size=2]

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.


I'll certainly look into those options, thank you.

Share this post


Link to post
Share on other sites
First off, Amazon AWS has a free usage tier which provides for both linux and windows instances.

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 :)

Share this post


Link to post
Share on other sites
[size=2]

First off, Amazon AWS has a free usage tier which provides for both linux and windows instances.

I've just stumbled across that myself. I'm sold.

[size=2]

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?"

Precisely, thank you. I was having a difficult time articulating that

[size=2]

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

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. tongue.png

Share this post


Link to post
Share on other sites
We do shared Windows/Mac/Linux development at work all the time. It can be very productive if you set up the right support.

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!