Simple online 2 player mode?

Hi!

I know zero about networking and all this talk of TCP, nodes and switches and ports makes little sense to me.

I want to create a simple multiplayer game for android where one person can create a "room" and it will be the server for the other players to connect to.

a good example would be on smash bros ultimate where you can choose to search for rooms or create one yourself.

i have no idea where to start? does GMS2 have a built in functions to accommodate this? has anyone created a script that does this? is this as easy to implement as it sounds?

or should i forget the whole thing?
 

TomOmNom

Member
It's as scary as people make it sound. You should probably have some solid knowledge about GM before you continue if you don't already though.

Assuming this game is going to feature Online play, you should also know that you will need a dedicated server for THIS kind of game (to perform room finding operations, and to relay information), but for PC applications, this can also be hosted by one of the users if they use Port Forwarding.
This will be impossible without one user being able to port forward OR having access to a dedicated server.

However, if you only want it to be over the local network (LAN), you don't need port forwarding or a dedicated server, but one of the players can host it.

The most essential thing you need to know about for networking, are Buffers.

Here are some tutorials I used to make a chatroom:

If you know anything about networking already, Matharoo has an AMAZING tutorial that skips over the dry explanations and goes very quickly.
Buffers in GameMaker (Networking Pt. 1) [GMS 2 / 1.4] - YouTube
It's 3 parts, this is the first one.

Introduction To Networking In GameMaker Studio 2 | Blog | YoYo Games
This tutorial is missing some explanations for the code, but the explanations of the networking are great.

Beginners Guide To Networking | Blog | YoYo Games
This is a revised version of the above tutorial. Read both.

Networking (yoyogames.com)
The manual is always a good resource, and it explains some topics well.

There's another one I can't find unfortunately, because it was the most helpful one.
There's also many LOOOOOOOONG tutorials on YouTube and if that's more your thing go right ahead.

Networking is super fun. Don't give it up if it's something you've always wanted to do.
But it is a pain sometimes. gl;hf
 
Thanks for your help, I've tried reading loads of networking tutorials etc. i just doesn't click with me. i did an online networking course and im still none the wiser about all this stuff. i know all the terms and can repeat what they do and quote the OSI model etc. but i still don't understand any of it šŸ˜…. I guess i'm just not smart enough to understand it.
 

Padouk

Member
Is it just for learning purposes?

If yes... I would forget all about Matchmaking, you won't learn much from that part.

For a fighting game like smashbros. Where there is no random and everything is farily easy to simulate I would go with Determinist Lockstep.
It's a good beginner solution to covers the basics and only requires to sync the player's input. You don't have to worry about sync any other game state.

It also helps to think a little bit more asynchronously if you are not used to it.


Have a look at Meseta 3-part series: https://meseta.medium.com/netcode-concepts-part-3-lockstep-and-rollback-f70e9297271
He also ends his article with a sample implementation of Determinist lockstep for GMS: https://meseta.itch.io/lockstep
And a simple development relay. You should have all you need there to get started on your fighting game.

It won't teach you much about how to fill a buffer or how to move it around... but it will show you other higher level concepts and how to deal with them.
--

When you are ready with those basis, comeback and we will talk about matchmaking and production ready relays ;)
 
Top