VOGONS


First post, by naerbnic

User metadata
Rank Newbie
Rank
Newbie

Since a very common usage of DOSBox is to run games, it would make sense to package up games into an easily loadable and configurable format. Perhaps I've not figured out the trick of doing this, but let me get the idea out anyway.

Idea: Create a new package "format" for DOSbox which will easily let users load DOS applications through a single command-line call, or through a simple GUI interface

Mechanics: The package format I have in mind is trivial, and would easily be able to work with the existing DOSbox code.

Create a directory with a name "<appname>.dosbox". For the purposes of this example, we'll use game.dosbox as the directory name. This directory will then contain the following tree:

game.dosbox/
--> configs/
----> default.ini
----> install.ini
----> (etc.)
--> data/
----> (any data the package maker wants)

The .ini files will be standard DOSbox config files. DOSbox can now be called with the command line "DOSbox game.dosbox". When this happens, here is the sequence of operations it performs:

  1. It sets "data/" as the default working directory, which commands like "mount" can use implicitly (e.g. "mount c foo" will mount the directory game.dosbox/data/foo/ as C: ).
  2. It loads "configs/default.ini" as per the normal DOSbox config file loader, including any autoconf.bat instructions.

Other config files can be loaded using the syntax "DOSbox game.dosbox <cfgname>". In this case, it looks for "configs/<cfgname>.ini" instead, and runs DOSbox with that.

Some reasons why this is a good idea:

  • Allows for games to be individually packaged, and relocatable on a filesystem.
  • Gives users a potentially platform-independent way of wrapping their games, minimizing the difficulty of moving it to other computers
  • Attaches configuration options (such as memory usage, sound card configurations, etc.) to the particular game, instead of all games, depending on what is actually necessary
  • Can potentially give dosbox.com a standard way of providing configurations for particular games, providing the configurations as part of the compatibility table to make individual games run as well as possible
  • Simplifies the work for dosbox frontends, and potentially provides a more consistent method of operation for the multitude of existing frontends.

Naturally, this is the simplest version of this idea, and there are a number of possible extensions, of which I'll list some here:

  • Include a metadata file inside of the root for purposes of frontends, to allow them to give information such as title, developer, publisher, release date, etc.
  • Instead of a directory structure, use an existing packaging format (e.g. zip) to keep the contents of the directory inside a single file. On many platforms, with the addition of shell-level configurations, this should make DOS games double-clickable.
  • Create an associated file format which can be copied and distributed without any copyright issues, which provide configurations and instructions to "bake" a particular game into a full package if the user provides their own disk images for the game. This will provide a more user-friendly way of setting a game up without running afoul of copyright laws (if that is ultimately an issue)
  • Allow a disk image to be read only, implementing a union file-system on top of the ones mounted as part of the image. These could automatically be placed in a users home directory. This prevents the packages from collecting cruft, and potentially allows them to have the advantage of any other read-only format (e.g. using a CRC or hash to assure that you've created an image correctly)

I'm willing to work on the basics if I can get a few yay's for the idea. Anyone out there like this? Know any reason I shouldn't do this? Is someone working on something similar?

"So...what's it like to be a turtle?"
"It's a lot like being a walking house that eats lettuce."

- naerbnic

Reply 1 of 8, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

You little genius, you.

Do not want, do not need. No real benefit over the way DOSBox works now. The large majority of DOS games have to be installed, which is not made easier in any way by the stuff you're describing.

Reply 2 of 8, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

It has already been done - by yours truly 😀

I have no documentation for the system except for the help feature, so all I can offer is the code and some examples.

The code is in the archive DOSBox-CLU-commands.zip. Unpack it and put the CMD-files somewhere in your path. Do a Start => Run... => cmd.exe,
CD to a fresh folder and do a:

DOSBox-CLU /help

You should get a text like this:

DOSBox-CLU - a DOSBox Command Line Utility
By MiniMax

DOSBOx-CLU uses informationen embedded in a dosbox.conf file to automate the
process of installing and running DOS applications in DOSBox.

Here is an example from a dosbox.conf file for a shareware episode of
Death Rally:

# Title: Death Rally v1.1 - Shareware episode
# Publisher: Apogee Software
# Year: 1996
# Link: http://www.3drealms.com/rally/
#
# Archives: 1ral11.zip
# Config-files: C:\RALLY\DR.CFG
# Save-games: C:\RALLY\DR.SW?

[autoexec]
mount C "C-drive"
mount D "Unpacked" -t cdrom

The important parts are the Archives, Config-files, and Save-games entries.
Running DOSBox-CLU from the same folder as this dosbox.conf file will first
create a folder named "C-drive", and next unpack the file "1ral11.zip" into a
folder called "Unpacked". Finally DOSBox is launched, and the [autoexec]
section is used to mount "C-drive" as the emulated hard-disk, and "Unpacked" as
the emulated CD-ROM.

From there it is all the same, old DOSBox procedure: Switch to D:, run the
installer, switch to C:, run the setup program, and run the game.

DOSBox-CLU can also be run with a few command line options:

/unpack Only do the unpacking. Do not launch DOSBox.

/run No unpacking, just launch DOSBox.

/backup Create 2 (Zip) archives with the files mentioned by the Config-
files and Save-games entries. Useful if you want to save disk-
space by deleting the "C-drive" and the "Unpacked" folders.

/restore Unpack the 2 archives "Game-configs.zip" and "Save-games.zip" into
their original location. Useful after doing a (re)install of the
game.

/info Lists some of the comments in the dosbox.conf file.

I have also include 2 examples of how the dosbox.conf files with all the magic info that I use look like. That should get you started.

Attachments

  • Filename
    DOSBox-CLU-commands.zip
    File size
    9.15 KiB
    Downloads
    282 downloads
    File comment
    DOSBox Command Line Utility (2009-08-24)
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox.conf
    File size
    2.69 KiB
    Downloads
    328 downloads
    File comment
    Magic dosbox.conf for the game Beneath a Steel Sky
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox.conf
    File size
    9.95 KiB
    Downloads
    475 downloads
    File comment
    Magic dosbox.conf for the game Death Rally (shareware version)
    File license
    Fair use/fair dealing exception
Last edited by MiniMax on 2009-09-17, 16:22. Edited 7 times in total.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 8, by IIGS_User

User metadata
Rank Oldbie
Rank
Oldbie
naerbnic wrote:

The .ini files will be standard DOSbox config files. DOSbox can now be called with the command line "DOSbox game.dosbox".

No, the ini files you mentioned will be called dosbox.conf, like before. Right? 😉
Partially conf files could be called gamename.conf, likewise.

naerbnic wrote:

Simplifies the work for dosbox frontends, and potentially provides a more consistent method of operation for the multitude of existing frontends.

You are describing frontend technology here. 🤑
Call Vigil whether he want to port his Boxer frontend to Windows/Linux, because it uses similar technology as you've described. 😀

Klimawandel.

Reply 4 of 8, by Vigil

User metadata
Rank Newbie
Rank
Newbie

Boxer has indeed done basically all of this for OSX. Boxer is currently OSX-only and I'm in no hurry to port it for other OSes, but I can give documentation for the internal behaviour of the program (or just the sourcecode) if desired.

Boxer's package format was designed to use off-the-shelf filesystem features, and to allow packages to be created ad-hoc just by renaming a game's folder with the ".boxer" extension. No constraints are put on the internal file structure of a package (besides a few optional extra features below), and local configuration files are generated inside the package by Boxer when the package is first opened. Boxer auto-detects about four dozen games (and counting) that have specific emulation requirements and gives them customised configuration files at that point. Modifications to CPU speed and frameskip while the game is running are automatically written back to the package's configuration file, and I plan to make it remember fullscreen/windowed toggle in a future version too.

Boxer handles drive mounting automatically based on the package's file structure: no explicit configuration is needed and any CD-ROMs in the computer's CD/DVD drive (or ISOs mounted in OSX) are automatically mounted in DOS. The base folder of the package is mounted as drive C; additional drives can be added to a game package simply by naming folders in the package with .cdrom, .floppy or .harddisk extensions: these are then mounted in DOS as drives of the appropriate type when the package is launched. Likewise, isos within a package are automatically detected and mounted. Boxer handles all path translation between the OSX filesystem and its representation in DOSBox: click on a program inside a game package from OSX, and the package will be mounted and the program launched relative to it. Drive letters are assigned automatically, though they can also be overridden manually simply by naming a drive's folder to start with a single letter.

Game installation is in most cases a breeze, as Boxer creates a new package when it detects that an installer is being launched. 19 times out of 20 one can just tell the game's installer to install to *anywhere* on drive C and the end result will be a fully-functioning, self-contained game package containing the game's installed files. After installing from a CD or ISO, Boxer will also offer to copy the source disc into the package (as a .cdrom folder) so that the source disc is no longer required to run the game.

Boxer's package format has a few features that are specific to OSX: mainly that packages act as opaque files on OSX and they can be launched just by clicking on them (there's a right-click menu option to view their contents instead). Launching a package will ask the user to choose which program inside it to run, and it will optionally remember that choice for next time so that the game will start as soon as the package is launched. This program choice is recorded using a symlink, which is OSX/Unix-specific and will not work on Windows, but that was not a crucial design choice and could be replaced/supplemented with an explicit path statement in a configuration file.

I think it's worth emphasising again that *no* creation or modification of configuration files is required of the user at any stage, and as little information as possible is stored in configuration files. Instead, Boxer makes almost all decisions about the DOS environment at runtime based on the package file structure, which allows packages to be created and modified fairly freely without needing to sync a configuration file to what the filesystem is already saying.

This approach to packaging games has had about 8 months of 'field testing' behind it and has proven its worth in the wild. When implemented right, the approach makes installing and launching games exponentially simpler, and packages are a much more elegant way of storing and distributing those games as well.

While Boxer's package format is not an ideal cross-platform solution in its current state, I strongly recommend that similar systems be looked at. The key to adoption is to make it easy to create packages - make the format obvious and simple, make it flexible and fault-tolerant, don't place overly specific requirements on the format's internal structure and use the filesystem tools that people already have.

Reply 5 of 8, by naerbnic

User metadata
Rank Newbie
Rank
Newbie

First, thanks for your input everyone. I hadn't heard of Boxer before. Sounds intriguing. Fortunately, I have a mac which I can run it on to try it out, so I can see first-hand what you're talking about.

The only issue is that a few components of the general idea can't be done with any of the projects referenced here. First, I'd like any such format to be platform independent and appear as a single file. Having double-clickable files in Windows which can be automatically executed would be convenient, certainly. Second, having a Union FS over an installation to separate game specific configuration/saves from the game data files would seem to be useful.

In any case, I'm going to investigate and see what's out there.

In other news, does anyone other than me find it odd that the dosbox.conf file contains some properties which are dependent on the capabilities of the client computer running it (e.g. frames skipped, screen resolution, fullscreen) and others which have to deal with the configuration of the emulated computer (how much EMS/XMS there is, which devices/video cards are available), even though they are, in effect, separate sets of configuration?

Thanks again,

"So...what's it like to be a turtle?"
"It's a lot like being a walking house that eats lettuce."

- naerbnic

Reply 6 of 8, by Vigil

User metadata
Rank Newbie
Rank
Newbie

Indeed, user-specific preferences (like client screen resolution) should really be kept out of publicly-distributed configuration files. The ability to apply multiple configuration files makes it much easier to do so, but almost every game I have seen distributed with dosbox (from Sierra, GOG, Steam, abandonware, you name it) does not bother. Which makes a package format all the more attractive - the local configuration file can be a very specific subset storing only parameters specific to the game, not the user.

A union filesystem would have a lot of good benefits, and it may be possible to do this on OSX and other Unix systems in a transparent way. However, I think the holy grail of complete platform interoperability will make any (non-trivial) package format extremely difficult to manipulate using each plaftorm's existing filesystem tools, which in turn would hinder adoption.

Edit: having said that, FUSE for Unix (and MacFUSE for OSX) would probably remove that difficulty on supporting platforms, though (mac)FUSE would need to be installed by the user first.

Reply 7 of 8, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

Did anything ever eventuate from this? With the AnyDayNow(tm) release of the OpenPandora I'd like to have an easy way to take my games with me and synchronise the savegames etc. with my main PC. A package format would be ideal for that.

I too was thinking of a zip with a cut down dosbox.conf for sound card IRQs etc. and anything not specified (screen resolutions and render methods) to come from the system-wide config. I'm not thinking of this as an installer package though (which is what MiniMax's utility looks to be), I'm thinking of it more along the lines of this file could be copied somewhere and that's the install. Then double-click on it to play the game.

These are the main issues I see that will need to be overcome before something like this would work:

  • Need host-independent way of setting the emulator speed (e.g. 8086, 80286, max)
  • Need overlay or the like to allow savegames and self-modifying .exe files to do their thing without modifying the original package
  • Need alternate configs for games that behave differently in different environments (e.g. Zone 66 gives you different music depending on whether you have a Sound Blaster or a GUS.)
  • Package would need to support folders as well as disk images for those games with unusual disk requirements

I think it's worth avoiding filesystem-level features like FUSE to union the filesystem as that would be a portability nightmare. Adding some sort of copy-on-write filesystem to DOSBox might be overkill but would at least allow this to work anywhere DOSBox does.

Reply 8 of 8, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
Malvineous wrote:

I'm not thinking of this as an installer package though (which is what MiniMax's utility looks to be), I'm thinking of it more along the lines of this file could be copied somewhere and that's the install. Then double-click on it to play the game.

Well, the beauty of my little hack is that it can be anything. In the config-file you specify an archive-file. This file is then unpacked into "Unpacked" (unless Unpacked already exists). Now, it could be a set of non-installed files, in which case "C-drive" is usually mounted as C, and "Unpacked" mounted a D, and then the rest of the autoexec-section is responsible for doing the copying/installation.

But nothing prevents you from putting together an archive consisting of an already installed game, and then mount "Unpacked" as C and ignoring the "C-drive" directory.

Malvineous wrote:

Need overlay or the like to allow savegames and self-modifying .exe files to do their thing without modifying the original package

DOSBox-CLU can handle that too - in a way. In addition to the Archive, the config-file also allows you to specify Save-games and Config-files patterns. The /backup option can then be used to copy those files into 2 external Zip-files, one with the save-games, and one with the config files. And /restore will of course do the opposite.

EDIT: Updated my post above with DOSBox-CLU-commands.zip (2009-08-24).

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32