1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Local multiplayer via bluetooth or wi-fi

Discussion in 'Programming' started by Mikhail, Nov 8, 2016.

  1. Mikhail

    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.
     
  2. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,677
    It's certainly possible with local wifi, without any extensions or plugins. Bluetooth (I believe) is currently unavailable, according to the manual.

    About online, it's probably best to look at this and port forwarding.
     
  3. Mikhail

    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.
     
  4. DukeSoft

    DukeSoft Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    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! :)
     
  5. Mikhail

    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: Nov 8, 2016
  6. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,677
    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).
     
  7. Mikhail

    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: Nov 8, 2016
  8. Ram@1619

    Ram@1619 Guest

    Hello
    Anybody have documentation on local multiplayer using wifi hotspot or through blutooth .
     
  9. MrFox

    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.
     
    JesterOC likes this.
  10. Mool

    Mool Member

    Joined:
    Nov 6, 2016
    Posts:
    113
    Bluetooth works fine. Check out my app.
     
  11. Nabil Kabour

    Nabil Kabour Member

    Joined:
    Aug 6, 2018
    Posts:
    92
    did you make this game in gamemaker? Why does the documentation say bluetooth is unavailable?
     
  12. Mool

    Mool Member

    Joined:
    Nov 6, 2016
    Posts:
    113
    Yes all done im GM, but i have written my own Java Extension for using bt
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice