grayman 2974 Posted February 22, 2020 Report Share Posted February 22, 2020 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. Quote Link to post Share on other sites
Dragofer 1430 Posted February 22, 2020 Report Share Posted February 22, 2020 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. 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
grayman 2974 Posted February 22, 2020 Author Report Share Posted February 22, 2020 Slide_distance should be irrelevant, since it's part of the animation (which will be skipped). It's the AI's inability to get to the path_corner where he should sit/sleep that's the problem. Quote Link to post Share on other sites
stgatilov 1255 Posted February 22, 2020 Report Share Posted February 22, 2020 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: 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. 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? Quote Link to post Share on other sites
Dragofer 1430 Posted February 22, 2020 Report Share Posted February 22, 2020 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. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
grayman 2974 Posted February 22, 2020 Author Report Share Posted February 22, 2020 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. Quote Link to post Share on other sites
stgatilov 1255 Posted February 22, 2020 Report Share Posted February 22, 2020 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. Quote Link to post Share on other sites
grayman 2974 Posted February 22, 2020 Author Report Share Posted February 22, 2020 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." Quote Link to post Share on other sites
Dragofer 1430 Posted February 22, 2020 Report Share Posted February 22, 2020 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. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
Dragofer 1430 Posted February 22, 2020 Report Share Posted February 22, 2020 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. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.