Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve scene format #1398

Open
RiscadoA opened this issue Dec 3, 2024 · 0 comments
Open

Improve scene format #1398

RiscadoA opened this issue Dec 3, 2024 · 0 comments
Assignees
Labels
A-Engine B-Scene P-Urgent This issue is a big priority, and it would be good to close it ASAP
Milestone

Comments

@RiscadoA
Copy link
Member

RiscadoA commented Dec 3, 2024

Problem

Our current scene format isn't well-fitted for an editor. The distinction between the scene/sub-scene hierarchy and the child of hierarchy is hard to understand and represent.

Solution

We should change our scene format to something more standard, which considers the ChildOf relations.

My and @jdbaracho's proposal is the following format:

{
  "components": {
    "Car": {
      "speed": 100
    }
  },
  "entities": {
    "left-spot-light": {
      "components": {
        "cubos::engine::SpotLight": {}
      }
    },
    "right-spot-light": {
      "components": {
        "cubos::engine::SpotLight": {}
      }
    }
  }
}

Each scene essentially describes an entity and it's children. One confusing weird part of this are relations. I think they could be placed in an extra field, alongside "components".

{
  "relations": {
    "foo@cubos::engine::SpringConstraint@bar": {
      "strength": 0.4
    }
  },
  "entities": {
    "foo": {}
    "bar": {}
  }
}

Imports could also be placed in an extra field, "imports".

{
  "imports": {
    "subscene": "/assets/subscene.cubos"
  }
}

Given that we're giving ChildOf so much importance, it might make sense to make ChildOf a core relation, instead of part of a plugin.

@RiscadoA RiscadoA added this to the 0.6 milestone Dec 3, 2024
@RiscadoA RiscadoA self-assigned this Dec 3, 2024
@RiscadoA RiscadoA added the P-Urgent This issue is a big priority, and it would be good to close it ASAP label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Engine B-Scene P-Urgent This issue is a big priority, and it would be good to close it ASAP
Projects
None yet
Development

No branches or pull requests

1 participant