• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Development GMS2 + Multiplayer?

Neptune

Member
I want to create a 100 player battle royale... Haha not really, but it communicates the kind of fast-paced/high player count networking I'm wanting.

I've gathered from other topics that it is not recommended to code a server in GM, especially for large player-count games that are not P2P.

Anyone have examples or recommendations on what language to create a dedicated server for a fast paced GM game?
Where do I code this thing? How do I connect it to a GM client? Where would you host such a server(s)?

Thanks for any info!
 

chamaeleon

Member
Java, C#, C++, Go (no particular order as far as I'm concerned). Possibly Node.js but might depend on the level of multi threading required (maybe worker threads is sufficient, maybe not). Rust would be perform as well as the first 4, but it's quite possibly the hardest of them to get up to speed with due to its approach to memory management.

Using GMS raw network functions the server would just use normal socket functions (or convenience libraries on top of them). You send and receive packets of data and it is up to you to define your message protocol. Maybe you use json strings, maybe you use binary messages.
 

chamaeleon

Member
Though you make it sound like it doesnt matter what language
Really, aim for the language and environment which you feel you would be most comfortable using at this point. With a well-defined API/communication protocol, you can always swap the server out later if one implementation in one language holds you back or has performance issues for whatever reason. So I'd recommend you write it down explicitly with comments about implications for tricky details, either before or as you implement the server so you don't have to rely on understanding your source code at some later point and possibly overlook something if you do end up having to reimplement it.
 

chamaeleon

Member
Don't overlook checking out general resources that are not GMS specific for inspiration, for example (I can't vouch for their accuracy or applicability, but maybe you'll find something useful)
 

TheWaffle

Member
Yes, all will mesh with GM as a client IF using GM _raw communication systems ... I'm just doing one in PHP because it can be ported to ANY server anyplace without issue.
Also, its fun. OK, I am crazzy ... Even my nephew says PHP gets very messy, but for me, the syntax is very similar to GM making the transition back and forth a non-issue.
Also, by coding a server in PHP, it will mesh with DBPro and Purebasic (and Fastbasic/Flatbasic if you want to get fancy [MASM]) not to mention any system using sockets or HTML POST
requests. It makes portability and scalability very fluid and sorta simple.
 

Yal

🐧 *penguin noises*
GMC Elder
I coincidentally just dug up this tutorial when talking about networking learning resources in another place, might help with the GM side of things?
 

IDPreson

Member
Using GMS2 to make a big multiplayer is not available ,Because in the official HELP DOC which about network , it says the network server is global , all the data will be save in the async_load , and I've tried to synchronize 100 monsters ,but due to the GMS2's weak performance and unsupport thread , it's failed.
So believe me , don't try.
PS :Gms2 does not support multiple servers
 

IDPreson

Member
Using GMS2 to make a big multiplayer is not available ,Because in the official HELP DOC which about network , it says the network server is global , all the data will be save in the async_load , and I've tried to synchronize 100 monsters ,but due to the GMS2's weak performance and unsupport thread , it's failed.
So believe me , don't try.
PS :Gms2 does not support multiple servers
Synchronizing 100 monsters is very catchy
 

Gaius

Member
Now don't get me wrong I have nothing against you doing it with this engine. But this sounds like it's better done in some other engine and language. Gamemaker studio and multiplayer is something I fount to be challenging to do, but not impossible.
 

ZeDuval

Member
Java, C#, C++, Go (no particular order as far as I'm concerned). Possibly Node.js but might depend on the level of multi threading required (maybe worker threads is sufficient, maybe not).
As far as I know, with a Node server, you're able to handle hundreds of sockets without any kind of multithreading because of how the event loop work. MT would only becomes necessary if you're doing a lot of file stuff.
So Node should be a more than viable choice here.
 

chamaeleon

Member
As far as I know, with a Node server, you're able to handle hundreds of sockets without any kind of multithreading because of how the event loop work. MT would only becomes necessary if you're doing a lot of file stuff.
So Node should be a more than viable choice here.
Number of sockets is not the issue I had in mind. Nor is file I/O much of an issue either, for exactly the same reason (it can be and should be asynchronous). The question is how much CPU bound work the server either has to perform as a result of an incoming message, or because it is also responsible for managing game/world state and needs to perform various computations outside the scope of incoming messages, which is the reason I mentioned worker threads. Whether Node.js is suitable or not depends on what the implications of "100+ battle royale" actually means with respect to server computations.
 
Top