• 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 Slowed when using "Joystick" function without joystick connected

Y

yaragad

Guest
Hello,

This happened with 1.4 and also 2.0 GameMaker. Here the problem step by step:

- My game ran perfectly with keyboard control.
- Then, I included Joystick functions from GameMaker, as it works with my PS2 controller perfectly.
- Now, when Joystick is connected, everything goes perfect. But if I run the game without the joystick connected, game runs in some kind of slow motion.

Help very appreciated.
Regards.
 

kburkhart84

Firehammer Games
Are you verifying that the joystick is connected in your code before attempting to use the gamepad functions? I made my FHInput extension, and had it working on GMS1 before and on GMS2 now, and there are TONS of calls to gamepad functions in the code, that unless there is actually a gamepad connected and configured to use, never slows down the game with them.

This is something I've heard of before, just FYI.
 

rwkay

GameMaker Staff
GameMaker Dev.
the joystick_* family of functions are not in GMS2, mainly because they did slow games down (for technical reasons on Windows that I will not bore you with, the were polling/sampling functions and took a long time), we only support the gamepad_* family of functions.

Now have you just mixed of joystick and gamepad or are you trying to use joystick_* functions???? We have compatibility functions but you really really want to change over to the gamepad_* functions

Please, please use the system event API for detecting gamepads and only use the pads that are actually connected - https://www.yoyogames.com/blog/75/how-to-setup-and-use-gamepads, this tech blog should help you.

Russell
 
Y

yaragad

Guest
Thank you. Solved.
Solution: Using Joystick u need to controll wheter controller is connected or not. If no Joystick conneced, Joystick code must be skipped in order to avoid slowing down due to polling process.
 
Top