Ambushers AI Mod

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Ambushers AI Mod

Post by Hey Doomer »

Along with outflanking an opponent, one of the essential tactics is to ambush an enemy. Flanking causes confusion and diverts attention; ambush has an element of surprise. This is my take on that, called Ambushers.

Screenshots:
Spoiler:
The idea is illustrated in the above screenshots. Ambushers seek a corner area to hide behind that is out of view of the player, which is why I took these with chase cam turned on. The top shows an imp just outside a doorway, and the bottom a shotgun sergeant hiding behind a pole.

Monsters become shadows, seek an ambush point, and wait for the player. If the players gets close enough they pursue, but otherwise if seen they look for another ambush point. Parameters can be tweaked in Settings, including shadows on or off, the radius of the effect, the corner "sharpness" (not all Doom corners are 90 degrees), and the chance of spawning an ambusher. This works well with my other AI mod, Flankers. It should also be compatible with other AI mods that rely on path finding.

A debug mode will show the sector ambush points and the monsters in a blue stencil render to see this working. Not fancy but handy if testing this with other mods.

While this affects all monsters (including Cacodemons, for example), I haven't tested this enough to see what happens with a variety. Could be interesting, I suppose.

Now at v1.1
Last edited by Hey Doomer on Fri Dec 24, 2021 6:23 pm, edited 2 times in total.
User avatar
Enjay
 
 
Posts: 26882
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Ambushers AI Mod

Post by Enjay »

It seems to be doing pretty much what it was intended to do. It's really strange, after so many years, for Doom bad guys to not just mindlessly walk towards you no matter what. Having them see you but then wait in a room after you have retreated or behind something is quite a different feel.

Is there any way to stop the enemies spamming their wakeup sounds? Many of them seem to be making their alert sound over and over (I think they do this when the player is not in full view - but I'm not sure). Aside from sounding bad generally, it undermines the whole "I'm gonna sit here quietly and wait to ambush the player" idea behind what the monsters are meant to be doing.

This was just tested with Vanilla monsters and maps.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Ambushers AI Mod

Post by Hey Doomer »

Enjay wrote: Is there any way to stop the enemies spamming their wakeup sounds? Many of them seem to be making their alert sound over and over (I think they do this when the player is not in full view - but I'm not sure). Aside from sounding bad generally, it undermines the whole "I'm gonna sit here quietly and wait to ambush the player" idea behind what the monsters are meant to be doing.
Ah I did notice that. Have to think of the best approach. I think that's connected to the two levels of response. Thanks

Update:
Added an experiment as a fix and uploaded!
ileblanc
Posts: 27
Joined: Sat Jun 22, 2019 7:37 pm
Graphics Processor: Intel (Modern GZDoom)

Re: Ambushers AI Mod

Post by ileblanc »

I can't seem to find a way to download fm your flankers mod mate. The fine if not available to download
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Ambushers AI Mod

Post by Hey Doomer »

ileblanc wrote:I can't seem to find a way to download fm your flankers mod mate. The fine if not available to download
Flankers is here: viewtopic.php?f=43&t=74197. Seems to dl OK.
User avatar
Enjay
 
 
Posts: 26882
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Ambushers AI Mod

Post by Enjay »

Sound fix seems to work nicely. :thumb:
User avatar
Enjay
 
 
Posts: 26882
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Ambushers AI Mod

Post by Enjay »

I hadn't really noticed any performance issues when using this- even on maps with quite a lot of monsters. So, purely out of interest, I decided to try this with the old stress-test fallback NUTS.WAD.

The frame rate was less than 1 fps even before any monsters were alerted!

So, yeah, if you have enough monsters on a map, there will definitely be a performance hit with this.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Ambushers AI Mod

Post by Hey Doomer »

Enjay wrote:I hadn't really noticed any performance issues when using this- even on maps with quite a lot of monsters. So, purely out of interest, I decided to try this with the old stress-test fallback NUTS.WAD.

The frame rate was less than 1 fps even before any monsters were alerted!

So, yeah, if you have enough monsters on a map, there will definitely be a performance hit with this.
Lol. But seriously a few reasons:
  • It accepts all monsters within that random drawing based on what spawns. So the iterator checks ALL monsters that have the MOFLAG set each time. Quite a few are skipped, but as you say if there are enough of them...
  • Iterators are comparatively slow, more linked than searchable list. They start at 1, go to 2, go to 3... so there's no way to optimize this list other than select by class.
  • Sector ambush points can vary greatly within a radius of each monster, and these are also iterated through per monster that meets criteria. The more concave and complex the geometry the more points exist.
  • Monsters don't change behavior unless within a defined radius; outside that radius nothing happens or the existing behavior is turned off. That radius can be changed by monsters, player, or both.
The way this AI works is that once a monster finds an ambush point it targets it so normal Doom AI takes over. I wonder if the engine creates problems when dozens of monsters are all packed together heading for the same target...

It's possible to add to an array on spawning, but structures can't be put in dynamic arrays. I may end up doing something like that, but any manual searching will be slower than an iterator I think.

Lowering the effective radius in Settings may help. I suppose I can also put a cap on the number of monsters tagged as ambushers.
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Ambushers AI Mod

Post by Dan_The_Noob »

is this no longer available? there's no links anywhere.
thugsta
Posts: 150
Joined: Mon Jan 21, 2019 10:10 am

Re: Ambushers AI Mod

Post by thugsta »

Dan_The_Noob wrote:is this no longer available? there's no links anywhere.
All their links have been removed other then "Relighting". Also they have not been seen since April and their contact info has been removed so i don't think they are coming back unfortunately

Return to “Gameplay Mods”