Archetypes and Collection Ids not supported for arrays
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: After #3212
Version: See above
Platform(s): Gamestudio
Describe the bug
Arrays cannot currently derive from their source in a base prefab or have collection ids attached.
To Reproduce
Steps to reproduce the behavior:
- Define an array with a non zero size in a component
- Add the component to a scene
- Save the scene
- Open the Yaml
- Notice the lack of collection Ids
Additional context
Some of the support for that already exists, we can attach Ids to arrays, but some of the internal logic called through AssetPropertyGraph.ReconcileWithBaseNode work with the expectation that collections processed support addition and removal. Arrays are fixed size, they don't support such operations. We would have to rewrite some of that logic to either work on replacing items or setup a specific path for arrays.
Additionally, a safeguard has been placed here
https://github.com/Eideren/xenko/blob/f3238d95c039e8f5163a984a510b60096b78e5ff/sources/assets/Stride.Core.Assets/CollectionIdGenerator.cs#L113-L117
To ensure no ids are generated before we fix the above.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CollectionIdGenerator.cs at the linked safeguard and trace AssetPropertyGraph.ReconcileWithBaseNode, focusing on how fixed-size arrays are handled. Reproduce the issue by saving a scene with a non-zero-size array and inspecting its YAML. Done means arrays can derive from base prefabs and retain collection IDs without relying on collection addition or removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100