50 player - Multiplayer | Information?

Jochum

Member
Hi everyone,

I'm creating a multiplayer shooter game. The most game mechanics are ready but I've to add the most difficult part, multiplayer.

I'm searching for a server system where I have multiple servers available which people can join.
The process should go like this:
1. People push "Join Game"
2. People get into a lobby and stay there till 50 players joined.
3. People spawn into the official map.

I'm using Gamemaker Studio 2 (Windows) and I would love to learn how to do this.
Unfortunately I can't find any good explaining tutorials about this, only tutorials about LAN Networking or networking where someone need to create and join a game manually.

The game should save multiple things, like:
- Bullet locations
- Player locations
- Player health
- Collectables still available or not

Can anybody help me with this?
Thanks a lot!
Kind Regards,
Jochum
 
M

Master Maker

Guest
As far as the number of players goes, you can use the following code:
Code:
if (instance_number(obj_player) == 50) {
        room_goto(rm_game);
}
The buttons should be easy enough to figure out. Just use mouse_x checked against the button's width, etc. and if they click, just run room_goto(rm_lobby);

As far as spawning, the method depends on what you want, ans whether the game is side-scrolling or top-down. Check for collisions at a proposed, random spawn point, and if there is one, choose another random spawn point. If not, just spawn the player.
 

Jochum

Member
As far as the number of players goes, you can use the following code:
Code:
if (instance_number(obj_player) == 50) {
        room_goto(rm_game);
}
The buttons should be easy enough to figure out. Just use mouse_x checked against the button's width, etc. and if they click, just run room_goto(rm_lobby);

As far as spawning, the method depends on what you want, ans whether the game is side-scrolling or top-down. Check for collisions at a proposed, random spawn point, and if there is one, choose another random spawn point. If not, just spawn the player.
Thank you for the feedback! I need to find some information about the server hosting and automatic server finding aswell. Do you have any idea where I can find that?
 

The-any-Key

Member
I got some tutorials that you might be able to adapt to your game. But multiplayer is not that simple as people think. It's hard work and less hair on your head.
And 50 players seems a little to much for game maker to handle. You might need a dedicated server (that is even more advanced :)
 

Jochum

Member
I got some tutorials that you might be able to adapt to your game. But multiplayer is not that simple as people think. It's hard work and less hair on your head.
And 50 players seems a little to much for game maker to handle. You might need a dedicated server (that is even more advanced :)
Thank you for the feedback. However, I need a system where the players do not have to manually fill in IP's. For example, I run the servers where they play on and they automaticly join when a server isn't full.
 

NightFrost

Member
If you want avoid filling in IPs, you need a lobby server whose address is coded into your game. In a user-friendly addition you could also check for a ini file for the lobby address so it can be changed by users should the server need to migrate elsewhere (or just push an update for the game with new lobby address). When a player wants to act as server, the game contacts the lobby and announces it there. Other players who just want to join a game can check the announcements in the lobby and then click to join.

EDIT - oh, you said you host the game servers; in that case it is even simpler, ignore the part where players announce being a server. The fact of the matter is, you need server addresses, whether they are obscured from players or not.
 

The-any-Key

Member
players do not have to manually fill in IP's
You can use the online lobby in GMnet.

In GMnet you can use:
Direct connect and enter IP.
or...
Browse LAN lobby.
or..
Browse WAN lobby.
or..
Use steam invite system.

You could use the online lobby to automatically join a game.
 

True Valhalla

Full-Time Developer
GMC Elder
Years ago, there were a decent number of resources that could help you learn to code GM multiplayer games. Those resources served as a semi-passable introduction to networking for beginners. However, everyone has long since realized that it's an excruciating uphill battle to support 20+ players using GM alone. Been there, done that...it's the worst.

The more realistic approach is to completely avoid using GM for your server. You have to use another language for your server; it's practically unavoidable for anything more ambitious than a 4-player LAN game. I chose to learn C++ for my servers (circa 2009) and that was a 6-9 month commitment in itself.

You can/should use GM for the client. But not the built-in networking functions, unless they are somehow convenient for you. For certain target platforms, such as HTML5, the built-in networking functions do not even function and you will have to integrate your own custom networking interface. This is what my studio has been working on, and I'd bet that only the top 0.01% of community members could execute that process.

To be honest, it was hard enough to learn GM networking all of those years ago with the resources that were available then. But today...well, all I can say is good luck.
 

Niften

Member
Multiplayer is a real pain and if you're new to GM I would attempt some less complicated stuff first. Personally it's pretty hard to create a game and then implement multiplayer afterwards -- the game should be built on multiplayer.
 
A

Adam Tompkins

Guest
I spent over 2 years on my networking game, only to find out at the very end of the process that Game Maker Studio does not support IPv6 networking and I could not release the game on Apple.
 
A

Adam Tompkins

Guest
You took a bite in the sour apple.

Hold the phone. How could you have develop an ipv6 network game in GM when GM don't support it. You mean you wanted it to be a network game?
I made a networking game, but it only works with an IPv4 connection. Anybody on an IPv6-only network cannot connect to my game. For this reason, Apple will not publish my game, but it is available on Google Play.
 
Years ago, there were a decent number of resources that could help you learn to code GM multiplayer games. Those resources served as a semi-passable introduction to networking for beginners. However, everyone has long since realized that it's an excruciating uphill battle to support 20+ players using GM alone. Been there, done that...it's the worst.

The more realistic approach is to completely avoid using GM for your server. You have to use another language for your server; it's practically unavoidable for anything more ambitious than a 4-player LAN game. I chose to learn C++ for my servers (circa 2009) and that was a 6-9 month commitment in itself.

You can/should use GM for the client. But not the built-in networking functions, unless they are somehow convenient for you. For certain target platforms, such as HTML5, the built-in networking functions do not even function and you will have to integrate your own custom networking interface. This is what my studio has been working on, and I'd bet that only the top 0.01% of community members could execute that process.

To be honest, it was hard enough to learn GM networking all of those years ago with the resources that were available then. But today...well, all I can say is good luck.
Would it be possible and worth it to code a server in Python compared to C++? I'm learning that at the moment.
 
Last edited:
Top