Boxer
Boxer copied to clipboard
Returning Boxer's default to writing directly to Gameboxes instead of Gamebox State(s)
This problem has been outstanding for several years, so I'd like to get some feedback on returning the regular Boxer app to its original behaviour regarding gamebox file saving.
Currently, this fork defaults to writing all data to Gamebox States in ~/Library/Application Support/Boxer/Gamebox States. This behaviour is an accidental remnant of a WIP build of Boxer2 from 2018. In this thread alunbestor describes how gamebox states were only meant to be used in standalone builds, not the regular build.
Currently, the Boxer 2.0alpha built from source will always write game state to AppSupport, but this was a leftover from implementing standalone game apps, and it will not ship with this behaviour enabled by default.
The original behaviour for regular Boxer was to write directly to the Gamebox, and not use states at all. Alunbestor describes the necessary patch to return Boxer to its original behaviour:
For now, if you're building your own copy from source then you can override this behaviour by modifying _shouldShadowDrive: in BXSession+BXFileManagement.m to always return NO. This will cause all Boxer builds - regular and standalone - to write directly to the gamebox.
The plan was to add an option to enable/disable Gamebox State saves to AppSupport in the UI, but that never materialized. If that is not feasible, it seems reasonable to me to return this fork's regular Boxer behaviour back to NO for _shouldShadowDrive.
(Or, if someone can think of a better way of doing it that would preserve this behaviour only for the Standalone version, that would be even better!)
Please return to the simpler way of writing changes into the boxes. That would make sharing game boxes much easier, especially for those with saves.
Issue is compounded by the fact that same-named directories in different gameboxes will both be affected by a change to either of them as the gamebox states cannot distinguish between individual gameboxes if the path and filename are the same in each.
As a user who engages in a lot of file writing within the gamebox environment, Boxer is basically useless to me until this issue is resolved.
Issue is compounded by the fact that same-named directories in different gameboxes will both be affected by a change to either of them as the gamebox states cannot distinguish between individual gameboxes if the path and filename are the same in each.
Stumbled across the same problem just now after wrecking some of my gameboxes :-(
Seeing no action in response to this request for a year, I have went ahead and made the change myself. I have no idea how to create a pull request between Github and Bitbucket, so I'll paste the code here instead. I'll leave it up to @MaddTheSane if he wants to merge in the change.
In Boxer/BXSession+BXFileManagement.m, line 216:
#pragma mark - Drive shadowing
- (BOOL) _shouldShadowDrive: (BXDrive *)drive
{
//Don't shadow if we're not running a gamebox.
if (!self.hasGamebox)
return NO;
//Don't shadow read-only drives or drives that are located outside the gamebox.
if (drive.isReadOnly || ![self driveIsBundled: drive])
return NO;
//vga256: Force boxer to revert to original and intended Gamebox storage.
//do not use "Gamebox States" anymore.
//see https://github.com/MaddTheSane/Boxer/issues/49
return NO;
}
@livid @j0hnny63 @lnxbil: I've compiled a binary with Intel 64-bit and ARM64-bit support, that includes this patch, download here.
Not to mention that shadowing is super broken :3
For example, for Duke Nukem 3D I have DUKE3D.CFG (modified by setup) and DUKE3D.GRP (not modified by anyone!!) shadowed in Gamebox States, while GAME0.SAV and GAME1.SAV (actual save files) are in original game box 🥲
This was 2.0.0-alpha from my old MacBook; does it work correctly with newer versions?
And, as this is completely hidden new behaviour from updating Boxer, it is very easy to 1) transfer your DOS games to a new computer, then 2) find out that saves were not transferred after erasing the old computer :<