beyond-all-reason / beyond-all-reason/RecoilEngine

Create an "enum to luanumber" macro to guard against float imprecision

Open
#2,944 0 comments 0 reactions 0 assignees View on GitHub
good first issue refactor
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.