luxtorpeda-dev / packages

Package build scripts and support for luxtorpeda client
https://luxtorpeda.org
zlib License
37 stars 29 forks source link

dosbox-staging issues #506

Closed Jpxe closed 2 years ago

Jpxe commented 2 years ago

Linux Distribution

Manjaro

Luxtorpeda Version

36.0.0.r289.0253e5c-1

Bug description

I've been testing some DOS games and I got some issues in luxtorpeda-dev that I don't get in Boxtron.

The only game that seems to work correctly for me is Carmageddon. It launches and alt+enter and esc work.

Steps To Reproduce

  1. Launch mentioned DOS games

Expected Behavior

To launch the games

Additional Context

No response

Relevant log output

Here:s a log of Jagged Alliance: https://gist.github.com/ToughGuyKunio/be22a107dcfd0c13adafd99e030a6e4d

I started, got z:> promt and typed exit

d10sfan commented 2 years ago

@ToughGuyKunio

The way that dosbox-staging works inside luxtorpeda-dev with the "default" option is that it's attempting to get a config path from the original dosbox launch and use that with dosbox-staging natively.

An example of this can be found with steamdb for Carmageddon: https://steamdb.info/app/282010/config/

You can see that there's a config path so that's why that one works. ROTH also provides a config file.

Using this config files directly may be a reason for any issues with window or alt+enter probably. Since it sounds like it works on other games, this would be most likely.

You may be able to load the games manually when you're in the command line prompt inside staging, although not sure.

One possible solution to this would be support for each particular game in the packages file. This would mean passing in the appropriate command line arguments for each game. If you can find the right commands, such as passing a path to a configuration file in the launch options of particular games that do not work with default, then those could be added to the support. Boxtron had something similar with special patches or changes for specific games.

Boxtron did some additional work such as attempting to clean the original configuration files that isn't currently being done by this layer. At least some of this work, like midi, should be supported by staging itself, but there might be some things that would need to be done still.

d10sfan commented 2 years ago

For the ones without being able to alt enter or escape see if there is a mapperfile setting in the configuration and if so if commenting it out restores that functionality and if the game still works ok. Also check if you have that in any of your own personal dosbox configs.

"can check the provided config files for a mapperfile setting, and then comment that out temporarily to use a default mapping."

JoshuaFern commented 2 years ago

Here's a list of games that I've experienced with similar issues: https://store.steampowered.com/app/358280/Alien_Carnage__Halloween_Harry/ https://store.steampowered.com/app/358170/Arctic_Adventure/ https://store.steampowered.com/app/559640/Betrayal_Collection/ https://store.steampowered.com/app/329630/Command_HQ/ https://store.steampowered.com/app/358250/Cosmos_Cosmic_Adventure/ https://store.steampowered.com/app/327940/Dragonsphere/ https://store.steampowered.com/app/329640/Eradicator/ https://store.steampowered.com/app/328920/F117A_Nighthawk_Stealth_Fighter_20/ https://store.steampowered.com/app/374080/Falcon/ https://store.steampowered.com/app/286790/Falcon_AT/ https://store.steampowered.com/app/429520/Falcon_Gold/ https://store.steampowered.com/app/738470/God_Of_Thunder/ https://store.steampowered.com/app/358290/Hocus_Pocus/ https://store.steampowered.com/app/283430/Litil_Divil/ https://store.steampowered.com/app/397330/Little_Big_Adventure__Enhanced_Edition/ https://store.steampowered.com/app/398000/Little_Big_Adventure_2/ https://store.steampowered.com/app/358200/Math_Rescue/ https://store.steampowered.com/app/358220/Mystic_Towers/ https://store.steampowered.com/app/400370/Normality/ https://store.steampowered.com/app/358230/Paganitzu/ https://store.steampowered.com/app/358360/Raptor_Call_of_the_Shadows_1994_Classic_Edition/ https://store.steampowered.com/app/358350/Secret_Agent/ https://store.steampowered.com/app/327400/Sid_Meiers_Colonization_Classic/ https://store.steampowered.com/app/306350/Slipstream_5000/ https://store.steampowered.com/app/624550/Spiritual_Warfare__Wisdom_Tree_Collection/ https://store.steampowered.com/app/245410/Wizardry_6_Bane_of_the_Cosmic_Forge/ https://store.steampowered.com/app/245430/Wizardry_7_Crusaders_of_the_Dark_Savant/ https://store.steampowered.com/app/70640/Worms/ https://store.steampowered.com/app/358420/Xenophage_Alien_Bloodsport/

And games with completely different issues: https://store.steampowered.com/app/358180/Bio_Menace/ - Unable to input a number at episode selection. https://store.steampowered.com/app/358260/Crystal_Caves/ - Unable to input a number at episode selection. https://store.steampowered.com/app/358210/Monster_Bash/ - Unable to input a number at episode selection. https://store.steampowered.com/app/358240/Monuments_of_Mars/ - Unable to input a number at episode selection. https://store.steampowered.com/app/358330/Pharaohs_Tomb/ - Unable to input a number at episode selection. https://store.steampowered.com/app/292390/Realms_of_the_Haunting/ - Almost works but completely breaks my display resolution, need to alt+enter to fix. https://store.steampowered.com/app/456540/STAR_WARS_Rebel_Assault_I__II/ - Almost works but completely breaks my display resolution, need to alt+enter to fix. https://store.steampowered.com/app/358340/Word_Rescue/ - Unable to input a number at episode selection.

Games working out of the box: https://store.steampowered.com/app/358440/Dark_Ages/ https://store.steampowered.com/app/358300/Major_Stryker/ https://store.steampowered.com/app/358390/Stargunner/ https://store.steampowered.com/app/358380/Wacky_Wheels/

I don't understand the intricacy of how luxtorpeda-dev is launching games compared to boxtron, but it's clear the current implementation does not result in a usable out of the box experience in the vast majority of cases.

d10sfan commented 2 years ago

@JoshuaFern

The dosbox-staging launch is very simple in lux, just doing this script: https://github.com/luxtorpeda-dev/packages/blob/master/engines/dosbox-staging/assets/run-dosbox-staging.sh

As I mentioned when it originally came out, it was very simple and not designed as a replacement for what boxtron was doing but that I'd like to get to the point where it could be.

It sounds like a big part of that is the configuration issues. When you're saying those games don't work, do they just show a z prompt, or something else altogether?

It'd be great if you could help see if there's a common thread between them that could get them to work with changes to that script. Such as issues with the configuration, or something else entirely.

JoshuaFern commented 2 years ago

I've looked into this more, and I've identified three issues.

Issue one: A ton of DOS games on Steam end their launch options with -c, then the run script adds -fullscreen to the end which is interpreted by the emulator as a command rather than a launch option resulting in fullscreen not working and the text -fullscreen being in the command prompt in some instances. We can fix this by simply putting -fullscreen first in the arguments or by removing -c. I don't understand the reasoning behind appending -c so I'll leave it.

Issue two: Configuration files are having case-sensitive issues, take Hocus Pocus as an example, the launch arguments are -conf "..\HOCUS.conf" -noconsole -c but the actual config is located at ../Hocus.conf, to fix this we can use find with the case insensitive option.

Issue Three: Some games don't launch directly via launch arguments at all, but rather run a BAT file which contains those arguments. We need to extract those arguments from the file and run those through the script, extracting them one by one.

Here's my current modified script that tackles the first 2 issues:

#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"

new_args=(./dosbox)
new_args+=("-fullscreen")

for var in "$@"
do
    tmp_arg="${var/\\//}"
    if [[ $tmp_arg != *"-"* ]]; then
    tmp_arg=$(basename $tmp_arg | xargs -I% find .. -type f -iname "%")
    fi
    echo "$tmp_arg"
    new_args+=("$tmp_arg")
done

"${new_args[@]}"
d10sfan commented 2 years ago

@JoshuaFern

Thanks, I've committed what you have so far and done some basic tests with a few games that I have. https://github.com/luxtorpeda-dev/packages/commit/3f4ab17528d57077e1e6875a5042f71e3e5a37c4

For the bat script, do you have an example of what one that is launching for Windows looks like? And the main thing we're looking for is the configuration file I'm assuming? Are they always ending in .conf? Or are there other launch information we need in the bat script?

Wondering if we might be able to do a find search on .conf, if none is found in the launch options, and figure it out that way, but that'd only work if that's the only thing we care about.

JoshuaFern commented 2 years ago

For the bat script, do you have an example of what one that is launching for Windows looks like?

Here's an example BAT from the game Worms:

nixos-workstation% cat runworms.bat
.\dosbox\dosbox .\drivec\goworms.bat -conf .\worms.conf -fullscreen -exit
exit

Wondering if we might be able to do a find search on .conf, if none is found in the launch options, and figure it out that way, but that'd only work if that's the only thing we care about.

Games often, but not always, have two .conf files, the game-specific.conf and the dosbox.conf for the bundled dosbox that shipped with the game.

It's slightly more complicated than just looking for any file with a .conf extension and loading that. Some games load multiple conf files and some conf files can exist that are not normally loaded.

Since I have all my DOS games installed right now I can just show you: ``` nixos-workstation% find . -iname "*.conf" ./Master Levels of Doom/dosbox.conf ./Master Levels of Doom/master.conf ./Hexen/base/dosbox.conf ./Hexen/base/hexen.conf ./Hexen Deathkings of the Dark Citadel/base/dosbox.conf ./Hexen Deathkings of the Dark Citadel/base/hexen.conf ./Heretic Shadow of the Serpent Riders/base/dosbox.conf ./Heretic Shadow of the Serpent Riders/base/heretic.conf ./Alien Carnage Halloween Harry/Alien Carnage/Dosbox/dosbox.conf ./Alien Carnage Halloween Harry/Alien Carnage/CARNAGE.conf ./The Apogee Throwback Pack/DOSBOX/BSTONE_AOG.conf ./The Apogee Throwback Pack/DOSBOX/BSTONE_PS.conf ./The Apogee Throwback Pack/DOSBOX/ROTT.conf ./The Apogee Throwback Pack/DOSBOX/ROTT_E.conf ./Arctic Adventure/Artic Adventure/Dosbox/dosbox.conf ./Arctic Adventure/Artic Adventure/ARTIC.conf ./Betrayal Collection/Betrayal at Krondor/DOSBOX/dosboxBAK.conf ./Betrayal Collection/Betrayal at Krondor/DOSBOX/dosboxBAK_single.conf ./Bio Menace/Bio Menace/Dosbox/dosbox.conf ./Bio Menace/Bio Menace/BMENACE.conf ./Blake Stone Aliens of Gold/Blake Stone - Aliens of Gold/Dosbox/dosbox.conf ./Blake Stone Aliens of Gold/Blake Stone - Aliens of Gold/BSAOG.conf ./Blake Stone Planet Strike/Blake Stone - Planet Strike/Dosbox/dosbox.conf ./Blake Stone Planet Strike/Blake Stone - Planet Strike/BSPS.conf ./One Unit Whole Blood/dosboxBlood.conf ./One Unit Whole Blood/dosboxBlood_addon.conf ./One Unit Whole Blood/dosboxBlood_client.conf ./One Unit Whole Blood/dosboxBlood_server.conf ./One Unit Whole Blood/dosboxBlood_setup.conf ./Command HQ/dosbox_windows/daum/dosbox_commandhq.conf ./Command HQ/dosbox_windows/daum/dosbox_commandhq_launch_windows.conf ./Command HQ/dosbox_windows/dosbox_commandhq.conf ./Command HQ/dosbox_windows/dosbox_commandhq_config_windows.conf ./Command HQ/dosbox_windows/dosbox_commandhq_launch_windows.conf ./Commander Keen/base1/dosbox.conf ./Commander Keen/base1/keen1.conf ./Commander Keen/base2/dosbox.conf ./Commander Keen/base2/keen2.conf ./Commander Keen/base3/dosbox.conf ./Commander Keen/base3/keen3.conf ./Commander Keen/base4/dosbox.conf ./Commander Keen/base4/keen4.conf ./Commander Keen/base5/dosbox.conf ./Commander Keen/base5/keen5.conf ./Cosmo's Cosmic Adventure/Cosmo Cosmic Adventure/Dosbox/dosbox.conf ./Cosmo's Cosmic Adventure/Cosmo Cosmic Adventure/Cosmo.conf ./Crystal Caves/Crystal Caves.app/Contents/Resources/Crystal/CRYSTAL.conf ./Crystal Caves/Crystal Caves.app/Contents/Resources/dosbox.conf ./Crystal Caves/Crystal Caves/CRYSTAL.conf ./Crystal Caves/Crystal Caves/Dosbox/dosbox.conf ./Crystal Caves/Crystal Caves/Dosbox/boxtron_358260_824e15.conf ./Crystal Caves/Crystal Caves/Dosbox/boxtron_auto.conf ./Dark Ages/Dark Ages/Dosbox/dosbox.conf ./Dark Ages/Dark Ages/DARK.conf ./Doom 2/base/doom2.conf ./Doom 2/base/doom2m.conf ./Doom 2/base/dosbox.conf ./Dragonsphere/dosbox_windows/daum/dosbox_dragonsphere.conf ./Dragonsphere/dosbox_windows/daum/dosbox_dragonsphere_launch_windows.conf ./Dragonsphere/dosbox_windows/dosbox_dragonsphere.conf ./Dragonsphere/dosbox_windows/dosbox_dragonsphere_config_windows.conf ./Dragonsphere/dosbox_windows/dosbox_dragonsphere_launch_windows.conf ./Duke Nukem 3D/gameroot/classic/dosbox.conf ./Duke Nukem 3D/gameroot/classic/dosbox_build.conf ./Duke Nukem 3D/gameroot/classic/dosbox_client.conf ./Duke Nukem 3D/gameroot/classic/dosbox_server.conf ./Duke Nukem 3D/gameroot/classic/dosbox_setup.conf ./Eradicator/dosbox_windows/daum/dosbox_eradicator.conf ./Eradicator/dosbox_windows/daum/dosbox_eradicator_launch_windows.conf ./Eradicator/dosbox_windows/dosbox_eradicator.conf ./Eradicator/dosbox_windows/dosbox_eradicator_config_windows.conf ./Eradicator/dosbox_windows/dosbox_eradicator_editor_windows.conf ./Eradicator/dosbox_windows/dosbox_eradicator_launch_windows.conf ./F-117A Nighthawk Stealth Fighter/dosbox_windows/daum/dosbox_F117A.conf ./F-117A Nighthawk Stealth Fighter/dosbox_windows/daum/dosbox_F117A_launch_windows.conf ./F-117A Nighthawk Stealth Fighter/dosbox_windows/dosbox_F117A.conf ./F-117A Nighthawk Stealth Fighter/dosbox_windows/dosbox_F117A_config_windows.conf ./F-117A Nighthawk Stealth Fighter/dosbox_windows/dosbox_F117A_launch_windows.conf ./Falcon/DOSBOX/dosbox_falcon.conf ./Falcon/DOSBOX/dosbox_falcon_single.conf ./Falcon AT/DOSBOX/dosbox_falconat.conf ./Falcon AT/DOSBOX/dosbox_falconat_single.conf ./Falcon Gold/DOSBOX/dosbox_falcong.conf ./Falcon Gold/DOSBOX/dosbox_falcong_single.conf ./Final Doom/base/dosbox.conf ./Final Doom/base/plutonia.conf ./Final Doom/base/plutoniam.conf ./Final Doom/base/tnt.conf ./Final Doom/base/tntm.conf ./Gabriel Knight/GK1/DOSBOX/dosboxGK.conf ./Gabriel Knight/GK1/DOSBOX/dosboxGK_single.conf ./Gabriel Knight 2/GK2/DOSBOX/dosboxGK2.conf ./Gabriel Knight 2/GK2/DOSBOX/dosboxGK2_single.conf ./God Of Thunder/GOT.conf ./Gold Rush - Classic/dosbox.conf ./Hocus Pocus/Hocus Pocus/Dosbox/dosbox.conf ./Hocus Pocus/Hocus Pocus/Hocus.conf ./Imperium Galactica/DOSBOX/dosbox.conf ./Imperium Galactica/DOSBOX/dosbox_ig.conf ./Imperium Galactica/DOSBOX/dosbox_ig_settings.conf ./Imperium Galactica/DOSBOX/dosbox_ig_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq1/DOSBOX/dosboxKQ1.conf ./King's Quest Collection/2016_KingsQuestCollection/kq1/DOSBOX/dosboxKQ1_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq2/DOSBOX/dosboxKQ2.conf ./King's Quest Collection/2016_KingsQuestCollection/kq2/DOSBOX/dosboxKQ2_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq3/DOSBOX/dosboxKQ3.conf ./King's Quest Collection/2016_KingsQuestCollection/kq3/DOSBOX/dosboxKQ3_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq4/DOSBOX/dosboxKQ4.conf ./King's Quest Collection/2016_KingsQuestCollection/kq4/DOSBOX/dosboxKQ4_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq5/DOSBOX/dosboxKQ5.conf ./King's Quest Collection/2016_KingsQuestCollection/kq5/DOSBOX/dosboxKQ5_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq6/DOSBOX/dosboxKQ6.conf ./King's Quest Collection/2016_KingsQuestCollection/kq6/DOSBOX/dosboxKQ6_single.conf ./King's Quest Collection/2016_KingsQuestCollection/kq7/DOSBOX/dosboxKQ7.conf ./King's Quest Collection/2016_KingsQuestCollection/kq7/DOSBOX/dosboxKQ7_single.conf ./King's Quest Collection/dosbox-0.63/dosbox.conf ./Larry7/dosbox_L7.conf ./Larry7/dosbox_L7_single.conf ./Larry7/lsl7.conf ./Litil Divil/dosboxLilDevil.conf ./Little Big Adventure/original/LBA.conf ./Little Big Adventure 2/LBA2.conf ./Major Stryker/Major Stryker/Dosbox/dosbox.conf ./Major Stryker/Major Stryker/STRYKER.conf ./Math Rescue/Math Rescue/Dosbox/dosbox.conf ./Math Rescue/Math Rescue/MATH.Conf ./MegaRace 1/dosboxmegarace.conf ./MegaRace 2/dosboxmegarace2.conf ./Monster Bash/Monster Bash/Dosbox/dosbox.conf ./Monster Bash/Monster Bash/MBASH.conf ./Monuments of Mars/Monuments of Mars/Dosbox/dosbox.conf ./Monuments of Mars/Monuments of Mars/MARS.conf ./Mystic Towers/Mystic Towers/Dosbox/dosbox.conf ./Mystic Towers/Mystic Towers/TOWERS.CONF ./Nam/dosbox_windows/daum/dosbox_nam.conf ./Nam/dosbox_windows/daum/dosbox_nam_launch_windows.conf ./Nam/dosbox_windows/dosbox_nam.conf ./Nam/dosbox_windows/dosbox_nam_config_windows.conf ./Nam/dosbox_windows/dosbox_nam_launch_windows.conf ./Normality/DOSBOX/dosboxNORMAL.conf ./Normality/DOSBOX/dosboxNORMAL_single.conf ./Normality/dosboxNORMAL_settings.conf ./Paganitzu/Paganitzu/Dosbox/dosbox.conf ./Paganitzu/Paganitzu/PAGA.CONF ./Phantasmagoria/Phant/DOSBOX/dosboxPHANT.conf ./Phantasmagoria/Phant/DOSBOX/dosboxPHANT_single.conf ./Phantasmagoria 2/Phant2/DOSBOX/dosboxPHANT2.conf ./Phantasmagoria 2/Phant2/DOSBOX/dosboxPHANT2_single.conf ./Pharaoh's Tomb/Pharaoh's Tomb/Dosbox/dosbox.conf ./Pharaoh's Tomb/Pharaoh's Tomb/TOMB.conf ./Police Quest - SWAT/PQ_SWAT/DOSBOX/dosboxSWAT1.conf ./Police Quest - SWAT/PQ_SWAT/DOSBOX/dosboxSWAT1_single.conf ./Police Quest Collection/PQ2/DOSBOX/dosboxPQ2.conf ./Police Quest Collection/PQ2/DOSBOX/dosboxPQ2_single.conf ./Police Quest Collection/PQ1/DOSBOX/dosboxPQ1.conf ./Police Quest Collection/PQ1/DOSBOX/dosboxPQ1_single.conf ./Police Quest Collection/PQ3/DOSBOX/dosboxPQ3.conf ./Police Quest Collection/PQ3/DOSBOX/dosboxPQ3_single.conf ./Police Quest Collection/PQ4/DOSBOX/dosboxPQ4cd.conf ./Police Quest Collection/PQ4/DOSBOX/dosboxPQ4cd_single.conf ./Quest for Glory Collection/QG1/DOSBOX/dosboxQG1VGA.conf ./Quest for Glory Collection/QG1/DOSBOX/dosboxQG1VGA_single.conf ./Quest for Glory Collection/QG2/DOSBOX/dosboxQG2.conf ./Quest for Glory Collection/QG2/DOSBOX/dosboxQG2_single.conf ./Quest for Glory Collection/QG3/DOSBOX/dosboxQG3.conf ./Quest for Glory Collection/QG3/DOSBOX/dosboxQG3_single.conf ./Quest for Glory Collection/QG4/DOSBOX/dosboxQG4.conf ./Quest for Glory Collection/QG4/DOSBOX/dosboxQG4_single.conf ./Raptor Call of the Shadows/Raptor - Call of the Shadows/Dosbox/dosbox.conf ./Raptor Call of the Shadows/Raptor - Call of the Shadows/RAPTOR.CONF ./Realms of Arkania 2 Startrail Classic/dosboxrealms2.conf ./Realms of Chaos/Realms of Chaos/Dosbox/dosbox.conf ./Realms of Chaos/Realms of Chaos/CHAOS.CONF ./Realms of the Haunting/dosboxROTH.conf ./Realms of the Haunting/dosboxROTH_settings.conf ./Realms of the Haunting/dosboxROTH_single.conf ./Rise of the Triad Dark War/Rise of the Triad - Dark War/Dosbox/dosbox.conf ./Rise of the Triad Dark War/Rise of the Triad - Dark War/ROTT.CONF ./Secret Agent/Secret Agent/AGENT.conf ./Secret Agent/Secret Agent/Dosbox/dosbox.conf ./Shadow Warrior DOS/Shadow Warrior/Dosbox/dosbox.conf ./Shadow Warrior DOS/Shadow Warrior/dosbox.conf ./Shadow Warrior DOS/Shadow Warrior/dosbox_build.conf ./Shadow Warrior DOS/Shadow Warrior/dosbox_setup.conf ./Shadow Warrior DOS/Shadow Warrior/SW.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior_client.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior_client_betas.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior_server.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior_settings.conf ./Shadow Warrior Original/gameroot/dosbox_swarrior_single.conf ./Shadow Warrior Original/bin/dosbox.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior_client.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior_server.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior_settings.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior_settingsTD.conf ./Shadow Warrior Classic/gameroot/classic/dosbox_swarrior_single.conf ./Sid Meier's Colonization/dosbox_windows/daum/dosbox_smcolonization.conf ./Sid Meier's Colonization/dosbox_windows/daum/dosbox_smcolonization_launch_windows.conf ./Sid Meier's Colonization/dosbox_windows/dosbox_smcolonization.conf ./Sid Meier's Colonization/dosbox_windows/dosbox_smcolonization_config_windows.conf ./Sid Meier's Colonization/dosbox_windows/dosbox_smcolonization_editor_windows.conf ./Sid Meier's Colonization/dosbox_windows/dosbox_smcolonization_launch_windows.conf ./Slipstream 5000/SS5000.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq1/DOSBOX/dosboxSQ1.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq1/DOSBOX/dosboxSQ1_single.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq2/DOSBOX/dosboxSQ2.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq2/DOSBOX/dosboxSQ2_single.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq3/DOSBOX/dosboxSQ3.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq3/DOSBOX/dosboxSQ3_single.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq4/DOSBOX/dosboxSQ4.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq4/DOSBOX/dosboxSQ4_single.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq5/DOSBOX/dosboxSQ5.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq5/DOSBOX/dosboxSQ5_single.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq6/DOSBOX/dosboxSQ6.conf ./Space Quest Collection/2016_SpaceQuestCollection/sq6/DOSBOX/dosboxSQ6_single.conf ./Space Quest Collection/dosbox-0.63/dosbox.conf ./Star Wars - Rebel Assault 1 and 2/dosbox_rebel.conf ./Star Wars - Rebel Assault 1 and 2/dosbox_rebel2.conf ./Star Wars - Rebel Assault 1 and 2/dosbox_rebel2_single.conf ./Star Wars - Rebel Assault 1 and 2/dosbox_rebel_single.conf ./Stargunner/Stargunner/Dosbox/dosbox.conf ./Stargunner/Stargunner/Dosbox/boxtron_358390_53608f.conf ./Stargunner/Stargunner/Dosbox/boxtron_auto.conf ./Stargunner/Stargunner/STARGUN.CONF ./SS1/dosbox_windows/daum/dosbox_systemshock.conf ./SS1/dosbox_windows/daum/dosbox_systemshockcd_launch_windows.conf ./SS1/dosbox_windows/daum/dosbox_systemshockfd_launch_windows.conf ./SS1/dosbox_windows/dosbox_systemshock.conf ./SS1/dosbox_windows/dosbox_systemshockcd_launch_windows.conf ./SS1/dosbox_windows/dosbox_systemshockfd_launch_windows.conf ./SS1/dosbox_windows/dosbox_systemshock_config_windows.conf ./Terminal Velocity/Terminal Velocity/Dosbox/dosbox.conf ./Terminal Velocity/Terminal Velocity/TV.conf ./Tomb Raider (I)/dosbox.conf ./Tomb Raider (I)/dosboxTR.conf ./Tomb Raider (I)/dosboxTRWindowed.conf ./Tomb Raider (I)/TOOLS/config_template/dosbox_ddraw.conf ./Tomb Raider (I)/TOOLS/config_template/dosbox_default.conf ./Tomb Raider (I)/TOOLS/config_template/dosbox_direct3d.conf ./Ultimate Doom/base/dosbox.conf ./Ultimate Doom/base/ultimate.conf ./Ultimate Doom/base/ultimatem.conf ./Wacky Wheels/Wacky Wheels/Dosbox/dosbox.conf ./Wacky Wheels/Wacky Wheels/Wacky.conf ./Wizardry6/dosbox_windows/daum/dosbox_wizardry6.conf ./Wizardry6/dosbox_windows/daum/dosbox_wizardry6_launch_windows.conf ./Wizardry6/dosbox_windows/dosbox_wizardry6.conf ./Wizardry6/dosbox_windows/dosbox_wizardry6_launch_windows.conf ./Wizardry7/dosbox_windows/daum/dosbox_wizardry7.conf ./Wizardry7/dosbox_windows/daum/dosbox_wizardry7_launch_windows.conf ./Wizardry7/dosbox_windows/dosbox_wizardry7.conf ./Wizardry7/dosbox_windows/dosbox_wizardry7_launch_windows.conf ./Wolfenstein 3D/base/dosbox.conf ./Wolfenstein 3D/base/wolf3d.conf ./Wolfenstein 3D/base/wolf3dc.conf ./Spear of Destiny/base/dosbox.conf ./Spear of Destiny/base/SOD.conf ./Word Rescue/Word Rescue/Dosbox/dosbox.conf ./Word Rescue/Word Rescue/WORD.conf ./Worms/worms.conf ./XCom UFO Defense/dosbox.conf ./X-COM Terror from the Deep/dosbox.conf ./XCom Apocalypse/dosbox.conf ./Xenophage/Xenophage/Dosbox/dosbox.conf ./Xenophage/Xenophage/XENO.CONF ```
Note: I manually removed some lines from the above output, here's a sample of what those looked like: ``` ./Doom 2/doomsday/mkspecs/common/sanitize.conf ./Doom 2/doomsday/mkspecs/common/gcc-base.conf ./Doom 2/doomsday/mkspecs/common/qcc-base-qnx-aarch64le.conf ./Doom 2/doomsday/mkspecs/common/watchos.conf ./Doom 2/doomsday/mkspecs/common/gcc-base-mac.conf ./Doom 2/doomsday/mkspecs/common/linux.conf ./Doom 2/doomsday/mkspecs/common/msvc-desktop.conf ./Doom 2/doomsday/mkspecs/common/shell-unix.conf ./Doom 2/doomsday/mkspecs/common/tvos.conf ./Doom 2/doomsday/mkspecs/common/qcc-base-qnx-x86-64.conf ./Doom 2/doomsday/mkspecs/common/solaris.conf ./Doom 2/doomsday/mkspecs/common/clang.conf ./Doom 2/doomsday/mkspecs/common/qcc-base-qnx-armle-v7.conf ./Doom 2/doomsday/mkspecs/common/clang-mac.conf ./Doom 2/doomsday/mkspecs/common/g++-unix.conf ./Doom 2/doomsday/mkspecs/common/ios.conf ./Doom 2/doomsday/mkspecs/common/ghs-integrity-x86.conf ./Doom 2/doomsday/mkspecs/common/android-base-tail.conf ./Doom 2/doomsday/mkspecs/solaris-cc/qmake.conf ./Doom 2/doomsday/mkspecs/android-clang/qmake.conf ./Doom 2/doomsday/mkspecs/freebsd-g++/qmake.conf ./Doom 2/doomsday/mkspecs/haiku-g++/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-arm-msvc2017/qmake.conf ./Doom 2/doomsday/mkspecs/freebsd-clang/qmake.conf ./Doom 2/doomsday/mkspecs/openbsd-g++/qmake.conf ./Doom 2/doomsday/mkspecs/linux-aarch64-gnu-g++/qmake.conf ./Doom 2/doomsday/mkspecs/macx-icc/qmake.conf ./Doom 2/doomsday/mkspecs/aix-g++/qmake.conf ./Doom 2/doomsday/mkspecs/linux-g++/qmake.conf ./Doom 2/doomsday/mkspecs/dummy/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-arm64-msvc2019/qmake.conf ./Doom 2/doomsday/mkspecs/win32-icc-k1om/qmake.conf ./Doom 2/doomsday/mkspecs/wasm-emscripten/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-x64-msvc2015/qmake.conf ./Doom 2/doomsday/mkspecs/qnx-armle-v7-qcc/qmake.conf ./Doom 2/doomsday/mkspecs/macx-ios-clang/qmake.conf ./Doom 2/doomsday/mkspecs/android-g++/qmake.conf ./Doom 2/doomsday/mkspecs/qnx-x86-64-qcc/qmake.conf ./Doom 2/doomsday/mkspecs/integrity-armv7/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-arm64-msvc2017/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-x64-msvc2019/qmake.conf ./Doom 2/doomsday/mkspecs/solaris-cc-64/qmake.conf ./Doom 2/doomsday/mkspecs/linux-icc/qmake.conf ./Doom 2/doomsday/mkspecs/integrity-armv7-imx6/qmake.conf ./Doom 2/doomsday/mkspecs/solaris-cc-stlport/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-arm-msvc2019/qmake.conf ./Doom 2/doomsday/mkspecs/macx-g++/qmake.conf ./Doom 2/doomsday/mkspecs/solaris-g++-64/qmake.conf ./Doom 2/doomsday/mkspecs/hurd-g++/qmake.conf ./Doom 2/doomsday/mkspecs/win32-msvc/qmake.conf ./Doom 2/doomsday/mkspecs/linux-g++-32/qmake.conf ./Doom 2/doomsday/mkspecs/solaris-g++/qmake.conf ./Doom 2/doomsday/mkspecs/solaris-cc-64-stlport/qmake.conf ./Doom 2/doomsday/mkspecs/lynxos-g++/qmake.conf ./Doom 2/doomsday/mkspecs/linux-arm-gnueabi-g++/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-x64-msvc2017/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-arm-msvc2015/qmake.conf ./Doom 2/doomsday/mkspecs/linux-icc-k1om/qmake.conf ./Doom 2/doomsday/mkspecs/hpuxi-g++-64/qmake.conf ./Doom 2/doomsday/mkspecs/winrt-x86-msvc2017/qmake.conf ./Doom 2/doomsday/mkspecs/macx-xcode/qmake.conf ```

These qmake.conf files could become a problem for the conf autodetection logic if we wanted to add the ability to play DOOM in dosbox-staging in the future.

d10sfan commented 2 years ago

@JoshuaFern

It looks like from that example that the bat script is saying to run goworms inside dosbox as it's launch script. Does that sound right?

Not sure how it knows where the files are though.

If that's the case maybe we can detect that the launch command was a bat file and read it to find what the dosbox commands are like the goworms.

JoshuaFern commented 2 years ago

It looks like from that example that the bat script is saying to run goworms inside dosbox as it's launch script. Does that sound right?

Yeah, the difference is that runworms.bat is run by Windows, where .\drivec\goworms.bat is run by dosbox.

d10sfan commented 2 years ago

@JoshuaFern

Ok, maybe the solution could be to look for an argument that ends in .bat (to look for the steam argument that uses the windows bat), then if that is detected read the file and look for the dosbox command and split on anything after that to look for the bat command and any conf commands. Does that sound workable?

JoshuaFern commented 2 years ago

Yeah, that sounds like it would work and be fairly simple.

d10sfan commented 2 years ago

@JoshuaFern Ok, do you want to give that part of the script a try, or would you prefer me to take a look at it?

d10sfan commented 2 years ago

@JoshuaFern

Also for adding individual games, the following would be roughly what it would look like in the packages.json file. Then the env file (https://github.com/luxtorpeda-dev/packages/blob/master/engines/dosbox-staging/env.sh) in the engines/dosbox-staging would need to get changed as well, to add the new app id. This is so the download will automatically get updated.

"appid": {
    "game_name": "Game Name",
    "download": [{
        "name": "dosbox-staging",
        "url": "https://github.com/luxtorpeda-dev/packages/releases/download/dosbox-staging-10/",
        "file": "dosbox-staging-common-10.tar.xz",
        "cache_by_name": true
    }],
    "command": "./run-dosbox-staging.sh",
    "use_original_command_directory": true,
    "engine_name": "dosbox-staging"
}

I think this is probably simple enough that that could be added for each game.

JoshuaFern commented 2 years ago

@JoshuaFern Ok, do you want to give that part of the script a try, or would you prefer me to take a look at it?

I'd prefer if you took this one, I'm somewhat busy at the moment.

JoshuaFern commented 2 years ago

I'd like to present the new iteration of the launch script, this version is a bit of a work in progress but right now it basically runs everything I throw at it.

#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR" && cd ..

shopt -s nocasematch

launch_cmd="runworms.bat" # Temporary test variable until a method for detecting the launch command is presented.
cur_args=($@)
new_args=(./dosbox-staging/dosbox)
new_args+=("-fullscreen")

# Handle cases with no arguments.
if [[ -z $cur_args ]]; then
    if [[ $launch_cmd == *"bat"* ]]; then
        bat_conf=$(basename $launch_cmd | xargs -I% find . -type f -iname "%")
        cur_args=$(cat $bat_conf | grep dosbox)
    elif [[ $launch_cmd == *"dosbox"* ]]; then
        echo "TODO: Try to handle Dosbox binary without launch options"
    fi
fi

# Process arguments.
for var in ${cur_args[@]}
do
    tmp_arg="${var//\\//}"
    if [[ ! -f "$tmp_arg" && $tmp_arg == *"conf" && $tmp_arg != "-"* ]]; then
        tmp_arg=$(basename $tmp_arg | xargs -I% find .. -type f -iname "%")
    elif [[ $tmp_arg == *"bat" ]]; then
        tmp_arg=$(basename $tmp_arg | xargs -I% find .. -type f -iname "%")
    elif [[ $tmp_arg == "-fullscreen" || $tmp_arg == *"\dosbox" || $tmp_arg == "-noconsole" ]]; then
        tmp_arg=""
    fi
    if [[ -n $tmp_arg ]]; then
        echo "Adding: $tmp_arg"
        new_args+=("$tmp_arg")
    fi
done

LD_LIBRARY_PATH="dosbox-staging/lib:$LD_LIBRARY_PATH" "${new_args[@]}"
d10sfan commented 2 years ago

@JoshuaFern

Looking good, https://github.com/luxtorpeda-dev/luxtorpeda/pull/117 adds the client part for having the exe in the arguments.

Let me know how that goes and what your changes to the packages json file end up being.

Thanks!

d10sfan commented 2 years ago

Merged the changes in thanks for the help!