I picked up the term "entity" from a fellow nesdev member some years ago and it stuck. Everything that has its own update logic every frame is called an "entity" in my engines, there is no distinction. They have flags for whether they draw or not and their behavior and interaction and so on is entirely up to the implementation of a given entity.
However I've seen folks in other game development websites distinguish entity from actor in certain ways, but in the end it appears to be an entirely arbitrary choice.
In game development context these are arbitrary terms. If you're going to distinguish them youd have to explicitly define them. (Outside of game development, entity and actor do have different meanings, though.)
Actor, Entity, Pawn, Object, Character, Bob, etc. game engines have a name for the base class of their interactable "things".
In my current game I call everything a "Dog".
rainwarrior wrote:
In game development context these are arbitrary terms. If you're going to distinguish them youd have to explicitly define them. (Outside of game development, entity and actor do have different meanings, though.)
Actor, Entity, Pawn, Object, Character, Bob, etc. game engines have a name for the base class of their interactable "things".
In my current game I call everything a "Dog".
Why not "lizard?" Haha. I remember your KS update referring to them as "dogs," and I thought: "directed object graph?" No, that can't be right... *edit* what does Bob mean.. "base object?" Haha.
"Dog" doesn't have any acronymic meaning in my game. It's just the word I've chosen. Partly I just wanted it to be short, because I'd be typing it a lot. (There is a "lizard" for the player but it's not a subclass of "dog".)
I saw "bob" in some game engine once but I forget where. On the Amiga there was a "bob" that meant
"blitter object" that has a similar meaning to "sprite", so perhaps it was building on that idea, but it also doesn't really have to mean
anything.
rainwarrior wrote:
(There is a "lizard" for the player but it's not a subclass of "dog".)
So your update logic for the player is entirely separate from your dog system? This was interesting to me because for my first two games, the main character(s) were entirely separate from the entity system, however in my current game I chose to make the main character part of the entity system itself---it's just always the first one spawned. I'm not certain there is any particular benefit to doing it differently this time except maybe one or two fewer jsr's in the main loop. Plus it shares various bits of plumbing with the rest of the entity system this time around (i.e. animation system based on structures of arrays, in previous engines I had two parallel animation systems...so now I have less code to maintain.)
That's a very situational question. Sometimes it makes a lot of sense to do that, and sometimes not. A lot of times it doesn't really matter much either way. ...and there are also lots of ways to share code between things without them being the same "class".
The way you choose prioritize things and order the updates between various things can bear on this, for example: Does the player always update first? Does everything else update in a specific order?
(Ninja'd about the "bobs", but...)
I think I picked up "actor" from an old book about classic Mac game programming, where a "sprite" just had the logic for drawing it and then redrawing the background over it when it moves, and an "actor" was a sprite with movement behavior.
I learned about "actor" from the Duke Nukem 3D CON files, but still call them objects living in the object tables.
When talking about it, i use "object" and "instance". Object is the ideal form. Instance is every "material" object in memory, on- or off screen, with or without sprite. Think of object as a stamp, and instance as every clone you produce with the stamp. I think i picked it up from game maker a decade ago or so.
Using a one-syllable word in coding is a very good idea, though.
When coding or writing technical documents I use "object", but when I'm being less technical I use "entity". Not a big fan of "actor", for whatever reason.
FrankenGraphics wrote:
When talking about it, i use "object" and "instance". Object is the ideal form. Instance is every "material" object in memory, on- or off screen, with or without sprite. Think of object as a stamp, and instance as every clone you produce with the stamp. I think i picked it up from game maker a decade ago or so.
That terminology is a bit at odds with prevailing practice, I think.
In C++ and many other programming languages, an "object" is an "instance" of a "class".
So, your use of "instance" is normal, but what you're calling an "object" is a class, and thet word normally refers to an instance. After looking it up, I guess I should say "Game Maker" rather than you, since this is indeed the unfortunate way Game Maker has chosen to define these terms.
The more conventional definitions:
- class: a template or "type" for making objects, the code for an object belongs to its class because the same code can run every instance.
- instance: when you use a class to make a new object, you get an instance of that class. Each one contains its own set of data.
- object: an instance of a class, synonymous with instance but I think the word instance is used more in contexts where it's important to note that it is one of many like it.
For confusion's sake: in Java there is a class called Object, and you can make Object object instances of it.
I would also cation against using a game specific name for "things", as you will end up reusing parts of it, then one day you will find yourself making a game with animated skeletons but they are all called "Tanks".
I've seen some engines define an Entity as something in the world, and an Actor as an Entity + Animation System. Thus something like BGM Music, or Action Volumes are Entity, but things with with a mesh and animation are Actors.
Code:
-+ Entiity
| MusicPlayer
| Volume
| Camera
+-Actor
| Player
| MeshWalker
| Prop
....
I use object as a base for anything placed in the game world. All objects are either a trigger or an actor.
Triggers can be scripted events, sound, palette, graphic, or raster effects. Actors consist of the player, NPCs, enemies, or blocks.
rainwarrior wrote:
the unfortunate way Game Maker has chosen to define these terms
I guess it does make a bit sense inside internal logic, because you never really get to directly define classes (GM does that for you).
Anyway, i should update my vocabulary to the definition you wrote to avoid future confusion.
I switch back and forth between entity and actor, with "actor" being the easiest to say, but it's weird if you have something that needs to have logic but isn't actually something that's "alive"; It's weird to refer to a chair or an elevator as an "actor", even if it's semantically correct for your engine.
So, it's up to you which one you use, it's just however you feel like flavoring your code.
Just pretend there's a little
Spirou inside the elevator.
"Entity" is the word I prefer over object and actor. I've been using "ent" im my game as an abbreviation. Anything that has it's own logic, and similar variables like X, Y, active, state, etc., falls into this category.
I'd have to check the code, because I forget off the top of my head how exactly I structured it, but I also needed to have metatiles that would need logic themselves but be separate from ents; like for example entrances to caves (which could be abstracted further by just calling them "doors", if they need to be), and sharp grass that can cut the player. I treat these as types of collisions, or interactions, and can have up to 256 of them, and the type is defined in the metatile structure. I use these as indices for a jump table, which is also based off the ent whose logic is currently being processed. That way I can have whatever logic needs to happen as a simple subroutine. If nothing needs to happen for a given metatile, it's just a simple rts.
While I've been using "entity" in my NES games, I just started using "ntt" for Pico-8, haha. en tee tee. Entity. "Ent" makes me think of one of these:
Attachment:
download.jpg [ 10.17 KiB | Viewed 1163 times ]
Sounds like pico-8 is a living antipattern factory, if it rewards people for picking bad names. This kind of stuff is unacceptable for a potential education tool.
It makes sense to me to use actor to refer to any object that can interact with the world on its own and entity anything that doesn't do anything on its own, at most only respond to stimuli (static props, trigger zones, physics enabled object, etc).
Dwedit wrote:
Sounds like pico-8 is a living antipattern factory, if it rewards people for picking bad names. This kind of stuff is unacceptable for a potential education tool.
Tell that to my nephew who is currently learning programming with it
Dwedit wrote:
Sounds like pico-8 is a living antipattern factory, if it rewards people for picking bad names. This kind of stuff is unacceptable for a potential education tool.
People said the same thing about BASIC. In one sense, they were right, it encourages bad habits and teaches you some of the "wrong things". In another sense, it's a platform that gets kids excited about programming, they learn basic algorithms and concepts, and then (hopefully) move on to doing things more correctly later. So I'm not going to complain.