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

    • 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.
      · 6 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...