Windows Bluetooth Gamepad Crashing Game - Possible Bug?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by sludgecoyote, Apr 7, 2019.

  1. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    I'm experiencing a strange issue with my Xbox One Bluetooth Controller. It seems when any Gamemaker Studio 2 project is running that has gamepad support, and I hit the "pair" button on the top of the controller, the game immediately begins slowing down, and eventually freezes the game, requiring a hard restart of my computer. I noticed this when I was at an event this past weekend and the game started slowing down randomly when using a bluetooth controller. I'm assuming that maybe the connection was weak and the controller has an automatic method of trying to stay paired to the computer. I went home and tested this in a blank project with only one object in the room with one gamepad function (pressing 'up' on the D-pad) and sure enough, hitting "pair" mid-game breaks the game. I had my buddy test this with another controller at his house on a different project and it also does it to him.

    Are there some preventative measures that I am unaware of to make sure this doesnt happen? I've tried adding "if gamepad_is_connected(0)" and "if gamepad_is_supported()" before any joystick functionality but the problem still persists.

    This seems to be happening with ANY project that has gamepad functionality.
     
    Last edited: Apr 7, 2019
  2. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    Bump! Any word on this? Seems to be an issue on other games created in GMS, such as Hyper Light Drifter.
     
  3. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,525
    I use an XB1 controller to test my game and it works fine although it has always been paired beforehand even if the controller was powered off before launching the game.
    Are you using the Official MS Wireless Dongle or a 3rd party bluetooth dongle?

    If you can list some repro steps I'd be happy to test this here for you as well - is it literally just unpair it, power off, run game, power on and pair it while the game was running?
    How are you testing the performance drop with the one object project, show_debug_overlay() or some other method?
     
  4. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    I am using an official MS Xbox One wireless controller with bluetooth for Windows, this one here:
    https://www.amazon.com/Xbox-Wireless-Controller-Black-one/dp/B01LPZM7VI/

    This crash actually happens when the controller is ALREADY paired, and you hold down the pair button mid game. I know there wouldn't be a reason to do this normally - but people may be accidentally doing it. Or, we have also noticed that when the controller gets low on battery, this also seems to happen. (I'm guessing it tries to keep a connection somehow when the signal is weak).

    I'm using just the regular debug mode in GM, within the IDE. The frame rate drops down to 3 FPS. I get no error message in the console, as it seems to just slow the frame rate down and bog down the computer, until my whole PC is essentially frozen if you dont quit out of the game quick enough.
     
  5. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,525
    Yes, obviously you are using an XB1 wireless controller, otherwise it would be wired.
    What I was asking was how you connect it to the PC.

    Do you use the Official MS Wireless Xbox Adapter (this is what I use, found here)
    Are you using some 3rd party USB Bluetooth dongle?
    Are you using the integrated bluetooth controller on a laptop?
    Are you using any 3rd party software or drivers wth the controller?

    As I said give me some repro steps you want me to perform and I'd be happy to test it my end and see if I get the same results.
     
  6. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    The controller I am using has bluetooth built in, you don't need a dongle, there is nothing that physically connects to the computer - it pairs like any modern bluetooth device. No third party drivers.

    I outlined the repro steps in my last message but here they are again in an easier to read format:
    1. Make sure your controller is connected and paired.
    2. Start a GM game
    3. Hold the "pair" button on the top of the controller
    4. Game slows down and crashes computer
    Does this make sense?
     
  7. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,525
    I am asking how you recieve that on the PC side to facilitate the connection - you have to have bluetooth on your PC right?

    Do you connect it to a 3rd party USB bluetooth dongle?
    Do you use the integrated bluetooth on a laptop or desktop motherboard?

    I ask as it's possible it may be a bluetooth driver issue on the PC side, but I will test with the Official MS Adapter that I use and let you know.

    Can you export your small test project as a .yyz and link it so I can test the exact same project as you and then I will follow your repro steps and report back my results.
     
  8. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    I gotcha. I am connecting through the integrated bluetooth in my PC's motherboard. So, no external dongle. The driver is called Qualcomm QCA9377.

    I have linked an example for this crash to be recreated here: https://drive.google.com/file/d/19mHDQALNaraajrgmeBakq-z5YnlWpDia/view?usp=sharing

    Make sure your bluetooth controller is connected and paired before you start the game. When you are mid-game, hold down the pair button on the top of the controller for a couple of seconds. In my case, the framerate drops and eventually freezes up the computer.

    If you need any other info let me know. Thanks for your help!
     
  9. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,525
    OK so I plugged in my MS Adapter, turned on the pad and it synced up - then loaded your test project and ran it.

    Held down on the dpad and the blue square moved downwards, I added show_debug_overlay() to the code which reports about 10-12k fps.
    I then held the sync button until the sync light on the pad started flashing, at which point control was lost from the game. Still 10-12k fps show on screen.
    I pressed the sync button on my dongle, and the pad synced back up.
    I had to repress down for it to move the blue square again, but the fps was still between 10-12k fps.

    No slowdown at all here using the Official MS Adapter and a standard XB1 pad that came with my XBox One X.

    Are your bluetooth drivers for the laptop up to date?
    Can you update the firmware in your controller the same way you can with regular XB1 controllers?

    It sounds more like an issue with the way your bluetooth chipset handles sync/desync when compared to the MS Adapter than anything specific to GMS2.
     
  10. sludgecoyote

    sludgecoyote Member

    Joined:
    Apr 7, 2019
    Posts:
    9
    Bummer that you can't recreate the issue.

    All bluetooth drivers are up to date. I checked the controller's firmware as well via the Microsoft Accessories app and it is also up to date.

    This issue happens across multiple computers - my desktop, my laptop, and my colleague's desktop and laptop. We each have our own controllers we are testing with, they are the same version. All these setups use the built-in bluetooth in the motherboard.

    The thing that makes me think its linked to GMS2 is that it happens on ONLY Gamemake games - weather they be ones I created, assets I download from the GM Marketplace, or published games I have through Steam (like Hyper Light Drifter, made in Gamemaker). I should note that to get the crash, the project seems to need gamepad functionality - in the sample file I created, it uses gamepad_button_check for simple movement.

    Wondering if you or anyone else here that would be able to try to recreate the issue on a PC with built in Bluetooth?

    Also, I did come across this post that seems to be the same issue: https://forum.yoyogames.com/index.php?threads/controller-problem.54639/
     
    Last edited: Jul 16, 2019

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