Replies: 2 comments 1 reply
-
This GDC talk Overwatch Gameplay Architecture and Netcode might provide some useful context, although it may not directly answer your question. They key thing that tied everything together for us was Blizzard's call out to leverage "singleton components". This helped us integrate our physics and netcode systems a bit more cleanly. Also for migrating an existing game, or integrating with existing libraries that use game objects, etc. you may consider some kind of wrapper utility if the data is going to be stored inside bitecs, but libraries expect "object-like" data: Object-like wrappers(for integrating third-party libraries): // src/components/position.ts
export const Position = defineComponent({ x: "f32", y: "f32", z: "f32" });
export const pos = Vec3.Wrap( Position ); Usage: update_model(
model,
pos( eid ),
vel( eid ),
quat( eid ),
);
myCameraInstance.applyTransform( quat( CAMERA_EID ));
|
Beta Was this translation helpful? Give feedback.
-
Bonus screenshot: You can see Overwatch stuffs a bunch of complex and shared system components into these singleton components: Obviously for many javascript-based games you just really won't need to do this, but from bitecs v0.4 onward, its much easier to do in BitEcs, and it might make serializing / replaying your game state simpler 👍 |
Beta Was this translation helpful? Give feedback.
-
Im wondering if there are any resources that show how to use bitecs to make a game that go beyond trivial examples such as basic movement. In an OOP architecture I would have some sort of game manager for handling game state, events getting passed around, interactive UI and menus, etc. I would love to see the ECS approach to building out a full game with similar features / solutions to the same problems.
BitECS is a little harder to use as a developer, but seems to stick to the pure ECS philosophy without muddling through OOP (I just read this series of blog posts: https://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/), so Im particularly interested in seeing it done with bitECS.
Beta Was this translation helpful? Give feedback.
All reactions