Skip to content

Configure AI spawning and player spawn points in multiplayer minigames#466

Open
Shombith03 wants to merge 6 commits into
bleeding-edgefrom
claude/fix-game-modes-Offj3
Open

Configure AI spawning and player spawn points in multiplayer minigames#466
Shombith03 wants to merge 6 commits into
bleeding-edgefrom
claude/fix-game-modes-Offj3

Conversation

@Shombith03

Copy link
Copy Markdown
Contributor

Summary

Updated two multiplayer minigame scenes to configure AI player spawning and define player spawn points. This enables AI opponents to spawn automatically when the server is ready.

Key Changes

  • Script Reference Update: Changed the MonoBehaviour script reference from 60055a52b62641648a575758553575f7 to 46ca9ae8ce99408c800f5e10c8691427 in both scenes
  • Player Spawn Points:
    • MinigameJoust: Added 3 spawn point references (1468661147, 1074736317, 987654322)
    • MinigameCrystalCaptureMultiplayer: Added 2 spawn point references (1468661147, 1074736317)
  • AI Configuration:
    • Enabled spawnAIOnServerReady flag in both scenes
    • Added AI player prefab reference
    • Configured AI initialization data with player names (AI_1, AI_2, AI_3), avatar IDs, and spawn settings
    • Linked AI profile list asset (guid: 32e9d97079547024991d0d39d1417f69)
  • Spawn Timing: Maintained pre/post spawn delays at 200ms

Implementation Details

  • AI players are configured with IsAI: 1 and AllowSpawning: 1 flags
  • All AI players use vessel class 0
  • Joust minigame spawns 3 AI opponents; Crystal Capture spawns 2 AI opponents
  • Both scenes reference the same AI profile list for consistent AI behavior

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ

claude added 6 commits April 3, 2026 16:56
…itializerWithAI

Both scenes were using the base ServerPlayerVesselInitializer which lacks
DomainAssigner.Initialize(), AI backfill spawning, and had empty
playerSpawnPoints. Upgraded to ServerPlayerVesselInitializerWithAI
(matching HexRace) and wired spawn points, AI player prefab, AI init
data templates, and AI profile list.

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ
…enes

Both scenes were missing the Reflex ContainerScope prefab instance that
HexRace has, causing all [Inject] fields (gameData, etc.) to be null.
This produced NullReferenceExceptions in OnNetworkSpawn for
ServerPlayerVesselInitializerWithAI, NetworkScoreTracker,
NetworkVolumeUIController, and MultiplayerMiniGameControllerBase.

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ
The Game GameObject had a MonoBehaviour referencing a deleted script
(GUID 9f7a7af0f6bd4545ba6e0f5f622342c0, had a cellData field). This
caused the "referenced script on this Behaviour" warning on scene load.

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ
…mode

When RequestedTeamCount=1, NormalizeHumanDomains() was building a
validDomains set containing only Jade (TeamDomains[0]), rejecting the
player's chosen domain (e.g. Ruby) and defaulting everyone to Jade.

Fix: when teamCount=1, accept whatever domain the human player chose.
Also updated BuildTeamCounts() to include the player's actual domain
in single-team mode so AI backfill joins the correct team.

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ
Cell.cs was converted from [SerializeField] GameDataSO to [Inject],
but OnEnable() runs before Reflex injection (which happens between
Awake and Start). gameData was null in OnEnable(), so the
OnInitializeGame subscription never happened and Initialize() never
ran — preventing flora/gyroid spawning.

Added deferred subscription pattern: try in OnEnable(), retry with
duplicate guard in Start() when the injected field is available.

https://claude.ai/code/session_01XtEPzN4njxYA1CPfZSg1HQ
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.

2 participants