• 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!

GameMaker Online Multiplayer Game Without A Server

ZeGGamer

Member
Hey,

I'm trying to figure out how to add Online Multiplayer To my game. I already have a lot of content in it already, along with a second player character that works just fine with typical local multiplayer conventions. However, what I want to do is make it so that my game has a Host and Join feature that allows people to connect using their versions of the game and play together. Much like what Steam Games have where they just connect to each other.

I'm new to this process, so I don't know everything when it comes to servers and such, but I would like it if I could make the game work so that a dedicated server project or version of the game isn't required, only two players connecting to each others game. No separate server entity required. (Like the host has the guest join the game, and the guest sends and receives information from the host game. Preferably using the content I made already.)

I watched this video as a reference, but it doesn't have what I want. If there is anything I am missing, or If I'm just being an idiot, please let me know.

Also PS. I'm using GMS2 V2.2, Thought I'd include that because I'm not sure if that changes anything.
 
Yes, you can make it so one of the player is the server. Perfectly valid for some types of games, but forget about having any control at all over what's happening in the game if you go that road.
 

ZeGGamer

Member
Yes, you can make it so one of the players is the server. Perfectly valid for some types of games, but forget about having any control at all over what's happening in the game if you go that road.
Ok, but when you say "Forget about having any control" does that mean there will be laggy interference, or is that coming from an administrative perspective? I'm only asking because my game is an action platformer, and it would suck if the former was true.

Also, Thanks!
 

TsukaYuriko

☄️
Forum Staff
Moderator
That's from an administrative perspective, as you will not have control over the server and what's happening on it (e.g. validating player actions to prohibit cheating) since it will be running on a player's PC, not your server - as in, there's nothing apart from the limits of their knowledge that prevents them from modifying it.

How laggy the gameplay will be (or, more importantly, feel) depends on how the game's networking code is written to work, the relevant hardware and configuration of both end user devices involved in a given session as well as the route between the two devices. You can't entirely avoid latency, so first and foremost, it is your job as the developer to write your networking code in a way that mitigates the effects of latency that are noticeable by or detrimental for players as much as possible. This is often achieved using a mix of dead reckoning and rollback netcode.
 

MeBoingus

Member
Generally I'd recommend writing the sever and client software seperately and then distributing both.

Players get up to all kinds of shenanigans when trying to play games with their friends. Personally, I've often hosted servers on other laptops, or in the cloud, just so that the connection/performance was relatively fair.
No matter how well you write your server code within the client, that client is still going to have to do more work than the others that are connecting to it.

P.S. The tutorial that you're watching, although comprehensive, is very long-winded. I'd take a look at all of the tutorial material that you can find on this, so that you learn most of the different ways that people handle this kind of stuff.
 

ZeGGamer

Member
Alright, I think I got it. I'll probably make a practice project working with this stuff before I put it into my real game though. Thanks for the help.
 
Top