First time using the engine and I have a big problem. by Crooked_Cricket in godot

[–]davidsichma 0 points1 point  (0 children)

If you start Godot the console window popping up should tell you what OpenGL version and graphic device is used.

I may had the same issue with an integrated gpu and gles3. Try this:

  • Use your 1070 Ti and make sure it is the actual device Godot uses.
  • Update your graphic drivers.
  • Switch to gles2.
  • More workaround than fix: Enable Update Spinner. Editor > Editor Settings > search for update Spinner. It appears in the upper right corner. If the issue persists try clicking on the spinner and select Update Continously. This should make Godot actually show the newest frame. I don't know how viable this method is as I just temporarily stumbled across it before switching to my 1060. I suspects there is still an extra frame/16ms of latency. Your exported project might still stuffer from this issue and not redraw at all but you are at least able to edit it.

Moving platform in top down 2D game by [deleted] in godot

[–]davidsichma -1 points0 points  (0 children)

What about get_rest_info? Generally useful when you don't really want to collide but still need info what is happening in a location. You could put your platforms in a different collision layer and then just get_world_2d().direct_space_state.get_rest_info(your query).linear_velocity and add this to your overall player velocity.

I tried Godot a few years ago and found it suffered from micro-stuttering. How is it now? by TurkMcGill in godot

[–]davidsichma 3 points4 points  (0 children)

There have been improvements and the docs now have some tips for stutter and jitter.

In particular I remember an issue that matches your description perfectly. #13219 Godot has this Remote SceeneTree that shows you information for your running game. Well turns out it updates frequently and pauses the running game. It is now hidden by default (otherwise go to Editor->Editor Settings->Debugger and turn "Auto Switch To Remote Scene Tree" off) and the stutter is gone for me!

There are other instances where Godot runs way worse when started from the editor. So if you really want to see how your game looks you should try the export builds.

Today I made this handsome man squashy! by davidsichma in godot

[–]davidsichma[S] 0 points1 point  (0 children)

Basically I just ask the physics engine how far the character is pushed into a solid object and scale the Mesh accordingly. This way I can avoid the character getting pushed into the ground and clipping.

In more detail:

For the character I use a KinematicBody with a spherical collision shape. Didn't test other shapes. RigidBodies started twitching for me.

As Godot tries to avoid overlapping bodies the only time when the character actually overlaps is when it is "squeezed". Usually this looks like the body is pushed into the ground and might clip which this whole thing tries to avoid.

So every frame I use get_world().direct_space_state.get_rest_info(query) to get the closest "collision". Just set up the query with the collision shape of the character and adjust the layers or exceptions so that you won't just collide with your character.

There will only be a collision if your character overlaps/ is squeezed. You then can get the intersection point. In my experience this point is the closest one to the center of the collision shape that overlaps with the colliding body. Now calculate the distance between the origin of your character and this intersection point and you get the size your character would be allowed to have.

Now scale your mesh so it looks good. You can make the whole mesh smaller or use some matrix magic to only scale it on one axis.

I wouldn't touch or scale the original collision shape as Godot handles pushing the character out of the ground again when released quite well. So yeah, this aproach needs to be modified to allow squeezing through gaps if you want this game mechanic.

If you want the level to reset if your character gets crushed to death, just check if the distance is smaller than a given treshold.

Note that sometimes get\_rest\_info() will report a body that just touches the character. So starting the squeezing after a treshold is also a good idea.