Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo mode can't be stopped with using only gamepads / joysticks #499

Open
joyrider3774 opened this issue Feb 13, 2024 · 4 comments
Open
Assignees
Labels

Comments

@joyrider3774
Copy link

Hi,

It would seem demo mode where the cpu's fight each other, can't be stopped if the only input device is a game pad / joystick.

I don't know if this was also the case in the original game, but i though i'd mention it. I was testing using latest git on a RG35XX handheld which only had gamecontroller support (i edited the conf files to be able to control game) but it seems at least the demo mode i can't seem to exit using a gamecontroller only

@katajakasa
Copy link
Member

Unfortunately I don't have a handheld or gamepad to test this with. Can you copypaste your mappings from the config file, and the start of the logfile (from start until "--- BEGIN GAME LOG ---") ?

@joyrider3774
Copy link
Author

joyrider3774 commented Feb 13, 2024

i could not control the game initially (no keyboard) but i knew the name of gamepad so edited the config to only change the joy_name1 , ctrl_type1and joy_offset1 value, i did not change anything else. I can play the game fine and everything seems to work except i can't quit demo mode using the gamepad only almost seemingly as if a check on it is missing but not sure how it is all mapped internally

ctrl_type1=1
joy_name1="Deeplay-keys"
joy_offset1=0
key1_jump_up="Up"
key1_jump_right="PageUp"
key1_walk_right="Right"
key1_duck_forward="PageDown"
key1_duck="Down"
key1_duck_back="End"
key1_walk_back="Left"
key1_jump_left="Home"
key1_kick="Right Shift"
key1_punch="Return"
key1_escape="Escape"             

i also provided a gamecontrollerdb.txt file in share/games/openomf containing these values

[root@buildroot /userdata/ROMS/Ports/OpenOMF/share/games/openomf]# grep "keys" ./gamecontrollerdb.txt
19000000010000000100000000010000,Deeplay-keys,a:b3,b:b4,x:b6,y:b5,leftshoulder:b7,rightshoulder:b8,lefttrigger:b13,righttrigger:b14,guide:b9,start:b10,back:b11,dpup:h0.1,dpleft:h0.8,dpright:h0.2,dpdown:h0.4,volumedown:b1,volumeup:b2,leftx:a0,lefty:a1,leftstick:b12,rightx:a2,righty:a3,rightstick:b15,platform:Linux,
[root@buildroot /userdata/ROMS/Ports/OpenOMF/share/games/openomf]#

requested log entry:

[root@buildroot /userdata/ROMS/Ports/OpenOMF/.local/share/openomfproject/OpenOMF]# cat openomf.log
[      0][I] Starting OpenOMF v0.6.6
[      0][I] Git SHA1 hash: 4287067184d9f16d02035f6cf0abcafb0f9755be
[      0][I] Configfile read!
[      0][I] Looking for plugins ...
[      0][E] Error while attempting to open plugin directory.
[      0][I] Found SDL v2.28.4
[      0][I] Running on platform: Linux
[      0][I] Loaded built-in controller mappings
[      0][I] We currently have 498 known game controller mappings
[      0][I] Loaded external game controller mappings from /userdata/roms/ports/OpenOMF/bin/../share/games/openomf/gamecontrollerdb.txt
[      0][I] We have 498 known game controller mappings
[      0][I] Found 1 joysticks attached
[      0][I] Opened Joystick 0
[      0][I]  * Name:              Deeplay-keys
[      0][I]  * Number of Axes:    4
[      0][I]  * Number of Buttons: 17
[      0][I]  * Number of Balls:   0
[      0][I]  * Number of Hats:    1
[      0][I]  * GUID          :    19000000010000000100000000010000
[      0][I] Video Init OK
[      0][I]  * Driver: mali
[      0][I]  * Renderer: opengles2
[      0][I]  * Accelerated: Yes
[      0][I]  * VSync support: Yes
[      0][I]  * Target support: Yes
[      0][I] Using audio sink 'openal'.
[      0][I] OpenAL Audio Sink:
[      0][I]  * Vendor:      OpenAL Community
[      0][I]  * Renderer:    OpenAL Soft
[      0][I]  * Version:     1.1 ALSOFT 1.22.0
[      0][I] Audio system initialized.
[      0][I] Loaded sounds file '/userdata/roms/ports/OpenOMF/bin/../share/games/openomf/SOUNDS.DAT'.
[      0][I] Loaded language file '/userdata/roms/ports/OpenOMF/bin/../share/games/openomf/ENGLISH.DAT'.
[      0][I] Loaded font file '/userdata/roms/ports/OpenOMF/bin/../share/games/openomf/CHARSMAL.DAT'
[      0][I] Loaded font file '/userdata/roms/ports/OpenOMF/bin/../share/games/openomf/GRAPHCHR.DAT'
[      0][I] Loaded altpals file '/userdata/roms/ports/OpenOMF/bin/../share/games/openomf/ALTPALS.DAT'.
[      0][I] Engine initialization successful.
[      0][I]  --- BEGIN GAME LOG ---

@katajakasa katajakasa added the bug label Feb 13, 2024
@joyrider3774
Copy link
Author

I looked through the code, and found the issue, the ESCAPE key in demo is handled here but only explicit keyboard input is handled here no gamepad at all and thats why you can not exit demo if using gamepads / joysticks only. see

int arena_event(scene *scene, SDL_Event *e) {
it needs a part added for gamepad controls as well

@katajakasa
Copy link
Member

Right. This issue is due to the normal input code only accepting escape input from player one. Since player one is a computer in demo mode, this hack was added to get out (when using keyboard). There was no similar out added for game controllers.

To fix, this requires changes to arena_handle_events(). Another ticket to backlog.

@katajakasa katajakasa self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants