Skip to content

Conversation

@fernando-cortez
Copy link
Contributor

@fernando-cortez fernando-cortez commented Jun 7, 2021

Part two of player persistence task. Jira here.

Breaking changes:

  • Names do not display above a character's head and are also not hooked up to PartyHud UI. That will be restored in a subsequent PR.

Changes:

  • Introduction of PersistentPlayer prefab. This is now MLAPI's "Default Player Prefab". This contains two NetworkBehaviours (name and character type). Next PR will integrate these NetworkVariables into ServerCharSelect and ServerBossRoomState for spawning. These NetworkObjects represent each player connection and as the name suggests, persist across scenes.
  • Player prefab has been renamed to PlayerAvatar. This prefab is spawned with client ownership inside of BossRoom scene.
  • PlayerGraphics prefab has been refactored to serve as the parent prefab for all character graphics. Character graphics for all 8 character types are variants of this root, with their associated model.
  • Avatar ScriptableObject that now represents a player character. This contains a reference to the avatar's CharacterClass SO, as well as its associated graphics prefabs. Avatar SO also serializes a GUID.
  • A corresponding SO registry (AvatarRegistry) has been created to associate all Avatars to the game. As a dev, this is the starting point for adding a new Character to the game.
  • To be able to mimic sending SO references across the network, NetworkGuidState has been introduced. The usage of this NetworkVariable<byte[]> can be seen inside CharacterContainer, where the received Avatar Guid is validated from the AvatarRegistry.

@fernando-cortez fernando-cortez added the 1-Needs Review PR needs attention from the assignee and reviewers label Jun 7, 2021
@fernando-cortez fernando-cortez changed the title Feature/player persistence base foundation Feature/player persistence prefab refactor Jun 7, 2021
[SerializeField]
AvatarRegistry m_AvatarRegistry;

void Awake()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect symmetry in this class
For awake and for register, I would expect a destroy and a unregister

@fernando-cortez fernando-cortez merged commit 63ecd92 into develop Jul 14, 2021
@fernando-cortez fernando-cortez deleted the feature/player-persistence-base-foundation branch July 14, 2021 14:13
SamuelBellomo added a commit that referenced this pull request Jul 20, 2021
* develop:
  Feature/player persistence prefab refactor (#349)
  upping MLAPI develop version (#355)
  Update to MLAPI: onnetworkspawn refactoring, player prefab removed from networkmanager prefab list (#352)

# Conflicts:
#	Assets/BossRoom/Prefabs/NetworkingManager.prefab
#	Packages/packages-lock.json
Cosmin-B added a commit that referenced this pull request Sep 14, 2021
* feature/adding-UTP:
  Adding ParrelSync and updating third party notice.md (#357)
  updating to latest UTP
  Feature/player persistence prefab refactor (#349)
  upping MLAPI develop version (#355)
  Update to MLAPI: onnetworkspawn refactoring, player prefab removed from networkmanager prefab list (#352)
  porting to UTP

# Conflicts:
#	Assets/BossRoom/Prefabs/NetworkingManager.prefab
#	Assets/BossRoom/Scenes/Startup.unity
#	Assets/BossRoom/Scripts/Client/BossRoom.Client.asmdef
#	Assets/BossRoom/Scripts/Shared/BossRoom.Shared.asmdef
#	Assets/BossRoom/Scripts/Shared/Game/UI/Editor/NetworkLatencyWarning.cs
#	Packages/manifest.json
#	Packages/packages-lock.json
#	ProjectSettings/PackageManagerSettings.asset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-Needs Review PR needs attention from the assignee and reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants