Jump to content
The Dark Mod Forums

AI sitting & sleeping in the wrong place


grayman

Recommended Posts

What's your opinion about disallowing an AI sitting down or sleeping if he's not in the correct place where he's supposed to do this?

This happens when the AI is unable to move to the path_corner where the animation plays.

A distance check can be done to determine "closeness", and an AI who fails will log his situation to the console, so mappers can see their AI is having a problem. And can correct it.

A failure will cause the AI to continue on with his patrol beyond the sitting/sleeping animations.

Thanks.

 

Link to comment
Share on other sites

In the worst case, standing next to a chair or bed still looks much better than sitting or sleeping in thin air in my book, so I'd support this.

Some chairs/beds need a lot of slide_distance though, so it'd probably need to be fairly generous before it skips the path node.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, grayman said:

It's the AI's inability to get to the path_corner where he should sit/sleep that's the problem.

What about the fact that AI can approach the final path_corner before path_sit from different directions?

It can depend on:

  1. Where he came from. Theoretically, all the travel history affects this with rapidly decreasing impact. But the typical case is when there are several nodes targeting the problematic one.
  2. Sometimes guard meets some obstacle. For instance, it may be another guard, or something that player has put on the path. Such situations are impossible to fully test against, but they can affect how the guard sits down.

All of this perhaps does not affect the distance strong enough to make a difference. But it can easily affect the direction.

Is there anything which ensures that guard sits in some specific direction?

Link to comment
Share on other sites

8 minutes ago, stgatilov said:

Is there anything which ensures that guard sits in some specific direction?

Typically a mapper should specify the direction in which the AI should face when the sit animation plays ("angle"), then a second direction for which way the AI should face when seated ("sit_down_angle").

If an AI approaches the chair from the front both angles are identical (so sit_down_angle is superfluous), while approaching from the side or behind they'd be at a 90 or 180 degree angle to each other.

But I don't think this is an issue. After grayman's clarification it'd be just a check if AI origin is within a certain distance of the path_corner origin (move_to_tolerance): skip path_sit node if failed.

Link to comment
Share on other sites

Sitting direction:

1. Set the "angle" spawnarg on the path_sit.

2. If "angle" is undefined, use whichever direction you're facing when the path_sit is processed. Some mappers put a path_turn in front of the path_sit.

 

Arrival direction:

Arrival direction should be irrelevant. The problem is that pathfinding says if the AI is at A and the sitting path_corner is at B, and there's no path from A to B, then the AI will not walk to B. He'll just continue along the string of path nodes.

 

 

Link to comment
Share on other sites

3 minutes ago, Dragofer said:

Typically a mapper should specify the direction in which the AI should face when the sit animation plays ("angle"), then a second direction for which way the AI should face when sitting ("sit_down_angle").

I don't like the word "typically" here 😫 Shouldn't there be a validation check for it?

Quote

But I don't think this is an issue. After grayman's clarification it'd be just a check if AI origin is within a certain distance of the path_corner origin (move_to_tolerance).

Yes, I agree that my comment is not very important regarding the distance check.

Link to comment
Share on other sites

1 minute ago, stgatilov said:

I don't like the word "typically" here 😫 Shouldn't there be a validation check for it?

Not really; we could be giving a false negative to the mapper. The code leaves the problem solution in the hands of the mapper, who can observe what his AI is doing, and adjust accordingly. "My guy isn't facing the right way, let me go to the wiki to see how to correct this."

Link to comment
Share on other sites

2 minutes ago, stgatilov said:

I don't like the word "typically" here 😫 Shouldn't there be a validation check for it?

If it's still the way I remember it, if the mapper makes a path_sit node without defining at least "angle" the AI will just sit down behind himself. Don't think there's any way to get around this without input from the mapper where he's placed the chair.

Link to comment
Share on other sites

Ok, seems my view of the forums was a bit out of sync, now all grayman's replies showed up making mine a bit redundant.

First time I saw the "HOT! 9 replies" tag on a forum thread, hehe.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...