Hello guys.
I was trying to have a custom "chasing" function for a monster.
What I wanted to achieve is a monster moving away from its target when it's too close, but with specific escaping routes and the possibility to attack like it was in a normal chasing (this is why I completely put aside the easy way of just using the FRIGHTENED flag and call it a day).
I got the "avoid the target" and "avoid obstacles" done, working pretty well too, but then I tested the creature with normal steps... and it broke.
Basically, what happens is that the monster doesn't get block by the step like an actual obstacle, but he won't move forward anymore and won't climb the step, but only if the total height of the steps to climb exceeds the standard Doom monster limit of 24... even though the monster MaxStepHeight is 32... I even tried raising it up to 64, but this behavior didn't change.
Not to mention that if the monster target gets closer, sometimes the monster will climb up the steps...
To me even weirder, is when the monster tries to go downstairs instead, because in this case it will recognize the "stepping down" as an obstacle and just avoid it like a wall etc.
This is the code I'm using:
I wonder if there's some hardcoded stuff within CheckMove(), because I'm clueless about this behavior.
This is the monster class:
I was trying to have a custom "chasing" function for a monster.
What I wanted to achieve is a monster moving away from its target when it's too close, but with specific escaping routes and the possibility to attack like it was in a normal chasing (this is why I completely put aside the easy way of just using the FRIGHTENED flag and call it a day).
I got the "avoid the target" and "avoid obstacles" done, working pretty well too, but then I tested the creature with normal steps... and it broke.
Basically, what happens is that the monster doesn't get block by the step like an actual obstacle, but he won't move forward anymore and won't climb the step, but only if the total height of the steps to climb exceeds the standard Doom monster limit of 24... even though the monster MaxStepHeight is 32... I even tried raising it up to 64, but this behavior didn't change.
Not to mention that if the monster target gets closer, sometimes the monster will climb up the steps...
To me even weirder, is when the monster tries to go downstairs instead, because in this case it will recognize the "stepping down" as an obstacle and just avoid it like a wall etc.
This is the code I'm using:
Spoiler:I tried different moving functions, but nothing really change except with TryMove, but I'm getting some jittering results for some reason.
I wonder if there's some hardcoded stuff within CheckMove(), because I'm clueless about this behavior.
This is the monster class:
Spoiler:I'd like to know if what I'm trying to do is possible without having to rewrite the zdoom chasing functions, otherwise I'll just surrender and use the FRIGHTENED flag T_T
Statistics: Posted by Kan3x — Sun Mar 10, 2024 4:14 pm