-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Follow-up to #3860 - better fix #3870
Comments
There's an additional issue with that patch, beyond the risk of obfuscating the underlying problem. This added a lot of Thinking "it's a Location object, I'll just get one of its coordinates, check it against NaN, fast and easy" is a totally understandable assumption, but it turns out that Terasology/engine/src/main/java/org/terasology/logic/location/LocationComponent.java Lines 112 to 117 in d9fdb02
…it checks to see if the entity's parent has a location, adjusts relative to that, and so on up the chain. It's probably not a long chain. But even for short chains it has very different performance characteristics than the Methods like ExplosionAuthoritySystem.onActivate will probably never notice the difference. But other methods, like where the player is and what they're looking at get called every tick. I believe (informed by at least a little empirical data from a quick test run) this has had a significant impact on CPU load. |
How/why does that value end up to NaN, and why are not just removing the location component from the entity? What am I missing here? |
@meetcshah19 might remember some more from the original research (there was quite a bit). Will ping on Discord as well :-) |
I wasn't sure, so I just did a quick search on whether setting up In that case, given how rarely this happens (measured as percentage-of-method-calls, not percentage-of-multiplayer-games) and that it really is an exceptional case, I think try/catch would serve us much better here than checking up front. Now exactly where to catch it or what to do about it when it's caught I don't know. |
Related to #3984 |
#3860 fixes an issue where in some circumstances a
NaN
value gets mixed into some rendering. At first it seemed to be a sequence issue about a player's respawn location not having been set right before re-entering the player after death, causing a different player to fail trying to draw the player that doesn't have a valid location yet. Something like that, see the other issue for details, near midnight here and running on empty :-)We're applying a temporary fix to catch and deal with the
NaN
but that doesn't feel right, like outlined in the PR. Need to revisit - making this issue as a reminder.The text was updated successfully, but these errors were encountered: