Handmade Hero»Forums»Code
8 posts
None
Day 84 : Definition of what is an entity
Hello everyone !

So I'm a little bit late to the party since I am at day 84. In this day, Casey is considering how to properly use the ground bitmap and he says that we probably don't want to add them as a new entity type but he considers it anyway.

That got me wondering : how, in Handmade Hero, is an Entity defined ? What is an entity ? What must its properties be in order to be considered a proper one ?

Because if everything can be considered an entity, then it seems to me that the whole system weakens a little bit.
David Butler
81 posts / 1 project
I love pretty much anything technical, whether it be programming, networking, hacking or electronics.
Day 84 : Definition of what is an entity
Edited by David Butler on
rivten

how, in Handmade Hero, is an Entity defined ? What is an entity ? What must its properties be in order to be considered a proper one ?

Because if everything can be considered an entity, then it seems to me that the whole system weakens a little bit.


I think that is it fairly subjective, there is definitely a grey area when deciding what should be a proper entity. But I think one specific point to consider is: Will specific instances of the thing interact with specific instances of other things?

The concept of ground as a movement bounding constraint does in-fact effect many entities, but that is already being handled as EntityType_Space (which means that ground in a sense, is already an entity... or well the absence of it)

But the problem that is being worked here is how to visually represent the ground, and that doesn't actually interact with other entities... If ground doesn't need to interact with other entities, then you are just wasting CPU cycles by putting ground in the entity list. If it isn't going to affect anything, then there is no point in looping through it.
8 posts
None
Day 84 : Definition of what is an entity
Thanks for you reply.

I had indeed in mind the "cost" of being an entity (CPU cycle to test against others). So if I follow you, being eligible for an entity is more about "is it worth it ?" (in terms of efficiency and code structure).

As always, I guess that this is a concept that is build up from what we need as features rather than something properly defined in advance.

Yet, this is still blurry to me. I hope this is refined afterwards.

Thanks still for the explanation.