-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
The GridMap freezes if meshes are changed frequently #49995
Comments
And maybe this problem: #33648 |
Can you reproduce this if you change the 3D physics engine to GodotPhysics in the Project Settings? |
yes
|
may be problem in: bool GridMap::_octant_update(const OctantKey &p_key) {
....
//erase body shapes
420: PhysicsServer::get_singleton()->body_clear_shapes(g.static_body); /* <<<< IS OK! */
....
/* \/\/ IS NOT OK*/
496: PhysicsServer::get_singleton()->body_add_shape(g.static_body, shapes[i].shape->get_rid(), xform * shapes[i].local_transform); I don't have a GDB debugger at hand right now to trace the life cycle of STATIC_BODY |
HEY! may be is problems? @Calinou void GridMap::_update_octants_callback() {
if (!awaiting_update)
return;
List<OctantKey> to_delete;
for (Map<OctantKey, Octant *>::Element *E = octant_map.front(); E; E = E->next()) {
if (_octant_update(E->key())) { /*free g.static_body <<<<<<<*/
to_delete.push_back(E->key()); /*push remove queue <<<<<<<<<<*/
}
}
while (to_delete.front()) {
octant_map.erase(to_delete.front()->get()); /* erase FRONT queue <<<<<<*/
to_delete.pop_back(); /* pop BACK! skip empty octans <<<<<<< */
}
...
} fixed while (to_delete.front()) {
octant_map.erase(to_delete.front()->get()); //erase FRONT queue
to_delete.pop_front(); // FIXXXXXX ?
}
|
I don't use GridMaps extensively or have experience dealing with the physics server, so I don't know. cc @pouleyKetchoupp |
The problem is logical. |
Godot version
3.3.2-stable
System information
Windows 10, GTX 1050ti, GLES3
Issue description
GridMap freezes and throws errors if grids change frequently
see this video: https://www.youtube.com/watch?v=ckImAKQaIuw
Maybe this is related to issue?
Steps to reproduce
Create a GridMap project and change tiles frequently, in large numbers in one frame.
Decreasing the octave will increase the errors.
Minimal reproduction project
This project. Run Test.tscn
SCP Manager.zip
LEFT_CLICK - Set block/Remove block
RIGHT_CLICK - Move Camera
WHILE_MOUSE - Zoom
GitHub: https://github.com/Valeryn4/Godot-GridMap-Err
The text was updated successfully, but these errors were encountered: