Jump to content
The Dark Mod Forums

AI committing suicide


grayman

Recommended Posts

I've seen a few comments about AI being discovered dead in missions.

 

This happened to me for the first time while beta-testing Biker's new mission this morning. I came upon a Builder guard lying dead in a doorway, and I know he was alive and patrolling earlier. In previous tests of this mission, I had to dispose of this guard myself.

 

I'm inclined to write an issue up for this, but wanted to start a discussion before I did.

 

Anyone know what's causing this?

Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

There have been accusations against "Interleaved Thinking Optimizations" but Biker's settings don't seem too aggressive. Was this event after a Quick-Save?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

There have been accusations against "Interleaved Thinking Optimizations" but Biker's settings don't seem too aggressive. Was this event after a Quick-Save?

 

Not in my case. I had probably done a regular save perhaps 5 mins before finding the body.

Link to comment
Share on other sites

Anyone know what's causing this?

 

For a while I was playing with an extended version of "Thieves", one of my guards used to be dead and the ragdoll all mutilated at spawn, it didn't happen when I moved my spawnpoint nearby so that I could try watch to see the initial state. I 'fixed' it by jiggling him around a bit and putting his feet closer to the floor, tho he was only like 2-3 units above to start with.

 

I wonder if it's not something to do with the initial gravity where all items are 'dropped' before the map is playable? perhaps some situation causes the falldamage to become stupidly high or something, it was a problem we quite often had working on a UT2k4 mod a while back, some setting was incorrect and would cause npcs to instagib walking between statics... admittedly funny to watch :)

Link to comment
Share on other sites

That is an interesting possibility. Maybe if they lose a tiny amount of health when they fall and it increments that might be a reason. But how? Walking down steps I suppose they just walk off a step and drop an inch or two. But in Heart most of them did not go down steps. But sometimes I've noticed AI get temporarily stuck and step up on some trim or other obstacle then drop down again. Gravity is certainly a theory worth keeping in mind depending on how the code works.

 

My own thinking changes are well within the recommended values on the wiki but still might be a cause. In an early Heart the cook always used to die. I removed all his thinking changes to default and he still died. He always died near the keg in the servant's dining room. So I changed his path to stop that.

 

I've reduced my thinking changes in my current map even more to see if this helps but it will take time to be sure.

 

Any other theories? How about clipping into weapons? Do they have damage stims or is that only during a melee?

Link to comment
Share on other sites

I wonder if you could use the Cut-Scene tools to record a timeDemo of the AI goofing around in the map then pinpoint what they are doing? (link a camera to an AI)...

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

the ai should only get hurt if there's a certain amt of momentum, so it would be odd if walking down steps was hurting them. perhaps instrumented code that reports health and location every second might show what's happening. just start up alchemist (say) with it and see what happens.

Link to comment
Share on other sites

the ai should only get hurt if there's a certain amt of momentum, so it would be odd if walking down steps was hurting them. perhaps instrumented code that reports health and location every second might show what's happening. just start up alchemist (say) with it and see what happens.

 

There is already code that prints a console message whenever someone gets hurt, maybe it would be good to add the cause to this message so instead of "4 damage applied" you get "4 damage (fall) applied to atdm:guard_benny_1".

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I ran Alchemist for an hour or so with an instrumented TDM 1.03 and saw 10 instances where damage was inflicted on patrolling AI. The damage ranged from 4 to 10 per shot. I stayed away from them, so I never was the cause of the damage.

 

In 8 of these cases, the AI was next to a door, and their patrol route took them through the door. Is it possible that an opening door can inflict damage? Probably yes, since a door is a mover.

 

In the remaining 2 cases, the AI was simply walking across a floor, headed for a door, but nowhere near the door. He got whacked twice with 10 damage in the exact same spot, but there's nothing there. One more shot and he would've died. I'll have to look closer at him.

 

I'm printing out the inflictor (i.e. a sword) and the attacker (i.e. the wielder of the sword), and in all these cases, none are specified, so the code marks both as the world. Since doors are named, I would expect the doors would've showed up as the inflictors, but they never were.

 

I'm going to let Alchemist run overnight and see who's left in the morning.

 

Oh, and the one Builder guard who died mysteriously in Biker's new mission in this morning's testing did so in a doorway. Curiouser and curiouser.

Link to comment
Share on other sites

I'm going to let Alchemist run overnight and see who's left in the morning.

 

You Sir, are a sick person! :ph34r:

 

:) Anyway, please put the instrumentation code into SVN, it would be useful in other instances, too.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

The overnight test resulted in one AI dying near a door.

 

I think the other AIs getting hurt last night stopped getting hurt because I moved to a safe spot in the map where I wouldn't be found overnight, and I might have moved beyond their intermittent thinking radius.

 

More testing today.

Link to comment
Share on other sites

Well I've yet to see this happen during normal gameplay. I have turned on g_dragentity though just to have some fun, moving things around. When I moved a guard over something he wasn't intended to walk on, like a bench or toarch, he died. The first time I saw this, it made me ROFL. Maybe this is the same thing that happens automatically.

--- War does not decide who is right, war decides who is left.

Link to comment
Share on other sites

The overnight test resulted in one AI dying near a door.

 

Throwing some out there ideas in :

Did the doorway have a func_static model arch/moulding over/around it, such that a vis-portal might intersect it?

 

This might cause a situation whereby the visportal's state is incorrect when the AI is "inside" the visportal?

 

Did the door have a property which would close it, either a trigger or "shouldbeclosed" spawnarg?

Link to comment
Share on other sites

Throwing some out there ideas in :

Did the doorway have a func_static model arch/moulding over/around it, such that a vis-portal might intersect it?

 

This might cause a situation whereby the visportal's state is incorrect when the AI is "inside" the visportal?

 

Did the door have a property which would close it, either a trigger or "shouldbeclosed" spawnarg?

 

 

The AI is getting hit by a moving door, but that's not the problem. The code looks at whether any damage should be accrued by getting hit, which brings into play the area where I think the bug is.

 

My current theory is that the timing differences of interleaved thinking are a contributing factor. The code assumes the physics math is happening over a 1-frame timespan, but some of the data used is for a timespan of N frames, where N is the number of frames used by interleaved thinking (if the player is far enough away).

 

So the problem is that a force in the vertical direction is magnified by N, and the code thinks the AI is hitting the floor harder than he really is.

 

This causes damage.

 

Right now I'm trying to figure out what the fix is, and apply it in such a way that it doesn't screw up something else.

Link to comment
Share on other sites

well one fix is for me to design betters maps where I dont have to have doors auto close...:laugh:

auto-close isn't the problem. in the situation i'm looking at, the AI is being swept to one side by the door he's opening. it might be that as he approaches the door, interleaved thinking makes him overshoot his normal stopping point, so he ends up next to the door when he opens it.

 

all theory at this point, though.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...