-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Ceil function with % and variable works inside editor and with debug build but not with release build #24035
Comments
Your project will work if you attach your script to your
|
Seems that something is wrong with ceil function
As workaround, this line can be change
to this:
|
Also changing line
to this
fix issue |
Okay, this is kind of a big problem and I'm not sure how to solve it. The original reproduction project is a bit too large but from the comments I noticed where the source of the problem is. Essentially GDScript tries to coerce the Because of that, you have actually a The easiest solution is to enforce explicit casting every time. So The other solution would be to always provide type information, even in release builds. That's arguably a good thing, as it can solve a bunch of issues with typed GDScript. I don't know how much this would affect the release build in terms of size though. We could also store compiled scripts in the export process, instead of just the tokenized source. This would improve the loading process on release, but also would affect scripts loaded on the fly (and lose the ability to just provide the source with a release template). Though this might be a good thing as well, I don't think it would solve the problem. I'm listening to ideas of what would be the best course of action. |
QQ.zip from the second-to-last comment is too large? O_o However, good job figuring out the problem! |
Is there any reason why |
Not really, a dynamically-typed language can still be strongly-typed (as GDScript is). If you try to use the modulo operator on a |
Shouldn't a strongly typed language throw an exception/crash when such error occurs? I might be wrong, but how is type-checking working in build (exported project) when type information is lost? What about dynamically loaded code? Or is type-checking supposed to be only available for a compilation-time, so allowing unsafe (from typing perspective) code execution at runtime? Wouldn't JIT benefit from keeping type info around? Also modulo can work on floats, it doesn't have to (and IMO shouldn't) coerce values to integer. |
Reopening as I reverted #26562. |
I am in 3.1-stable under Linux and this still happens. This is a huge issue that shouldn't be ignored because it causes bugs that are very hard to solve, especially for beginners coming from other engines. The fact that it only happens on Release, makes it even harder to debug. In our team, we spent the best part of a week trying to find a bug related to this issue, instead of implementing features for our game. |
Discussing this on IRC, seems like the best solutions would be:
|
Godot version:
3.1 b243c26
OS/device including version:
Windows 10
Issue description:
My project working inside editor and with debug build but not with release build.
Here is screenshoot with working project, exported with enabled debugging
and here is screenshoot with project, exported without enabled debugging
Steps to reproduce:
Minimal reproduction project:
UP.zip
The text was updated successfully, but these errors were encountered: