Closed Jpxe closed 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.
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."
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.
@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.
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[@]}"
@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.
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.
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.
@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.
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.
@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?
Yeah, that sounds like it would work and be fairly simple.
@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?
@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 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.
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[@]}"
@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!
Merged the changes in thanks for the help!
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
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