|
|
|
|
|
by reactordev
985 days ago
|
|
ECS is different. Systems coordinate entities, entities have components, some of them can be behaviors, some of them are not (vertex data). You would need to provide something that a component can inherit to derive that it’s a behavior. Unity does this by calling it a MonoBehavior (not Mono as in singular, mono as in Mono runtime, the name stuck). Having an ECBS system: one could model all the permutations as described while keeping code concise, shareable, and non-repeatable. Unity is really an ECBS. Inheritance vs non is as old as OOP vs functional. Each has their place, each has their pros and cons. Having functional components and behavior traits attached to object inheritance based entity nodes is probably the best of all composition. Entities can get more and more complex with inheritance chains (further classifying what components can be attached), components can include behaviors, data, events/triggers, sub-components. Behaviors (triggering events or waiting for) is where your game logic would mostly reside. |
|
1) If I wanted to learn more about ECS/ECBS, would Unity be a decent place to learn? I know sometimes the terms get coopted (for example, MVC as a term gets fairly abused at times in web development) so I wasn’t sure if their implementation was a good one to learn from. And while I’m a fan of open source, Unity certainly does seem to be a leader in adoption and available assets, etc and not a bad place to start. I’m not really looking to develop a commercial game, but in addition to my poking around game engines to see if and what might be applicable ideas for a more classic business/personal type apps, I am interested in building something that broadly speaking sorta acts like an FPS or Arma type game but just for the sake of playing around and simulating different drones and drone swarms, etc in a 3D environment and playing with that. Pretty crude is fine, and AAA level graphics aren’t really a huge concern. I think I honestly could prob get pretty far with just a non-graphical, non-gamelike OO design with JS/Python/whatever as a crude simulation. But I’ve heard that standing up something like an FPS in Unity is not too difficult. And I don’t plan on pushing boundaries from a graphics or asset perspective.
2) > Systems coordinate entities Could you elaborate a bit? Systems are the one aspect that for me are hardest to get my head around coming from more standard web/business development. So physics engines would be a system right? But I’m not sure what are other examples.
Thx for the info. And feel free to just refer to links if you know amy decent ones. I’ve been poking around ECS from a far for a couple years now but haven’t really found articles that fill in the gaps for things like systems in ECS. Though I’m sure the fact that I have little context in game development sure doesn’t help… lol.