I have not jumped on DECORATE in a long long time, so what I'm about to discuss will probably lack technical language. But I wanted to discuss an idea of practicality, what I'm calling dummy projectiles.
Basically the idea is; before a monster launches or fires a projectile, they would secretly fire a non damaging invisible dummy projectile. If the dummy projectile hits an ally (one of the other monsters) it runs an AI script telling the monster to move from its position, rather than firing a real projectile. This projectile would have maxed out movement speed, and it's timing with the monster would be seamless to the naked eye.
So in practice, you would run up to a group of zombies, and soon as they see you, they all fire dummy projectiles, the first row of zombies fires their shots, all the rest begin moving around, while continuing to fire dummy projectiles into the other zombies backs, causing them to move around for a better shot until they find one.
This goes against the common convention of watching monsters mess eachother up, but I recognize this is a thing that came out of the lack of technology at the time, for AI in particular.
I'm sure this idea has probably been elaborated on before. But I would really like to see it in practice just for the sake of seeing it really.
Thanks for reading.
[DECORATE] Dummy Projectiles and AI
[DECORATE] Re: Dummy Projectiles and AI
To add to the original idea. You can use dummy projectiles for some other useful AI behaviors.
One of these behaviors is when an enemy can or can not see you through objects to be alerted.
Hypothetically, you could set all monsters to fire a dummy projectile in your direction if the monster thinks it sees you, this projectile represents what they see in front of them first.
So if this projectile hits another monster, it could hypothetically cancel the alert status, or very quickly set the monster to go back to sleep.
Though this takes into account for sound, and would balance appropriately with the other things that alert monsters.
It's not a perfect solution to anything really, but it does have a very simple way of implementing itself into existing mechanics.
One of these behaviors is when an enemy can or can not see you through objects to be alerted.
Hypothetically, you could set all monsters to fire a dummy projectile in your direction if the monster thinks it sees you, this projectile represents what they see in front of them first.
So if this projectile hits another monster, it could hypothetically cancel the alert status, or very quickly set the monster to go back to sleep.
Though this takes into account for sound, and would balance appropriately with the other things that alert monsters.
It's not a perfect solution to anything really, but it does have a very simple way of implementing itself into existing mechanics.
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
[DECORATE] Re: Dummy Projectiles and AI
I can't think of a reliable way to do this without ZDoom 2.8 without going into insanely complicated ACS checks for every monster, where you'll need to manipulate a lot of TIDs and actor states via ACS and at that point I don't think it's good for the game anymore. If you had access to something such as HITTRACER, a ZDoom 2.8 flag, you could use A_CheckFlag with the tracer pointer to check if the projectile collided with a monster, in which case an inventory item can be given to his shooter (A_GiveToTarget) to tell him not to attack and return to his chasing state (A_JumpIfInventory).
Without this flag check option, you'd need to resort to custom pain states on every one of your monsters, which would interrupt their normal walking sequence or even their attack, to tell the other monster to abort their real attack via ACS.
Without this flag check option, you'd need to resort to custom pain states on every one of your monsters, which would interrupt their normal walking sequence or even their attack, to tell the other monster to abort their real attack via ACS.
- CloudFlash
- Zandrone
- Posts: 1074
- Joined: Mon Jun 04, 2012 5:35 pm
- Location: Wonderland (except not really)
[DECORATE] Re: Dummy Projectiles and AI
Seconding what SG said. Through maybe if the zombies spawned a slightly bigger 'Dummy Zombieman' actor inside them in their fire state, one that would return the inventory item instead of the actual Zombieman, their fire states wouldn't be interrupted...
I wonder if it's possible to make custom flags in DECORATE...
I wonder if it's possible to make custom flags in DECORATE...
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
[DECORATE] Re: Dummy Projectiles and AI
A_RadiusGive can be used along with ACS-driven projectile movement (calculate projectile vector, normalize, and move a virtual thing along this path in single tic with ACS periodically issuing A_RadiusGive with like 32 unit distance, to check if there are any non-monsters nearby).
This is 2.7, not 2.8. (Zandronum 3.0)
http://www.mediafire.com/download/5rntw ... usgive.wad
Use like this:
RadiusGive(x, y, z, distance, flags, script_number, arg1, arg2, arg3, arg4);
or
RadiusGiveNamed(x, y, z, distance, flags, script_name, arg1, arg2, arg3, arg4);
x, y, z — fixed-point coordinates of query.
distance — fixed-point distance (gets rounded to int anyway due to ACS->DECORATE float conversion problems)
flags — RGF_ flags.
script_number/name, arg1, arg2, arg3, arg4 — arguments passed to ACS_(Named)ExecuteAlways for each actor in range. The found actor will be the activator of this script.
I think this can be optimized by reusing the same actor instead of spawning a new one every time (because ZDoom has slow actor creation/deletion).
Also RGF_GIVESELF is not implemented, and few other filters don't make sense as well because they are supposed to be used within DECORATE (master/tracer/target checks for example).
Overall the script isn't finished but would work okay as an example for people who want to query actors in an area with ACS.
This is 2.7, not 2.8. (Zandronum 3.0)
http://www.mediafire.com/download/5rntw ... usgive.wad
Use like this:
RadiusGive(x, y, z, distance, flags, script_number, arg1, arg2, arg3, arg4);
or
RadiusGiveNamed(x, y, z, distance, flags, script_name, arg1, arg2, arg3, arg4);
x, y, z — fixed-point coordinates of query.
distance — fixed-point distance (gets rounded to int anyway due to ACS->DECORATE float conversion problems)
flags — RGF_ flags.
script_number/name, arg1, arg2, arg3, arg4 — arguments passed to ACS_(Named)ExecuteAlways for each actor in range. The found actor will be the activator of this script.
I think this can be optimized by reusing the same actor instead of spawning a new one every time (because ZDoom has slow actor creation/deletion).
Also RGF_GIVESELF is not implemented, and few other filters don't make sense as well because they are supposed to be used within DECORATE (master/tracer/target checks for example).
Overall the script isn't finished but would work okay as an example for people who want to query actors in an area with ACS.
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
[DECORATE] Re: Dummy Projectiles and AI
To add to all of this, monsters normally avoid shooting when they have an ally in front of them. Of course, monsters also normally have no allies; if you're making a custom map, however, you can spawn monsters from a dummy actor using A_SpawnItemEx and they will have the same friendliness settings, so not only will they rarely shoot each other, but even if they do, they won't infight (and if using projectiles, won't damage each other in the first place)
So depending on what you're aiming for, you can have a much simpler solution by spawning your monsters as friendly to each other to avoid all this collision detection mess.
So depending on what you're aiming for, you can have a much simpler solution by spawning your monsters as friendly to each other to avoid all this collision detection mess.