Movement Code With Smooth Turning?
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
There's also code for an altered Zombieman using SmoothMoveTurn included in the archive.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
Presumably in the VoxelChibi archive (fun little mod BTW).
I tried setting things up much along the lines that you had them: inherited from VoxelCharacter, used ChaseSmooth in place of A_Chase and then tried a few of the values from your various actors (including the Zombieman - and the mancubus, which I thought would be close to my robot because I originally based him off the mancubus).
Unfortunately, I couldn't get something to move without the kinds of problems I've been talking about. Shame, because the turning speed is exactly what I want, but if I can't get the enemies to behave properly while navigating around the map, it won't be viable. I'll keep trying to get something working though. Obviously the code works, because your enemies work.
I tried setting things up much along the lines that you had them: inherited from VoxelCharacter, used ChaseSmooth in place of A_Chase and then tried a few of the values from your various actors (including the Zombieman - and the mancubus, which I thought would be close to my robot because I originally based him off the mancubus).
Unfortunately, I couldn't get something to move without the kinds of problems I've been talking about. Shame, because the turning speed is exactly what I want, but if I can't get the enemies to behave properly while navigating around the map, it won't be viable. I'll keep trying to get something working though. Obviously the code works, because your enemies work.
-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
No, in the standalone archive.
Note that in VoxelChibiDoom!, the very first time ChaseSmooth is called, it uses the actor's orignal speed value specifically to avoid monsters in vanilla Doom maps getting stuck if placed near walls.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
Stand alone archive? The only one I can see is linked to here : viewtopic.php?p=1151905#p1151905 and the file has gone. Is there another? I've searched here, Doomworld and via Google. I don't see one in the VoxelChibiDoom thread, and the link there just takes me direct to the main mod PK3.
I did notice that you'd added that safety feature in VoxelChibiDoom.
I have had a problem with the robot from the video where it got stuck long after spawning and wandering around. I'd made an alcove that was 32 units above the floor that the robot was on (too high to step up, obviously). I was standing in the alcove. When the robot walked up to the alcove to try and get at me, it got stuck. Most of the time it doesn't, but this one time it happened. I jumped out of the alcove and wandered around the room. For a minute of so it stood there running on the spot, stuck on the too-high step-up to the alcove. Eventually it did free itself, but the robot had been standing there presenting no threat for way longer than would be needed to kill it in game.
I did notice that you'd added that safety feature in VoxelChibiDoom.
I have had a problem with the robot from the video where it got stuck long after spawning and wandering around. I'd made an alcove that was 32 units above the floor that the robot was on (too high to step up, obviously). I was standing in the alcove. When the robot walked up to the alcove to try and get at me, it got stuck. Most of the time it doesn't, but this one time it happened. I jumped out of the alcove and wandered around the room. For a minute of so it stood there running on the spot, stuck on the too-high step-up to the alcove. Eventually it did free itself, but the robot had been standing there presenting no threat for way longer than would be needed to kill it in game.
-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
I am referring to the SMTZombieman in the smoothmoveturn.pk3 I linked to.Enjay wrote: ↑Sun Feb 23, 2025 7:18 am Stand alone archive? The only one I can see is linked to here : viewtopic.php?p=1151905#p1151905 and the file has gone. Is there another? I've searched here, Doomworld and via Google. I don't see one in the VoxelChibiDoom thread, and the link there just takes me direct to the main mod PK3.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
Sorry, I'm obviously being completely dense.
I can't see a link to an archive. I can see the link to the Pastebin page, but that's just the code that I copied and used. I don't see a PK3 link anywhere.

I can't see a link to an archive. I can see the link to the Pastebin page, but that's just the code that I copied and used. I don't see a PK3 link anywhere.
-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
Sorry, I forgot I only posted the code instead of the archive.
I added a link to the pk3 in my first post.
I added a link to the pk3 in my first post.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
No wonder I couldn't see it.
I have it now. I'll take a look later today. Once again, thank you.

I have it now. I'll take a look later today. Once again, thank you.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
OK, well this is odd. Even with a completely unaltered copy of the archive that you linked to, the enemies do not behave correctly. See this video:
The most obvious problem is that the zombies get stuck when they try to descend the steps.
More subtle is the fact that they often seem to point the wrong way when getting ready to fire, and then turn to face their target during the actual attack frame. Of course, with using standard sprite enemies, that may be something that is less obvious/handled better with a model.
However, the weirdness is that it's clearly not working right even in this untouched example. I wonder if I have a setting somewhere that's messing it up?
Edit: and here's the code running on my robot enemy. It goes down slopes pretty much as it did in the last video (so I didn't bother recording that) but what happens when it goes up slopes is amusing.
Disappointingly, as you can see at the end, the thing I really wanted (smooth turning) isn't really happening. I've tried changing the turnspeedmax value for the enemy, but it didn't seem to change anything in game. InitSmoothMoveTurnMixin(self,turnSpeedMax : 170.0); (I tried lots of values, including 15, but no obvious difference.
The most obvious problem is that the zombies get stuck when they try to descend the steps.
More subtle is the fact that they often seem to point the wrong way when getting ready to fire, and then turn to face their target during the actual attack frame. Of course, with using standard sprite enemies, that may be something that is less obvious/handled better with a model.
However, the weirdness is that it's clearly not working right even in this untouched example. I wonder if I have a setting somewhere that's messing it up?
Edit: and here's the code running on my robot enemy. It goes down slopes pretty much as it did in the last video (so I didn't bother recording that) but what happens when it goes up slopes is amusing.
Disappointingly, as you can see at the end, the thing I really wanted (smooth turning) isn't really happening. I've tried changing the turnspeedmax value for the enemy, but it didn't seem to change anything in game. InitSmoothMoveTurnMixin(self,turnSpeedMax : 170.0); (I tried lots of values, including 15, but no obvious difference.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
A bit of progress... maybe (I'm really just taking wild guesses to see if anything works).
If I comment out this line in the Pastebin code:
smtActor.SetOrigin(tempPos + dir * smtActor.speed,true);
my monsters can navigate the map properly, and still turn smoothly.
Of course, I have no idea if doing this is "harmful" in any way, or if other bits of code should also be removed if this is gone, but it does seem like it might be progress of some sort.
If I comment out this line in the Pastebin code:
smtActor.SetOrigin(tempPos + dir * smtActor.speed,true);
my monsters can navigate the map properly, and still turn smoothly.
Of course, I have no idea if doing this is "harmful" in any way, or if other bits of code should also be removed if this is gone, but it does seem like it might be progress of some sort.
-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
Loks like some of the newer GZDoom versions broke the mod. I tested it with 4.3.3. and it works flawlessly.
That bit of code originally used a separate value for speed and somehow got left in when the whole syste was converted to a mixin using the actor's speed directly. Looking at it again after all this time, it looks like it can be commented out safely.Enjay wrote: ↑Sun Feb 23, 2025 11:34 am A bit of progress... maybe (I'm really just taking wild guesses to see if anything works).
If I comment out this line in the Pastebin code:
smtActor.SetOrigin(tempPos + dir * smtActor.speed,true);
my monsters can navigate the map properly, and still turn smoothly.
Of course, I have no idea if doing this is "harmful" in any way, or if other bits of code should also be removed if this is gone, but it does seem like it might be progress of some sort.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
Ironic. That seems to be the bit that was causing me problems all along. I only commented it out because it looked like it might refer to parts of the code I was less bothered about (i.e. a total guess), but with it gone, things seem to be working perfectly now - smooth chasing and no problems with slopes or other obstacles, as far as I can tell. 
And once again, than you very much, particularly for your patience.
Edit: Evidence


And once again, than you very much, particularly for your patience.
Edit: Evidence

-
- Posts: 1334
- Joined: Tue Dec 06, 2016 11:25 am
Re: Movement Code With Smooth Turning?
Still strange that it worked in earlier GZDoom versions. Oh well. I have plans to make an "official" library out of this with Ash's help.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
Indeed.
And official library would be most welcome. It's definitely a thing that a lot of people have wanted and would find useful.
-
-
- Posts: 26882
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Movement Code With Smooth Turning?
[Edit]
Doh! Nevermind "WanderSmooth is the answer. Please ignore the following.
BTW, the movement would be just perfect for Dalek models. Hmmm...
[/Edit]
Doh! Nevermind "WanderSmooth is the answer. Please ignore the following.
BTW, the movement would be just perfect for Dalek models. Hmmm...
[/Edit]
Spoiler: Ignore