• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Bluetooth Gamepad Crashing Game - Possible Bug?

S

sludgecoyote

Guest
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 by a moderator:
S

sludgecoyote

Guest
Bump! Any word on this? Seems to be an issue on other games created in GMS, such as Hyper Light Drifter.
 

rIKmAN

Member
Bump! Any word on this? Seems to be an issue on other games created in GMS, such as Hyper Light Drifter.
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?
 
S

sludgecoyote

Guest
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.
 

rIKmAN

Member
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/
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.
 
S

sludgecoyote

Guest
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?
 

rIKmAN

Member
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?
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.
 
S

sludgecoyote

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

rIKmAN

Member
If you need any other info let me know.
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.
 
S

sludgecoyote

Guest
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 by a moderator:
Top