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

Create function to create the shorter binary of the world #10

Open
osvegn opened this issue Jan 11, 2024 · 1 comment
Open

Create function to create the shorter binary of the world #10

osvegn opened this issue Jan 11, 2024 · 1 comment

Comments

@osvegn
Copy link
Owner

osvegn commented Jan 11, 2024

Create a function that create a binary object of the world with the shorter size.

@osvegn
Copy link
Owner Author

osvegn commented Jan 17, 2024

Informations should contains world information.
A world contains each of those part: resources, entities and systems.
A resource contains a type and a data.
A entities contains an ID and a list of components.
A component contains a type and a data.
A system contains a type and a state.

The way to perform a good world image in this ECS should be this way:

  • 4 control bytes (such as magic number)
  • (1 byte for now) 2 bits to know which element follow (resources description: 00, entities descriptions: 01, systems descriptions: 10)
  • 00 [
    • 1 byte to know the number of resources (0-256)
    • [
      • (1 byte for now) X bits to fit resource different type count, which describe the type
      • 1 byte for the size of resource data in bytes
      • Y bytes of data
        ]
        ]
  • 01 [
    • 16 bits to know the number of entities (0-65 535)
    • [
      • 16 bits to know entity ID
      • 8 bits to know the number of components
      • [
        • X bits to fit component different type count, which describe the type
        • 8 bits for the size of resource data in bytes
        • Y bytes of data
          ]
          ]
          ]
  • 10 [
    • 8 bits to know the number of systems (0-256)
    • [
      • X bits to fit system different type count, which describe the type
      • 1 bit to know if it is active or not
        ]
        ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant