-
-
Notifications
You must be signed in to change notification settings - Fork 746
Load Entities from RON #112
Comments
Remark: Relevant specs issue amethyst/specs#18 |
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 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 ---
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. |
Same as #122 (comment) |
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. |
@Xaeroxe We should abstract away from any particular data formats where possible (and doesn't hit performance). Loading entities from any |
I'm downgrading this to "Important" because while valuable, this isn't something we can take immediate action on. |
I don't see how this is much different from #122, but I think it can be closed, too. |
We should be able to construct entities from YAML files (*.yml) stored in the
resources/entities
directory. Files can be nested arbitrarily in subfolders for organizational purposes, if the user wants. The markup format should be as follows:The string name of the entity is the filename minus the
.yml
extension. The user should be able to create an instance of such an entity in Rust code.The text was updated successfully, but these errors were encountered: