Giter Site home page Giter Site logo

Load Entities from RON about amethyst HOT 7 CLOSED

amethyst avatar amethyst commented on July 22, 2024 2
Load Entities from RON

from amethyst.

Comments (7)

zakarumych avatar zakarumych commented on July 22, 2024 3

@Xaeroxe We should abstract away from any particular data formats where possible (and doesn't hit performance). Loading entities from any serde::Deserializer is better than just .ron
And I'd recommend using binary formats in production.

from amethyst.

msiglreith avatar msiglreith commented on July 22, 2024

Remark: Relevant specs issue amethyst/specs#18

from amethyst.

 avatar commented on July 22, 2024

After taking a look at the ability to load a world/map in #145, I'm wondering how this will work for that use case. Using this approach for loading individual entities seems fine, but I think doesn't address the overall question of how to load a game world. It seems like we can proxy off most/all of the "real work" of loading entities/components to specs-rs, so if this looks right from Amethyst's POV, I can go propose this over there to see if there's any interest. Basically, it would look something like this:

impl State for SomeExample {
    fn on_start(&mut self, ctx: &mut Context, world: &mut World) {
        // other init code...

        let world_yaml = load_some_yaml_file("example");

        world.register_component(Component1, "component1");
        world.register_component(Component2, "component2");
        
        world.from_yaml(world_yaml["entities"]);
    }
}

With a resources/worlds/example.yml file that looks like this:

---
textures:
  # ...
entities:
  - component1:
      field1: true
      field2: 'value'
      field3: [1.0, 2.1]

  - component1:
      field1: false
      field2: 'value'
      field3: [1.0, 2.1]
    component2:
      field1: []

Also, I can move this to a new ticket if it seems off-topic from loading entities from yaml specifically.

from amethyst.

Xaeroxe avatar Xaeroxe commented on July 22, 2024

Same as #122 (comment)

from amethyst.

Xaeroxe avatar Xaeroxe commented on July 22, 2024

Ron is ready to use at this point and we've decided in other threads that's what we're going to be using, so I changed the issue title.

from amethyst.

Xaeroxe avatar Xaeroxe commented on July 22, 2024

I'm downgrading this to "Important" because while valuable, this isn't something we can take immediate action on.

from amethyst.

torkleyy avatar torkleyy commented on July 22, 2024

I don't see how this is much different from #122, but I think it can be closed, too.

from amethyst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.