josh771's AI Director

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.
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

josh771's AI Director

Post by Josh771 »

Image
E1M1 with 20% population and groups of 1 to 10 monsters, plus item randomization

This "AI Director" is a very simplistic attempt at something akin to Left 4 Dead's AI Director: spawning monsters based on in-game factors to keep things interesting as you play. It creates spawn rosters of all the monsters and (optionally) all the items on a map, removing them in the process, then uses that same roster to spawn new monsters and items at randomized positions. This means a map that normally has a lot of imps will still have a lot of imps, a map that didn't have a chaingun spawn in it still won't have one. However, it also means a map that had one hell knight could have more than one -- and in unexpected places. Or it could have none at all.

The settings menu includes options for adjusting how many monsters spawn in place of old ones, how frequently new monsters spawn in over time (which can also be disabled entirely), and adjusting how many monsters are placed at the start of the map. There are more settings, each hopefully described well enough within the menu itself for you to figure out how it all works together. There is even a setting to make spawns over time less frequent and numerous when players are injured -- and, for that matter, more numerous when players are supercharged!

I find that this can make IWAD maps feel fresh again, and I like that I can adjust it to turn maps into slaughterwads or casual strolls.

One difference between the spawns-over-time with my "AI Director" as opposed to DCS is that this mod tries to avoid teleporting monsters into the map where the player can see them. Instead, it quietly spawns groups of enemies out of sight at a minimum distance, so that you might stumble upon them or be surprised by new foes in a room you'd cleared earlier.

Download v0.2 on GitHub!
Moderator Note: Version 0.2 has a bug in recent versions of GZDoom. Please download and use the "master" version in the meantime until Josh does a new release: master.zip
--caligari87


While the current state of this mod does not take incredibly many factors into account when spawning monsters mid-game (players' health and armor if "Dynamically Soften Spawns" is enabled), I plan to add dynamic moments of higher and lower intensity spawning, and possibly even dynamic item spawning adjustments based on things like player ammo levels. For now, this is essentially a highly customizable randomizer, but I felt it had reached a point where it was well worth sharing. :)
Spoiler: Setting Recommendations
Last edited by Josh771 on Fri Oct 26, 2018 11:02 am, edited 1 time in total.
User avatar
Cherno
Posts: 1319
Joined: Tue Dec 06, 2016 11:25 am

Re: josh771's AI Director

Post by Cherno »

Ineresting project. This kind of "middleware" hopefully will show it's true potential in the mid- to longterm, when dedicated TCs which utilize it are released (like a Left4Dead TC! :twisted: )
User avatar
Rowsol
Posts: 970
Joined: Wed Mar 06, 2013 5:31 am

Re: josh771's AI Director

Post by Rowsol »

Messed around for a bit. A few things I noticed.

At default settings there seems to be less monsters than without the mod.
I turned all the item random options on and on map12 I had a row of BFGs in the ooze where there is usually a row of health bonuses.
An occasional monster stuck in the wall.
Sometimes the monsters wouldn't respond, like they couldn't hear me. Not entirely sure this is the mod and not just the level I was playing.
The option for no monsters to spawn in front of you when you start the level is kinda iffy. There are some maps that have a ton of guys facing away at the spawn, something like nuts.wad comes to mind.

This is yet another cool mod you've released.
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

Re: josh771's AI Director

Post by Josh771 »

Rowsol wrote:At default settings there seems to be less monsters than without the mod.
Default settings are 1 to 3 monsters at half of the usual monster spawns. This means that, on average, it should be close to vanilla counts. Spawning 1 to 3 monsters at random should produce an average of about 2 monsters per spawn point, which reduced by 50% becomes 1 monster per spawn point. Therefore, it is somewhat probable that you end up with 1:1 monster counts or something very close to it. But it has a very real chance to be considerably less or considerably more, not to mention that it may create pockets where there are no monsters and large groups where there was normally a small one.
Rowsol wrote:I turned all the item random options on and on map12 I had a row of BFGs in the ooze where there is usually a row of health bonuses.
That's a product of (1) the number of BFGs in the map and/or (2) total random chance. I suggest turning off "Randomize Weapons" to prevent this from happening, although this should be an incredibly rare occurrence. I would ask you to see if you can replicate this on that same map.
Rowsol wrote:An occasional monster stuck in the wall.
This was much more common before I put in a few measures to try to prevent it, but those measures are imperfect and I'm still figuring out ways to prevent it. :wink:
Rowsol wrote:Sometimes the monsters wouldn't respond, like they couldn't hear me. Not entirely sure this is the mod and not just the level I was playing.
The spawned monsters are randomly given +AMBUSH. I should probably add a setting to disable this behavior. They sometimes also totally ignore the player when they are stuck on a ledge or inside a wall. If I can prevent those spawns from occurring, it should fix this issue.
Rowsol wrote:The option for no monsters to spawn in front of you when you start the level is kinda iffy. There are some maps that have a ton of guys facing away at the spawn, something like nuts.wad comes to mind.
This is the primary reason I made it an option, rather than just force it. There are maps where you would not want this to happen. In general, this option is meant for maps with a little more varied geometry than nuts.wad to prevent players from getting bombarded in what are normally fairly mild starts. One can always disable the setting; this is definitely a mod that requires user setup for maximum enjoyment.
Rowsol wrote:This is yet another cool mod you've released.
Thanks! :)
User avatar
namsan
Posts: 147
Joined: Sat Mar 31, 2012 4:27 am
Preferred Pronouns: He/Him
Location: Japan

Re: josh771's AI Director

Post by namsan »

looks freaking interesting, honestly.
Can you add features like "Reduce the amount of enemies when player died and restarted"?
It would make no-save run interesting.
User avatar
Cherno
Posts: 1319
Joined: Tue Dec 06, 2016 11:25 am

Re: josh771's AI Director

Post by Cherno »

Josh771 wrote:
Rowsol wrote:An occasional monster stuck in the wall.
This was much more common before I put in a few measures to try to prevent it, but those measures are imperfect and I'm still figuring out ways to prevent it. :wink:
When I spawn monster groups, I commonly spawn an invisible projectile at a low velocity outwards from the center spawning spot. Once it hits something, it will spawn the monster. This way, monsters won't spawn in walls so often.
OlegGontar
Posts: 25
Joined: Sun Oct 14, 2018 1:37 am

Re: josh771's AI Director

Post by OlegGontar »

Is your mod compatible with monster randomizer mods too?
User avatar
BoneofMalkav
Posts: 81
Joined: Thu May 22, 2014 6:04 am
Graphics Processor: nVidia with Vulkan support
Location: It's Never Worth The Risk

Re: josh771's AI Director

Post by BoneofMalkav »

OlegGontar wrote:Is your mod compatible with monster randomizer mods too?
Testing it with Shades of Doom, Works just fine with it so far.
User avatar
Rowsol
Posts: 970
Joined: Wed Mar 06, 2013 5:31 am

Re: josh771's AI Director

Post by Rowsol »

It seems that the more closed in an area, the less guys spawn. I have the settings cranked (2-8 guys, 100% chance) and I've found that very little ever spawns in the imp closet of map02 after grabbing the red key, 1 or 2 guys instead of the normal 5 imps. I assume there's some check in the code to prevent spawning if it would otherwise spawn in the wall. I think that's where my initial diagnosis of 'default has less monsters' stems from. The mod is still fun regardless of the occasional mishap.
User avatar
sir_firebrand
Posts: 14
Joined: Sun Apr 09, 2017 7:31 am

Re: josh771's AI Director

Post by sir_firebrand »

So, is this basically the zdoom version of Left 4 Dead's "The Director"?

Tried this with some Iwads (Hexen and Heretic) and mods (HD, Beautiful Doom, Brutal Doom and High Noon Drifter) here and all of them seem to be compatible with this.

I will probably replay some good wads that got stale, this will probably will make an excellent addition to wads like alien vendetta and DTWiD.

I wish this was compatible with Zandronum, so all those coop servers would have some variety on the monster's position and location...

Damn you Zandronum!

I U STOPED UPDATING
User avatar
-Ghost-
Posts: 1777
Joined: Wed Sep 08, 2010 4:58 pm

Re: josh771's AI Director

Post by -Ghost- »

Great idea! I'm loving all the AI stuff you're putting out right now, they really help mix things up in familiar level sets. It's nice that they work with other mods, too.

Enemy spawning feels okay, I'm still trying to figure out a good item randomization amount, since it tends to give you too much at once.
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

Re: josh771's AI Director

Post by Josh771 »

sir_firebrand wrote:So, is this basically the zdoom version of Left 4 Dead's "The Director"?
That's my end goal. I hope to eventually introduce more dynamic and less purely random behavior, with item spawns occurring in the map as you explore rather than as soon as the map begins, and other things (like tracking player skill level/map difficulty, etc).
OlegGontar wrote:Is your mod compatible with monster randomizer mods too?
Should be just fine, but it's got some hiccups even in vanilla.
Rowsol wrote:It seems that the more closed in an area, the less guys spawn. I have the settings cranked (2-8 guys, 100% chance) and I've found that very little ever spawns in the imp closet of map02 after grabbing the red key, 1 or 2 guys instead of the normal 5 imps. I assume there's some check in the code to prevent spawning if it would otherwise spawn in the wall. I think that's where my initial diagnosis of 'default has less monsters' stems from. The mod is still fun regardless of the occasional mishap.
Yeah, I've noticed the same thing, and you've guessed right: it's because of the code attempting not to spawn monsters inside walls. I'm considering something of a "fix" for this, giving each spawn point a flag that gets set after its first spawn. Using this flag, I can make the first monster placed at a spawn point actually spawn in the exact position.
User avatar
BROS_ETT_311
Posts: 219
Joined: Fri Nov 03, 2017 6:05 pm

Re: josh771's AI Director

Post by BROS_ETT_311 »

I don't think anyone else has mentioned this, but will this eventually be expanded to include a dynamic music system. This might seem superfluous to most, but I'm always a huge sucker for games that incorporate such a system, and this mod seems to have the potential for just that.
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

Re: josh771's AI Director

Post by Josh771 »

BROS_ETT_311 wrote:I don't think anyone else has mentioned this, but will this eventually be expanded to include a dynamic music system. This might seem superfluous to most, but I'm always a huge sucker for games that incorporate such a system, and this mod seems to have the potential for just that.
There is currently no plan for a dynamic music system. That said, I love the idea, but I think something like that might be better suited to a fuller gameplay mod or TC.
User avatar
RikohZX
Posts: 307
Joined: Tue Sep 04, 2012 9:11 pm

Re: josh771's AI Director

Post by RikohZX »

Or perhaps someone making an addon that taps into when the AI director decides it's time for the lube.

Return to “Gameplay Mods”