fix: late-joining visuals fix for imps [MTT-1558]
Description
This PR resolves the issue encountered when joining a game session already underway, where the late-joiner would see ghost imps. In-scene placed NetworkObjects were destroyed & despawned on the server, and so the joining client would always load new NetworkObjects which were not synchronized with the server.
Here, graphics GameObjects on the imps are instead selectively turned off when transitioning to the Dead state, and the imp is not destroyed/despawned anymore. The LifeState is then synced on joining clients, and on OnNetworkSpawn(), the graphics components are displayed accordingly to the latest LifeState.
Reason for draft: this is one avenue we can take. It occurs to me after integrating this approach that the imps in the additive scenes behave basically like pots. They can be respawned, redefeated, and so the progression of the game feels lost? The other approach we can do to keep this progression is to move all of the in-scene placed enemy NetworkObjects to the Boss Room scene, and destroy them as we were normally. This keeps the same feeling of progression. @SamuelBellomo this makes for a decent edu piece I feel.
Issue Number(s)
Contribution checklist
- [ ] Tests have been added for boss room and/or utilities pack
- [ ] Release notes have been added to the project changelog file and/or package changelog file
- [ ] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] JIRA ticket ID is in the PR title or at least one commit message
- [ ] Include the ticket ID number within the body message of the PR to create a hyperlink
@fernando-cortez
This keeps the same feeling of progression. @SamuelBellomo this makes for a decent edu piece I feel.
I'd talk about it as an alternative we considered in your edu piece, but wouldn't spend time on this in boss room (this would happen with singleplayer games as well, where putting ennemies in an additive scene would result in the same issue). Also, can you link to your edu PR or Jira ticket please?
Placed on hold as conversations are still evolving on the best solution.
Closing as this PR introduces the dynamic spawning solution.