Sleeping AI

From The DarkMod Wiki
Revision as of 20:00, 25 May 2010 by Fidcal (talk | contribs)
Jump to navigationJump to search

PLACEHOLDER TODO...

Sleeping AI are (mostly) working now. They can either put themselves to bed at map start when they have set the spawn arg

sleeping 1 or can be made to go to sleep and get back up during patrolling. This is done by targetting a path_sleep entity which then targets a path_wait.

There is also a testmap, test/sleep, which shows both possibilities. Testing please, there might be a few bugs creeping around (I also changed patrolling quite a bit).

By default, place the AI on the right side of the bed (as you look towards the head of the bed) and facing away from the bed. If you want the AI to start from the other side then add:

lay_down_left 0 (note this goes on the AI if the AI is using sleeping 1 BUT on the path_sleep if you are using a path_sleep)

Distance the AI slides across onto the bed can be controlled by

lay_down_slide_dist 16 (default)


There are a few known problems: They can only lay down in one direction, so we would need a second mirrored animation. The bed I'm using is too high, so they were clipping into it. I had to push it 8 units into the ground. They often lie close or even over the edge of the bed.

AI have their eyes closed now while sleeping. This is using the pain anim as a place holder at the moment, since we don't have a suitable anim yet (sleeping looks like a quite painful experience now...)

Another problem is that the bounding box stays behind and is solid when the AI goes to bed.

When you KO a sleeping AI, they pop back to standing, like they did in Thief.

Also this is probably unrelated but might be contributing to this problem: I'm noticing that KO'd AI are sometimes(?) flashing into the AF pose for just a frame, then back to the pose they were in before KO'ing. You can see it if you watch really closely.

There is also a problem when they see the player while laying down - they jump up for a moment, then finsih putting themselves to bed and then finally get up to chase the player.