View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003820||The Dark Mod||AI||public||19.08.2014 13:55||26.09.2018 18:44|
|Platform||Win32||OS||Windows||OS Version||7 sp1|
|Target Version||TDM 2.06||Fixed in Version||TDM 2.06|
|Summary||0003820: New code to recognize Ai falling asleep & waking up in/from sitting position.|
|Description||As per Grayman's post, logging a bug tracker request for the following sleeping animation that requires new code to go with it.|
|Steps To Reproduce||We need code support to recognize that falling asleep in a sitting position is a different anim than falling asleep in a lying position (and the opposite sequence of waking up).|
Given this sequence of anims:
Standing->sit down->fall asleep->sleeping->wake up->stand up.
We have the ones in red, but we still missing the others
And we need a path node for sitting/sleeping to go with the existing one for lying/sleeping.
|Tags||No tags attached.|
Since "in red" can't carry over from the thread to here, here are the anims we're missing:
And the code needs to be written to know when to use the "asleep while sitting" family of anims, as opposed to the "asleep while lying down" family.
"It's probably not crucial to have fall asleep/wake up animations. The sleeping animation isn't so different from regular sitting that there would be much of a jump going straight to 'stand up' when the ai is alerted. And vice versa. While it might be nice the feature could work without it."
|Also need changes to path nodes so an AI can walk to a spot and sit and fall asleep.|
In a discussion about sleeping sitters (http://forums.thedarkmod.com/topic/16460-sleeping-ai-get-them-to-sleep-on-the-ground/page-3#entry406343) Destined says:
"It would be great, if it were possible to activate the sleeping behaviour directly from the sitting behaviour. In that case, it would be possible for the AI to appear to work on a table and (due to the late hour), fall asleep at some point. Later on, it can wake up and continue, what it was doing. I do not know the intricacies of the code adn thus I have no idea how viable this is, so please see it as a suggestion in case it is not too difficult to implement, as I am sure there are still more pressing matters for you."
1 - AI currently use the sleep_location spawnarg to define whether they sleep on a bed or on the floor. This spawnarg was given to the AI to satisfy the undead's desire to sleep on the floor. I implemented it so that normal humans could sleep on a bed or on the floor. But, once the spawnarg is given, it denies the AI the ability to change where it sleeps as it patrols.
In 2.06, you can give the path_sleep entity the same spawnarg. 0 = sleep on the floor. 1 = sleep on a bed. 2 = sleep on a chair. If the AI has the "sleep on chair" animations, then he can use the third option. But even if he doesn't, he can change his sleep location at any time during his patrol. When the AI encounters a path_sleep entity, if it has the sleep_location spawnarg set, that will define where the AI sleeps. It will override the same spawnarg on the AI. If the path_sleep entity does not have the sleep_location spawnarg, then the AI will sleep where the AI's sleep_location spawnarg tells it to sleep.
This allows AI to vary their sleeping locations as they move around a map, by letting the code read the sleep_location from the path_sleep entities.
2 - Sleeping in a chair requires that the AI sit down first using the path_sit entity.
3 - A new path node, path_wakeup, is used to wake up an AI sleeping in a chair w/o causing him to stand up. He'll wake up and stay seated.
4 - I noticed that in 2.05, when an AI starts a mission asleep, using the sleeping spawnarg, and he wakes up for some reason, when he returns to his original spot, he will sleep again if he's not in Alert Idle. If he's in Alert Idle (and has his weapon drawn), he simply stands in place w/o lying down again.
If, however, the mapper has initially put the AI to sleep using the path_sleep entity, he will lie down when he returns to his position, whether he has his weapon drawn or not. For an AI with a drawn sword, the sword ends up piercing his jaw and sticking out the top of his head or helmet. Not good.
So, in 2.06, I changed the second behavior to match the first.
5 - For the new "sleep in chair" situation, per request, I've designed it so that the AI can fall asleep in a chair, wake up, stay seated in the chair, fall asleep again, wake up, blah blah blah. Between naps, you can have the AI do anything else you want by using the appropriate path nodes.
For example, the path node chain
path_corner -> path_turn -> path_sit -> path_sleep (sleep_location = 2) -> path_wait -> path_wakeup -> path_wait -> path_sleep -> path_wait-> path_corner
would cause the AI to walk to a chair, turn to the correct angle for sitting, sit down, fall asleep, stay asleep for a certain time, wake up, wait a while, fall asleep again, sleep for a while, and get up and proceed with his patrol.
6 - Currently, there are no “sitting & sleeping” animations for females.
|19.08.2014 13:59||grayman||Note Added: 0006859|
|22.08.2014 20:41||grayman||Note Added: 0006875|
|24.08.2014 15:11||grayman||Note Added: 0006889|
|07.09.2014 17:25||grayman||Category||Coding => AI|
|22.05.2017 00:45||grayman||Note Added: 0008872|
|22.05.2017 00:45||grayman||Assigned To||=> grayman|
|22.05.2017 00:45||grayman||Status||new => assigned|
|12.08.2017 18:12||grayman||Note Added: 0009079|
|12.08.2017 18:12||grayman||Status||assigned => resolved|
|12.08.2017 18:12||grayman||Resolution||open => fixed|
|12.08.2017 18:12||grayman||Fixed in Version||=> TDM 2.06|
|12.08.2017 18:12||grayman||Target Version||=> TDM 2.06|
|26.09.2018 18:44||VanishedOne||Relationship added||related to 0004887|