Skip to main content
added 1 character in body
Source Link
user321630
user321630

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it which the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes. I likemight then link its camera to another camera in the scene at a security station which renders its output to a textured plane where I can look at what the sentry is seeing on a monitor inside the security station, only to discover that it's in a totally different location than where I put it and damaged since it got swept away by a tornado.

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it which the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes. I like then link its camera to another camera in the scene at a security station which renders its output to a textured plane where I can look at what the sentry is seeing on a monitor inside the security station, only to discover that it's in a totally different location than where I put it and damaged since it got swept away by a tornado.

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it which the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes. I might then link its camera to another camera in the scene at a security station which renders its output to a textured plane where I can look at what the sentry is seeing on a monitor inside the security station, only to discover that it's in a totally different location than where I put it and damaged since it got swept away by a tornado.

added 1 character in body
Source Link
user321630
user321630

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it withwhich the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes. I like then link its camera to another camera in the scene at a security station which renders its output to a textured plane where I can look at what the sentry is seeing on a monitor inside the security station, only to discover that it's in a totally different location than where I put it and damaged since it got swept away by a tornado.

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it with the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes.

Like I might have an entity, and what is this? It might start out having no components associated, so it's like a nada, a nil, a null thing that is just sitting in the scene. But then I might attach a camera component to it and cool, now I can look through it, though it can't be moved or oriented since it has no motion component. I might then attach a directional light to it and now it's like a camera that shines light in the direction it's looking, which might be useful to navigate in the dark. Now I might attach a motion component to it and now it can move around and be oriented in space. Then I might attach a weapon component to it, specifically a minigun, and it might now be capable of firing at things. I might then attach a script component to it which the interpreter runs repeatedly where, upon encountering a living creature in its line of sight, it will begin firing upon it, making it a "sentry" of sorts. Then I might attach a model and physics component to give it form and volume in space which also allows the physics system to pick it up and allow it to get swept away by forces like tornadoes. I like then link its camera to another camera in the scene at a security station which renders its output to a textured plane where I can look at what the sentry is seeing on a monitor inside the security station, only to discover that it's in a totally different location than where I put it and damaged since it got swept away by a tornado.

added 81 characters in body
Source Link
user321630
user321630

And this whole light-flashing camera sentry "thingamajig" which is influenced by physics was not something I anticipated in advance whatsoever. It's just something I whipped up on the fly using a generic entity and attaching an interesting combo of components to it to get what I wanted while playing with the engine at runtime, and it's through toying with such engines at runtime that got me so interested in the ECS as a way to handle constantly changing user-end requirements without intrusive design changes as I was accustomed to seeing where a lot of alternative architectural designs would requiringrequire anticipating this "sentry light/camera/weapon thingamajig" possibility more upfront or else potentially face very costly design changes.

Of course, practically speaking, you might have a lot of common component combos you use that yield something of a "preset/template" for common entity/component combos you frequently create, and would otherwise call for a lot of code duplication to create if you listed every individual component type to add to each common combination, but you can eliminate such duplication with a simple and straightforward procedural approach without being tempted to subtype your entities, and I think those simpler approaches encourage a more generalized way to think about the ECS with the "has-a" composition mindset, not the "is-a" inheritance sort of mindset.

And this whole light-flashing camera sentry "thingamajig" was not something I anticipated in advance whatsoever. It's just something I whipped up on the fly using a generic entity and attaching an interesting combo of components to it to get what I wanted while playing with the engine at runtime, and it's through toying with such engines at runtime that got me so interested in the ECS as a way to handle constantly changing user-end requirements without intrusive design changes as I was accustomed to seeing where a lot of alternative architectural designs would requiring anticipating this "sentry light/camera/weapon thingamajig" more upfront or else potentially face very costly design changes.

Of course, practically speaking, you might have a lot of common component combos you use that yield something of a "preset/template" for common entity/component combos you frequently create, but you can eliminate such duplication with a simple and straightforward procedural approach without being tempted to subtype your entities, and I think those simpler approaches encourage a more generalized way to think about the ECS.

And this whole light-flashing camera sentry "thingamajig" which is influenced by physics was not something I anticipated in advance whatsoever. It's just something I whipped up on the fly using a generic entity and attaching an interesting combo of components to it to get what I wanted while playing with the engine at runtime, and it's through toying with such engines at runtime that got me so interested in the ECS as a way to handle constantly changing user-end requirements without intrusive design changes as I was accustomed to seeing where a lot of alternative architectural designs would require anticipating this "sentry light/camera/weapon thingamajig" possibility more upfront or else potentially face very costly design changes.

Of course, practically speaking, you might have a lot of common component combos you use that yield something of a "preset/template" for common entity/component combos you frequently create, and would otherwise call for a lot of code duplication to create if you listed every individual component type to add to each common combination, but you can eliminate such duplication with a simple and straightforward procedural approach without being tempted to subtype your entities, and I think those simpler approaches encourage a more generalized way to think about the ECS with the "has-a" composition mindset, not the "is-a" inheritance sort of mindset.

Source Link
user321630
user321630
Loading