Closed Krater107a closed 1 year ago
Can you reproduce this on 3.5.1?
Contents of file (Godot 3.5.1.stable.mono) C:\Users\Krater\AppData\Roaming\Godot\projects\GridTest-84bcc8e1f92452940dceff8b8d91675c\testgrid.tscn-editstate-28339fdbe73c95444f583f5d0f2bf3a8
Before Altering Configure Snap -> Grid Step (and then saving the scene): "grid_step": Vector2( 8, 8 ), After Altering Configure Snap -> Grid Step (and then saving the scene): "grid_step": Vector2( 4, 4 ),
-- tldr: No this doesn't seem to be happening in Godot 3.5.1.
The "grid_step": Vector2 field remains decimal free. When the decimal is introduced the alignment of everything in the effected scene seems to be thrown off.
Regression from #65101, now Range
is rounding to closest k * step + min
instead of k * step
.
And min
for the grid-step-SpinBoxes in the snap settings dialog is 0.01
:
https://github.com/godotengine/godot/blob/2a04b18d37de6c6e621db5a9dfd1cd0da5ccb015/editor/plugins/canvas_item_editor_plugin.cpp#L137-L153
CC @MrPhnix
Got it, I'll check it out tomorrow. 👍
I suspect that this issue could still be contributing to the kerning issues described in #67401, which was only ever partially fixed as there are still major kerning issues in b9 that persist depending on how far the text is from the scene origin. It's only immediately noticeable in games with sub-HD resolutions.
I double-checked the math that defines the value of the range, and it seems to be correct even with a small minimum value (0.01), I will look at the grid code.
After looking at the SpinBoxes code, inaccuracies are fixed by setting the minimum for the grid step to zero, but if the user types a zero, it freezes the editor. I found a way to solve the problem by checking the value entered for the step, before setting it in the range.
P.S. I don't know what to do about issue #67401.
Moreover, as the minimum value of the min step is 0.01, it is not displayed correctly in the SpinBoxes of the "configure snap" window, and the grid is hard to see on the screen since it is so small.
Is 0.01 important for the minimum step value? Can we replace it with 1 since it doesn't really matter to go below 1px, and even with a step size of 0.01, the nodes, like the points in Polygon2D, will still move as if there was a 1px grid.
The SpinBox's step is 1, so 1 makes sense as minimum value.
I have made a pull request (#70428) to fix this issue.
Please check 3.x (https://github.com/godotengine/godot/blob/3.x/editor/plugins/canvas_item_editor_plugin.cpp) it seems to be there as well. I have my fork synchronized with 3.x as of 14th of December, and I have just noticed this issue there.
Applied the fix, and it solved the issue for 3.x: editor/plugins/canvas_item_editor_plugin.cpp
@roalyr Indeed, #65101 was cherry-picked to 3.x (for 3.6). I've marked #70428 to be cherry-picked to 3.x as well.
I am not sure if this is the same issue but I notice some misalignment happening when using the new tilemap in Godot 4.10beta
. Either the snapping grid starts to slide or the tilemap grid but I am not sure which of both is sliding.
The video demonstrates the issue a bit better.
It's the same issue. TileMap's grid is displaying correctly.
Would this be the reason I am observing an odd 1-2px gap between my character body and the floor? This was driving me absolutely mad, so glad I found this issue haha.
Just wanted to mention this here just in case someone else encounters this. This misaligned grid is now fixed in 4.0 beta 11.
But if you are opening a project from 4.0 beta 10 into beta 11, the grid would still be misaligned. To fix this, you would just have to re-open the "Configure Snap" dialogue in the Snapping Options. Upon pressing OK, it should "recalculate" the grid and it should now be aligned.
Just wanted to mention this here just in case someone else encounters this. This misaligned grid is now fixed in 4.0 beta 11.
But if you are opening a project from 4.0 beta 10 into beta 11, the grid would still be misaligned. To fix this, you would just have to re-open the "Configure Snap" dialogue in the Snapping Options. Upon pressing OK, it should "recalculate" the grid and it should now be aligned.
Thanks a ton for this, was super confused why the update didn't fix anything for me haha.
It seems like this is a regression in godot 3.6
The grid displays fine in godot 3.5 if i open my project back up with it, but in godot 3.6, when zooming in the grid becomes inaccurate compared to the tilemap. snapping still works fine and places things correctly, it seems like its just a visual bug.
heres short video showing the grid lines becoming inaccurate the more you zoom in: grid-inaccurate-zoomed-godot-3.6.webm
(am on fedora linux with godot 3.6)
Please open a dedicated issue for 3.x to track this
Sure, added a new issue for this here - godotengine/godot#98466
Cheers,
Godot version
Godot 4, beta 8 (.net c# version)
System information
Windows 11 21H2
Issue description
When mapping out a simple "level" in my proto-type 2d platformer, have noticed the grid becomes mis-aligned compared to the "2nd" grid provided by the tilemap. The further away from scene origin tiles are placed the greater the mis-alignment is.
Steps to reproduce
Create a new project in godot 4 b8. Create a new 2D scene, name it what ever. Click on "..." configure snap. Change grid step from it's default to some other number (ex 4px 4px). Save the empty scene. Using your operating system, navigate to/.godot/editor
Using a text editor open up your scene's "editstate" config file.
Observe under section 2D={} "grid_step": Vector2(4.01, 4.01). -- grid_step is no longer a whole number but now a decimal.
Go back to godot.
Observe that your scene's ruler and grid are now more and more inaccurate the further from origin you go. Also notice your UI-Ruler now has a decimal place instead of whole numbers as markers.
This becomes very evident when placing tiles, a huge mis-alignment begins to occur.
Minimal reproduction project
N/A