Earlier quoted context omitted.
It was a quote from Meet the Parents lol.
A cromulent quote from a movie, where one character busts the chops of another character based on an eager classification error.
Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
111–113 of 113 posts
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#112Earlier quoted context omitted.
Both Unity and COM use aggregation instead of implementation inheritance to compose bunches of small sub-objects together. Unity has the notion of components (inheriting from MonoBehaviour => Behaviour => Component => Object), which can be multiply attached to GameObjects (inheriting from Object), that you can switch between with gameObject.GetComponent (). COM has the notion of multiple interfaces to the same "contr…
From your point of view, are GameObjects in Unity an implementation of entities from the entity–component–system pattern, or is there a difference?
http://t-machine.org/index.php/2007/09/03/entity-systems-are...
ECS builds on top of some of the ideas of COM and GameObject/Component, but loses much of the baggage, takes it much further in a different direction, and has a lot of other advantages, like storing the data in separate contiguous cache-friendly buffers.
https://en.wikipedia.org/wiki/Entity_component_system
>In naïve ECS implementations, every system iterates through the complete list of all entities, and selects only those entities that are needed. The total iteration cost for all systems becomes too costly if the number of systems grows or the number of entities is large. In other ECS architectures, every component type is stored in a separate list, so whatever systems operate on a given type of component are only iterating over objects they care about by default. In this common ECS architecture, the described disadvantage actually becomes a major performance advantage, by more efficiently leveraging the CPU instruction and data caches.
http://t-machine.org/index.php/2014/03/08/data-structures-fo...
>Net effect: Contiguous memory is King
>If you store your data contiguously in RAM, it’ll be fast onto the Bus, the CPU will pre-fetch it, and it’ll remain in cache long enough for the CPU(s) to use it with no extra delays.
>NB: this is independent of the programming-language you’re using. In C/C++ you can directly control the data flow, and manually optimize CPU-caching – but whatever language you use, it’ll be compiled down to something similar. Careful selection and use of data-structures will improve CPU/cache performance in almost all languages
Also:
Entity–component–system (ECS) back and forth (skypjack.github.io):
https://news.ycombinator.com/item?id=19166910
Entity Component System Framework that is CPU cache friendly:
https://stackoverflow.com/questions/23473783/entity-componen...
Designing a cache-friendly entity component system:
https://cerulean-skies.com/index.php?article=1
Unity is rolling out a new officially supported entity component system that's a totally different stack than GameObject/Component. (But they interoperate, of course.)
https://docs.unity3d.com/Packages/com.unity.entities@0.1/man...
One (but not the only) fundamental difference between COM and GameObject/Component, is that you query for COM interfaces with an interface GUID, so you can only have one interface on an object for each GUID. But Unity lets you slap as many of the same component class on an object as you like. The singular Component GetComponent() method will just return the first one, but the plural Component[] gameObject.GetComponents() returns an array of all the components of the given class.
For example, it is useful to attach several different Colliders to the same GameObject (each with its own position/size/shape/etc). They all just work together as you would expect. A RaycastHit will identify which Collider was hit, as well as the sibling Transform of the GameObject it was attached to.
Another fundamental difference is that with GameObject/Component, each GameObject and component is always a completely separate independent object, but COM allows the implementation class to implement any number of different interfaces with the same instance (using C++ multiple inheritance, so each interface implementation has its own vtable pointing back to the same implementation class's different methods), or delegate to other sub-objects using "aggregation", or even make sub-objects lazily on demand with "tear-off interfaces".
Re: Goodbye, shitty Car extends Vehicle object-orientation tutorial (2011)
#113Earlier quoted context omitted.
The Sims actually uses "subject oriented programming", and it even personalizes objects and objectifies people! ;) It's actually implemented in C++ of course, but it has a virtual machine that executes a noodly visual programming language called "SimAntics". And by noodly, I mean optimized for spaghetti code, containing intertwined loops, floppy, and droopy... https://medium.com/@donhopkins/the-sims-pie-menus-49ca02a…
SOP sounds a lot like ECS, with the subjects being the components, but I guess I kind of said that in a different comment. The Kantian thing is kind of a mindfuck. I may need to think about that for a while. It reminds me of the work Phil Agre did on literary criticism of AI.
Kind of like JavaScript with "this" and "that", or like the subject and predicate of a sentence.
There was also a sparse "relationship matrix" where you could associate data with pairs of objects and numeric keys, so it could remember that a person had a "slept in" relationship with a bed that increases every time they sleep in it, which affects how much they are attracted to the bed's "sleep in" action advertisement, so after they sleep in one bed a few times, when they become tired, that bed becomes more attractive than the couch and other people's beds, so they learn to sleep in the same bed every night.
Wow cool, do you have a link to Phil Agre's AI LitCrit please?
Have you read Chip Morningstar's "How To Deconstruct Almost Anything: My Postmodern Adventure"? "Academics get paid for being clever, not for being right." -- Donald Norman