Boxer

Developer diary: plans and progress reports.

Remember Sammy Jankis Thursday 15th July 2010

Today’s new build is all about gameboxes and game configuration:

This build also fixes a number of recent UI bugs in OS X 10.5 which had busted the program panel and drive list. There’s no reason not to be downloading the new build right now dammit.

The inevitable long-winded feature tour

These improvements were all blockers for 1.0 final, and are more pieces of the game-installation IKEA wall unit screwed firmly in place. While none of these features are very visible, they do pave the way for exciting new things in Boxer’s future.

So, yet another metadata file?

Yup, gameboxes have been extended to add a new metadata file, Game Info.plist, which is stored in the gamebox’s root folder alongside DOSBox Preferences.conf.

In future Boxer versions, this file will store things like the game’s developer, publisher, year, genre, Mobygames page etc. This metadata would be used for Spotlight and Quicklook integration, and for a snazzy game manager UI I’ve been thinking about for a while.

For the moment however, this file only stores the game’s unique identifier.

Unique identifier, you say?

Many long-planned Boxer features have needed a way to unambiguously identify gameboxes, in order to associate external data with them: data that cannot be stored inside the gamebox itself for whatever reason.

For this purpose, Boxer now creates and stores a “unique” identifier for each gamebox, by generating an SHA-1 hash out of every executable file inside it. I put “unique” in quotation marks, because this approach has the desirable effect that the hash will be the same each time it is generated, and the same for anyone in the world running that version of that game.

This latter fact is crucial for another long-planned Boxer feature: integration with an online game repository. The idea is a kind of CDDB for games: to let Boxer automatically retrieve user-submitted metadata and configurations for newly-minted gameboxes. More on this in a future blog post!

A word on game detection

Boxer has had automatic game detection for most of its life, and it works by scanning the folder or gamebox you opened for files that match known games. This behaviour has been improved in this build to detect games outside of gameboxes once again, the same as Boxer 0.8x does.

Boxer has to be careful about how deep it scans for games, though. If you open a floppy disk, CD-ROM or gamebox then Boxer will scan the whole file heirarchy inside it, since it is known to be a manageable size. The rest of the time however, Boxer will only scan the base folder it is opening and will not search into any subfolders.

This is necessary to avoid massive slowdowns if you open (for example) your Home folder in Boxer. However, this does make Boxer less reliable at detecting games outside of gameboxes, since it may stop looking too early.

For historical reasons, Boxer 0.8x would save the autodetected configuration into the gamebox. Boxer 1.0 no longer does this: Boxer runs the auto-detection at every launch regardless, so it would be redundant to store it, and a stored configuration could get in the way of future corrections to the autodetected version. The gamebox configuration file is now meant solely for persisting a user’s own adjustments of the emulation settings.

Ah yes, persisting settings

When you adjust emulation settings from the CPU panel, Boxer works out what DOSBox configuration parameters would represent the changed settings and then writes those parameters back to the gamebox’s own configuration file.

Boxer now also compares against the parameters that are in the game’s auto-detected configuration file; if any are the same, they are stripped from the gamebox configuration file instead. This way, Boxer won’t store redundant settings.

Not all emulation settings are created equal of course. Some, like CPU speed and core optimization, concern the game itself and should apply to anyone playing it; these do belong in the gamebox configuration file. Others, like framerate or window size, are about your own Mac and your own personal preferences, and should only apply to you.

Such settings are not stored inside the gamebox configuration file anymore: instead, Boxer stores them inside its own application preferences, keyed to each gamebox by its unique identifier. This way, they don’t come along for the ride if you pass the gamebox on to someone else.

Commentary

  1. Is it possible to work up a way to set sound volume settings, per-game perhaps?

  2. Good question! I’ve been thinking about an application-wide volume control, since I often want to mute the sound and listen to my own music while testing games. And it would certainly be possible for Boxer to play with the emulation mixer settings (application-wide or per-game) to achieve this.

    However, what did you have in mind for individual games? It’s common for games have their own volume controls within the game, have you found some that have volume problems regardless?

    If there is a game that needs emulator-level tweaking in order to be audible, then that’s more a compatibility problem rather than a preference, and should be handled with an automatic configuration instead. For instance, Boxer has to configure The 7th Guest so that the voices aren't too soft to hear over the MIDI music.

  3. Multiple sessions. I have noted that some programs get upset (polite verbiage) if two copies/sessions are concurrent.

  4. That's true, if a DOS program stores state in temporary files within its folder/gamebox then another session of the same program can clobber the previous one's state. Finder will normally stop you from opening the same gamebox twice, instead just foregrounding the one that's already open, but you can still get a duplicate session if you open a gamebox again through the File menu.

    This problem could be mitigated by reimplementing what Boxer 0.8x does, which is to create per-session temporary folders in TemporaryItems and set those as the %TEMP% folder for their respective sessions. Many DOS programs will use %TEMP% instead of the base folder if it is defined, which would keep each session's scratch data separate.

  5. Multiple sessions continued: a trail-and-error oops?

  6. What do you mean?

  7. Multiple sessions continued: one will not know if the program will honor %TEMP% or not, until it malfunctions (oops). Then remember only-one rule for it.

  8. True, there's only so much that Boxer can do to avoid the problem and after that it's in the user's hands.

    A temp drive will be useful regardless: some games (like Descent 2 and Bethedsa games for instance) will leave leftover temporary cache files lying around in their gamebox, that they would otherwise put in the temp folder. Normally this is harmless and only happens when the game is terminated prematurely, but it's messy and takes up disk space all the same.

    My plan is to make this tempory folder drive X, hidden from the UI like Y and Z are but still accessible from DOS. It would be cool if this could be a RAM drive instead of a physical folder, but I'm too cowardly to start hacking DOSBox's C++ drive code to add such a feature in.

  9. Can we change the cd "in game" ?

  10. Sure! If you have physical CDs, just eject the first and put in the next one and Boxer will handle it automatically. If you have the discs as ISOs or folders, then you will need to use the Drives panel to unmount the first CD's drive and then add the next one as a new drive at the same drive letter.

  11. Tahnks a lot (and for all your job too). Do you think it will work, if i import the cd it the boxer Folder (like that"Cd.cdrom" and manually i create a new folder who i called "Cd2.cdrom" and copy into the content of this cd2) Best regards from France. :)

  12. You can manually import them like that yes - though I'd recommend waiting until next week for the next build, which will add one-click importing from the Drives panel.

  13. Fantastic work, as ever!

  14. As for sound: the game I'm thinking of [Project: Space Station] has zero volume control whatsoever. It was designed to play from the PC internal speaker 25 years ago. Love the game, but don't love having it at such a high volume.

  15. Ah right, that makes sense. It is possible to reduce the volume for PC speaker games by sending commands to the DOSBox MIXER, and I may play around to see if it's worth Boxer just lowering the PC speaker volume for all games if the default output volume is unnecessarily loud compared to soundcard audio.

    However, user adjustments could be handled just fine by an application-wide volume control I think.

Design by 40watt.