Skip to content

perf: replace all remaining unneeded PlanetData creation instances#1242

Open
OH296 wants to merge 2 commits into
Adeptus-Dominus:mainfrom
OH296:legacyPlanetData
Open

perf: replace all remaining unneeded PlanetData creation instances#1242
OH296 wants to merge 2 commits into
Adeptus-Dominus:mainfrom
OH296:legacyPlanetData

Conversation

@OH296

@OH296 OH296 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Replaced remaining direct PlanetData constructions with cached get_planet_data(planet) calls across UI, AI, missions, navy/orks, and battle/event paths. Cuts allocations and keeps a single, consistent planet state.

  • Refactors
    • Swapped new PlanetData(...) for system/star.get_planet_data(planet) in combat alarms, star selection, feature UI, enemy AI, events, mission init/complete flows, navy/guard/ork logic, recruit math, and post‑battle handling.
    • Removed manual cache writes and deletes (e.g., target.system_datas[...] = p_data), centralizing lookups to avoid copy divergence.

Written for commit 5f37fca. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added Size: Small Type: Performance Refactor sub-type that improves performance labels Jun 16, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files

Confidence score: 1/5

  • In scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml, using undefined _orbiting instead of orbiting creates a deterministic runtime crash when that path executes, so fleet/star handling can fail immediately in gameplay — rename to orbiting (and run a quick smoke test of the fleet orbit flow) before merging.

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would require human review. This refactor replaces direct PlanetData construction with cached getters across UI and core subsystems. While performance-focused, it risks subtle state/caching bugs and needs human review.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Small Type: Performance Refactor sub-type that improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant