Add support for xash3D
-
@Cesarpuig @ExarKunIv Hey did either of you manage to get a gamepad working? I added -sdl_joy_old_api to /opt/retropie/ports/xash3d/Xash3D.sh and it now allows for movement, dual analogue control moving around, and the menu buttons let me select a game or cancel my selection. But once I'm in the game there doesn't appear to be any mapping for any of the actions. Jump, attack etc, the controller doesn't do anything.
I had a look around online about as it seems the valve folder has a joystick.cfg (which is empty) and config.cfg which has the following controller values:-
joy_axis_binding "sfpyrl"
joy_enable "1"
joy_forward "1.0"
joy_forward_deadzone "0"
joy_forward_key_threshold "24576"
joy_lt_threshold "-16384"
joy_pitch "200.0"
joy_pitch_deadzone "0"
joy_rt_threshold "-16384"
joy_side "1.0"
joy_side_deadzone "0"
joy_side_key_threshold "24576"
joy_yaw "200.0"
joy_yaw_deadzone "0"
joystick "0"Any other idea what else I need to input to get the other buttons working? Seems odd the menu buttons are mapped somewhere but I can't figure out where.
-
@retropieuser555 im slowing working on getting all my ports working with my game pad.
so for me i was just going to us xboxdrv for the mapping and just map the keyboard to my gamepad.
for me it is the easiest but that's just because i have been using xboxdrv for so long -
@ExarKunIv Yeah makes sense. I always find xboxdrv to be a huge headache, I got it working on dosbox on a few games but for some reason I couldn't get the controller to killall xboxdrv and go back to emulationstation controls.
Oh one other question with xash3d, do you get a crash and a segmentation fault whenever you try and select the GUI for keyboard or gamepad controls? Or is that just me?
-
@retropieuser555
if you need some help with xboxdrv i could always try to help out.as for your other question. i have not messed with it that much yet. but i will keep my eye out for that. ill try to get play with it a little later and ill let you know what i find
-
@ExarKunIv in terms of xboxdrv there's this post I made before but I couldn't quite figure out what I'm missing in the end https://retropie.org.uk/forum/topic/25490/xboxdrv-returning-back-to-normal-settings-when-leaving-dosbox?_=1590594996098 Once things get into terminal I am pretty lost what it's trying to do generally.
-
do you have
runcommand-onend.sh
?UPDATE
im able to get into the gamepad and keyboard options to change anything without crashing
-
@ExarKunIv No I don't think I've made that file, it should be with runcommand-onstart.sh right? And try to write something that always turns off xboxdrv each time I close a core or program?
re: xash3d That's interesting. I wonder if I should try and reinstall xash3d, as if I can get the GUI to open up properly perhaps I can edit the controls in there.
Do you have your config.cfg file from the valve folder please? I suspect that's the file xash3d looks at for this
-
@retropieuser555 yes you should have the
onstart
andonend
in the same place, that is why the xboxdrv will not turn off for you before. there is nothing to tell it to turn off//======================================================================= // Copyright Flying With Gauss Team 2020 © // config.cfg - archive of cvars //======================================================================= MP3Volume "0.8" allow_levelshots "0" bottomcolor "6" cl_allow_fragment "0" cl_backspeed "400" cl_charset "utf-8" cl_cmdbackup "2" cl_cmdrate "60" cl_draw_beams "1" cl_draw_particles "1" cl_enable_compress "0" cl_enable_split "1" cl_enable_splitcompress "0" cl_envshot_size "256" cl_forwardspeed "400" cl_himodels "0.000000" cl_laddermode "2" cl_lc "1" cl_lightstyle_lerping "0" cl_lw "1" cl_maxoutpacket "0" cl_maxpacket "40000" cl_maxpayload "0" cl_nopred "1" cl_nosmooth "0" cl_predict "0" cl_scoreboard_bg "1" cl_showerror "0" cl_showfps "0" cl_showpacketloss "0" cl_showpos "0" cl_sidespeed "400" cl_smoothtime "0.1" cl_sprite_nearest "0" cl_trace_events "0" cl_trace_messages "0" cl_trace_stufftext "0" cl_updaterate "60" cl_viewbob "0" cl_vsmoothing "0.05" cmd_scripting "0" con_alpha "1.0" con_black "0" con_charset "cp1251" con_fontnum "-1" con_fontscale "1.0" con_fontsize "1" con_halffrac "0.5" con_mapfilter "1" con_maxfrac "1" crosshair "1" download_types "msec" dsp_off "0" fps_max "100.0" gamma "2.500000" gl_allow_software "0" gl_allow_static "0" gl_anisotropy "0.000000" gl_check_errors "1" gl_clear "0" gl_compensate_gamma_screenshots "0" gl_detailscale "4.0" gl_finish "0" gl_keeptjunctions "1" gl_max_size "256" gl_nosort "0" gl_overbright "0" gl_overbright_studio "0" gl_swapInterval "0" gl_texture_lodbias "0.0" gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" hand "0" host_allow_materials "0" host_mapdesign_fatal "1" hostname "unnamed" http_autoremove "1" http_timeout "45" http_useragent "xash3d" hud_capturemouse "1" hud_centerid "0" hud_classautokill "1" hud_draw "1" hud_fastswitch "0" hud_scale "0" hud_takesshots "0" hud_textmode "0" hud_utf8 "0" joy_axis_binding "sfpyrl" joy_enable "1" joy_forward "1" joy_forward_deadzone "0" joy_forward_key_threshold "24576" joy_lt_threshold "-16384" joy_pitch "100" joy_pitch_deadzone "0" joy_rt_threshold "-16384" joy_side "1" joy_side_deadzone "0" joy_side_key_threshold "24576" joy_yaw "100" joy_yaw_deadzone "0" joystick "0.000000" look_filter "0" lookspring "0" lookstrafe "0" m_enginemouse "0" m_enginesens "0.3" m_forward "1" m_ignore "0" m_pitch "0.022000" m_side "0.8" m_yaw "0.022" menu_mp_firsttime "1" model "gordon" mp_decals "300" mp_logecho "1" mp_logfile "1" name "Player" net_drawslider "0" net_graph "0" net_graphheight "64" net_graphpos "1" net_graphsolid "1" net_graphwidth "192" net_scale "5" net_speeds "0" r_adjust_fov "1" r_bump "1" r_customdraw_playermodel "0" r_detailtextures "0" r_drawentities "1" r_dynamic "1" r_fastsky "0" r_flaresize "200" r_lighting_ambient "0.3" r_lighting_extended "1" r_lighting_modulate "0.6" r_oldparticles "0" r_speeds "0" r_sprite_lerping "1" r_sprite_lighting "1" r_strobe "0" r_strobe_cooldown "3" r_strobe_debug "0" r_strobe_swapinterval "0" r_studio_drawelements "1" r_studio_lambert "2" r_studio_lerping "1" r_studio_lighting "1" r_studio_sort_textures "0" r_studiocache "1" r_underwater_distortion "0.4" r_vbo "1" r_vbo_dlightmode "1" r_wadtextures "1" rate "30000" s_combine_sounds "0" s_cull "0" s_lerping "0" s_phs "0" s_reverse_channels "0" s_samplecount "0" s_show "0" sensitivity "3" sleeptime "1" snd_mute_losefocus "1" suitvolume "0.250000" sv_aim "1" sv_allow_PhysX "1" sv_allow_compress "1" sv_allow_download "0" sv_allow_fragment "0" sv_allow_joystick "1" sv_allow_mouse "1" sv_allow_noinputdevices "1" sv_allow_rotate_pushables "0" sv_allow_split "1" sv_allow_studio_attachment_angles "0" sv_allow_touch "1" sv_allow_vr "1" sv_check_errors "0" sv_corpse_solid "0" sv_downloadurl "" sv_enttools_enable "0" sv_enttools_maxfire "5" sv_fixmulticast "1" sv_log_onefile "0" sv_log_singleplayer "0" sv_maxpacket "2000" sv_precache_meshes "1" sv_quakehulls "0" sv_reconnect_limit "3" sv_sendvelocity "1" sv_skipshield "0" sv_stepsize "18" sv_trace_messages "0" sv_userinfo_enable_penalty "1" sv_userinfo_penalty_attempts "4" sv_userinfo_penalty_multiplier "2" sv_userinfo_penalty_time "0.3" sv_validate_changelevel "1" topcolor "30" touch_config_file "touch.cfg" touch_enable "0" ui_borderclip "0" ui_language "english" ui_renderworld "0" ui_show_window_stack "0" ui_showmodels "0" vgui_utf8 "0" vibration_enable "1" vibration_length "1.0" viewsize "120.000000" violence_ablood "1" violence_agibs "1" violence_hblood "1" violence_hgibs "1" volume "0.800000" exec keyboard.cfg exec userconfig.cfg // end of config.cfg
-
@ExarKunIv Thanks for that! I'm gonna mess around with xash3d a little more tonight or tomorrow and see if I can figure out where the differences are.
I'm gonna mess around with those run commands. At the moment I'm loading xboxdrv as part of the .sh files of the dosbox games, but I'll try this way around instead and see if it's more successful than what I was doing before. Thanks for your help with that!
-
Do you guys know a way to get the constant console messages to stop appearing onscreen?
-
@quicksilver delete
-console
fron launch commandLD_LIBRARY_PATH=/home/pi/RetroPie/roms/ports/Half-Life /home/pi/RetroPie/roms/ports/Half-Life/xash3d -console -clientlib cl_dlls/client.so -dll dlls/hl.so
-
@ExarKunIv Bingo! I got the gamepad working, the joystick.cfg file isn't called by the game in the file so I could either call it or add the binds into the keyboard.cfg. Oddly modifying my keyboard.cfg file has stopped the crash when I select the option in the GUI as well. But if I go to edit entries there in the GUI it causes a crash. But I can just edit the file manually anyway.
So yeah, if anyone is ever hunting down gamepad controls on this port, it's definitely possible.
-
@retropieuser555 can you post what you did, i might want to try it that way. if you dont mind
-
Hey guys I was able to successfully build the newer version of xash3d (xash3d-fwgs) on my Pi 4 (link to the binary below):
https://mega.nz/folder/xBpAgYYb#arEdY1Y2DVere_gGRqeFjw
You can do a direct swap of the binary (only if you built from source, I dont know if this will work if you installed from binary. If you installed from binary, go back and update from source first) in your
/home/pi/RetroPie/roms/ports/Half-Life/
folder (make a back-up first just in case!). I have tested it lightly and I can confirm it works but I have only played a few minutes into the game. Performance is better if set to 720p or lower in runcommand menu (before doing this, go into the game video settings and change to windowed mode - and set resolution to window resolution otherwise it will still try to run 1080p even when you selected 720p in runcommand. This results in a black screen.)Link to the source:
https://github.com/FWGS/xash3d-fwgs -
@quicksilver thanks for the update,
-
@ExarKunIv Sure thing!
So I edited the launch Xash3D.sh that's sitting in /opt/retropie/ports/xash3d similar to @Cesarpuig had above, but I added in the -sdl_joy_old_api option.
LD_LIBRARY_PATH=/home/pi/RetroPie/roms/ports/Half-Life /home/pi/RetroPie/roms/ports/Half-Life/xash3d -clientlib cl_dlls/client.so -dll dlls/hl.so -sdl_joy_old_api
And then for the keyboard.cfg file I found this for the guys who edited xash3d for the playstation mini and it worked for the gamepad binds for me first time:-
//======================================================================= // Copyright Flying With Gauss Team 2018 © // keyboard.cfg - archive of keybindings //======================================================================= unbindall bind ESCAPE "cancelselect" bind SPACE "+moveup" bind 1 "slot1" bind 2 "slot2" bind 3 "slot3" bind 4 "slot4" bind 5 "slot5" bind KP_UPARROW "+forward" bind KP_LEFTARROW "+left" bind KP_RIGHTARROW "+right" bind KP_DOWNARROW "+back" bind ALT "+strafe" bind SHIFT "+speed" bind F1 "botstop" bind F2 "botgo" bind F3 "pause" bind F4 "addbot" bind F5 "menu_startserver" bind F6 "savequick" bind F7 "loadquick" bind F8 "stop" bind F10 "menu_quit" bind F12 "screenshot" bind DEL "+lookdown" bind PGDN "+lookup" bind END "centerview" bind KP_PGDN "+lookup" bind KP_DEL "+lookdown" bind KP_END "centerview" bind PAUSE "F3" // Controller mapping by Advokaten // D-Pad bind UPARROW "invprev" bind DOWNARROW "invnext" bind LEFTARROW "impulse 100" bind RIGHTARROW "+speed" // Face buttons bind A_BUTTON "+jump" bind B_BUTTON "+duck" bind X_BUTTON "+reload" bind Y_BUTTON "+use" // Shoulders and triggers bind L1_BUTTON "+attack2" bind L2_BUTTON "savequick" bind R1_BUTTON "+attack" bind R2_BUTTON "+attack2" // Start bind START "cancelselect" // Select bind BACK "+showscores" // end of keyboard.cfg
My only issue I have left is I've found turning on the flashlight drops the framerate from a pretty much perfect 60FPS down to 15FPS. So I think I need to change something in the config.cfg to get that working better.
Oh I fixed my xboxdrv issue, thanks again for that! I'll have to try and pick another dosbox game to test out and try it again so I can make sure I can do it again.
-
@quicksilver Thanks! roughly what framerate are you getting? As I am surprised oddly how well it seems to work on the pi3b. But then maybe I haven't got far enough into the game for it to get so hectic that the framerate will freeze on me.
-
@retropieuser555 said in Add support for xash3D:
@quicksilver Thanks! roughly what framerate are you getting? As I am surprised oddly how well it seems to work on the pi3b. But then maybe I haven't got far enough into the game for it to get so hectic that the framerate will freeze on me.
60fps mostly at 720p but does drop a little when a lot is going on. I'll have test with the flashlight and see what happens. I'm having issues with the controller so I might have to use xboxdrv. I can map face buttons but I don't understand the xash3d axis mapping page at all.
Edit:I believe the mapping screens in the newer version may be different than the old version.
-
@retropieuser555 said in Add support for xash3D:
But once I'm in the game there doesn't appear to be any mapping for any of the actions. Jump, attack etc, the controller doesn't do anything.
The newer version I posted allows controller and keyboard button remapping in game. The issue I am having is getting the analog sticks working right. The left analog seems to work well but my right analog has me looking up and down when I push left and right. Right trigger does nothing and left trigger makes me spin indefinitely (even when I release the trigger Im still spinning)
Edit: SUCCESS! I got the analog/axis map figured out and they now work properly. Just had to keep swapping the mappings until they lined up with their intended function. Now I just need to get the dead-zones figured out so im not drifting all over the place and map my face buttons. Looks like I wont need xboxdrv after all.
-
To anyone having issues getting the joystick axis's set correctly you'll need to edit this section of the
config.cfg
joy_axis_binding "sflpyr" joy_enable "1" joy_forward "0.700000" joy_forward_deadzone "10000" joy_forward_key_threshold "24576" joy_lt_threshold "+16384" joy_pitch "90.300003" joy_pitch_deadzone "10000" joy_rt_threshold "+16384" joy_side "0.700000" joy_side_deadzone "10000" joy_side_key_threshold "24576" joy_yaw "90.300003" joy_yaw_deadzone "10000" joystick "0.000000"
The first line
joy_axis_binding
is what axis controls Side/Forward/Left Trigger/Pitch/Yaw/Right Trigger. So you'll need to rearrange those letters until your axis and triggers are controlling the correct functions. For my wireless xbox 360 controllerjoy_axis_binding "sflpyr
is correct. The joystick deadzone functions are in multiples of 10,000. So for examplejoy_pitch_deadzone "10000"
is a 10% deadzone (took me forever to figure that out since for example dosbox uses a value of "10" for a 10% deadzone)Now on to map the controller buttons. Hopefully this will be more straight forward.
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.