JOY commands when no gamepad plugged cause heavy Frame Rate drops (Windows).

Previous topic - Next topic

spacefractal

the fix to the issue is more simple than excepted and took 15 min to fix:

When GETJOYNAME$(x)="" then the JOY command should not been called at all (for all JOY command).

That it.

GETJOYNAME$() is NOT one of the commands that slowdown.

The most stupid issue and im newer noticed it before today.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

This is great, it seems that is exactly what I stumbled on a win 10 machine a week ago.
For some unknown reason this one game that calls joypad was working half the speed it should. All other games were fine.
It was pretty much a clean install machine, not much into it.

One chap recommended installing this DIRECT PLAY for the win 10 to fix it but I found annoying that a code won´t work out of the box.
I didn´t get to try out though, but if it is glb fixed, all the better.
Great fix Space!

spacefractal

im have adjusted GameInput API (im update later soon), so its newer call any joy commands when there is no joypad there. Howover there was some back issues as well.

Now its works excellent with the Xbox one controller too.

Simple just use GETJOYNAME$ to make sure there is a joypad before use of any JOY commands.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

I will def keep that in mind...strange I never had any trouble with win 7, it was just this one new win 10 machine that did so...and it is a very powerfull machine, it should have no problem handling my games.

erico

just to add up, one of the games had the joybutton command going but not the joydad ones, it worked fine, so did the buttons, the one game that had joypad calls did sport that half speed.

spacefractal

I'm confirm it'd the issue. Framerate is now faster and playable for him again.

I'm when possible release the new game input so it's don't call joy commands when no gamepads is inserted.....

All gernot needs to do its return 0 when name is empty for all joy commands for windows. Then it's been fixed.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/


MrPlow

I had this issue on my Zombie shooter game... if gamepad was removed or connected after loading... etc.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

In my case i was calling 2 joypads but had only one connected.

dreamerman

You found simple fix that doesn't complicate code to much, thats good. Btw it would be nice to have some pinned topic with known bugs and workarounds/fixes for them or something like this.. What's interesting I noticed that in some AAA/normal games you need to have joypad plugged in before starting game, as when game already loads with no joypad it will only allow to use mouse + keyboard as controls...
Check my source code editor for GLBasic - link Update: 20.04.2020

spacefractal

this fix should been done automatic in the glbasic source code, which should been quite simple too. Its pretty much samme line that should been done for all JOY commands.

btw we could do a sticky thread, that links to bugs with workaround.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

Doh! Fixed in next update hopefully. The joystick was unaquired, the pointer was null -> I tried to poll it with some very ancient NT joystick code.
I think I'd better remove this code at all one day, because it's very very old APIs that are used.

spacefractal

we should use xinput instead? howover this is a nice workaround fix, so its dont fall framerate when gamepad not used. Its was ran fine with a gamepad plugged. So hence.... dont use JOY command when name is empty. Its a one line fix. Just check if a name exits. if not then return it 0.

Also sometimes its can press a button down, even when a name is empty. That issue would also been fixed too.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/