New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dummy Templars survive in orc graveyard #115
Conversation
Yes that's quite an issue. I'd find it sad actually if they'd be dead from the start I remember my first time playing and it was such a rush hearing the fighting and the thrill of trying to make it in time (and actually failing). I wonder if there is a better way. Maybe they could still automatically die, but triggered by something else, e.g. the orcs dropping below a certain threshold of HP or the player coming too close (although that would not include ranged combat). Any suggestions? |
They could die if the player is like 10 m away from their waypoint. Then the player would still see them, but if they don't die by the orcs, they would still be dead if the players passes them. The only downside would be that they could drop dead on sight without a reason for the player. |
Yes, I think that could be quite ugly, if there are no orcs left by then. The death could be triggered by line of sight. As soon as the hero (not the player in this case!) sees a templar their HP could drop to a certain value. Then they would die on the next hit. This still doesn't exclude the possibility that they could survive, but makes it smaller |
The Templars already die with one hit from the orcs, even with full HP. The problem is that at one point the orcs may attack Baal Lukor first before they attack the dummy Templars so the Templars don't even get hit. That was the case when I made the screenshot above. These Templars would have to die somehow nonetheless. |
Another possible solution would be to kill the remaining dummy Templars when Baal Lukor initiates the dialog with the player. Then the player will have seen some Templars fighting already and the rest can be killed in the background. |
I guess it might just be the best to kill them right away, as you initially suggested. Anything else seems even more fragile or might end up looking weird. Although, of course there will be less fighting going on and it does not feels so "realistic". I think we can give it some more thoughts. Maybe we will find a both satisfying and robust solution. |
How about, we have Baal Lukor ignore the orcs and be ignored by the orcs until the player gets close. This way the orcs should focus on the templars and finish them off in time. |
That's a good idea. Additionally, the Templars should also attack the orcs (but deal no damage), because right now they just stand around doing nothing and waiting for the orcs to kill them. |
Yeah so their state/daily routine is deliberately to just sit and wait, as the name and description implies: gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/ZS/ZS_SittingDuck.d Lines 1 to 9 in 5b6dda8
If Baal Lukor is ignored and also ignores them, the orcs should quickly kill off the templars (as originally intended). There might not be the need to modify the templar’s state. I’d also like to avoid it, because with making them more perceptive and active the chance of them surviving is actually higher, i.e. running to a different orc or run somewhere entirely different where they survive. I will first take Baal Lukor out of the equation and then we can check how reliable it is. |
I see your point.
I agree. The tests will show if that already fixes the issue. |
Yes that sounds good. In Gothic 2 there is an easy way to have an NPC igore and be ignored that is not available in the Gothic 1 scripts. I will have to think of a way to do it. Having Baal Lukor ignore the orcs should be straight forward, by overwriting his state to turn him into a vegetable until the player has line of sight. To make the transition smooth, I’d have him draw his weapon from the start. For making the orcs ignore Baal Lukor, on the other hand, I don’t have an elegant idea yet. I will have a look at the orientation of the waypoints: Maybe the orcs are already aligned towards the templars and will only spot them on first sight. NPCs generally don’t change their targets once they attack (only if they are attacked by someone else). So they would finish off the templars before “realizing” there is also Baal Lukor, who will then only fight back once the player approaches. These are just thoughts and notes, until I have the time to try it out in practice. |
@AmProsius, Am I correct in the assumption, that #78 promotes the occurrences of this issue here? If that’s correct, should we prioritize this issue for v1.1.0? |
I have to check that. I think the Templar dummies are not affected by that fix. |
Okay. I somehow had this impression, because Baal Lukor will now start to attack before being attacked. Thanks for checking! |
I double checked: The dummy Templars don't engage. But since Baal Lukor now attacks the orcs (and vice versa), the dummy Templars from the screenshot above almost always survive, so this fix is sill very important. |
Thanks for checking! My current idea would be to intercept the Note to myself: |
That sounds like a very smooth solution! |
I implemented the necessary checks in 47ea4d1. I will try to implement the proposed fix. |
I experimented a bit with it and it looks very clumsy:
I expected the orcs already engaging the templars in a fight when the player comes close, but that's not the case. This approach does not look promising, and spawning the templars dead seems like the better option in comparison. I just tried some other things like having the templars detect their nearest enemy and sending a damage perception to them. That causes the orcs to immediately attack and kill them. Additionally I have the templars draw their weapon and run towards that very enemy. That looks very natural for the first two single templars. Unfortunately, the two templars in the cave with Baal Lukor don't detect "their" orcs but the ones further up towards the player (possibly because the orcs closer to them spawn just slightly later). As a result they are rushing out the cave towards the player and stand around while the orcs attack the player. So that's even weirder. I don't want to go too far off, because it is becoming harder to not break a mod's changes. I will brainstorm some other ideas. |
I think I now found a good compromise: The sitting ducks are still sitting ducks: The do not perform any action. Every 100 milliseconds they iterate over all(!) enemies in their proximity and sent out damage perceptions. That means the enemy thinks they received damage from that templar. Even if the player or Baal Lukor interferes, the orcs will kill the templars first, because the perception is sent continuously. The orcs will always switch to attack the templars, as their most recent attacker. If no enemy was found, this process is repeated until the player comes too close (25 meters). In that case the sitting duck "commits suicide". I tried this a few times and I am happy to say that all templars were killed. For some of them I could even hear the death cry and could just see how they died. That's the best case scenario. In the worst case, the templars will just be dead when the player arrives. Which is good, too. There is still one thing to consider: Should we add this functionality for the sitting-duck AI state in general? I first thought of checking if the NPC in question is one of the selected templars. In that case, however, the fix would not work if the templars were exchanged, renamed or more were added. |
Before answering this, I'd like to know where this behavior is also used besides the orc graveyard. It might have unforeseen side effects. If we can verify that the altered behavior doesn't change anything story related, I'm happy to go with your proposed solution. |
This is a draft. A test and documentation is still missing. Refs #115
Yes, it shouldn't. That "sitting duck" AI-state is some comments in the code describing, that is exclusively used for NPCs to be killed of (I quoted that comment a few posts above). Therefore, the changes are only beneficial in all cases. Nevertheless, this AI state is only used for the templars in the grave yard, plus one outside. |
I committed the changes so far, if you want to try it out. Unfortunately, I didn't write a test yet, but entering the orc graveyard (irrespective of the story progression suffices). |
Perfect, go ahead then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool fix! I enjoyed running through the orc graveyard and seeing the orcs kill the templars. It's way more immersive than my proposed solution.
Some notes that apparently were filtered by Github:
and
(Copied from here) It seems unlikely to me for anyone to use the AI state at all, even less so for a different purpose. The sitting ducks really react to nothing at all. They have no perceptions and wouldn’t even react to the player talking to them. That they are waiting to be killed is even in the name of the AI state. That’s my justification to killing off any NPC in that state if the player comes to close. Regarding the blood effect, I don’t understand the question/comment. Could you elaborate, please? |
I think he meant something like the effect when the player character gets hit by an arrow/bolt. I wouldn't include that though, I'm happy with the current solution. The concerns regarding the use of the "Sitting Duck" AI state in mods are reasonable, so I'd like to add checks for the inserted templars. On the other hand, this fix wouldn't apply to additional templars that could be added by a mod then. I'm still in favor of the additional checks though. |
Describe the bug
When the player is fast enough, he can kill the orcs near the dummy Templars before the orcs kill the Templars. Then the dummy Templars just stand there doing nothing.
Expected behavior
The dummy Templars in the orc graveyard are now already dead when the player enters the graveyard.
Additional context
My suggestion would be to kill the dummy Templars when the player first enters the orc graveyard.
Screenshot