Jump to content
The Dark Mod Forums

Ragdoll AI moved and twisted after reloading


Springheel

Recommended Posts

No, that guy on the floor mattress is a ragdoll placed at map start.

Link to comment
Share on other sites

I'm watching the AI in question at map restore, and in the first 519 frames, he slides off the bed and onto the floor. It's not a smooth change; he moves in short jerks every few frames until he ends up in his final position.

 

So now I need to find out what's pushing or pulling him off the bed.

 

l8r...

 

 

 

Link to comment
Share on other sites

Status ...

 

I think this has something to do with intermittent thinking. We've seen a few physics problems occur due to IT, and this might just be another one.

 

When a savegame is restored, a KO'ed AI--even though he was at rest when the game was saved--is considered to be NOT at rest at restore time, and subject to the game's laws of gravity. If I KO a guard and drop him on a bed, then save and restore, that guard moves ever so slightly when he's restored. It's not enough that you'd notice while standing over him, but the code is moving him a tiny amount each frame until the amounts become small enough to consider him at rest, at which point physics turns off until you bump him or hit him with something later.

 

In the case of lost_soul's mangled guard, the player is far enough away at restore time that intermittent thinking takes over and time--and probably physics--distorts. The tiny nudge that gravity applies becomes amplified, and the body begins to move in a perceptible way. Any particular body might not move at all, but some might.

 

All this is just a SWAG, but it looks like this is where the code is taking me. (Of course, it might take a left turn later.) There are a billion things going on inside the physics code.

 

Atm, it doesn't look like the attached sword is causing the problem. The code checks the master first, which is the AI's body, then it checks the sword, then the head. If the sword or the head find that the master has moved, then they move accordingly. If the master doesn't move, they don't move. So the master is driving them, not the other way around.

Link to comment
Share on other sites

Hm, is the "at rest" value never saved, or just not restored properly?

"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 correct solution--as Springheel suggested--is to turn off IT for KO'ed AI.

 

The code was already turning it off for dead AI, with the comment "Ragdolls think every frame to avoid physics weirdness."

 

Since KO'ed AI physically act the same as dead AI, I simply added a check for being knocked out.

 

In 5 tries, lost_soul's KO'ed AI stayed on the bed in the exact same position.

 

@lost_soul: Is this the position the AI ended up in when you dropped him on the bed?

 

post-3633-131915889887_thumb.jpg

Link to comment
Share on other sites

Wow, that could be an exciting fix...one of the very last gameplay-breaking bugs! :)

Link to comment
Share on other sites

Yep, that screen shot looks about right. Nice work! I think he was standing near the front door of the building. He was the archer IIRC and I blackjacked him when he came out the front door.

Edited by lost_soul

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

Link to comment
Share on other sites

Yep, that screen shot looks about right. Nice work! I think he was standing near the front door of the building. He was the archer IIRC and I blackjacked him when he came out the front door.

 

Ok, good.

 

He's not an archer, though. I wonder if you blackjacked him just outside the hall door that leads to the balcony over the large lodge-like room. It appears that the code keeps track of two AI origins, and one of them might be getting stuck at the spot where the AI gets knocked out. Because of "if it ain't broke don't fix it", I'm not going to figure out why this is.

Link to comment
Share on other sites

Yeah I think you're right. Now that you mention it, I blackjacked the archer, chucked him over the (outside) railing and stashed the body beneath the stairs outside. That guy in the room is the one who patrols through the hallway.

 

EDIT: Just loaded up my game and checked. The archer is outside beneath the stairs.

Edited by lost_soul

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

Link to comment
Share on other sites

That's nice work! At a later time we might want to revisit the "enable IT for dead/knocked out AI", tho, because now the game will get slower if the user knocks out/kills everyone on the level. (But hopefully dead/knockedout AI skip most checks in their thinking code, anyway?)

"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

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

    • 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
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...