Skip to content

v0.20

Latest

Choose a tag to compare

@firstbaseman firstbaseman released this 26 May 00:06

SMB4 League Import Tool v0.20

v0.20 is a major safety, cleanup, compatibility, and hardening release for SMB4 League Import Tool.

TLDR: The tool still helps you register, unregister, manage, and export Super Mega Baseball 4 custom league/franchise saves, but it is now much safer around master.sav, better at protecting against broken registrations, easier to troubleshoot, friendlier for Wine/Proton/Steam Deck users, and cleaner internally. It also now blocks risky actions while SMB4 is running, because the game loads .sav files into memory on startup. Hell yeah.

What Changed

Blocks Actions While Super Mega Baseball 4 Is Running

image

v0.20 now checks whether Super Mega Baseball 4 appears to be running before performing save-related actions.
The tool checks for the SMB4 executable/process name:

supermegabaseball.exe

If the game is running, the tool blocks:

  • Loading league/franchise saves
  • Saving registration changes
  • Exporting a save file

This matters because SMB4 loads .sav files into memory on startup. Editing save files while the game is open can cause changes to be ignored, overwritten, or not reflected until the game is restarted. The check uses the executable/process name rather than a PID because PIDs change every time a program launches. This should also be more appropriate for Steam, EA App, Wine, Proton, and Steam Deck scenarios.

Safer master.sav Saving

The tool is much more careful when writing registration changes back to master.sav.
Instead of casually overwriting the live file, the tool now:

  • Rebuilds the updated save data separately first.
  • Creates a timestamped backup of master.sav.
  • Only replaces the original file after the new version is ready.
  • Avoids directly overwriting the live save file mid-process.

If something goes sideways, there is a much better chance your original master.sav survives.

Backup files look something like this:

master.sav.20260403-153012-123.bak

Better Protection Against Missing Save Files

The tool now checks whether registered entries actually have matching league-*.sav files.
This matters because master.sav can point to a league or franchise save that no longer exists. If that happens, SMB4 may expect a save file that is missing.

If you try to save a registration that points to a missing non-default save file, the tool warns you instead of blindly writing a broken reference.

Safer Registration Planning

The registration flow is now cleaner and less prone to accidental state drift.

Previously, reading the grid could mutate the stored row ViewModel. That worked, but it blurred the line between loaded save state and current checkbox state.

v0.20 separates those concepts:

Loaded row data stays stable.
Current checkbox state is read separately.
The planner builds the new registration list from that snapshot.

The user-facing behavior is the same, but the save path is safer and easier to reason about.

The current internal flow is closer to:

Grid checkbox state
→ Registration change planner
→ Ordered registered GUID list
→ master.sav rewrite

Safer Filename Repair

SMB4 league save files have an internal ID/GUID. Sometimes a file gets copied, renamed, exported, shared, or manually moved, and the filename no longer matches the save file's internal ID.

v0.20 can detect that mismatch.

The important part: it does not silently fix it behind your back. If the tool finds a filename/internal GUID mismatch, it asks first. If you approve the repair, the file is renamed to match its internal ID. If another file already exists with the target name, the tool creates a backup first.

The repair prompt now also shows an example mismatch, including:

League/Franchise name
Current filename
Expected filename

So instead of just saying “something is mismatched,” the tool gives you a concrete example of what it found.

New Diagnostic Logging

The tool now writes diagnostic logs. Logs are useful when something fails to load, save, export, rename, or clean up. Instead of trying to guess what happened, you can check the log and get a much clearer trail.

Logs include:

  • Tool version
  • Windows/.NET version
  • Selected saves folder
  • Load, save, and export events
  • Filename repair results
  • Cleanup events
  • Errors and exceptions
  • Runtime environment details

On native Windows, logs are stored here:

%LOCALAPPDATA%\SMB4LeagueImportTool\Logs\SMB4LeagueImportTool.log

There is also an Open Logs Folder button in the tool. No more digging around AppData like a raccoon with a flashlight.

Global Error Logging

If the app trips over something unexpected, it should leave footprints.

Unexpected errors are now logged too. If something slips past the normal error handling, the tool tries to write the details to the log file before showing an error message.

Wine / Proton / Steam Deck Compatibility Improvements

SMB4 League Import Tool is still a Windows app. There is no native Linux build yet.

That said, v0.20 includes best-effort support for users running the tool through Wine, Proton, Steam Deck, or Protontricks.

The tool can now:

  • Detect when it appears to be running under Wine or Proton.
  • Log Wine/Proton environment details.
  • Detect the expected Super Mega Baseball 4 Steam App ID: 1487210.
  • Warn if the tool appears to be running inside the wrong Protontricks prefix.
  • Use a more Linux-friendly log path when possible.
  • Fall back to the Wine prefix's Windows-style LocalAppData path if needed.
  • Use clearer compatibility-safe path handling internally.

For Protontricks users, choose:

Super Mega Baseball 4 (1487210)

That helps make sure the tool is running inside SMB4's own Proton prefix instead of some random fake Windows basement.

If you are manually selecting your SMB4 saves folder on Linux or Steam Deck, look for the folder containing:

master.sav
league-*.sav

Common Steam Linux save locations may appear through Wine as paths like:

Z:\home\<user>\.local\share\Steam\userdata\<SteamUserId>\1487210\remote

or:

Z:\home\<user>\.steam\steam\userdata\<SteamUserId>\1487210\remote

Exact paths can vary depending on Steam install location, Steam Deck setup, Flatpak installs, custom prefixes, and Wine/Proton configuration.

This is compatibility support, not native Linux support. The tool is still a Windows executable.

Steam Cloud Warning Cleanup

Steam Cloud detection was cleaned up and moved into its own internal service.
If Steam Cloud appears to be enabled, the tool warns you that Steam may overwrite local save changes.

Recommended:

  • Close SMB4 before editing saves.
  • Back up your saves first.
  • Temporarily disable Steam Cloud if needed.
  • Re-enable Steam Cloud only after confirming everything works.

Steam Cloud is useful, but when you are editing save files manually, it can also be the friend who “helps” by undoing your work.

Smarter Save Button

The Save Changes button now only enables when there are real pending registration changes.
If you toggle a checkbox and then toggle it back to its original state, the tool now knows there is nothing new to save.
Small thing, big quality-of-life improvement.

Unsaved Change Warnings

The tool now warns before throwing away unsaved registration changes.

You will get a warning if you try to:

  • Reload leagues/franchises
  • Select a different saves folder
  • Close the tool

This helps prevent the classic “wait, did I save that?” problem.

Better Grid Safety

The league/franchise table is safer now.
The tool ignores grid-change events while it is loading rows programmatically. That prevents false “pending changes” states during loading. v0.20 also clears stale grid rows if a selected folder contains master.sav but no league-*.sav files. The app already avoided saving in that condition, but now the grid visually reflects the current folder too.

No ghost rows. No UI gaslighting.

Export Improvements

Exporting selected league-*.sav files is cleaner now.
The tool better checks whether the selected row actually has a real save file before trying to export it. If a save is missing, you get a clearer warning.
Export is also blocked if SMB4 appears to be running, because the file on disk may not match what the game currently has loaded in memory.

Safer SQLite Connection Handling

v0.20 replaces manually built SQLite connection strings with a small internal SQLite connection factory using SqliteConnectionStringBuilder.

Before, the tool built connection strings manually, like:

Data Source=...;Mode=ReadOnly;Pooling=False;

That usually works, but manually building connection strings can be fragile if paths contain unusual characters.

The tool now has clearer SQLite access paths:

Read-only SQLite access
Writable SQLite access

This does not change how users interact with the app, but it makes the database plumbing safer and easier to maintain.

Cleaner Internal Code

A lot of code was reorganized so the main WinForms form is no longer doing every job by itself.

Logic is now split into clearer pieces:

Core/
  Save loading
  Save scanning
  Save exporting
  master.sav registry updates
  Steam Cloud detection
  Wine/Proton environment detection
  Running-game detection
  SQLite connection creation
  Logging
  Temp cleanup
  Folder validation
  Constants and SQL queries

Models/
  Row data
  Load results
  Scan results
  Save plans
  Validation results

Basically, for you coders out there, the app is easier to maintain, easier to debug, and less likely to become one giant cursed form file.

Centralized SMB4 Save Assumptions

Common SMB4 save-file details now live in one place instead of being scattered around the code.

That includes:

  • master.sav
  • league-*.sav
  • league-
  • .sav
  • Steam Cloud marker file
  • Super Mega Baseball 4 Steam App ID: 1487210
  • Super Mega Baseball 4 executable/process names
  • Old temp folder name
  • SMB4 SQLite query strings
  • League type labels like Default, Custom, and Franchise

This makes future changes safer. If something needs to change later, there are fewer places for bugs to hide.

Updated README

The README was updated to explain:

  • What the tool does
  • What it does not modify
  • How backups work
  • Where logs are stored
  • How Steam Cloud can interfere
  • How filename repair works
  • How Wine/Proton/Steam Deck compatibility works
  • How to run the self-contained EXE
  • What information to include when reporting issues

Technical Notes

v0.20 strengthens the architecture introduced across the v0.19 cleanup work.

The important internal shift is that the app now has a clearer separation between:

UI state
Loaded league/save data
Registration planning
master.sav rewriting
Save scanning and filename repair
Runtime/process safety checks
SQLite connection creation

The core flow is now closer to:

LeagueImportForm
  User interaction and orchestration

LeagueImportLoader
  Load pipeline

LeagueSaveScanner
  league-*.sav discovery, metadata reading, and filename repair

LeagueDisplayBuilder
  Display ordering and row grouping

LeagueRegistrationChangePlanner
  Registration save-plan logic

MasterLeagueRegistry
  master.sav read/write behavior

SqliteConnectionFactory
  Safe SQLite connection creation

Smb4GameProcessDetector
  Running-game safety checks

Models
  App state, scan results, load results, row data, and save plans

This matters because the WinForms form is no longer responsible for every important piece of behavior. It still coordinates the workflow, but more of the actual save/scanner/planner logic now lives in focused classes.

That makes future work safer and reduces the odds of the app turning into one giant haunted form file.

Release Packaging Notes

This version is intended to be distributed as a self-contained Windows executable.

You should be able to run:

SMB4LeagueImportTool.exe

without installing the .NET runtime separately.

If the tool is distributed in a ZIP, extract the ZIP before running it.

Do not run the EXE directly from inside the ZIP.

Important Reminder

This tool modifies SMB4 save registration data.

Always back up your SMB4 saves before using it.

Close Super Mega Baseball 4 before using the tool. SMB4 loads save files into memory on startup, so editing saves while the game is running can cause changes to be ignored or overwritten.

Steam Cloud can also overwrite local save edits, so be careful when using save-editing tools with Steam Cloud enabled.

LIT does not edit league contents, rosters, players, uniforms, stats, teams, or franchise data inside individual save files. It primarily updates the registration list in master.sav.

Summary

v0.20 is a major safety, compatibility, and maintainability release.

The tool should now be:

  • Safer when SMB4 is running
  • Safer with master.sav
  • Better at avoiding broken registrations
  • Easier to troubleshoot
  • Cleaner internally
  • Less prone to accidental registration-state drift
  • More robust around SQLite connection handling
  • Clearer around filename repair prompts
  • More reliable during normal use
  • Friendlier to Steam Deck/Linux users running through Wine, Proton, or Protontricks
  • Better prepared for future features