Skip to content

Conversation

@stephanmeesters
Copy link

@stephanmeesters stephanmeesters commented Dec 22, 2025

Goal of this refactor PR

These functions all refer to GameLogic

  1. Check that reset is always called before startNewGame
  2. Remove the code in startNewGame that is already handled in reset
  3. GameInfo appears to have an unnecessary local variable, use TheGameInfo everywhere
  4. Call reset and the end of init as this code was duplicated

Overview of startNewGame

  1. in SP, set up the load screen and return on the first call so the real start happens from the update loop (in case of a new game)
  2. Initialize defaults and globals; resolve the active GameInfo (network/skirmish/challenge/replay) and copy per-game restrictions (e.g., superweapon limits).
  3. Fill in random sides/colors/start positions, bring up the load screen, and tear down any background UI.
  4. Load map.ini, load the terrain map, and prepare the side list for MP/skirmish.
  5. Build player sides/teams from slots (plus a replay observer), reset team/player lists, and notify the script engine of the new map.
  6. Configure victory conditions, radar, world extents, partition manager, ghost objects, and terrain newMap.
  7. Spawn bridge landmarks, refresh radar/pathfinding, and reveal shroud per observer/MP rules.
  8. Instantiate map objects (trees/props/logic objects), assign teams/positions, update behaviors, and register with pathfinding.
  9. Place initial network buildings/units, preload assets, set up the tactical view and initial camera position.
  10. Finalize relationships/skill points, drive load progress and fade-out, switch UI/control bar to the target mode, and clear loading state.

@stephanmeesters stephanmeesters force-pushed the refactor-gamelogic-startnewgame branch 2 times, most recently from f926932 to 8cb26a4 Compare December 22, 2025 17:01
@stephanmeesters stephanmeesters force-pushed the refactor-gamelogic-startnewgame branch from 8cb26a4 to 78ea6d6 Compare December 23, 2025 15:50
@stephanmeesters stephanmeesters marked this pull request as ready for review December 23, 2025 15:53
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