beyond-all-reason / beyond-all-reason/RecoilEngine
Create an "enum to luanumber" macro to guard against float imprecision
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Lua numbers in recoil are float32s, which can fully represent only up to 2^24. For numbers larger than 2^24, they will suffer from rounding issues.
In the event that values are larger than 2^24, we want to loudly let the developer know, so they can do more creative casting as needed. I assume some sort of compile time warning and/or assert would be appropriate. I imagine this should be a macro.
Contributor guide
Research direction
The issue names no files or tests. Start by locating Recoil's Lua-number conversion sites and existing numeric-check or assertion macros, then determine where an enum-to-luanumber macro belongs. Done means values above 2^24 trigger a clear compile-time warning or assertion while allowing intentional casts to be handled explicitly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- compilers, game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100