Skip to content

feat: Add scenario/mod hook system (Issue #483)#494

Merged
PipFoweraker merged 2 commits intomainfrom
issue/483-mod-hook
Dec 13, 2025
Merged

feat: Add scenario/mod hook system (Issue #483)#494
PipFoweraker merged 2 commits intomainfrom
issue/483-mod-hook

Conversation

@PipFoweraker
Copy link
Owner

Summary

Implements a minimal but complete scenario loading system that allows custom game configurations without code changes. This demonstrates expansion promise - content can scale beyond solo dev.

Key Features:

  • ScenarioLoader class for loading scenario JSON files from godot/data/scenarios/ or user://scenarios/
  • Scenario selection dropdown in Custom Game setup screen
  • Support for overriding starting resources (money, compute, reputation, doom, etc.)
  • Support for custom events in scenarios
  • Support for custom start dates

Sample Scenarios Included:

  • Bootstrap Mode: Extra resources for learning the game
  • Crisis Mode: Challenging start with higher doom (2020 start date)
  • Sandbox Mode: Unlimited resources for experimentation

Documentation:

  • Complete format specification in docs/SCENARIOS.md
  • Examples for common use cases
  • Troubleshooting guide

Technical Changes

File Change
godot/scripts/data/scenario_loader.gd New ScenarioLoader class
godot/autoload/game_config.gd Added scenario_id field with save/load
godot/scripts/game_manager.gd Added _apply_scenario_overrides()
godot/scripts/core/events.gd Extended to include scenario events
godot/scripts/ui/pregame_setup.gd Scenario dropdown and description
godot/scenes/pregame_setup.tscn UI elements for scenario selection
docs/SCENARIOS.md Complete documentation
godot/data/scenarios/*.json 3 sample scenarios

Test Plan

  • Launch game and navigate to Custom Game
  • Verify "Scenario" dropdown appears with 4 options (Standard + 3 custom)
  • Select each scenario and verify description updates
  • Launch Bootstrap Mode - verify increased starting resources
  • Launch Crisis Mode - verify reduced resources, higher doom, 2020 start date
  • Launch Sandbox Mode - verify very high resources
  • Verify scenario selection persists after game restart
  • Drop a new .json file in scenarios folder and verify it appears without code changes

Closes #483

🤖 Generated with Claude Code

PipFoweraker and others added 2 commits December 13, 2025 19:07
Implements a minimal but complete scenario loading system that allows
custom game configurations without code changes.

New Features:
- ScenarioLoader class for loading scenario JSON files from
  godot/data/scenarios/ or user://scenarios/
- Scenario selection dropdown in Custom Game setup screen
- Support for overriding starting resources (money, compute, etc.)
- Support for custom events in scenarios
- Support for custom start dates

Sample Scenarios Included:
- Bootstrap Mode: Extra resources for learning
- Crisis Mode: Challenging start with higher doom
- Sandbox Mode: Unlimited resources for experimentation

Documentation:
- docs/SCENARIOS.md with complete format specification
- Examples and troubleshooting guide

Technical Changes:
- GameConfig: Added scenario_id field with save/load support
- GameManager: Added _apply_scenario_overrides() for resource injection
- GameEvents: Extended check_triggered_events() to include scenario events
- pregame_setup: Added scenario dropdown and description display

Closes #483

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@PipFoweraker PipFoweraker merged commit 6eb2017 into main Dec 13, 2025
16 checks passed
@PipFoweraker PipFoweraker deleted the issue/483-mod-hook branch December 13, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal scenario/mod hook (stub ok, but real)

1 participant