Any difference between "actor" and "entity?"

You can talk about almost anything that you want to on this board.

Moderator: Moderators

User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Any difference between "actor" and "entity?"

Post by GradualGames »

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.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Any difference between "actor" and "entity?"

Post by rainwarrior »

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".
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Re: Any difference between "actor" and "entity?"

Post by GradualGames »

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.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Any difference between "actor" and "entity?"

Post by rainwarrior »

"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.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Re: Any difference between "actor" and "entity?"

Post by GradualGames »

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.)
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Any difference between "actor" and "entity?"

Post by rainwarrior »

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?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Any difference between "actor" and "entity?"

Post by tepples »

(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.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Any difference between "actor" and "entity?"

Post by Dwedit »

I learned about "actor" from the Duke Nukem 3D CON files, but still call them objects living in the object tables.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2033
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Any difference between "actor" and "entity?"

Post by FrankenGraphics »

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.
http://www.frankengraphics.com - personal NES blog
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Any difference between "actor" and "entity?"

Post by tokumaru »

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.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Any difference between "actor" and "entity?"

Post by rainwarrior »

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.
Oziphantom
Posts: 1163
Joined: Tue Feb 07, 2017 2:03 am

Re: Any difference between "actor" and "entity?"

Post by Oziphantom »

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: Select all

-+ Entiity
 | MusicPlayer
 | Volume
 | Camera
 +-Actor
  | Player
  | MeshWalker
  | Prop
....
User avatar
never-obsolete
Posts: 403
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

Re: Any difference between "actor" and "entity?"

Post by never-obsolete »

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.
. That's just like, your opinion, man .
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2033
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Any difference between "actor" and "entity?"

Post by FrankenGraphics »

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.
http://www.frankengraphics.com - personal NES blog
Drag
Posts: 1350
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Any difference between "actor" and "entity?"

Post by Drag »

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. :P

So, it's up to you which one you use, it's just however you feel like flavoring your code.
Post Reply