Zdoom and Gampad Fully Working in MENU with NO KEYBOARD
-
Just recompiled it two days ago, from retropie branch instead of master. Now my controller is working like a charm. I can choose options with cross button, go back with circle button, and access main menu by pressing start. Now I can play zdoom mods only from a gamepad. Thanks!
-
@Protocultor Sorry to bother, but I tried to install your binary build of 2.8.12.2 on my Pi 3 B+. I started with a fresh zdoom.ini. I've tried it with two different controllers: a SNES30 Pro connected via the 8bitdo USB wireless adapter, and the SN30 Pro Wired Controller (the first registers as a PS4 controller, and the second registers as a 360 controller). I can navigate the menu, but I have two major problems:
- On both controllers, the left thumb stick is acting as if up and right on the left thumbstick is constantly being pressed, so the menu is constantly scrolling up, and if I get into the game, I am constantly looking up and moving forward.
- I can't open the menu while in-game.
Is there anything I'm doing wrong? I tried building from source on the retropie branch, but I have the same results whether I build form source or download the binary build.
-
@G30FF I don't even know how to start, you are the first person that describes me something like it. One question: does this situation happen in-game with the original executable (without my changes)?
-
For opening menus ingame, see here.
About your issue with left analog stick constantly pressing up or right: It happened to me too on menu navigation, when I tested with another PS2 controller with a loose left analog stick. Zdoom allows menu navigation through left analog stick, but it's super sensitive: the minor axis movement done in the stick is detected, and it can result in the controller keeping pressing up or down constantly. It only stops when I center the analog left stick manually with my thumb. It happened both on original Zdoom, and on the binary containing the changes made by @Protocultor.
It happened because there's no deadzone values being applied to the axes that corresponds to the left analog stick, when it's used specifically for menu navigation. There's deadzone only for other actions besides menu navigation, such as character movement per se.
For common users, there's some solutions / workarounds for this issue:
- Fix the looseness in the left analog stick of your controller (If there's any);
- Try centering the left analog stick manually with your thumb, when navigating through menus;
- Test Zdoom with another controller, by unplugging all other controls you have, and plugging only the one you're going to use.
For developers, a possible solution would be implementing deadzone support in menu navigation (If not done yet), or allowing menu navigation not from controller axes, but controller hats (d-pad, per example).
Similarly to what @Protocultor done in Zdoom, I'm trying to implement menu navigation in Doom Legacy, and I'm using hats for pressing up, down, left or right in the menus. For the moment, I haven't got that issue yet (besides testing with controllers with only axes and no hats, but that's another discussion).
-
@Solid-One thanks for the explanation, that makes a lot more sense.
I'll mess around with the code in the next few weeks to see if I can add a fixed amount of deadzone to menu/GUI actions only. After all, they are meant to be controlled with the cursor keys; analog input is no advantage here. -
For the in-game issues, I want to report that it's my bad, and has nothing to do with your changes. My ZDoom analog settings were messed up, so it was registering one axis as constantly being pressed. I've fixed that and it seems to be working just fine now. I thought the issues were related because it seemed to be constantly pressing up on both the menu and in-game, but I see that wasn't the case.
The only issue I have remaining is with the analog on the menu, although I am able to get it to stop registering the analog presses if I move the analog stick around for a while after loading ZDoom. That however only works inconsistently.
Either way, please disregard my comments about the issues in-game. I did that to myself!
EDIT: I can consistently get the menu analog issue to stop after it starts by rotating the left analog stick in a circle. That seems to make it stop until the next load of ZDoom.
-
@BuZz Any chance this could get merged? It has been an open PR since April.
Thanks for all your hard work!
-
@corezon This will need to be revisited. We are moving to lzdoom and zdoom is being removed (it's already happened on our fkms_rpi4 development branch).
This is based of https://github.com/drfrag666/gzdoom - branch 3.82
Our fork was a temporary measure really and was only in place due to bugs with the upstream code (which I believe were possibly caused by fast-math optimisations).
-
Did anyone end up looking back into this for lzdoom? Finally got lzdoom and brutal doom going and realised this won't work with it.
-
@bassybeats I did. The changes in ZDoom worked with LZDoom with some slight fixes:
https://github.com/protocultor/gzdoom/commit/8ba7e49184c2be58c0ad03a7602dcd2c4b0ff6fdBinaries for Rpi3B+:
https://github.com/protocultor/gzdoom/releases/latestThe unfortunate issue is that there's no actual repository for the RPi "version" of LZDoom, since the source to compile comes from a tag; there's not even a branch to work with. So I had to fork the repo and create a branch from that tag to be able to apply the changes.
If you have to compile it, follow these steps:
cd ~ mkdir lzdoom_joy cd lzdoom_joy # Clone LZDoom from my repo and branch git clone https://github.com/protocultor/gzdoom.git --branch joypad_menu --depth 1 cd gzdoom c="$(lscpu -p | grep -v '#' | sort -u -t , -k 2,4 | wc -l)" ; [ "$c" -eq 0 ] && c=1 # In the following, remove "-DUSE_ARMV8=On" if you're not using a Rpi3 or later model cmake -DCMAKE_BUILD_TYPE=Release -DNO_GTK=On -DUSE_ARMV8=On . # The following will take A LOT of time make -j$c # After a long wait... its backup time cd /opt/retropie/ports/lzdoom sudo mv brightmaps.pk3 brightmaps.pk3.BAK sudo mv game_support.pk3 game_support.pk3.BAK sudo mv lights.pk3 lights.pk3.BAK sudo mv lzdoom.pk3 lzdoom.pk3.BAK sudo mv lzdoom lzdoom.BAK sudo mv soundfonts/lzdoom.sf2 soundfonts/lzdoom.sf2.BAK # ...and finally, replace the installed lzdoom with what you compiled sudo cp ~/lzdoom_joy/gzdoom/*.pk3 /opt/retropie/ports/lzdoom/ sudo cp ~/lzdoom_joy/gzdoom/lzdoom /opt/retropie/ports/lzdoom/ sudo cp ~/lzdoom_joy/gzdoom/soundfonts/lzdoom.sf2 /opt/retropie/ports/lzdoom/soundfonts/
You still have to do a first-time configuration with the keyboard, at least to increase the deadzone with some gamepads.
Note that, if you don't have sound, you must create the file
.alsoftrc
in your home (~
) with the following content:[alsa] mmap = false
(Thanks to @RussellB for the solution to this: https://retropie.org.uk/forum/post/234245)
EDIT: updated instructions for the recreated branch, which is now based on 3.86a.
-
@Protocultor do we need to have the other version installed to do this? or should be be uninstalled.
-
@ExarKunIv Welp, you end up replacing it, but installing LZDoom from RetroPie-Setup copies scripts to be able to run it through EmulationStation. So, if you're familiar with those you could create one by hand and avoid installing. Otherwise, just do it and replace LZDoom afterwards.
-
@Protocultor cool i think that i might be able to handle
-
I kinda got tired of this being an issue for years in every *nix platform, so I sent a pull request to GZDoom itself:
https://github.com/coelckers/gzdoom/pull/1072
Let's see if we can see it solved in LZDoom afterwards. -
@Protocultor your instructions worked great. your a life saver
now i dont need to make a mapping with xboxdrv just to get the menu up. -
Just installed lzdoom on Retropie using the new 4.6 beta.
I've got Doom up and running.
It works great with an Xbox 360 controller - apart from having to use a keyboard to start a new game.
Once in game I remapped all the controls based on the PS1 version of the game.
i.e. Strafe left/right is left shoulder/right shoulder
Weapon previous/next is left trigger/right trigger etc.Here's a snippet from the [Doom.Bindings] section of my lzdoom.ini file
Joy1=+strafe Joy2=+use Joy3=+attack Joy4=+use MWheelUp=weapprev MWheelDown=weapnext MWheelRight=invnext MWheelLeft=invprev DPadUp=togglemap DPadDown=invuse DPadLeft=invprev DPadRight=invnext Pad_Start=menu_main Pad_Back=pause LThumb=crouch LShoulder=weapprev RShoulder=weapnext LTrigger=+altattack RTrigger=+attack Pad_A=+use Pad_Y=+jump Joy5=+moveleft Joy6=+moveright Joy7=togglemap Joy8=menu_main Joy12=invprev Joy13=invnext Axis1Plus=+right Axis1Minus=+left Axis2Plus=+back Axis2Minus=+forward Axis3Plus=weapprev Axis6Plus=weapnext Joy11=centerview Axis5Plus=+lookup Axis5Minus=+lookdown
The only thing left is to assign "menu_forward" and "menu_backward" to the Xbox 360 controller. Is this something that's already been done and if so, is there a file(s) I need to replace please?
Apologies if this has been asked previously.
I was just reading the ZDoom Controls section from here and realised it was out of date.
-
@Protocultor Can you please look into updating this fork of LZDoom for RetroPie? It is currently behind on a lot of updates and bug fixes compared to main LZDoom branch (this fork is v3.84 while the main LZDoom version is v3.86a).
-
@zerosaber75 sorry, but I'm not interested in updates, new features, and the like. My main concern was to make gamepads/joysticks to work with the Rpi and *nix platforms in general, and I've done it. I'm kinda dissappointed that my pull request was completely ignored by the people behind GZDoom, and I've decided not to spend any more time with this.
In any case, my fixes are very simple to understand and apply for people interested, if you or anyone else wants to make the latest version of LZDoom work with the RPi. If anyone have any questions about my fixes, I will still gladly answer them. -
@Protocultor How can one port the gamepad fixes to the newer versions of LZDoom for themselves?
-
@zerosaber75 by making these changes :
https://github.com/protocultor/gzdoom/commit/8ba7e49184c2be58c0ad03a7602dcd2c4b0ff6fd
AFAIK some files may have changed directory, but their names and contents remain the same, so by applying these changes you're good to go.
But that's the easy part. The complicated part is what you need to do first, what you were asking me to do: to make the latest (or at least, later) LZDoom compile and run on a RPi, and hoping it will run on a decent speed. Last time I checked, it asked for a sound library that didn't work (for me). That's were I understood why the people in Retropie chose an older tag to publish; it is less messy with the required libraries.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.