14 KiB
Steamworks Setup Guide for Tekton Armageddon
This guide explains how to set up Steamworks for Windows, Mac, and Linux builds while using Nakama for mobile platforms (Android/iOS) for leaderboards, achievements, and shop functionality.
Overview
- Desktop (Windows/Mac/Linux): Single build that detects Steam at runtime
- If launched through Steam: Steam login available for Nakama registration; all features use Nakama
- If launched standalone: Uses Nakama for all features
- Mobile (Android/iOS): Uses Nakama for all backend services
- Unified Backend: All platforms use Nakama for achievements, leaderboards, and shop
- Steam Integration: Steam is only used for authentication (auth session ticket for Nakama login)
Prerequisites
Steamworks Setup
-
Steam Partner Account
- You need a Steam Partner account to access Steamworks
- Apply at: https://partner.steamgames.com/
-
Steam App ID
- Create a new app in Steamworks
- Note your App ID (e.g., 480)
- Update
steam_app_idinscripts/services/steamworks_manager.gd
-
Steamworks SDK
- Download the Steamworks SDK from Steamworks
- The GodotSteam plugin includes the SDK, but you may need it for reference
Installation Steps
1. Install GodotSteam GDExtension
Option A: Via Godot Asset Library (Recommended)
- Open Godot Editor
- Go to
Project > Asset Library - Search for "GodotSteam GDExtension 4.4+"
- Download and install the plugin
- Restart Godot Editor
Option B: Manual Installation
- Download from: https://codeberg.org/godotsteam/godotsteam/releases
- Download version 4.18.1 (compatible with Godot 4.6.2)
- Extract to
addons/godotsteam/in your project - Enable the plugin in
Project > Project Settings > Plugins
2. Configure Steamworks in Project
-
Enable the Plugin
- Go to
Project > Project Settings > Plugins - Enable "GodotSteam"
- Go to
-
Set Steam App ID
- Edit
scripts/services/steamworks_manager.gd - Change
steam_app_idto your Steam App ID:
var steam_app_id: int = YOUR_APP_ID_HERE - Edit
-
Add BackendService as Autoload
- Go to
Project > Project Settings > Autoload - Add
BackendServicewith path:res://scripts/services/backend_service.gd - Enable it as a singleton
- Go to
3. Configure Steamworks Features
Achievements
-
Define Achievements in Steamworks
- Go to Steamworks > Your App > Achievements
- Create achievements with API names (e.g., "first_win", "level_10")
- Set display names, descriptions, and icons
-
Use in Code
# Unlock an achievement BackendService.unlock_achievement("first_win") # Set progress (for progress-based achievements) BackendService.set_achievement_progress("kill_100_enemies", current_kills, 100) # Check achievement status var progress = BackendService.get_achievement_progress("first_win")
Leaderboards
-
Define Leaderboards in Steamworks
- Go to Steamworks > Your App > Leaderboards
- Create leaderboards with API names (e.g., "high_score", "fastest_time")
- Set sort order (ascending/descending) and display type
-
Use in Code
# Submit a score BackendService.submit_leaderboard_score("high_score", 1000) # Get leaderboard entries BackendService.leaderboard_entries_loaded.connect(_on_leaderboard_loaded) BackendService.get_leaderboard_entries("high_score", 1, 10) func _on_leaderboard_loaded(leaderboard_id: String, entries: Array): for entry in entries: print("Player: %s, Score: %d" % [entry.player_name, entry.score])
Shop (Steam Inventory)
Note: Steam shop functionality requires additional setup with Steam Inventory Service or Steam Microtransactions. This is a complex feature that requires:
-
Steam Inventory Service Setup
- Define items in Steamworks > Your App > Inventory
- Set item types, prices, and properties
- Implement purchase callbacks in
steamworks_manager.gd
-
Alternative: Use external payment processor for desktop and sync with Nakama
4. Export Presets
The project includes export presets for all platforms:
Desktop Builds (single build for Steam and standalone)
- Windows Desktop (preset.0) →
build/tekton_armageddon_v2.1.7.exe - macOS (preset.2) →
build/tekton_armageddon_v2.1.7.zip - Linux/X11 (preset.3) →
build/tekton_armageddon_v2.1.7.x86_64
Mobile Builds
- Android (preset.1) →
build/tekton-dash-armageddon-v.2.1.5.apk
Note: Desktop builds are universal - the same executable works on both Steam and standalone. The game detects whether it's running through Steam at runtime and switches backends accordingly.
Configure macOS Export
-
Code Signing (for distribution)
- Get an Apple Developer certificate
- Update
codesign/identityin export preset - Set
codesign/enabletotrue
-
Architecture
- Currently set to "universal" (Intel + Apple Silicon)
- Can be changed to "x86_64" or "arm64" if needed
Configure Linux Export
- Architecture
- Currently set to "x86_64"
- Add ARM64 preset if needed for Linux ARM devices
5. Platform Detection
The BackendService automatically detects the platform and backend:
# Detection logic in BackendService
if OS.has_feature("android") or OS.has_feature("ios"):
# Mobile → Nakama
elif OS.has_feature("steam"):
# Desktop → Steamworks
else:
# Desktop → Local storage (non-Steam builds)
You can check the current platform:
print("Platform: %s" % BackendService.get_platform_name())
print("Initialized: %s" % BackendService.is_initialized())
Platform Types
- DESKTOP_STEAM: Running through Steam client (Steam login available, all features use Nakama)
- DESKTOP_NAKAMA: Desktop build not running through Steam (uses Nakama)
- MOBILE_NAKAMA: Android/iOS (uses Nakama)
Runtime Detection
The game automatically detects the launch method:
- If
OS.has_feature("steam")is true → Steam login available, all features use Nakama - Otherwise → All features use Nakama
This means the same desktop build can be:
- Uploaded to Steam (Steam login enabled, all data stored in Nakama)
- Distributed standalone (all data stored in Nakama)
Steam Login for Nakama
When running through Steam, players can use their Steam account to register or log in to Nakama. This is the only Steam integration - all game features (achievements, leaderboards, shop) use Nakama.
How it works:
- Player clicks "Sign in with Steam" button on login screen
- Game retrieves Steam auth session ticket via Steamworks
- Auth ticket is sent to Nakama for authentication
- Nakama validates the ticket with Steam backend
- If valid, player is logged in/registered to Nakama
- Player's Steam account is linked to their Nakama account
Benefits:
- No password needed for Steam users
- Automatic account creation on first login
- Seamless cross-platform progression (all data in Nakama)
- Steam username is used as display name
- Unified backend across all platforms
Requirements:
- Nakama server must be configured with Steam API key
- Steamworks must be initialized (game launched through Steam)
- GodotSteam plugin must support
getAuthSessionTicket()
Configuration: Set your Steam API key in Nakama server configuration:
nakama:
social:
steam:
api_key: "your_steam_api_key"
Nakama Integration for Mobile
Current Setup
Your project already has Nakama integrated via addons/com.heroiclabs.nakama/ and NakamaManager autoload.
Connecting to BackendService
The BackendService will automatically use Nakama on mobile. You need to implement Nakama-specific methods in NakamaManager:
# In NakamaManager.gd, add these signals:
signal achievement_unlocked(achievement_id: String)
signal leaderboard_score_submitted(leaderboard_id: String, score: int, success: bool)
# Implement achievement methods
func unlock_achievement(achievement_id: String):
# Use Nakama's achievement system
var achievement = await client.write_storage_object_async(
session,
NakamaWriteStorageObject.new(
"achievements",
achievement_id,
{"unlocked": true, "timestamp": Time.get_unix_time_from_system()}
)
)
achievement_unlocked.emit(achievement_id)
# Implement leaderboard methods
func submit_leaderboard_score(leaderboard_id: String, score: int):
# Use Nakama's leaderboard system
var result = await client.write_leaderboard_record_async(
session,
leaderboard_id,
score
)
leaderboard_score_submitted.emit(leaderboard_id, score, result != null)
Testing
Testing Steam Builds
-
Export Steam Build
- Use the "Windows Desktop (Steam)" preset (preset.0)
- Export to
build/steam/tekton_armageddon_v2.1.7.exe
-
Upload to Steam
- Upload the exported build to Steamworks
- Set as the default build for your app
-
Run through Steam
- Launch the game via Steam (not directly)
- Steam must be running
- Check console for "SteamworksManager: Steam initialized successfully"
-
Test Achievements
- Call
BackendService.unlock_achievement("test_achievement") - Check Steam overlay (Shift+Tab) to see achievement unlock
- Call
-
Test Leaderboards
- Submit scores via
BackendService.submit_leaderboard_score() - View in Steamworks backend or Steam overlay
- Submit scores via
Testing Non-Steam Builds
-
Export Non-Steam Build
- Use the "Windows Desktop (Non-Steam)" preset (preset.1)
- Export to
build/standalone/tekton_armageddon_v2.1.7.exe
-
Run Directly
- Run the executable directly (not through Steam)
- Check console for "BackendService: Initialized Nakama backend"
-
Test Leaderboards
- Ensure Nakama server is accessible
- Open the leaderboard panel to fetch rankings
- Submit scores via
UserProfileManager.submit_to_leaderboard() - Leaderboards are global (same as mobile)
-
Test Shop
- Ensure Nakama server is accessible
- Open the shop panel to fetch catalog
- Purchase items via
UserProfileManager.purchase_item() - Shop functionality works the same as mobile
Testing Nakama (Mobile)
-
Run on Mobile Device
- Export to Android/iOS using the Android preset (preset.2)
- The game will automatically use Nakama backend
- Check logs for "BackendService: Initialized Nakama backend"
-
Test in Editor
- To test Nakama in editor, temporarily modify
_detect_platform():
func _detect_platform() -> void: current_platform = Platform.MOBILE_NAKAMA # Force Nakama - To test Nakama in editor, temporarily modify
Troubleshooting
Steamworks Not Initializing
Problem: "SteamworksManager: Failed to initialize Steam"
Solutions:
- Ensure game is launched through Steam (not directly)
- Check Steam is running
- Verify
steam_app_idis correct - Check GodotSteam plugin is enabled in Project Settings
- Restart Godot Editor after installing plugin
Achievements Not Unlocking
Problem: Achievements don't appear in Steam overlay
Solutions:
- Ensure achievement API names match Steamworks configuration
- Check
steam.storeStats()is called after setting achievements - Verify achievement is published in Steamworks (not in draft)
- Test with Steam overlay open (Shift+Tab)
Leaderboards Not Working
Problem: Leaderboard scores not submitting
Solutions:
- Ensure leaderboard exists in Steamworks
- Check leaderboard API name matches
- Verify leaderboard is published
- Check console for error messages
Platform Detection Issues
Problem: Wrong backend being used
Solutions:
- Check OS features:
print(OS.get_supported_features()) - Manually override platform in
_detect_platform()for testing - Ensure
BackendServiceis added as autoload
File Structure
scripts/services/
├── backend_service.gd # Unified interface (autoload)
└── steamworks_manager.gd # Steamworks implementation
export_presets.cfg # Export presets for all platforms
docs/STEAMWORKS_SETUP.md # This documentation
Additional Resources
- GodotSteam Documentation: https://godotsteam.com/
- GodotSteam GitHub: https://codeberg.org/godotsteam/godotsteam
- Steamworks Documentation: https://partner.steamgames.com/doc/home
- Nakama Documentation: https://heroiclabs.com/docs/nakama/
Next Steps
- Complete Steam Partner account setup
- Create Steam app and get App ID
- Install GodotSteam plugin
- Configure achievements and leaderboards in Steamworks
- Implement Nakama methods in
NakamaManagerfor mobile - Test on all target platforms
- Set up code signing for macOS distribution
- Configure Steam Inventory Service if using in-game shop
Notes
- Steam builds only work when launched through Steam client
- Non-Steam builds use Nakama for leaderboards and shop (same as mobile)
- Shop functionality is available on both Steam (via Steam Inventory) and non-Steam (via Nakama)
- Non-Steam builds sync to Nakama server, not Steam
- Nakama is already integrated for multiplayer, leaderboards, and shop
- Export presets are organized in separate folders:
build/steam/andbuild/standalone/
Build Workflow
For Steam Distribution
- Export using Steam presets (preset.0, preset.3, preset.5)
- Upload builds to Steamworks
- Configure achievements and leaderboards in Steamworks backend
- Set build as default in Steamworks
- Shop uses Steam Inventory Service (requires additional setup)
For Standalone Distribution (itch.io, GOG, etc.)
- Export using Non-Steam presets (preset.1, preset.4, preset.6)
- Distribute the standalone executables
- Ensure Nakama server is accessible to players
- Players get global leaderboards and shop via Nakama
- No Steam integration required
For Mobile Stores
- Export using Android preset (preset.2)
- Upload to Google Play / App Store
- Ensure Nakama server is configured and accessible
- Leaderboards and shop work the same as non-Steam desktop