Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridMap reports errors to the Physic server on removing cells #43712

Closed
Tracked by #45333
Chaosus opened this issue Nov 20, 2020 · 1 comment · Fixed by #50052
Closed
Tracked by #45333

GridMap reports errors to the Physic server on removing cells #43712

Chaosus opened this issue Nov 20, 2020 · 1 comment · Fixed by #50052

Comments

@Chaosus
Copy link
Member

Chaosus commented Nov 20, 2020

Godot version:
3.2.3 - 3.2.4

OS/device including version:
Win10/GTX1060

Issue description:
Removing the cell by calling set_cell_item(x, y, z, -1) will cause errors in the PhysicServer even if there is no physic body attached to cells.

Steps to reproduce:
Run attached project.
The following code will spam errors to the Output:

image

ERROR: get: Condition "!id_map.has(p_rid.get_data())" is true. Returned: __null
   At: ./core/rid.h:150
ERROR: body_set_state: Condition "!body" is true.
   At: modules/bullet/bullet_physics_server.cpp:675
ERROR: Invalid ID.
   At: modules/bullet/bullet_physics_server.cpp:1551

Minimal reproduction project:
GridMapBug.zip

@XLIVE99
Copy link

XLIVE99 commented Mar 22, 2021

I encountered this error too. But mine is on gridmap paint and it prints on "Output", so I analyzed this bug.
First, these are descriptions of the terms I'm going to use:
-Paint: Gridmap paint
-Action area: Smallest box that contains a paint (Here's some image for better explanation):
Action_area

The bug only occurs if action happened in a frame which action area bigger than octant size. So in order to reproduce the bug, you need to:
-Undo + Paint
-Undo + Redo + Erase (Mouse right click)
-Clear selection + Paint
-Cut selection + Paint
If these actions is not bigger than octant size then the bug wont appear. However the bug can still appear while the action area is smaller than or equal to octant size in some special conditions:

Gridmap octant size setted to 2 for easier visualization.
All action areas which contains both green and red tile will cause the bug.

Bugmap_octant2

If octant size setted to 3 then all areas as shown above will increase 1 cell, like this:
resim_2021-03-22_165305

Sometimes the bug will appear as infinite loop (only output if input happens such as mouse motion), and sometimes it happens once or third. It depends on where you click first. If infinite loop happens then in order to get rid of the bug, you need to paint and erase the corresponding tile.

Undo + Redo + Erase doesn't produce bug always, as mentioned above only erasing tiles which cause infinite loop will give error once.

Hope this helps to solve the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants