Help with Game Maker 2 Online Multiplayer

edited in Questions and Answers
I recently created a couch co-op game that I would like to turn into a online multiplayer. I've read some tutorials and figured out how to make it work on a LAN but I can't find any information on how to make it work online.

Does anyone have experience with this specifically in Game Maker 2? Please help.

image
Thanked by 3Wolfbeard critic konman

Comments

  • I've just started diving into online multiplayer as well, and this particular rabbit hole goes very deep.

    You basically have 3 flavours of net code:
    1.) Peer to Peer Lockstep
    2.) Client Server
    3.) Client Side Prediction

    The type of game you're making will determine which is the best choice. Peer to peer can work well if you're only going to be playing over a local LAN. Client Server works well for games where latency isn't vital, like Starcraft.

    However if you're making a game where moment to moment inputs need to feel responsive like in fighting games or competitive FPS games, you're going to have to go for the creme de la creme of net code, Client Side Prediction, also called roll back net code.

    The gist of roll back net code is that you should be able to rewind your game to any point in the past, alter some things and then simulate it back to the present in a single frame.
    So the sequence is, get input locally, send it to the server. Play game with local inputs as though it were correct. When the server gets back to you with all inputs (both yours and other players) rewind your game to where those inputs should have been (using time stamps) and simulate back to the current frame.
    If this sounds like black magic, it's because it is.

    The long and the short of it is, you're going to have to write your net code to suit your game, as there is no one size fits all solution. There is a good reason why even AAA companies hire in specialists to do the net code for their games.

    Here is a nice article I've found to help get me in the right mindset:
    What every programmer needs to know about game networking

    If you're keen for the mental exercise, and generally interested in net code for games, I say go for it. If it is to find out if your game has appeal as a multiplayer experience, my suggestion would be to focus on the gameplay mechanics and local co-op for now. If people are exited to play it locally, they will be exited to play it online as well.
    Thanked by 2flobar konman
  • @pieter thanks so much for the info.

    I recently purchased a course on how to make online multiplayer games in html5 and game maker but it's more relevant to the Client Server model as far as I can tell. Not ideal for the fast-paced type of game I want to make. The Client Side Prediction model sounds like something more relevant to what I'm looking for.

    For interest sake are you building the server in game maker or another server side language? I've built my current one in python but I feel like it's somewhat abstract compared to working directly in game maker as a server.

    I definitely think there is a market for more indie titles that can introduce multiplayer capabilities. So I'm prepared to put in some time and get to grips with how it works and how to implement it. Challenge accepted :).

    Thanks again for the insight. Now I know what to search for.
    Thanked by 1pieter
  • edited
    Here's an awesome write up of the different types of online multiplayer architectures in plain english for anyone who's interested: http://www.gabrielgambetta.com/client-server-game-architecture.html
    Thanked by 1pieter
Sign In or Register to comment.