3 ms·
Half-OT: Anyone tried to apply ECS in a different context than games?
by k__ 3y ago
Half-OT: Anyone tried to apply ECS in a different context than games?
- dkersten 3y agoI’ve thought about it a bunch, because I quite like ECS in games, but for me, doing web service backends, there was never any real benefit over just using a relational database since ECS is basically an in-memory subset of relational. Even when that is enough, I found that I rarely deal with collections of entities with particular components in bulk like I would with ECS, but rather most web API’s operate on individual entities at a time, so the ECS benefits are less useful. I’m sure there are some use cases where it makes sense, but I’ve yet to encounter situations where I want the flexibility to compose entities out of data-components (ie entities have a lot of variety, most non-games I’ve worked on, entities tend to be one of a handful preset types), need to operate on subsets of entity data in bulk (systems) and can also tolerate in-memory (lack of transactional persistence). Eg if I need to treat data in bulk, say time series, it tends to be a subset of the data and each entry is more or less uniform (no need to compose out of components), or I need transactional guarantees. So while I’m sure there are cases where it’s useful outside of games, I feel that almost always a dull blown database us preferable (and even in games I’d say that a relational database would probably be preferable, from a data modelling point of view, if performance weren’t a concern) I’d love to hear from anyone who has used ECS outside of games, though!
- masfoobar 3y ago> I’ve thought about it a bunch, because I quite like ECS in games, but for me, doing web service backends, there was never any real benefit over just using a relational database since ECS is basically an in-memory subset of relational. This. When I try to explain ECS.. or just "data oriented" I often say it is like creating a well defined database. Most developers have experience in SQL one way or another. > I’d love to hear from anyone who has used ECS outside of games, though! I am a C# programmer. I am also the Lead Developer. While C# is, by default, an OOP language.. I try to limit on inheritence and/or overrides. Point is I try not to go hard on OOP ways of doing things, and seperate logic into their own libraries. How is this ECS? The truth is, directly.. it isn't. However, I try to encourage seperation of data and logic. You could say this mindset shares a lot with ECS. One time -- a few years ago now, where I implemented "ECS like" solution was adding a (free version of) google maps onto our web page. My boss was "but the map might do this" or "but how can the map do that?" "How can we do that?" and my answer was components! Nobody really understood what I meant so I chucked an example together and they liked it. Add the map (the entity) and tell it what components you want. Want to add pins = Component. Want to be able add a circle (point with radius) = Component. Want to create polygons = Component. The System element would update the components. Not comparable directly to games, but its an example of ECS outside of it.
- omikun 3y agoI don't have any examples but I would love it if spreadsheet programs would use this for generating plots. It's pretty much impossible to plot anything with more than 100k data points in anything I've tried.
- dkersten 3y agoIt’s just storing the cells in a columnar fashion. If you don’t need the component composition (systems that can iterate entities that have certain components) then to don’t really be ECS, just use a tightly packed array.
- kitd 3y agoLong ago, I interviewed for a job at a company that wrote race car monitoring systems (ie displaying graphical real-time data about car & engine state and conditions). They wanted to know how I would go about developing such a system. My young green self gave some half-arsed answer and I didn't get the job (sadly. The perks were magnificent). Looking back and knowing what I know now (having written a basic ECS mechanism for learning), I think ECS would work well as a guiding pattern. There's basically a fixed number of entities and components, and the systems are not hugely complex. Wire it up with a data input layer and a graphical output layer, and it would be a great fit.
- aothms 3y agoI know that Autodesk (and other construction software vendors) aim to do something akin to this to organize their data API https://aps.autodesk.com/en/docs/fdx/v1/developers_guide/core_components/entity_component_system/ https://aps.autodesk.com/en/docs/fdx/v1/developers_guide/cor... The S for System is somewhat unarticulated here.