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

Local multiplayer via bluetooth or wi-fi

M

Mikhail

Guest
Hello!
I want to make a simple multiplayer game with Game Maker Studio 2 for mobile platforms, but it should work locally (via wi-fi or bluetooth). For e.g. this is a list of existing games and my game will be classified as (Bluetooth | Local WIFI | WIFI Direct | Online). I have some experience in programming and GML should not be a problem for me. But I want to know for sure whether it is possible to implement Wi-Fi and bluetooth communication? Required answer those who have already done it. Any plug-ins required for this? I do not want to reinvent the wheel and modify some libraries or broken code. I just need a 100% working solution without bugs.

Why Game Maker Studio 2? Because I want to make a game with my friend who doesn't have any programming skills. So, we need some game editor like Game Maker Studio 2 despite the fact that I have programming experience. And now my task - is to solve the problem with local multiplayer before we start to make a game.
 
M

Mikhail

Guest
Thank you for the answer. Okay, it would be enough for my game. Unfortunately I haven't found any docs/examples/tutorials about local wi-fi communication for mobile platforms yet. Could smbdy help me? I believe that it is a common task for Game Maker Studio 2 and easy to carry out.
 

DukeSoft

Member
Its actually really easy. On the iOS and Android versions you can use the default networking functions for TCP.

If you want to connect some players that are near to each other, bluetooth would sound good but its not really good for gaming. Other than that bluetooth is not natively supported by GM.

The solution: Make 1 player open a wifi hotspot and let others connect to it. I've tested this on android devices and it works just fine! :)
 
M

Mikhail

Guest
I mean that multiplayer should work locally without wi-fi router (without having of connection to the existing configured wi-fi hotspot). If I want to play out of range of my wi-fi router or any other router. I need to use wi-fi direct or make a local wi-fi host or something like this. Is it possible with GMS2?
 
Last edited by a moderator:

Bingdom

Googledom
Mobile platforms work the same as computers. Window network tutorials will work the same for phones.

Not sure if it will work with wi-fi direct. As DukeSoft has mentioned, have a person to open a wifi-hotspot on their phone and let other players connect to it. I'm not sure if the hotspot owner can connect to other people's games although or if its the other way around. (applies to every game, hardware thing I believe).
 
M

Mikhail

Guest
Okay, thnx. Is there any documentation or tutorial how open wifi-hotspot automatically and show self wi-fi host name (all with GM) to let other players to connect? At least I have to get GML docs about wi-fi host opening:) Then I will be able to code other stuff. But it seems that it is impossible with GMS2 :( I have to open wi-fi host manually and RUN SOME SERVER ON MY PHONE written in some other language... As I had expected at the beginning.
 
Last edited by a moderator:
R

Ram@1619

Guest
Hello
Anybody have documentation on local multiplayer using wifi hotspot or through blutooth .
 
M

MrFox

Guest
Well,

What you can do is to manually open an hotspot, and your friend will connect on it. Then, what you only need to display on your game is your local ip address for your mate to be able to type it in a connection screen and connect to your game. No need to have a third party server on your phone.
 
Top