The Forge Framework Documentation

repository·master·Indexed 26 days ago

https://github.com/confettifx/the-forge

A cross-platform programming framework for extending game engines, porting old games, or building custom engines. It provides low-level graphics, OS, and utility building blocks for PC, Mobile, and Console platforms, including a C reloader (cr.h) for live-reloading plugins with automatic static state management via CR_STATE.

Tokens
31.7K
Snippets
59
Records
195
Agent score
90%

What's inside The Forge

  1. Overview of The Better String Library (bstrlib)

    master

    The Better String Library (bstrlib) is a standalone, portable string abstraction designed to replace the standard C char buffer or C++ std::string. It focuses on mitigating buffer overflow/overrun issues, simplifying string manipulation, and providing high performance with interoperability for libraries expecting null-terminated (\0) char buffers.

    Key features include:

    • Safety: Substantial mitigation of buffer overflow/overrun problems.
    • Performance: Improved performance for common string operations and high-performance interoperability.
    • Portability: Works with major compilers including gcc/g++, MSVC++, Intel C++, WATCOM C/C++, Turbo C, Borland C++, and IBM's native CC on Windows, Linux, and Mac OS X.
    • C++ Integration: Includes a robust C++ wrapper utilizing overloaded operators, rich constructors, exceptions, stream I/O, and STL support.
  2. Overview of ozz-animation

    master

    ozz-animation is an open-source C++ 3D skeletal animation library and toolset designed for high performance and low memory usage using a data-oriented design. It provides runtime functionalities such as loading, sampling, and blending character animations. The library is renderer-agnostic and game-engine agnostic, making it suitable for integration into various engines.

    Key features include:

    • Runtime Playback: Loading, sampling, and blending animations.
    • Toolchain: Tools to convert major DCC formats (gltf, Fbx, Collada, Obj, 3ds, dxf) into optimized runtime structures.
    • Offline Libraries: Capabilities to implement conversion from custom animation and skeleton formats.
  3. Overview of DirectX 12 Agility SDK Redistributable

    master

    The DirectX 12 Agility SDK Redistributable NuGet Package provides the DirectX 12 Agility SDK runtime and its associated development headers. This allows developers to use newer DirectX 12 features and APIs without requiring a full Windows OS update.

    For detailed getting started guides and technical documentation, refer to the official Microsoft resource: https://aka.ms/directx12agility

  4. Overview of AMD AGS SDK

    master
    The AMD GPU Services (AGS) library allows developers to query AMD GPU hardware and software state information not typically available through standard OS or graphics APIs. It supports querying graphics driver versions, GPU hardware info, performance metrics, shader extensions, and additional extensions for DirectX 11 and DirectX 12. It also provides support for AMD Crossfire (multi-GPU) and Eyefinity (multi-display) configurations.
  5. Overview of Flecs ECS

    master

    Flecs is a fast, lightweight, and portable Entity Component System (ECS) designed for building games and simulations with millions of entities. It provides a zero-dependency C99 API and a modern, type-safe C++11 API that avoids STL containers.

    Key features include:

    • Support for Entity Relationships, hierarchies, and prefabs.
    • Cache-friendly archetype/SoA storage.
    • Automatic component registration across shared libraries/DLLs.
    • A lockless scheduler for multi-core CPU execution.
    • Integrated reflection framework with JSON serialization.
    • A web-based UI (Flecs Explorer) for monitoring and controlling applications.
  6. Supported Platforms for The Forge Framework

    master

    The Forge Framework (TM) is a cross-platform programming framework that supports a wide range of hardware and APIs:

    • Windows 10/11: DirectX 12 / DXR
    • Steam Deck: Vulkan 1.1 with VK_KHR_ray_query Ray Tracing API
    • Android: Pie or higher with Vulkan 1.1
    • Apple:
      • iOS 14.1 / 17.0
      • iPad OS 14.1 / 17.0
      • macOS 11.0 / 14.0 (Intel and Apple silicon support)
    • Meta Quest: Quest 2 using Vulkan 1.1
    • Consoles (Commercial License Required):
      • XBOX One / XBOX One X / XBOX Series S/X
      • PS4 / PS4 Pro / PS5
      • Nintendo Switch using Vulkan 1.1
  7. Use Vectormath features and types

    master

    The library provides several math types and features:

    • 3D Math: Supports vectors, matrices, and quaternions using either generic scalar math or x86/64 SSE intrinsics.
    • 2D Math: Includes unpadded Vector2 and Point2 types for basic 2D vector math. These are always in scalar mode (size = 2 floats).
    • C++ Interface: Uses a modern C++ interface with operator overloads and return-by-value, rather than the original C interface.
    • Namespace: Uses a cleaned-up namespace structure compared to the original Sony implementation.
  8. High-Level Features of The Forge

    master

    The Forge provides several high-level "lego" building blocks for game engines and SDK development:

    • Resource Loader: Asynchronous loading for textures, buffers, and geometry data.
    • Lua Scripting System: Used for automation and playground testing.
    • Animation System: Based on the Ozz Animation System.
    • Math Library: Consistent library based on an extended Vectormath with NEON intrinsics for mobile and double precision support.
    • Memory Management:
    • Input System: Custom C library with gesture support for touch devices.
    • Entity Component System (ECS): Fast implementation based on flecs.
    • FileSystem: Cross-platform C API supporting disk-based files, memory streams, and zip archives.
    • UI System: Based on Dear imGui, extended for touch input.
    • Shader Translator: Uses The Forge Shading Language (FSL), a superset of HLSL.
  9. Explore Shadowing Techniques in Light and Shadow Playground

    master

    The Light and Shadow Playground unit test provides several selectable shadow and lighting techniques via a drop-down menu:

    • Exponential Shadow Map: Filters shadow map edges using an exponential function based on light depth, tested depth, and a user-defined softness constant.
    • Adaptive Shadow Map with Parallax Correction Cache: Uses a hierarchical grid structure to choose light source views and a caching system to render only uncovered parts of the scene, reducing aliasing and CPU/GPU costs for day/night cycles.
    • Signed Distance Field Soft Shadow: Uses a 3D volume texture atlas of mesh SDFs to achieve cheap soft shadows via approximate cone intersection.
    • Screen-Space Shadows: Complementary to regular shadow mapping to add extra detail. Supported on PS5, Nintendo Switch, and PS4.
  10. Convert triangle lists to triangle strips

    master

    Use the stripify algorithm to convert a vertex cache optimized triangle list into a triangle strip. This can save memory on extremely constrained systems or improve performance on older GPUs. Note that triangle strips typically have ~50-60% of the indices of a triangle list.

    std::vector<unsigned int> strip(meshopt_stripifyBound(index_count));
    unsigned int restart_index = ~0u;
    size_t strip_size = meshopt_stripify(&strip[0], indices, index_count, vertex_count, restart_index);