Overview
An Anime Game Launcher provides comprehensive game management features including installation, updates, predownloading, version tracking, and repair functionality. The launcher automatically detects your game state and guides you through necessary actions.Launcher States
The launcher uses a state-based system to determine what actions are available. Each state corresponds to a specific condition of your game installation.Launch - Ready to Play
Launch - Ready to Play
The game is fully installed and up-to-date. You can launch the game immediately.Button: “Launch” (green, play icon)
GameNotInstalled - Fresh Installation
GameNotInstalled - Fresh Installation
The game is not installed. The launcher will download and install the complete game files.Button: “Download” (download icon)File Location: Downloads to the path configured in
config.game.path.for_edition(config.launcher.edition)GameUpdateAvailable - Update Required
GameUpdateAvailable - Update Required
A game update is available. The launcher will download and apply the update.Button: “Update” or “Resume” (if partial download exists)Resume Support: If a file matching the update already exists in the temp folder, the button will show “Resume” instead of “Update”
GameOutdated - Version Too Old
GameOutdated - Version Too Old
Your installed game version is too old and cannot be updated incrementally.Button: Disabled with warning stylingTooltip: Displays version outdated messageAction Required: Manual game reinstallation
PredownloadAvailable - Pre-patch Available
PredownloadAvailable - Pre-patch Available
A pre-download for the next game update is available. You can download it in advance.Button: Separate predownload button (save icon)Tooltip: Shows version and download size for predownloadImplementation: Files are downloaded to
temp/updating-{matching_field}/.predownloadcompleteGame Installation
Initial Installation
Configure Game Path
Set your desired game installation path in the launcher preferences before downloading.The path is stored at
config.game.path.for_edition(config.launcher.edition)Start Download
When in
GameNotInstalled state, click the “Download” button.The launcher will:- Download game files using the configured thread count (
config.launcher.sophon.threads) - Show progress with downloading status and progress bar
- Automatically unpack and install files to the game directory
Wait for Completion
The download uses multi-threaded downloading for optimal speed.Progress Updates: Real-time progress tracking via
ProgressBarMsg::UpdateFromState(state)Error Handling: Download and unpacking errors are displayed with detailed error messagesGame Updates
Standard Updates
When a game update is available:- The launcher detects the version difference via
GAME.try_get_diff() - The state changes to
GameUpdateAvailable(diff)with the version diff information - Clicking “Update” triggers
download_diff::download_diff()which:- Downloads the update files to the temp folder if specified
- Applies the diff using
diff.install_to(game_path, threads, callback) - Updates launcher state upon completion
If the download is interrupted, the launcher will show “Resume” instead of “Update” if partial files exist in the temp folder.
Predownload System
The predownload feature allows downloading updates before they’re officially released. How it works:- A separate predownload button appears when
PredownloadAvailablestate is active - Shows the future version and total download size (game + all voice packs)
- Downloads to temporary folder:
temp/updating-{matching_field}/ - Creates
.predownloadcompletemarker file when finished - Button changes to success styling (green) when predownload is complete
Predownloaded files are automatically used when the update officially releases, saving time on update day.
Version Management
Version Detection
The launcher performs version checking during initialization:Voice Pack Management
Voice packs are treated as separate installable components:VoiceNotInstalled(diff)- Voice pack not installed for selected languageVoiceUpdateAvailable(diff)- Voice pack update availableVoiceOutdated(diff)- Voice pack version too old
Game Repair
The repair function is accessible via the application menu. Access: Menu → Repair Game Implementation: Located insrc/ui/main/repair_game.rs
What it does:
- Verifies game file integrity
- Redownloads corrupted files
- Fixes installation issues
File Locations
Game Files
- Installation Path:
config.game.path.for_edition(config.launcher.edition) - Data Folder:
{game_path}/{edition.data_folder()} - Web Caches:
{data_folder}/webCaches/(used for wish URL extraction)
Download Cache
- Temp Folder:
config.launcher.temporstd::env::temp_dir() - Update Files:
{temp}/updating-{matching_field}/ - Predownload Marker:
{temp}/updating-{matching_field}/.predownloadcomplete
Download Settings
Thread Configuration
Downloads use multi-threading for improved performance: Setting:config.launcher.sophon.threads
Usage: diff.install_to(game_path, config.launcher.sophon.threads as usize, callback)
Temp Folder Configuration
Configure a custom temporary folder for downloads:Using a dedicated temp folder on a fast drive (SSD) can significantly improve download and installation speeds.
Error Handling
The launcher provides detailed error messages for common issues:Download Errors
Unpacking Errors
Kill Game Process
If the game becomes unresponsive, you can force-close it: Button: “Kill Game Process” (red, appears when game is running) Implementation:State Update Flow
The launcher automatically updates its state after major operations:Trigger State Update
AppMsg::UpdateLauncherState is sent after downloads, installations, or configuration changes