I don't understand actors as I the topic title should of clarified in a way. I saw they were like triggers, but yea. It just seems so complicated. It almost feels like picking up a Java book for the first time being insanely confused, or trying to solve an account Journal equation when the creator of the problem had many typo's.
I know explaining actors is long, proven by Prozaic's tutorial, but is there a way to kind of sum them up in a paragraph so I understand what they actually do?
Actors represent the art of the game. Actors are like templates, they don't exist initially in your map - they have to be created (instantiated) through the events they look for. They get sent signals (kind of like triggers) and do something based on the signal they get. For example, many of them have "when the unit Zealot is created, make a new copy of me at its location" and "when a Zealot attacks, run my attack animation."
Even shorter, actors are a hub for in-game events that turns the game logic into things you can see and hear.
This thread should probably be moved out of the tutorial forum, however...
Actors are a difficult data object, largely due to the lack of documentation and the cumbersome Event editing.
I don't have a full grasp of them yet myself.
However I know this much:
They send and receive messages, and take action upon receiving certain messages.
Bear with my analogy...
An Actor is sort of like a radio.
Unit objects, Effect objects, etc, are like radio towers. When they do anything in the engine, they broadcast a message.
The Actor object sits around and picks up signals, some of which are "broadcast" signals, and some of which are targeted towards it specifically.
When it receives signals (messages) that match the definitions in the Events fields, it performs the appropriate response. This is usually playing a sound or an animation.
Broadcast messages example
This is a little simplified but let's say an Infestor uses Fungal Growth on a pack of Hellions.
The Hellion Unit objects send out a message "I just had the Fungal Growth behavior applied to me".
Any Actor objects that are listening for that signal (tuned in like a radio to a broadcast frequency) will pick that up and perform their action. So the Actor to cover the Hellion in pulsing green slime receives the messages and creates itself attached to those units. The Actor that plays the impact sound of the Fungal Growth also was listening, so it plays itself as well.
Any other actors that are listening for that signal will also take action. For example if you made the EMP explosion animation Actor look for the Fungal Growth behavior message and create itself, it would make an EMP explosion on every Hellion.
Targeted signals example
Targeted signals (messages) are for things like a "Unit Actor", where the actor is specifically assigned to a single type of unit. It will then respond to virtually everything the unit does.
Imagine an invisible Marine. This Marine is a Unit object without an Actor.
The invisible Marine turns. You don't see anything because he doesn't have an Actor that is receiving messages and outputting them to you.
Now take the same Marine with a unit Actor. When the Marine turns, he sends out a "I just turned to this angle" message to his Actor. The Actor then takes that information and displays it to you. When the Marine takes fatal damage, he sends out a "I just died" message. The Marine Actor then says "the unit I am representing just died, I should play my death animation".
Learn more
If you want to read more on it, google for Model-View software architecture design. It's about having a View (representation of a data object) of a Model (the data object itself). The main benefit is that you can easily swap to a different View of the same Model, such as the way that you can swap out the Actor on a Marine to the Stalker's actor and the Marine will still work fine, but look and sound like a Stalker instead.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I don't understand actors as I the topic title should of clarified in a way. I saw they were like triggers, but yea. It just seems so complicated. It almost feels like picking up a Java book for the first time being insanely confused, or trying to solve an account Journal equation when the creator of the problem had many typo's.
I know explaining actors is long, proven by Prozaic's tutorial, but is there a way to kind of sum them up in a paragraph so I understand what they actually do?
@StatusQ3: Go
Actors represent the art of the game. Actors are like templates, they don't exist initially in your map - they have to be created (instantiated) through the events they look for. They get sent signals (kind of like triggers) and do something based on the signal they get. For example, many of them have "when the unit Zealot is created, make a new copy of me at its location" and "when a Zealot attacks, run my attack animation."
Even shorter, actors are a hub for in-game events that turns the game logic into things you can see and hear.
@StatusQ3: Go
This thread should probably be moved out of the tutorial forum, however...
Actors are a difficult data object, largely due to the lack of documentation and the cumbersome Event editing.
I don't have a full grasp of them yet myself.
However I know this much: They send and receive messages, and take action upon receiving certain messages.
Bear with my analogy...
An Actor is sort of like a radio. Unit objects, Effect objects, etc, are like radio towers. When they do anything in the engine, they broadcast a message.
The Actor object sits around and picks up signals, some of which are "broadcast" signals, and some of which are targeted towards it specifically.
When it receives signals (messages) that match the definitions in the Events fields, it performs the appropriate response. This is usually playing a sound or an animation.
Broadcast messages example
This is a little simplified but let's say an Infestor uses Fungal Growth on a pack of Hellions. The Hellion Unit objects send out a message "I just had the Fungal Growth behavior applied to me".
Any Actor objects that are listening for that signal (tuned in like a radio to a broadcast frequency) will pick that up and perform their action. So the Actor to cover the Hellion in pulsing green slime receives the messages and creates itself attached to those units. The Actor that plays the impact sound of the Fungal Growth also was listening, so it plays itself as well.
Any other actors that are listening for that signal will also take action. For example if you made the EMP explosion animation Actor look for the Fungal Growth behavior message and create itself, it would make an EMP explosion on every Hellion.
Targeted signals example
Targeted signals (messages) are for things like a "Unit Actor", where the actor is specifically assigned to a single type of unit. It will then respond to virtually everything the unit does.
Imagine an invisible Marine. This Marine is a Unit object without an Actor. The invisible Marine turns. You don't see anything because he doesn't have an Actor that is receiving messages and outputting them to you. Now take the same Marine with a unit Actor. When the Marine turns, he sends out a "I just turned to this angle" message to his Actor. The Actor then takes that information and displays it to you. When the Marine takes fatal damage, he sends out a "I just died" message. The Marine Actor then says "the unit I am representing just died, I should play my death animation".
Learn more
If you want to read more on it, google for Model-View software architecture design. It's about having a View (representation of a data object) of a Model (the data object itself). The main benefit is that you can easily swap to a different View of the same Model, such as the way that you can swap out the Actor on a Marine to the Stalker's actor and the Marine will still work fine, but look and sound like a Stalker instead.