Tributo a Loren Carpenter.
Fractal Flight 6502 Engine - Core Features
- "Rescue on Fractalus" Rendering: Implements a Voxel/Height-map rendering technique using a bottom-up "Limit Buffer" (painter's algorithm) to correctly handle mountain occlusion without a Z-buffer.
- Pseudo-Roll Effect: Simulates 3D camera banking efficiently using a "Tilt Table" that applies a vertical shear to screen columns, creating a convincing roll illusion without expensive 3D rotation math.
- Integrated Music: Features a built-in SAP music player ("Behind Jaggi Lines") that runs on the Vertical Blank Interrupt (VBL), fully synchronized with the game loop.
- Procedural Terrain System: Generates a 16x16 world grid with fractal roughness "seeds" and specific gameplay objects like "Bunkers" (marked via bit flags).
- Smart Terrain Following: Includes a collision avoidance system that "looks ahead" to automatically adjust the camera's altitude, preventing crashes into terrain features.
- Fixed-Point Physics: Utilizes 16.16 fixed-point precision for altitude (allowing distinct valley floors vs. mountain peaks) and 8.8 precision for lateral movement.
- Visual Effects System: Features a multi-stage "Hit Flash" reaction (progressing from Bright -> Mid -> Low-Fade) and a Green Laser drawing algorithm with perspective-based thickness.
- Double-Buffered Rendering: Uses a generic Double Buffering scheme (swapping DLI pointers and VRAM offsets $8000/$9000) to ensure flicker-free animation at high frame rates.
- Diagnostic Test Suite: Contains 6 built-in distinct "Modes" for isolating and debugging specific subsystems, such as math sorting, projection calibration, and fractal line generation.
- Joystick Flight Control: Replaces keyboard input with full Joystick support, including auto-centering logic that returns the ship to level flight when controls are released.
Mathematical & FOV Implementation Details:
11. FOV-Driven Scale Table Hack: Uses a pre-calculated reciprocal table (1/Z) multiplied by a Field of View constant (default #70) to project 3D points without slow 6502 division.
12. Iterative Grid Transformation: Instead of matrix multiplication for every node, it calculates "Step Vectors" (U and V) once and transforms the 8x8 grid using only additions, significantly boosting performance.
13. Pseudo-Roll Shear Effect: Simulates camera banking using a "Tilt Table" that applies a vertical shear to screen columns, creating a 3D roll illusion purely in screen space.
14. Recursive Midpoint Displacement: Recreates the "Fractalus" mountain look by recursively subdividing lines and displacing the midpoint based on world-space "seeds" (tags).
15. Quarter-Square Multiplication: Implements high-speed 16-bit signed multiplication using squaring tables ((sum)^2/4 - (diff)^2/4) for rotation and laser physics.
16. Limit-Buffer Occlusion: A bottom-up Y-buffer ("line_pixel_height_buffer") tracks the horizon for every column, ensuring correct painter's algorithm occlusion.
17. Procedural Ridge Walkers: Generates a 16x16 wrapping world using "Walkers" with momentum, creating natural connected mountain ranges rather than random noise.
18. High-Precision 16.16 Altitude: The camera uses 32-bit fixed-point altitude for smooth terrain following and vertical collision avoidance.
19. DDA-Based Perspective Lasers: Draws laser beams with 16-bit DDA slopes and perspective-correct thickness that scales as it moves toward the player.
20. Integrated Music Engine: Features an interrupt-driven playback of "Behind Jaggi Lines," synchronized with the game logic and handling Zero Page sharing between the player and the engine.
Geometry Clipping & Frustum Management:
21. Robust 3D Z-Near Clipping: Prevents mathematical warping and projection overflows by strictly rejecting or clipping points that are behind the camera or too close to the near plane (Z < 1.0).
22. 2D Cohen-Sutherland Algorithm: Implements a classic screen-space clipping system using 4-bit bitwise outcodes for rapid trivial rejection or acceptance of line segments.
23. Binary Search Intersector: Instead of expensive 16-bit division to find line-edge intersections, the engine uses a midpoint subdivision (binary search) strategy that reaches sub-pixel precision in just 8 iterations.
https://forums.atariage.com/topic/387215-flight-of-loren-a-tribute-to-loren-carpenter-rip/

No hay comentarios.:
Publicar un comentario