GithubHelp home page GithubHelp logo

Comments (52)

thrimbor avatar thrimbor commented on June 5, 2024 2

Where can I find the log?

For the flatpak version it should be in /tmp/

@drfiemost I'll try to update the flatpak version over the weekend

from hurrican.

thrimbor avatar thrimbor commented on June 5, 2024 1

Yeah, SDL 2.24.0

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024 1

Fine, we can provide a copy of the game controller db in the data dir and load it at startup, it wouldn't hurt.

from hurrican.

thrimbor avatar thrimbor commented on June 5, 2024 1

Flatpak update is out.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024 1

What about adding new entries to the configuration menu where users can select the corresponding button(s)?

There's not enough space left in the controller menu, also I don't think it would belong there.
For now I've added the fallback so the functions should always be mapped to a gamepad button.

Regarding the controller: gabomdq/SDL_GameControllerDB#678

Cool, GCDB updated! If @thrimbor can rebiuld the flatpak (hopefully the last time for now) you should be able to enjoy the game with your controllers.

from hurrican.

thrimbor avatar thrimbor commented on June 5, 2024 1

Done

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Is the flatpack built with the latest code from this repository?
I can select the 'x' button fine and the pause/exit/escape function should be mapped to the gamepad start button. There was a discussion specifically on this issue time ago drfiemost#7
You should either build the code yourself or contact the flatpack maintainer to check if the problems are still present in the latest version.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Well, its the Flatpak that comes with Kubuntu 22.04 by default. I installed it using Discover. It says "Source: flathub (flatpak)" and "Version: 1.0, published 03.04.22". It links to this GitHub repository. I have have no idea who maintains that flatpak.

from hurrican.

thrimbor avatar thrimbor commented on June 5, 2024

@drfiemost I created the flatpak image last year, mainly to make Hurrican available on the steam deck. The commit it's built off is cb4d008

Ideally the flatpak repo should get automatically updated by a CI job whenever this repo has a release tagged. I didn't set it up that way back then because there was no recent-ish release.

@Silicomancer which controllers are we talking about, and what do you mean by "trigger button"? Usually, the triggers are analog and not buttons

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

A Final Fantasy XIV controller. It has button numbers imprinted on it. I attached 2 images where you can see the numbers. The button I want to use as a fire button (only) is 8.

The other one is a very old Saitek P220 controller: https://www.picclickimg.com/cJIAAOSws81jJuJ0/Saitek-P220-Digital-USB-PC-Controller-Pad.webp

Both behave exactly the same with Hurrican. I'm sure that I used one of them (maybe both?) many years ago to play Hurrican on Windows.

top
front2

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Would it be possible to add a setting for the pause/exit/escape function? This surely would allow fixing the behavior anyway.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Ok, so the 'x' button issue is related to #27 which was merged after the flatpack build.

Not sure about the gamepad, you should check in the log if there's a line mentioning 'Start function mapped to button START'. If not it defaults to button 7.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Where can I find the log?

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Where can I find the log?

For the flatpak version it should be in /tmp/

I couldn't find it...

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

The file is Game_Log.txt, the directory is not specified so it should be the current dir from where you launch the game, maybe your home?

In case the start button is not correctly detected you may try tweaking your gamepad mapping to workaround the issue as mentioned here drfiemost#13 (comment).

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

I just installed the updated version. Thanks a lot!
Selecting "X" in keyboard configuration works fine now. However I am still unable to use the desired fire button.

I found the log here:
/run/user/1000/.flatpak/io.github.hurricangame.hurrican/tmp/

This should probably be the relevant part:

-> OpenGL init successful!

DirectInput8 polling for 512 keys!
Joystick 0: Acquire successful!
Buttons: 12 
Name: FUJIWORK CO., FF-GP1
Force-feedback: false
Initializing SDL_mixer
Requested 24 sound channels and got 24
Loaded texture demofont
Loading font: demofont.png
Loaded texture copper1
Loaded texture copper2
Loaded texture copper3
Loaded texture demozahlen
Loaded texture demologo
Loaded texture star
Loaded song file /app/share/hurrican//data/music/Cracktro.it

-> GameInit successful!

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Yes, that's it. I see the standard buttons are not being mapped. @thrimbor is the flatpack built with SDL2?
Gamepad support is quite limited with SDL1, even force-feedback is disabled.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Good, so the gampad should be supported.
@Silicomancer can you please check your gamepad id with SDL2 Gamepad Mapper, or any similar software, if it matches the one in SDL?
https://github.com/libsdl-org/SDL/blob/8c9beb0c873f6ca5efbd88f1ad2648bfc793b2ac/src/joystick/SDL_gamecontrollerdb.h#L133

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Sure. How do I do that?

I started the SDL2 Gamepad Mapper application and this is what it says:

SDL2 Gamepad Mapper 0.0.4 (Compiled with SDL 2.26.0, DLL version 2.26.0)

Checking for latest GameController mapping file
Loading any existing mappings into SDL
Scan for controllers
Found 1 gamepad(s)
"FUJIWORK CO., FF-GP1", 03005036852100000201000010010000 
Environmental variable "SDL_GAMECONTROLLERCONFIG" was not found
The GUID for "FUJIWORK CO., FF-GP1" is "03005036852100000201000010010000"

Does this help? Do I need to do more?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Ah, your controller's GUID is slightly different from the one in SDL. Try setting the following environment variable before running the game:

export SDL_GAMECONTROLLERCONFIG="
03005036852100000201000010010000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
"

More details in the arch wiki.

If it works it might be worth reporting to SDL for inclusion in the controller db.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Just tried as you said. I run the export command and then started Hurrican in the same bash. Behavior didn't change. Also the name of the controller ("FUJIWORK CO., FF-GP1") in the configuration menu is the same. I guess this means the env. variable was ignored or overruled.

I tried the same with that SDL2_Gamepad_Mapper tool. The tool finds the env. variable and it changes the disabled controller name from "FUJIWORK CO., FF-GP1" to "FF-GP1".

So I guess your idea should work. Could it be flatpak related problem that the env. var. is not found?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Not familiar with flatpack but flatpak-override --env seems to be what you're looking for.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

I have never used flatpak before. I tried to pass the env. var. via CLI but it didn't work. I got errors. I tried flatseal instead. It allows to permanently set an env. var. for a selected flatpak application. I added the new variable successfully but I can't see any effect in Hurrican. It still shows a "FUJIWORK CO., FF-GP1" controller.

@thrimbor Any ideas?

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Any idea how to proceed?

I guess I should report the missing controller to the SDL team but currently I don't think this will resolve the issue. I suppose something else is wrong as well. The fact that two completely different game-pads suffer from the same problem is a strong indicator that the issue is not (only) controller related.

Has someone tried to reproduce my issue using another kind of game-pad?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

My gamepad (a cheap xbox controler clone) is recognized out of the box

Joystick 0: Acquire successful!
Buttons: 11 
Name: Xbox 360 Controller
Force-feedback: true
It's a Game Controller, mapping standard buttons...
Start function mapped to button START (7)
Enter function mapped to button A (0)
Back function mapped to button B (1)
Delete function mapped to button LB (4)

and the GUID is not even in the DB

SDL2 Gamepad Mapper 0.0.4 (Compiled with SDL 2.26.4, DLL version 2.26.1)

Loading any existing mappings into SDL
Scan for controllers
Found 1 gamepad(s)
"Xbox 360 Controller", 030003f05e0400008e02000010010000 (mapping available)
Environmental variable "SDL_GAMECONTROLLERCONFIG" was not found

I also notice that there are kernel drivers loaded, including the force-feedback one

$ lsmod
Module                  Size  Used by
xpad                   40960  0
ff_memless             16384  1 xpad

I'm clueless at this point, guess you'd better ask the SDL guys for advice.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

You are right, Hurrican reacts in a different way. I don't see those mapping messages. But why? There must be some condition in the Hurrican code... what condition causes Hurrican to do the mapping?

I am afraid that asking the SDL guys will result in a "Hurrican? We don't know what Hurrican does internally. Your problem doesn't look like a SDL issue. Ask the Hurrican guys!". I guess we need to understand more of what is going on in Hurrican before I can ask the SDL people.

Have you tried to use the right shoulder button #8 as fire button? Does it definitely work for you?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

You are right, Hurrican reacts in a different way. I don't see those mapping messages. But why? There must be some condition in the Hurrican code... what condition causes Hurrican to do the mapping?

There is just a call to SDL_IsGameController, which in your case returns false:

if (SDL_IsGameController(joy)) {

We also use SDL_JoystickHasRumble to detect if force-feedback is supported.

Have you tried to use the right shoulder button #8 as fire button? Does it definitely work for you?

Hmm, both L2 and R2 are not recognized, maybe they're treated as analog and not handled, need to check...

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Hm. Not much information in the web. But looks like this issue actually could be caused by missing controller mapping. Which would mean I had the luck to use two controllers without supported mapping.

I tried to find more about that. And I looked into the SDL database header you linked above and I looked into SDL2 Gamepad Mapper tool again. This confused me a lot.

The mapper tool detects the controllers as "FUJIWORK CO., FF-GP1" (03005036852100000201000010010000) and "SAITEK P220" (03003d0ba30600000701000000010000).

But I could not find the controllers in the header file. There is nothing like "P220" in the header. There is a "FF-GP1" in the header. But nothing like "FUJIWORK". So where does the SDL2 Gamepad Mapper tool take the full names of my controller from?

Additionally the tool says "mapping available" for both controllers. But I could not find the IDs in the header. So where does the SDL2 Gamepad Mapper tool take the mappings from?

It feels like the mapping tool works different compared to Hurrican. Are there any external databases the tool could use additionally to the compiled header? Or maybe a local file? A system file? An online DB?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

It seems Gamepad Mapper downloads the file from https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
But there's no exact matching in there too so I guess there's some magic going on. Would be interesting to look at what SDL_IsGameController is doing.

BTW as I supposed L2 and R2 are handled as axis and not as buttons so there's some work to do to support them.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

It seems Gamepad Mapper downloads the file from https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt

Could be a good idea for Hurrican anyway. I saw there is a special function in the SDL API for loading mappings from a file easily.

But there's no matching in there too so I guess there's some magic going on.

I found two mappings for "Saitek P220". But you are right that my controller IDs aren't mentioned there as well.
So there is definitely more magic in the tool.

Are those IDs monolithic or do they contain sub-fields with specials meanings so that they could be matched like patterns?

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

It looks like the GUID contains sub-fields, if there's no exact match a partial match is tried.

https://github.com/libsdl-org/SDL/blob/4fa21ee5edb6f00ae9d3489961e659745bd4f4d8/src/joystick/SDL_gamecontroller.c#L2019

The FF-GP1 is included in the SDL2 db so it should be supported out of the box and the P220 could be configured with the SDL_GAMECONTROLLERCONFIG env variable.

Maybe trying with a minimal test program that calls SDL_IsGameController could help. If it still doesn't work it should be reported upstream.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Very good. This could also explain where the vendor name came from.

Well, since the mapping tool already matches both of my controllers I would like suggest to enable Hurrican to load the Text file in the same way first. This seems a good idea anyway and it would improve Hurrican independently of this issue. And I could re-test the behavior of both controllers easily. I guess the chances are good to fix this issue this way.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Thanks a lot. I can't wait to test it :-)

BTW, since I already tried the environment variable and it didn't work for me... would it be possible for me to edit the text file in the released flatpak? This would be a way to test mappings in case the default database text file doesn't solve the problems entirely.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

The change is ready (see #38), I want to give it another spin in the weekend before merging.

I have no clue if it's possible to edit files inside a flatpak, you'd better refer to the docs for this.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Ok, looks good. I will try it as soon as I can see a new flatpak in the repo.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Ok, the problems should be fixed now (#38). There is still a pending issue (#39) that will be merged in the upcoming days but it seems the Linux version is not affected for some reason.
Asking @thrimbor to update the flatpak and @Silicomancer to test if everything is good now, thanks.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Ok, good news and bad news.

For the P220 controller I can see the mapping log messages now. I guess it is an SDL database issue that my other controller isn't detected in the same way.

However the behavior didn't change. The game still exits AND shoots when pressing button 8. For both controllers. I guess there is another bug luring in the code.

Am I right that button 3 should exit an active game with the P220 now? I tried it and button 3 doesn't do anything. Also there is no other button (except button 8) that exits.

-> OpenGL init successful!

DirectInput8 polling for 512 keys!
Loaded 271 mappings from game controller db
Joystick 0: Acquire successful! 
Name: FUJIWORK CO., FF-GP1 
Axis: 4 
Hats: 1 
Buttons: 12
Force-feedback: false
Joystick 1: Acquire successful! 
Name: SAITEK P220 
Axis: 3 
Hats: 0 
Buttons: 8
Force-feedback: false
It's a Game Controller, mapping standard buttons...
Enter function mapped to button A (2)
Back function mapped to button B (3)
Delete function mapped to button LB (6)
Initializing SDL_mixer
Requested 24 sound channels and got 24
Loaded texture demofont
Loading font: demofont.png
Loaded texture copper1
Loaded texture copper2
Loaded texture copper3
Loaded texture demozahlen
Loaded texture demologo
Loaded texture star
Loaded song file /app/share/hurrican//data/music/Cracktro.it

-> GameInit successful!

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

That's a nice step forward! The remaining problem is the P220 has no start button so the default button with id 7 is used. This can be fixed by using a fallback mechanism, something like:

START  -> use SDL_CONTROLLER_BUTTON_START or SDL_CONTROLLER_BUTTON_X
Enter  -> use SDL_CONTROLLER_BUTTON_A
Back   -> use SDL_CONTROLLER_BUTTON_BACK or SDL_CONTROLLER_BUTTON_B
Delete -> use SDL_CONTROLLER_BUTTON_LEFTSHOULDER or SDL_CONTROLLER_BUTTON_Y

I'm not a gamer so this may not be the best choice but at least it seems tha buttons A, B, X and Y are always available.

As for the other controller you'd better contact the SDL_GameControllerDB project, they sure know better what to do.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

What about adding new entries to the configuration menu where users can select the corresponding button(s)?

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Regarding the controller:
mdqinc/SDL_GameControllerDB#678

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

@thrimbor ?

from hurrican.

thrimbor avatar thrimbor commented on June 5, 2024

Update is out now

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Tried it. For the FF-GP1 behavior didn't change.

For the Saitek the behavior changed. But not better, only different. The exit button now is hard wired to button 1 which should be the jump button. So now whenever I try to jump, it exits the game.

This is my current log:

-> OpenGL init successful!

DirectInput8 polling for 512 keys!
Loaded 273 mappings from game controller db
Joystick 0: Acquire successful! 
Name: FUJIWORK CO., FF-GP1 
Axis: 4 
Hats: 1 
Buttons: 12
Force-feedback: false
Joystick 1: Acquire successful! 
Name: SAITEK P220 
Axis: 3 
Hats: 0 
Buttons: 8
Force-feedback: false
It's a Game Controller, mapping standard buttons...
Start function mapped to button X (0)
Enter function mapped to button A (2)
Back function mapped to button B (3)
Delete function mapped to button LB (6)
Initializing SDL_mixer
Requested 24 sound channels and got 24
Loaded texture demofont
Loading font: demofont.png
Loaded texture copper1
Loaded texture copper2
Loaded texture copper3
Loaded texture demozahlen
Loaded texture demologo
Loaded texture star
Loaded song file /app/share/hurrican//data/music/Cracktro.it

-> GameInit successful!

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Hmmm, maybe using button X as a fallback was not a good idea :/
Unfortunately I don't see a better alternative, these are the buttons available for the P220:

Saitek P220
a:b2
b:b3
dpdown:+a1
dpleft:-a0
dpright:+a0
dpup:-a1
leftshoulder:b6
lefttrigger:b7
rightshoulder:b4
righttrigger:b5
x:b0
y:b1

As for the FF-GP1 I don't know, there are 273 mapping loaded on more than five hundred lines in the GCDB, maybe it's being skipped for some reason?

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

Hmmm, maybe using button X as a fallback was not a good idea :/ Unfortunately I don't see a better alternative, these are the buttons available for the P220:

Well, I don't know much about game controllers variants. But I guess the safest thing would be some configuration settings. I simply have no idea if it is possible at all to find a fall back or default that works for all controllers.

As for the FF-GP1 I don't know, there are 273 mapping loaded on more than five hundred lines in the GCDB, maybe it's being skipped for some reason?

I guess this is a good question for the GCDB project... I suppose the people there can answer this easily. Would you like to open an issue there? I would prefer you to ask because you wrote the GCDB code.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

I guess this is a good question for the GCDB project... I suppose the people there can answer this easily. Would you like to open an issue there? I would prefer you to ask because you wrote the GCDB code.

Added a follow-up on your issue.

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Opened libsdl-org/SDL#7700

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

@Silicomancer any way you can check the proposed patch? libsdl-org/SDL#7700 (comment)

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

Added the suggested mapping to the GCDB. If @thrimbor could update the flatpak and @Silicomancer test it we can report back if it works, thanks.

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

@drfiemost Did you include any change regarding the default button issue?

from hurrican.

Silicomancer avatar Silicomancer commented on June 5, 2024

I can't see any changes in the log:

-> OpenGL init successful!

DirectInput8 polling for 512 keys!
Loaded 284 mappings from game controller db
Joystick 0: Acquire successful! 
Name: FUJIWORK CO., FF-GP1 
Axis: 4 
Hats: 1 
Buttons: 12
Force-feedback: false
Joystick 1: Acquire successful! 
Name: SAITEK P220 
Axis: 3 
Hats: 0 
Buttons: 8
Force-feedback: false
It's a Game Controller, mapping standard buttons...
Start function mapped to button X (0)
Enter function mapped to button A (2)
Back function mapped to button B (3)
Delete function mapped to button LB (6)
Initializing SDL_mixer
Requested 24 sound channels and got 24
Loaded texture demofont
Loading font: demofont.png
Loaded texture copper1
Loaded texture copper2
Loaded texture copper3
Loaded texture demozahlen
Loaded texture demologo
Loaded texture star
Loaded song file /app/share/hurrican//data/music/Cracktro.it

-> GameInit successful!

from hurrican.

drfiemost avatar drfiemost commented on June 5, 2024

@drfiemost Did you include any change regarding the default button issue?

I tought I did but I was wrong. I should remove the fallback to X button since it was a bad idea. Not sure how to improve the situation though, I was thinking of a --start-button command line option but it could cause trouble when using two gamepads.

I can't see any changes in the log:
[...]

Not sure what to think, guess you should handle the issue with the SDL team.

from hurrican.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.