4

Well, concerning "The Sims" article you are reffering to that actually could mean a lot of different things. But the core idea as I get it is that each object can expose a list of "functions" that can be applied to it. For example item : ["destroy", "pick up", "eat", "cook"] and then the actor ...


2

With strong typed languages, you can create this functionality broadcast in public interfaces by the way of interfaces. Say: interface IDamageSource {     DamagePoints Damage { get; }     void Consume( DamagePoints points ); } interface IDamageTarget {    void TakeDamage( DamageSource source ); } interface IFixTarget {     FixMaterial[] FixCost();     void ...


1

Entity component systems store data in one of three ways: Centrally allocated arrays, accessable by all systems. Contigious arrays of subsets of components that each system is interested in. Contigious array of "entities" allocated in a centrally located memory buffer. Naughty Dog uses scenario 1. An entity in this context is just a collection of ...


1

Assuming the browser suspends the execution of the code of the page, when the browser gets back go your game you should only run the equivalent of one normal frame. Running a 5 second frame does not make sense when your game is made to run frames 60 times per second. Imagine all the collisions that will be missed. Instead of using a delta-time based like you ...


1

The browser suspends your page to save CPU power during that time. When tabbing back in the physics engine sees 1 frame with a 5 seconds duration so it moves the objects for that entire 5 seconds before processing friction and what not. The first thing is your velocity * friction calculation should be a power function, not a linear factor of time. For ...


1

Those Archetypes are IEnumerable<TComponentKind>, where TComponentKind is what you use to identify components. You can, of course, do better than that. For example, they could be TComponentKind[], or HashSet<TComponentKind>. TComponentKind could be string, Type or even int (and you use bit flags to identify components, in which case the Archetype ...


1

I'd argue you should keep the implementation alongside the definition in this case. It gives you a lot of flexibility. But .. You don't want to be serialising methods, so your players/NPCs should have references to the above via an ID/Key when serialised. [assuming the hotkey is not user-configurable, it's fine there. If it is, that should live elsewhere as ...


1

Stumbled on this old question and the short answer is “no”. Put only things in there that make sense. If you have something like a tilemap you don't need each tile to be an entity and iterate over that each frame. You could simply pass something like Tile[][] to a RenderSystem to integrate drawing entities alongside it. The same goes for Gui, just hand it ...


Only top voted, non community-wiki answers of a minimum length are eligible