Several Action Functions, properties, and flags?

Moderator: GZDoom Developers

Post Reply
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Several Action Functions, properties, and flags?

Post by Amuscaria »

Are any of these action functions implementable?

Action Functions:

A_Displace(mode,tid): the calling actor moves another actor to it's position. Uses the mode (0 for use tid, 1 for parent, 2 for child) paramenters or the tid of the actor to determine which actor(s) to move. If the calling actor is solid, then the actor being moved will be displace to as close to the calling actor as possible (kinda like how A_SpawnItem will spawn a item close to the calling actor as possible if there isn't enough room so the two dont overlap).

A_SynchMomentum(bool momx, bool momy, bool momz): This action makes an actor spawned copy the specified momentums of the parent. Thus if the parent changes directions, so will the children. The various boolean specicfies which momentum to synch up and which not to.

A_Ressurect: Ressurects the calling actor

A_Explode(radius, damage, hurt shooter, FULLDAMAGE): Just an additional parameter to the A_Explode. If FULLDAMAGE is set to 1, everything in the blast radius takes the full explosion damage regardless of how close or far away the actor is from the calling actor.

Properties

Lifetime (tics): Once a actor is awakened, the actor will have a timer that counts down in tics. When the tics become 0, the actor is killed. (Edge has something like this)

Flags:

+RAISESPECIES: If a monster has A_VileChase and a heal state, it will ressurect monster of it's species only.

+DISLOYAL: Monster with this flag will attack any other actor that isn't part of it's species randomly once awakened.

+CHECKSIGHT: If a monster with this flag on is chasing after a target, and the target goes out of the monster's sight, the monster will stop until the target reappears or it gets a new target.

+IGNOREMASS: Meant for projectiles. A projectile with this flag on that collides with an actor will push that actor back reguardless of it's mass (as if the target has 0 mass).

+CRUSH: Im not sure if this is in yet, but if not then this acts as an instant kill to all non-Boss and actors within the +DONTCRUSH flag on.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Several Action Functions, properties, and flags?

Post by Gez »

Eriance wrote:A_Ressurect: Ressurects the calling actor
Better call it A_Resurrect. :P
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Several Action Functions, properties, and flags?

Post by TheDarkArchon »

LifeTime can be done with ReactionTime and A_Countdown. The rest will be WFDS as DECORATE isn't being expanded anymore.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Several Action Functions, properties, and flags?

Post by Graf Zahl »

Eriance wrote:Are any of these action functions implementable?

Action Functions:

A_Displace(mode,tid): the calling actor moves another actor to it's position. Uses the mode (0 for use tid, 1 for parent, 2 for child) paramenters or the tid of the actor to determine which actor(s) to move. If the calling actor is solid, then the actor being moved will be displace to as close to the calling actor as possible (kinda like how A_SpawnItem will spawn a item close to the calling actor as possible if there isn't enough room so the two dont overlap).
no.
A_SynchMomentum(bool momx, bool momy, bool momz): This action makes an actor spawned copy the specified momentums of the parent. Thus if the parent changes directions, so will the children. The various boolean specicfies which momentum to synch up and which not to.
no
A_Ressurect: Ressurects the calling actor
Thing_Raise(0)
A_Explode(radius, damage, hurt shooter, FULLDAMAGE): Just an additional parameter to the A_Explode. If FULLDAMAGE is set to 1, everything in the blast radius takes the full explosion damage regardless of how close or far away the actor is from the calling actor.
maybe.

Properties

Lifetime (tics): Once a actor is awakened, the actor will have a timer that counts down in tics. When the tics become 0, the actor is killed. (Edge has something like this)
maybe
Flags:

+RAISESPECIES: If a monster has A_VileChase and a heal state, it will ressurect monster of it's species only.
WFDS
+DISLOYAL: Monster with this flag will attack any other actor that isn't part of it's species randomly once awakened.
absolutely not
+CHECKSIGHT: If a monster with this flag on is chasing after a target, and the target goes out of the monster's sight, the monster will stop until the target reappears or it gets a new target.
WFDS or use A_CheckSight
+IGNOREMASS: Meant for projectiles. A projectile with this flag on that collides with an actor will push that actor back reguardless of it's mass (as if the target has 0 mass).
Absolutely not because it's a perfect means to mess things up big time.
+CRUSH: Im not sure if this is in yet, but if not then this acts as an instant kill to all non-Boss and actors within the +DONTCRUSH flag on.
WFDS
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: Several Action Functions, properties, and flags?

Post by Skippy »

Graf Zahl wrote:
+CHECKSIGHT: If a monster with this flag on is chasing after a target, and the target goes out of the monster's sight, the monster will stop until the target reappears or it gets a new target.
WFDS or use A_CheckSight
Graf, I know this has been WFDS'd but I thought I'd just point out that A_CheckSight does not handle any information regarding the caller's current target; all it does is jump if there is LOS between the calling actor and any player. It can't be used for the implementation described.

Since this is a common misconception, perhaps a generic A_JumpIfSight action function would be a good idea anyway? 8-)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Several Action Functions, properties, and flags?

Post by Graf Zahl »

I still won't add any more DECORATE features unless I know where ZDoom is going with Doomscript although right now my feeling is that it's going nowhere at all.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Several Action Functions, properties, and flags?

Post by HotWax »

Graf Zahl wrote:
+DISLOYAL: Monster with this flag will attack any other actor that isn't part of it's species randomly once awakened.
absolutely not
Just to add to this in case anybody is wondering... The reason this has been so harshly rejected is that it would provide the potential for ZDoom to have to iterate through every monster in the level and have that monster look through every other monster in the level to check to see if it's in sight (By performing a CPU intensive LOS check) and not same species.

Right now, all the monsters care about are players. That means that there are a maximum of (actors in level) * 8 iterations every tic to check for LOS. The way "DISLOYAL" would work would require (actors in level) * (8 + actors in level - 1) iterations, or roughly the square of the number of actors present. In a decent sized map with 100 monsters, it would require over 10,000 LOS checks per tic. (compared to 800 or less)

Hopefully you understand why this might be a problem.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Several Action Functions, properties, and flags?

Post by TheDarkArchon »

HotWax wrote:
Graf Zahl wrote:
+DISLOYAL: Monster with this flag will attack any other actor that isn't part of it's species randomly once awakened.
absolutely not
Just to add to this in case anybody is wondering... The reason this has been so harshly rejected is that it would provide the potential for ZDoom to have to iterate through every monster in the level and have that monster look through every other monster in the level to check to see if it's in sight (By performing a CPU intensive LOS check) and not same species.

Right now, all the monsters care about are players. That means that there are a maximum of (actors in level) * 8 iterations every tic to check for LOS. The way "DISLOYAL" would work would require (actors in level) * (8 + actors in level - 1) iterations, or roughly the square of the number of actors present. In a decent sized map with 100 monsters, it would require over 10,000 LOS checks per tic. (compared to 800 or less)

Hopefully you understand why this might be a problem.
It's worse than that. The code would need to check if the actor is of the same species as the current one. So, although this will reduced the amount of times the LOS check is iterated, this offset by the fact each time a LOS check is done, a species check is done as well.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Several Action Functions, properties, and flags?

Post by HotWax »

TheDarkArchon wrote:It's worse than that. The code would need to check if the actor is of the same species as the current one. So, although this will reduced the amount of times the LOS check is iterated, this offset by the fact each time a LOS check is done, a species check is done as well.
A species check consists of "If my->species == his->species, ignore", which would translate in machine code to about 3-4 commands. Modern processors would blast through those checks in a fraction of a second.

On the other hand, a LOS check takes a significant amount of time to perform (significant naturally meaning a slightly longer fraction of a second) and many thousands of them per tic could easily add up to reduced performance even with a good CPU.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”