stride3d / stride3d/stride

Archetypes and Collection Ids not supported for arrays

Open
#3,213 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-GameStudio bug
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:

  1. Define an array with a non zero size in a component
  2. Add the component to a scene
  3. Save the scene
  4. Open the Yaml
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.