-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Area_enter doesn't work after some load/instance/changetree #8856
Comments
Is this valid in 2.1.2 or 2.1.1 as well? |
I know that the problem is here in the 2.1.2 as well. |
I'm having a look at this. Weird enough, running the project with visible collision shapes makes it work always. @Kadhel, can you try and tell if you get the same result? |
I have a project with this problem but it never happens when I'm looking for it, and the connection were made with the editor, not script. The weird thing is the same game I made with Unity have exactly the same problem 🙃 |
@RandomShaper I've tried with visible collision shapes and I have the same result, some collisions don't work after a few changeScene. |
OK. I'll keep researching.
El 29 may. 2017 9:21 a. m., "Kadhel" <notifications@github.com> escribió:
… @RandomShaper <https://github.com/randomshaper> I've tried with visible
collision shapes and I have the same result, some collisions don't work
after a few changeScene.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8856 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALQCtj-ZJ6gf4BMymzcCmeo4Fjd2lZZyks5r-nH7gaJpZM4Nh-0t>
.
|
Tested on this project removing shapes scaling and changing to box shapes, making all monitored and monitoring, and fail, even raycasts ignore the broken areas. All shapes are there, like in my project. |
With that PR merged, your hero is having his doses of coffee flawlessly. ;) It's not finished work, but you can give it a try and tell me the outcome. |
@RandomShaper praise It seems amazing, but how can I test it until it got merged in 2.1 ? (sorry for being a little unexperienced about this xD) |
See if this helps: |
If you need help putting that into practice, don't hesitate to ask. |
@RandomShaper Still happens with your fix :S |
Hmmm… I have more stuff merged in my local fork; maybe there is some beneficial interaction somewhere. I'll check. Anyway, I'm about to push some more changes to this PR. If anyone wants to test again, I'd be grateful since it's touching a lot of physics stuff. |
What is actually making collisions work well is running the game on a debug build! I'll keep researching and report. |
@RandomShaper is possible, I think that made it with debug-release |
Fresh news: on debug release, if I recompile without the 'DEBUG_MEMORY_ENABLED' macro, the error happens again. Pretty weird, isn't it? Can anybody compare debug with and without that macro and tell me if I am becoming crazy? I've tried to debug whether the RingBuffer stuff was somehow alleviating some out-of-bounds writes. I've added sentinels before and after every allocated block of memory, but everything looks OK in that regard. |
Something to add, not sure if helps: @Kadhel check if making the Elements the ones that check |
Good news! I isolated the part of Then, after commenting out the Some debugging after, I noticed that some "pickables" were being undetected because of And then I found it: The last version pushed fixes this. |
@RandomShaper still no luck here when compiling with |
@RandomShaper Maybe we should have a switch to make the |
@eon-s, sure you have the latest version? Please check Area's constructor (scene/3d, IIRC) for monitorable = false. @bojidar-bg, locally I have code to initialize allocs and reallocs (the added size, in its case) with a code-configurable value. And to fill blocks just before they are freed with the same. Maybe I can submit it. Now, I wonder if that value should be a constant or change across time to produce random behavior making bugs of this kind more noticeable. |
It seems I haven't pushed correctly. So you cannot possibly have the most recent! As soon as I get back to my computer, I'll repush. |
Yes, that was the case. :P Pushed! |
@RandomShaper works! |
- Use `NOTIFICATION_ENTER`/`EXIT_WORLD` for `Area` (intead of `*_TREE`). - Now both bodies' and areas' constraints are cleaned up. - And now also that happens as soon as the space is set to null (i.e., when exiting the tree) instead of only at freeing time. - When clearing constraints, the loop goes on to the next if the current is already released, instead of breaking. - When one has been already released, no error is shown from now on, as it's something expected, since a pair (our kind of constraint of interest) can be freed by any of its involved collision objects and the other will try again. - Implement index shifting (or marking as -1) for shapes indices in collision pairs shapes are removed. - Standarize behavior of bodies and areas so that anything that invalidates a given pair gives the same result (collision mask, actual collision, etc); for instance, triggering area enter/exit signals. - Add missing member initializations. - Extend the new-space-equals-area/body-current-space test to every case. - Fix 3D ray-casts early accepting Areas (skipping the mask check). - Fix unpairing of large elements (2D's `BroadPhase2DHashGrid`). Some of these prevent random crashes caused by constraints with dangling pointers to involved objects. Fixes godotengine#8856. Fixes godotengine#7589. Fixes godotengine#6676. And maybe others.
Fixed by #8999. |
Operating system or device - Godot version:
Issue description:
In 100% of the cases, the following problem happens :
After reloading/reinstanciate a scene a few times, the area_object in it aren't detected by area_enter anymore.
Steps to reproduce:
PS: When it happens, it persists (it reset only when leaving the game and comeback). And it can be seen that the "Collision Pairs", in Physics3d, in the monitor of the debugger, are lower than normal.
Link to minimal example project:
https://github.com/Mbenoni1/GodotEngineTestProject
This is a minimalist version of my own project. To see the problem happens, just launch, click play, then move with the arrows of your keyboard to take some elements. It will after a short time automatically come back to menu. Click "play", etc, and see the bug happens after 2 to 4 cycle.
Thanks ! If you have any questions, don't hesitate !
The text was updated successfully, but these errors were encountered: