Ambushers AI Mod

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR 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.

Ambushers AI Mod

Postby Hey Doomer » Fri Dec 24, 2021 2:22 pm

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.
Hey Doomer
 
Joined: 25 Sep 2021

Re: Ambushers AI Mod

Postby Enjay » Fri Dec 24, 2021 2:56 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ambushers AI Mod

Postby Hey Doomer » Fri Dec 24, 2021 3:19 pm

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!
Hey Doomer
 
Joined: 25 Sep 2021

Re: Ambushers AI Mod

Postby ileblanc » Sat Dec 25, 2021 8:31 am

I can't seem to find a way to download fm your flankers mod mate. The fine if not available to download
ileblanc
 
Joined: 22 Jun 2019
Discord: metallforest
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Ambushers AI Mod

Postby Hey Doomer » Sat Dec 25, 2021 8:44 am

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: https://forum.zdoom.org/viewtopic.php?f=43&t=74197. Seems to dl OK.
Hey Doomer
 
Joined: 25 Sep 2021

Re: Ambushers AI Mod

Postby Enjay » Sat Dec 25, 2021 9:21 am

Sound fix seems to work nicely. :thumb:
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ambushers AI Mod

Postby Enjay » Sun Dec 26, 2021 6:16 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Ambushers AI Mod

Postby Hey Doomer » Mon Dec 27, 2021 1:19 pm

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.
Hey Doomer
 
Joined: 25 Sep 2021

Re: Ambushers AI Mod

Postby Dan_The_Noob » Wed May 25, 2022 11:41 am

is this no longer available? there's no links anywhere.
User avatar
Dan_The_Noob
 
Joined: 07 May 2019
Twitch ID: Dan_The_Noob
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Ambushers AI Mod

Postby thugsta » Wed May 25, 2022 11:07 pm

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
thugsta
 
Joined: 21 Jan 2019


Return to Gameplay Mods

Who is online

Users browsing this forum: Ryuhi and 19 guests