Code: Select all
{
A_Chase(null,null,CHF_NORANDOMTURN );
if(target) {
if (angleto(target) > angle)
angle+=1;
else if (angleto(target) < angle)
angle-=1;'
}
}Code: Select all
{
A_Chase(null,null,CHF_NORANDOMTURN );
if(target) {
if (angleto(target) > angle)
angle+=1;
else if (angleto(target) < angle)
angle-=1;'
}
}Code: Select all
See:
TNT1 A 0 A_Chase(null,null,CHF_DONTTURN );
ZAA1 AAAAABBBBBCCCCCDDDDDEEEEEFFFFFGGGGGHHHHHIIIIIJJJJJKKKKKLLLLLMMMMMNNNNNOOOOOPPPPPQQQQQRRRRRSSSSSTTTTTUUUUUVVVVVWWWWWXXXXXYYYYYZZZZZ 1
{
//console.printf("%f",angleto(target));
if(target) {
if (angleto(target) > angle)
angle += 1;
else if (angleto(target) < angle)
angle -= 1;
}
}
loop;Code: Select all
ZAA1 AAAAABBBBBCCCCCDDDDDEEEEEFFFFFGGGGGHHHHHIIIIIJJJJJKKKKKLLLLLMMMMMNNNNNOOOOOPPPPPQQQQQRRRRRSSSSSTTTTTUUUUUVVVVVWWWWWXXXXXYYYYYZZZZZ 1
{
thrust(0.1,angle);
if(target) {
if (angleto(target) > angle)
angle += 1;
else if (angleto(target) < angle)
angle -= 1;
}
}
loop;No. Pathfinding requires actually being able to follow paths. Notice that if you go into a completely different room, it'll try to walk directly towards you instead of following the correct path to the next room.Jekyll Grim Payne wrote:I don't think you're right about A_Chase. I tested it on those zombies and observed (them being slow and 3D helped to observe better), and after bumping into an obstacle they clearly went around it to get to me. There's definitely some pathfinding, not just random walking around.
OK, that's fair. My frustration comes from the fact that the angle of the model HAS to follow the actual angle of the actor. Like, I expected INTERPOLATEANGLES would do something about it, but no dice. Considering models are pretty relevant, it's just weird to me there's no out-of-the-box solution.Arctangent wrote:Eh, I think you're underestimating how much the fact that they can only move in 45-degree intervals is necessary to make A_Chase's movement "work." You've got this nice gradual turn effect going on currently, but going with A_Chase's method would mean that running in a wall would either result in jarring angle changes or the zombies getting stuck on the wall as they slowly tank control to another angle, which might just lead them into another wall.
It's just a very goofy way of moving around that only "works" because Doom monsters move in such underdetailed, cheat-y ways to begin with.
That's an interesting idea. However, my problem isn't only with the visuals, it's also with the fact that I actually don't want the monster to be able to turn that fast. You know how often in Resident Evil you can run past a zombie? Yes, sometimes they'll suddenly lunge at you, turning 90 or 180 degrees (which will be implemented by a separate state and animation), but a good amoung of times you can just run by and they won't be able to turn fast enough to attack you. I want to replicate that behavior too.Cherno wrote:I have a project that uses models for monsters, and I implemented a solution that retains the 8 cardinal direction movement and rotation, but the angle changes are not instant but rather smoothed over several tics so the model doesn't just snap to it's new angle, but rather visibly turns towards it. It involves using invisible actors for the monsters itself and visible actors as children that continously rotate towards the main actor's angle. Is this something you need, or do you really need a movement solution that also lets the monsters move and rotate in all directions?
I'd guess I'm late posting this, whatever... I've messed around with ZScript to figure out A_Chase turning limits too.Jekyll Grim Payne wrote: Upd2:
Well, I'd say this looks decent: https://streamable.com/yil95
I'll have to tweak it a bit more and incorporate additional animations for long turns though, but it's something