Improved Monster AI Ideas

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Retraux Squid
Posts: 230
Joined: Sat Aug 13, 2016 8:41 pm
Location: E1M1

Re: Improved Monster AI Ideas

Post by Retraux Squid »

It would probably go, code-wise, something like this:
>Monster shoots out invisible tracers in all directions to give them an idea of the environment around them.
> They choose the longest direction (which would lead them out of cover), and strafe until they have line of sight to you.
> Once they establish LOS they shoot a few bursts, then strafe in the direction they just came from to get back into cover.
Posts: 5
Joined: Mon Dec 12, 2016 1:40 pm

Re: Improved Monster AI Ideas

Post by Kaminsky »

I know that in a game like Counter-Strike Source, bots were able to explore maps and use its surroundings to their advantage with the help of a separate navigation (.nav) file that was part of a map. It could tell the bots the traversable areas of map, potential places of cover (crates, pillars, small ledges, other doodads) were around the map and hazardous areas to avoid.

I think a similar concept could be done for ZDoom where maps can be analyzed when they are first loaded and the lines/sectors/things can all be collected and used to create vantage points that monsters will have knowledge of and can make good use of. These points can vary from being areas to ambush targets, take cover or avoid completely.
User avatar
User Accounts Assistant
Posts: 6000
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Improved Monster AI Ideas

Post by Caligari87 »

The problem with solutions such as this is that there's no way for the computer to pre-determine what would be a "vantage point" or "cover" (at least not without significantly powerful algorithms). It works in games like FEAR because that kind of thing is tightly controlled and pre-determined by the level designers, and they have highly complex pathing and decision-making structures to support it.

A more feasible solution for Doom would be to have monsters "think" about possible paths and locations in an organic fashion by using wandering versions of themselves. Say a zombieman, for example, has itself, and several "imaginary" zombiemen that wander randomly around it in a relatively close radius while trying to maintain line of sight with the real zombie (or being dropped when they break LOS and spawn a new one). They report if they have broken or gained line-of-sight to the player's last known (not real) position (itself marked by an "imaginary" player). They could also stop on health or ammo when they encounter it, if the zombie takes advantage of such things. The real zombie can then have a decision tree for which of these imaginary zombies it walks toward, depending on health, nearby friendlies, ammo, etc. A more "intelligent" enemy would have more imaginary versions of itself it can work with.

Another mitigating factor is that most enemies in Doom are not fast or strong enough in comparison to the player for any of this to make any difference. The player won't notice any additional subtly in most of the monsters unless they're significantly stronger or faster. For 90% of cases it's enough to set "afraid" on the monster when certain health ratios or range checks are met.

User avatar
Posts: 1987
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil

Re: Improved Monster AI Ideas

Post by Ravick »

Nash wrote:(...)
Let's say, if a group of shotgunguys is chasing you, the ones in the end of the mobwill avoid firing until there is no more shotgunguys in front of them
ZScript can already do this; what you'd do is fire a small cone of LineAttack or AimLineAttack (use a for loop) and for each trace, make sure the received LineTarget isn't of its own kind (using the "is" operator). If a trace hits its own kind, it's considered a fail. If even 1 trace fails, consider the attack has failed and abort the attack. If all traces do not fail, proceed with the attack. It's actually much shorter in code than it is to type this, haha.

Humm... Could I do that using ACS and DECORATE? Or maybe only DECORATE? (Please note that I'm not a ZScript hater, it is just totally new for me for now, and I'd like to try with languages I'm used to for now. And I'm planning to implement it in already DECORATE based actors.)

I've seem in the wiki: "Note that AAPTR_GET_LINETARGET is identified as AAPTR_LINETARGET in DECORATE."

But I could not find how to take this date from the LineAttack. Is it possible without ZScrit?

ALso, I can't find AimLineAttack documentation. Is it restrict to ZScript?


Thanks in advanced!

Re: Improved Monster AI Ideas

Post by Guest »

Some cool monster functions for ai are the avoidmelee flag, where a monster will back up if an enemey is too close, frightend flag where it will run away but still shoot at you a bit, and changing it's a_chase to a_fastchase, will cause it to randomly strafe left and right, which makes them really hard to hit with missiles.
User avatar
Posts: 9685
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Improved Monster AI Ideas

Post by Matt »

Interesting to bump this now that ZScript is a vastly more mature tech than it was last time anyone posted here.

...and I still can't imagine anything better than Retraux Squid's raycasting, at least not without a serious risk of bogging down the entire system the instant you try to play anything more complex than the original Doom maps on medium.
User avatar
Posts: 255
Joined: Fri Sep 08, 2017 2:54 pm

Re: Improved Monster AI Ideas

Post by r&r »

Is there or Anyone made a Universal Monster enhance mod?

That can give any monster randomly abilities
Smart Dodge,
A Speed/movement boost,
a Short leap attacks (melee attackers only),
Shoots double/longer/faster, then normal.

and it works for like all wads like Doom 1-2, Heretic-Hexen to Strife and other wads.

Return to “General”