Jump to content

Smoothed SetInput function


YouGroove
 Share

Recommended Posts

If i create a solid physic object and play with forces, using low friction , it just slides smooth on surface without any jittering. Why Navmesh functions are so jittering ? even setting friction to (0,0) ?

 

Actually calling GotoPoint or SetInput is not possible to use them for real.

Unity proposes a character controller we can call "ready to use" without any jittering or other physic problem used by hundred of games.

 

Could it be possible to have in LE3 "ready to use" Navmesh functions : GotoPoint(), SetInput() with some smooth parameter when calling them ?

 

Would be better for new comers (and i just dropped using Navmesh from some good time now caus of that

 

-----------

 

Edit :

Only SetInput is not ready to use, GotoPoint beeing ok and smooth without jittering at all.

Stop toying and make games

Link to comment
Share on other sites

mhmm not have used GoToPoint a lot yet but never noticed jittering. also Input stuff works smooth for me. the Leadwerks 3.1 game demo also use that functions and everything is fine. do you have a screen or small video what exactly you mean?

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

LE3 FPS demo just smooth by code camera position and weapon, as in FPS view you don't see the glitches.

Just open LE3 FPS demo , in the code change values to have camera behind the visible model player, you'll see the characte r controller it's jittering a lot.

 

That's strange LE3 keeping that controller like that , not ready to use compared to others 3D solutions.

It will only make code lot more complicated to have to code :

-Character controller on fake object with invisible material

-Attach your real character to that fake model

- smooth position of your real character

I don't see doing that workflow for lot of characters in a game

 

A character controller is meaned to be ok, ready to use without behaviour problems.

Stop toying and make games

Link to comment
Share on other sites

You must be right GotoPoint is perhaps free of jittering, just seeing crawlers walk , or aliens in my game running without jittering.

 

The only problem is SetInput function.

In fact i use SetInput that is called every frame on physicsUpdate().

Each frame some movement is given to it ,and jittering is super visible , so it can't be used for TPS games or FPS without do the tricks i listed above.

Stop toying and make games

Link to comment
Share on other sites

If you are setting physics forces inside the physics callback, do not modulate the input by the timing! This is what was causing your turret bullets to jump around. Just set the input as you want, because the function is called in regular intervals and does not need adjustment.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

For bullet is use SetVelocity, never use functions that will drop frame rate.

 

SetInput has a jittering problem, having it smoothed it would be ready ot use :

here is some code example :

 

function Script:Movement()

self.prevPos = self.entity:GetPosition()

-- handle player movement
self.playerMovement.z = ((App.window:KeyDown(Key.W) and 1 or 0) - (App.window:KeyDown(Key.S)and 1 or 0)) * self.moveSpeed



-- move the camera to the player and set the yaw from 3rd person view
self.Camera:SetPosition(self.entity:GetPosition(true), true)
self.Camera:SetRotation(Vec3(self.cameraPitch, self.cameraYaw, 0), true)

-- offset the camera up and back
self.Camera:Move(0, 3, -5)

-- rotate the model along with the camera
self.entity:SetRotation(Vec3(0, self.cameraYaw, 0))

-- move the controller in the rotation of the player
self.entity:SetInput(self.cameraYaw, self.playerMovement.z, 0 --[[self.playerMovement.x]], 0, false, 1)


end

 

I'm annoying but Character controllers in other 3D apps are smoothed , in LE3 not.

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...