Translating a Fortran F-16 Simulator to Unity3D
Unusual and Legacy Units
- Many commenters latch onto the article’s “UNITS” section, amused and horrified by slugs, US survey feet, and other obscure imperial units.
- People share additional odd units (e.g., Sami distance by “reindeer pee interval,” humorous and obsolete units, and informal workplace “ED” units), illustrating how messy non-coherent systems can be.
- Several aerospace engineers note real confusion between pounds-as-mass vs pounds-as-force, especially in flight dynamics.
Nautical Miles, Knots, and Aviation Units
- Discussion clarifies that the nautical mile historically tied to Earth geometry (minute of latitude), but is now defined exactly as 1852 m by international agreement.
- Some participants defend knots and nautical miles as natural for navigation; others argue they’re archaic and should be UI-only while internal calculations stay purely metric.
- There’s mild frustration at mocking knots without acknowledging their historical and practical rationale.
Array Indexing and Language Design
- Fortran’s arbitrary array lower bounds (-2..9, etc.) are praised as aligning code with math; other languages with similar features (Pascal, Ada, BASIC, Lua, .NET) are mentioned.
- There’s debate over 0-based vs 1-based vs arbitrary indexing:
- Some find 0-based “natural” and less error-prone; others recall it being unintuitive to learn.
- Arbitrary bounds help when indices are domain values (e.g., temperature bands), but Fortran’s modern interactions with them are described as buggy and non-portable.
- C tricks with pointer offsetting are discussed, with warnings about undefined behavior and poor ergonomics.
Units in Simulation and Unity Integration
- One camp says only internal consistency matters; units could be entirely fictional as long as ratios hold.
- Others counter that real units aid intuition, validation, and reuse of real-world data tables, and become critical when mixing engines (original Fortran integrator vs Unity’s physics).
- Commenters note numerical considerations (choosing units to avoid bad floating-point ranges) and that engines like Unity have an implicit “comfortable” scale.
- A side thread covers gravity scaling and how practical VFX and simulations sometimes rescale time or constants to get realistic behavior at non-realistic sizes.
Metric vs Customary in the Port
- Several people argue the port should have converted all formulas and tables to SI once, for clarity and performance.
- The author explains they deliberately kept the original tables and units to preserve behavior; converting them without explicit unit metadata would be error-prone.
- Another commenter suggests using unit tests around the translated model to safely migrate to metric later.
Unit Safety and Static Checking
- Concern is raised about mixing incompatible units (e.g., slugs vs feet) and ensuring variables like altitude stay sensible.
- Practitioners report that, in aerospace, unit correctness is handled by manual review, validation organizations, tests, and sims, not automated unit-checking tools.
- Some link to attempts at compile-time unit checking in Fortran and unit-typed libraries in other languages, but note tradeoffs and limited adoption.
Fortran, Readability, and “Formula Code”
- One commenter argues that verbose, “developer-style” variable names make numerical/engineering code unreadable; compact symbolic notation better mirrors paper formulas and reduces mistakes.
- Others echo that Fortran’s terse style lets domain experts quickly recognize algorithms, while heavy abstraction layers in modern code can obscure the actual math.
- There’s a wistful wish for languages or editors that natively support rich 2D formula/matrix notation.
Flight Sim Nostalgia and Related Work
- The article sparks memories of classic sims like Falcon 3.0/4.0, early hardware math coprocessors, and timing issues as CPUs got faster.
- People contrast “study sims” (very high fidelity) with more arcade-like flight games, debating how much realism remains fun.
- Links are shared to other simulator projects (e.g., a Clojure space sim and a FORTRAN-derived spacecraft simulator in C, a JS port of a similar F-16 model).
Coordinate Systems and Axes
- The post’s joke image about differing X/Y/Z conventions in 3D tools resonates; commenters argue over Y‑up vs Z‑up world coordinates.
- Some feel maps make X/Y “ground plane” and Z “up” inevitable; others note that 2D screen heritage makes Y‑up equally defensible, even if disorienting to some.