Smooth walking of character

Hi guys…
I have decided to compress couple to one pack of queries but the most important is the first one…

  1. My character ( controlled by BetterCharacterControll ) walks not smooth but “rough”. Looks like a shaking . How to solve this ?
  2. Importing models from blender with normal map ( bump maping ) bump factor is always considered as a value 1 despite the factical value in blender is ie 0.4 . Is it normal ?
  3. I have long sequence of animation. Is it possible to stop the animation durring the sequence lasts and ie start another one - with no using time ?
  4. During running the app I see tons of warnings regarding co-linear texturing triangulating problems or something - it’s happens after using normal map. It causes slowing down of app starting. How to avoid this ? - Of course still using normal maps
1 Like

Yes. If you’re using an AnimControl (from the old animation system), use

animChannel.setAnim(otherAnimationName, 0f)
2 Likes

If you see any of the following messages, then you’re using the direct Blender importer:

  • “Unable to find two closest vertices while triangulating face.”
  • “Infinite loop detected during triangulation.”
  • “There was an unknown problem with face triangulation. Please see log for details.”

In that case, I recommend switching to the glTF importer.

If you’re seeing some other warning message, please provide the exact text.

WARNING: Colinear uv coordinates for triangle [3 354, 3 355, 3 356]; tex0 = [0,096, 0,736], tex1 = [0,086, 0,728], tex2 = [0,076, 0,72]
lis 15, 2019 9:34:41 PM com.jme3.util.TangentBinormalGenerator processTriangle
WARNING: Vertices are on the same line for triangle [3 354, 3 355, 3 356].
lis 15, 2019 9:34:41 PM com.jme3.util.TangentBinormalGenerator processTriangle

Something like this…
BTW how to switch glTF ?

Export the file in blender to gltf and import it into the game as you did the blend file.

Thanks a lot… Is any guidance how to prepare export? I am struggling with problem to force the model to work . Throws npe at line with anim control.

Fix line with anim control.

Ok. Seemingly works… but model is rendered as black.

Is there a light in the scene?

Note: when you provide more information in your questions then sometimes you can get the exact right answer immediately rather than 20 posts in.

Another thing to note (unless you already are aware) is that the GLTF importer will apply JME’s PBRLighting shader when you convert from gltf -> j3o by default (In which case you need a light probe to view the model, otherwise it will appear to be rendered as a dull gray or black depending on the metallic value), as opposed to the standard Lighting.j3md shader that the blender importer uses when you convert to j3o.

1 Like

Hmmm… these days, the PBR models I load without probes render with directional light only… but they do render. Need a light probe for ambient.

Yeah the only time i ever actually have had the model rendering entirely gray or black is if the metallic value is close to 1.0 or whenever I have a spec gloss model and accidentally uncheck the “useSpecGloss” box unknowingly.

But i guess I was wrong to say entirely black, I should have instead said that it can appear so unsaturated at high metallic values that it tricks you to think its rendering black or dark gray

And we’ve now randomly guessed two possible problems… where as if any sample code had been provided by the original asker we wouldn’t have had to waste time guessing.

:slight_smile: Apparently main issue was thinned by other ones but the essential issue was quaking of character during walking on an android - even if I have 60fps and smooth scrolling of terrain under the character - What is the reason ?

Has the jitter problem been solved?:smile:
Maybe you can try to increase the accuracy of the physical engine to make sure that the update rate is greater than or equal to the rate of the renderer. It’s a lot more stable. That’s how I solved the jitter problem.
The following code:

The thing is… it’s impossible to guess without more information so we’re just going to be throwing out random ideas and doing all of the work.

Another random idea: you update the camera at the wrong time and so the physics engine hasn’t updated the position when the camera is updated.

Since we have all of 0 lines of code to go on, random guessing is the best we’ll be able to do.

It seems to be the solution with one condition - I have to check the performance of device before setting Accuracy. How you solved this ? On fast device is fine - on slower it slows down the action

I guess the jitter is due to the accuracy of the physical engine calculation. For example, the parameter settings of rigid bodies. Physical engine update rate.

You can try changing the frame rate of the rendering engine to 60 frames / s. Then the physical engine stays a little higher. For example, 65 frames / s.

But there should be other solutions for smooth motion. If you don’t use a physical engine. Moving objects directly is very smooth. So presumably there’s something to pay attention to when using a physical engine. At present, I am also studying.

All of these things will mask real issues.

Please describe how you have your scene setup and provide code if possible.

Does your camera follow the character? How do you do that? etc.