Skip to main content
GameDev.net gamedev.net
🔒 Locked

Why I’m building a "Sovereign" Physics Math Layer

Started by BearPackSalzy Mar 26 at 9:31 AM 4 replies 1.2k views
Original Post
BearPackSalzy
BearPackSalzy

Most gamedevs treat physics as a "close enough" problem. But if you’re doing rollback netcode, massive-scale simulations, or scientific research, "close enough" is a bug.

I’m unbundling the core math from my physics engine to create Axiomatic.

Why it’s overkill (in a good way):

  1. Fixed-Point by Default: We’re bypassing IEEE-754 entirely for the core simulation to ensure cross-platform bit-identity.

  2. Uncertainty Propagation: The engine tracks the error margin (±) through every calculation.

  3. Metrological Accuracy: Built-in registry of every major SI and Imperial unit with exact conversion factors (e.g.1 inch = 0.0254 meters exactly in fixed-point)

I'm packaging this as a standalone asset with a full Truth Hierarchy and Provenance Report. Stay tuned if you're into deterministic systems.

RmbRT
RmbRT

I like fixedpoint math. I'd be interested to see how you're going to handle stuff like sqrt or vector normalisation. Do you use multiple fixedpoint scales? Dynamic scales or multiple types? Also, what exactly is the point of the accumulated rounding error tracking? Is it for debugging purposes?

In my experience, it makes most sense to have a unique number type per problem domain, and then convert between those, instead of trying to have a universal type. That lets the programmer choose the scale, size, and precision appropriately. Also, divisions on integers are expensive, so it is best to find workarounds.

Not sure what you mean by truth hierarchy and provenance report.

Walk with God.
BearPackSalzy
BearPackSalzy

For sqrt and normalize, I'm using a lookup table with linear interpolation, then one or two Newton-Raphson refinement steps. It's slower than hardware float, but the result is bit-identical across platforms, which is the whole point.

On scales — yes, I use multiple fixed-point types per domain rather than one universal type. Each has a baked-in scale chosen for its range/precision tradeoff. I'm not trying to make one type rule them all.

The error tracking isn't for debugging exactly — it's metrological. When you chain unit conversions (say, feet → meters → newtons), rounding accumulates. The ± margin tells you how much of your result is "real" vs. drift. Useful if you're feeding outputs into scientific tooling or logging results you need to defend later.

The Truth Hierarchy is just a documented chain of where each constant or conversion factor came from — NIST, BIPM, ISO 80000, etc. The Provenance Report is a signed attestation that no value was eyeballed or approximated without disclosure. Overkill for most games, but that's kind of the pitch.

RmbRT
RmbRT

Do you have a background in cryptography, perhaps? It sounds like what a cryptographer would come up with.

Walk with God.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.