Skip to content

Feature/global world settings#49

Closed
bohemianjack wants to merge 8 commits intorockfactory:mainfrom
bohemianjack:feature/global-world-settings
Closed

Feature/global world settings#49
bohemianjack wants to merge 8 commits intorockfactory:mainfrom
bohemianjack:feature/global-world-settings

Conversation

@bohemianjack
Copy link
Copy Markdown

Code Changes Summary: feature/global-world-settings (2025-11-15)

TL;DR

  • Introduces global (world-level) building permissions with optional per-factory overrides.
  • The solver now respects these constraints so plans never suggest disallowed buildings.
  • New UI in Game Settings and Factory views to manage allowed/overridden buildings, with sync to remote storage.

Why This Matters

Players and planners often want to impose rules on which buildings are permissible (challenge runs, milestones, server rules, or performance limits). Until now, these constraints were manual and easy to violate by accident. With global building permissions and factory-level overrides:

  • You get a single source of truth for what’s allowed across the save.
  • The solver can only propose feasible solutions that honor those rules.
  • You still retain flexibility to make exceptions at the factory level where needed.

Scope

Introduce world-level building management with per-factory overrides; ensure solver enforcement; add intuitive UI and syncing so settings persist and travel with the save.

Key Changes (by commit message)

  • 69825b0 — add factory-specific building override UI
  • ae80eec — add building management UI to game settings
  • beaf016 — add building sync mechanism for factories
  • 748577f — integrate building restrictions into solver system
  • a6c5cbf — add factory-level building override actions
  • d451940 — implement game-level building management
  • 9a4ddb0 — add allowedBuildings field to Game and Factory interfaces (older base commit; later rewritten for author)

Functional Highlights

  • World-level allowedBuildings define the baseline set of permissible buildings.
  • Factory-level overrides allow enabling/disabling specific buildings for that factory only.
  • Solver integrates these constraints so generated graphs/recipes won’t include disallowed buildings.
  • Sync layer persists allowed/overridden buildings and keeps local/remote in step.
  • UI in game settings + factory views to manage permissions quickly (bulk and granular controls).

UX Details

  • Discoverability: Global controls live in Game Settings; per-factory controls live alongside factory configuration.
  • Feedback: The solver avoids suggesting disallowed buildings, reducing trial-and-error.
  • Flexibility: Per-factory overrides let you diverge from global defaults for special cases.

Modules/Areas Touched (high-level)

  • src/games/settings/ — settings UI for building management
  • src/factories/ — per-factory override controls and state
  • src/recipes/ and src/solver/ — enforcement of building restrictions
  • src/core/ and src/games/ — data shapes (allowedBuildings) and store slices

Backward Compatibility & Migration

  • Existing saves continue to work; new fields default sensibly.
  • Initializers/migrations ensure allowedBuildings is present where needed without user action.

Verification

  • Manual:
    • Verified that you can toggle global settings on/off from settings menu and that it carries over into new factories.
    • Verified that toggling a building off globally removes it from solver suggestions; per-factory override re-enables it locally.

- Add Game.allowedBuildings to track globally unlocked buildings per save
- Add Factory.allowedBuildings for factory-specific building overrides for the global settings
- Supports Satisfactory-style persistent building unlocks
- Initialize new games with empty allowedBuildings array

- Add toggleGameBuilding() to manage individual buildings

- Add setGameAllowedBuildings() for batch updates

- Add enableAllGameBuildings() and disableAllGameBuildings() helpers

- Add useGameAllowedBuildings() hook for UI access
- Add setFactoryAllowedBuildings() to enable/disable factory overrides

- Add toggleFactoryBuilding() for granular factory building control

- Allows factories to have custom building settings independent of game
- Update createSolver() to accept allowedBuildings parameter

- Calculate blockedBuildings based on allowedBuildings

- Solvers inherit factory-specific buildings or fall back to game-level

- Ensures solver respects building availability constraints
- Add syncGameBuildingsToFactories() to propagate game building changes

- Respects factory-level overrides when syncing

- Keeps all factories aligned with game settings unless overridden
- Add Available Buildings section with checkboxes for each building

- Add Enable All / Disable All buttons for quick configuration

- Buildings automatically sync to all factories on change

- Provides clear explanation of Satisfactory-style unlock system
- Add Factory Override toggle switch in solver limitations

- Allow factories to override global building settings

- Checkboxes disabled when using global settings

- Shows contextual help text based on override state

- Enables specialized factory configurations
@bohemianjack
Copy link
Copy Markdown
Author

Sorry meant to do this in my forked project, will push when changes are finalized.

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.

1 participant