Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
SavageCorona

Question(s) about Duke Nukem 3D/Other related games AI

Recommended Posts

I have a few questions about the AI of monsters in Duke Nukem 3D and related games like Blood and Shadow Warrior, mainly on how it works.

It's rather weird in the way it acts. Not that it isn't functional or challenging of course, but I found how it acts really odd in some cases, especially noticable in Blood. I haven't noticed this in Duke or Shadow Warrior, but in Blood, whenever I leave a room with an enemy in it, it appears to stop as if it's just lost interest in doing anything and just become dormant as if it were before it noticed me when I walked in the first time, then returns to attacking me a second after I walk back in. I'd like someone to post the section of code that makes it do that if possible. (I know the source code hasn't been released yet, so I'm not sure if it's possible to get into the code)

Second weird thing I noticed is that even if it's not facing me when dormant, it seems to notice that I'm there, unlike Doom, where if it's facing away, it won't notice me until I do something like shoot it or bump into it, even if I haven't done anything that should alert it like shoot at it or bump into it.

The last but probably not least thing I noticed is that in Duke, the enemy won't try and look around corners to kill me, which I noticed in Lunar Apocalypse when a mini-Overlord wouldn't try and come through a door (it was a left-turn through the door) to try and kill me despite the fact I tried to lure it through (unsuccessfully due to its minigun and grenade launcher and immediate backup right behind it) to a pipebomb trap I had set up. This wasn't because of the pipebombs because I picked up the bombs and it still wouldn't come through, so it's not like it's intelligent enough to avoid it on purpose in that situation.

Of course I know Blood was actually not finished off by 3D Realms, so obviously it'll be a bit different in its coding, but it's still odd in its own ways.

I haven't really noticed anything as odd as these in Shadow Warrior, other than minor flaws like the ninjas will just crouch for no apparent reason even if it's not behind cover, maybe due to the game being more advanced than Duke and Blood, but later on it might have a few noticable quirks.

I'd like someone to post the sections of code that make them do this, and also the English version (I don't understand code that much). ie. Explain what the code means/does, unless it's incredibly obvious what it says, I assume something like the Blood one would be something like (excluding the code punctuation like all the brackets and stuff)

If lost sight of player, become dormant
When player comes into view, resume attacking
Basically I want to know what it's "thinking" if that makes sense.

Share this post


Link to post

http://dukenukem.wikia.com/wiki/Con_files/Files

EDIT: http://wiki.eduke32.com/wiki/Scripting

game.con has enemy actor scripts.

Redneck Rampage had separate con files for each enemy in the game folder.

Never seen Blood's or SW's enemy scripts.

The scripts use states and flags with a heavy dose of counter and RNG based randomness to create the illusion of AI.

In DN3D you can see the scripts using flags like "ifcansee" and "ifcanshoottarget", so perhaps Blood uses them to make the enemies dormant when "ifcansee" is false, probably by setting actor speed to 0.

You'd need to find some Build modder that dabbled in enemy scripting to get a real answer.

Share this post


Link to post

I remember Duke Nukem 3D enemy behavior always being rather strange and not very robust. One thing in particular I noticed was that enemies were invulnerable, or at least took delayed damage, if they could not see you. This would result in hilarious situations where you could shoot two rockets down a corner, show up, and suddenly watch them die.

Share this post


Link to post
SavageCorona said:

Why was my post asking if there was a Build AI coder on the forum removed?

Bloodshedder was probably in the sauce.

Share this post


Link to post

A lot of my posts have been removed lately. A couple I probably understand why but ones like this I don't understand.

I don't remember that glitch, it would seem EDuke fixed that one along with most of the bugs. I didn't play much of the DOS version, because my dad got some program similar to EDuke (I think it was JDuke) to run on Windows XP. Now I can't stand to run it in DOSBox because it looks ugly as hell, OpenGL treats my eyes much nicer. (As well as actual modern PC support because it runs like a piece of crap)

Share this post


Link to post
Wagi said:

I remember Duke Nukem 3D enemy behavior always being rather strange and not very robust. One thing in particular I noticed was that enemies were invulnerable, or at least took delayed damage, if they could not see you. This would result in hilarious situations where you could shoot two rockets down a corner, show up, and suddenly watch them die.

There's a cool bug(?) when you shoot an enemy with the rpg, the blast kills any nearby unaware enemy instantly. For example, in E3L8 shoot the assault captain in the front desk room and you've already gotten rid of one of the battlelords. I think there was a similar way to kill a battlelord in E3L6's red key room too.

Share this post


Link to post

There's something similar in the Playstation version of QuakeII. Often if you close a door, everything behind the door will freeze, including enemy animations. If there was a guard shooting his machinegun at you as the door closes, he will still be there shooting when it opens. It's weird. I suspect it's more to do with loading areas than enemy ai however.

Share this post


Link to post
Captain Toenail said:

There's something similar in the Playstation version of QuakeII. Often if you close a door, everything behind the door will freeze, including enemy animations.


Not often. Always.

Share this post


Link to post

Duke3D has a bug that sometimes (rarely) if you shrink an enemy and don't kill it soon, the enemy will regain its normal behaviour while staying small. I once experienced it with Octobrain. The small bastard flying around having full health again and shooting his (of course big) energyballs at me, and he was impossible to hit, even with hitscan weapons I think... Nearly impossible, true.

EDIT: Reference: http://dukenukem.wikia.com/wiki/Shrink_Ray_(DN3D)#Notes. Apparently it happens when the shrunk enemy is hit or frozen.

Share this post


Link to post

Basically the 90s wasn't good at working out kinks. Sometimes I love games for that, Hitman Blood Money would never be as awesome without various glitches and an AI that seemed to have that kind of autism that was like Alzheimer's.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×