Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

V0.0.5 - Split Player Index assignment from Player Object Assignment

Pre-release
Pre-release

Choose a tag to compare

@CyanLaser CyanLaser released this 09 Dec 16:46
· 18 commits to main since this release

Change Notes

Updated the Object Pool to now be two prefabs:

  • CyanPlayerObjectPool - Assigns and syncs indices to players.
  • CyanPlayerObjectAssigner - Given player index assignment, assigns objects to players. Multiple of these can exist in the scene.

This change allows prefab authors to make their own object pools using this system without conflicting with other prefabs using the pool and wasting network bandwidth. Prefab authors, please read the updated readme on how to structure your prefabs. Example prefabs coming soon.

Features

  • Multiple Object assigners can exist in the scene and use the same player index assignment without using more network bandwidth
  • Better user prefab support for distributing
  • Dragging an Object Assigner prefab into the scene will auto add the Object Pool system for you if one doesn't already exist in the scene.
  • Object Assigners can be used to notify Udon of player index assignments, without needing to assign an object.
  • Added new Inspectors to help with setting up the object pool
    • Easily change size of the object pool
    • See all Object Assigners in the scene
    • Set a prefab for an Object Assigner and auto spawn prefab instances.
  • Updated Pool listener methods
    • Removed OnAssignmentChanged event
    • OnPlayerAssigned and OnPlayerUnassigned no longer give player ID but do give the a valid VRCPlayerApi of that player as well as the index assigned to or unassigned from this player.

Bug Fixes

  • Added checks for if serialization failed and auto retry.
  • Fixed issue where serialization may never happen due to float comparison errors.
  • Delay assignments on Master until serialization has finished to reduce delay between master and remote clients.
  • Check network status before serializing, resulting in faster serialization overall in heavy networked worlds.
  • Fixed CyanTrigger example where playerAssignedPlayer variable was misspelled.

Breaking Changes

Note: that this has breaking changes if you are using previous versions
Due to the splitting of the prefab, some work will be needed to update old systems to this new version.

  1. Add the new "PlayerObjectAssigner" prefab into the scene
  2. Move all pooled objects as children of this new prefab
  3. Fix all references to the object pool in your Udon programs to use this new prefab instead
    1. (U# users) Change all references of type CyanPlayerObjectPool to CyanPlayerObjectAssigner to fix any compile errors
  4. (Optional) set the pool listener reference in the PlayerObjectAssigner, if it was assigned in the previous PlayerObjectPool

Screenshots

image image image