Less jittery way of moving actors in ACS

Moderator: GZDoom Developers

Post Reply
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Less jittery way of moving actors in ACS

Post by Nash »

In the example file http://nash.wanzafran.com/doomstuff/position.zip you can see that the dead Caco is very jittery, like it cannot keep up with the player's position.

Would it be possible to "fix" the Thing_Move and SetActorPosition functions, or maybe create a new function that accurately positions actors dead-on?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

There's nothing to 'fix'. Thing_Move and SetActorPosition are not meant to simulate movement. They are normally used to relocate a thing to a completely unrelated position and are written to handle that case well.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

The "jittery-ness" is probably because scripts and the like are updated only each tic, and due to the uncapped framerate, it's possible for other things (players, cameras, platforms, etc.) to move in that split second between tics. If you set cl_capfps to 1, you'll notice that the "jittery-ness" is gone (though admittedly that's only because the whole game looks like a slideshow now. :P ) Unless new move commands can be created (an ACS ActorMover, perhaps?) this can't really be fixed, unfortunately.

Wait, since when do I know so much about the Doom engine? Graf's the programmer here... plus, I'm saying this without playing the wad, too, so I'm either hitting the nail on the head perfectly or dropping the hammer on my own foot. :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

I think it's all a matter of how you use it. That's how I'm moving the cameras in DK and it's as smooth as can be (if you've seen the demo). And I thought it worked well enough for that pos_test.wad I made that moved the actor through the obstacle course.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Cameras are interpolated by the engine so that's why they do not jitter.

EDIT:

Solar, then maybe you'd like to explain "how" to use it? In my position.wad file above, there isn't anything complex going on. It's just a single script and nothing more. Yet it still jitters.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

1) Use it to move cameras since the motion is always smooth.

2) Use it to move slow moving objects, so there is no visible jitter (ie orbiting objects).

3) Accept the consinquences if the desired effect is otherwise impossible to achieve, or the noticable jitter is negligible.

It'd be great if there were an argument that could be set to SetActorPosition that would provide a one frame interpolation between the thing's current position and the position it was being set to. Is it even possible? Beats the hell out of me.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

2) Use it to move slow moving objects, so there is no visible jitter (ie orbiting objects).
In my position.wad, the object is a static dead Cacodemon. How much slower can it get? :(
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Not exactly what I meant. By slow moving I meant that the object being moved wasn't being moved very far between tics. The player is one of the fastest moving objects in the game, I'd imagine trying to match something up exactly with it to be rather futile.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Post by XutaWoo »

Try adding a friendly Zombieman and make the dead Cacodemon follow it.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”