Files
tekton/launcher/README.md
T
2025-12-10 02:35:17 +08:00

125 lines
3.7 KiB
Markdown

# Tekton Launcher
A custom game launcher for **tekton-local** with auto-update functionality via itch.io.
## Features
- **Version Checking** - Automatically checks for game updates on launch
- **Progress Tracking** - Visual download progress with percentage
- **Checksum Verification** - MD5/SHA256 validation for downloaded files
- **Backup System** - Automatic backup before updates with rollback support
- **News Feed** - Displays devlog and announcements from itch.io
- **Changelog Display** - Shows what's new in each version
## Project Structure
```
launcher/
├── project.godot # Godot 4.4 project file
├── icon.svg # Launcher icon
├── scenes/
│ └── launcher.tscn # Main launcher scene
├── scripts/
│ ├── config.gd # Global configuration (URLs, colors)
│ ├── launcher_main.gd # Main orchestration script
│ ├── version_checker.gd # Version comparison and manifest fetching
│ ├── download_manager.gd # HTTP downloads with progress
│ ├── update_applier.gd # Backup, install, and rollback
│ └── news_fetcher.gd # News/devlog fetching
└── server/
└── version.json # Example version manifest
```
## Setup
### 1. Configure itch.io URLs
Edit `scripts/config.gd` and update:
```gdscript
const ITCH_GAME_URL := "https://your-username.itch.io/tekton-local"
const VERSION_MANIFEST_URL := "https://your-username.itch.io/tekton-local/data/version.json"
```
### 2. Host version.json on itch.io
Upload the `server/version.json` file to itch.io alongside your game files. Update it whenever you release a new version.
### 3. Export the Launcher
1. Open `launcher/project.godot` in Godot 4.4
2. Go to **Project > Export...**
3. Add a Windows Desktop preset
4. Export as `TektonLauncher.exe`
### 4. Creating Game Patches
Use the PowerShell script in the main project:
```powershell
.\tools\create_patch.ps1 -Version "1.0.0"
```
This will:
- Update `version.txt` in your game
- Generate checksums for the PCK file
- Create a JSON snippet to add to `version.json`
## Workflow for Releasing Updates
1. Make changes to the main game
2. Update `version.txt` with the new version number
3. Export the game as PCK only from Godot
4. Run `create_patch.ps1` to generate checksums
5. Upload the new PCK to itch.io
6. Update `version.json` with the new release entry
7. Upload updated `version.json` to itch.io
Players will see the update next time they launch the game!
## UI Theme
The launcher features a cyberpunk-inspired dark theme:
- Primary: Cyan (#00d4ff)
- Secondary: Magenta (#ff00aa)
- Background: Dark blue-black (#0a0a1a)
Customize colors in `scripts/config.gd`.
## Cross-Platform Support
The launcher automatically detects the operating system and:
| Platform | Executable | PCK File | Launch Method |
|----------|------------|----------|---------------|
| Windows | `tekton-local.exe` | `tekton-local-windows.pck` | Direct process |
| Linux | `tekton-local.x86_64` | `tekton-local-linux.pck` | chmod +x, then launch |
| macOS | `tekton-local.app` | `tekton-local-macos.pck` | `open -a` command |
### Multi-Platform Releases
When releasing for multiple platforms, use platform-specific keys in `version.json`:
```json
{
"version": "1.0.0",
"pck_windows": {
"url": "https://..../tekton-local-1.0.0-windows.pck",
"size": 52428800,
"checksum_md5": "..."
},
"pck_linux": {
"url": "https://..../tekton-local-1.0.0-linux.pck",
"size": 52428800,
"checksum_md5": "..."
},
"pck_macos": {
"url": "https://..../tekton-local-1.0.0-macos.pck",
"size": 52428800,
"checksum_md5": "..."
}
}
```
The launcher will automatically download the correct PCK for the current platform.