Armory 3D Game Engine Documentation

repository·main·Indexed 25 days ago

https://github.com/armory3d/armory

An open-source 3D game engine optimized for performance and portability, featuring a scriptable renderer and deep integration with Blender. Documentation covers building the API, compiling ArmorCore on Windows (Direct3D 11), Linux (OpenGL/Clang), and macOS (Metal), as well as details on the Oilpan C++ garbage collection library and the integrated UglifyJS 3 toolkit for JavaScript minification.

Tokens
10.7K
Snippets
16
Records
58
Agent score
85%

What's inside Armory

  1. Overview of recastjs and recastnavigation

    main

    recastjs

    recastjs is a port of recastnavigation using Emscripten. It provides a thin abstraction layer that allows you to use recastnavigation in a web browser via JavaScript or WebAssembly.

    recastnavigation

    recastnavigation is a navigation mesh construction toolset for games. It includes:

    • Recast: For navigation mesh construction.
    • Detour: A spatial reasoning toolkit compatible with any navigation mesh.
    • Crowd Management: Features for agent handling and behavior customization.
  2. Overview of Armory 3D Engine

    main

    Armory is an open-source 3D game engine designed for portability, minimal footprint, and high performance. It features a fully scriptable renderer that supports both deferred and forward rendering paths out of the box.

    When used as a Blender add-on, Armory provides deep integration, allowing Blender to function as a complete game development tool with a unified workflow from asset creation to game deployment.

  3. Overview of Oilpan C++ Garbage Collection

    main

    Oilpan is an open-source mark-and-sweep garbage collection (GC) library for C++. It can be used as a standalone library or integrated with V8's JavaScript garbage collector.

    Key Features:

    • Trace-based garbage collection.
    • Supports incremental and concurrent marking and sweeping.
    • Precise on-heap memory layout with conservative on-stack memory layout.
    • Supports collection with or without considering the stack.
    • Provides non-incremental and non-concurrent compaction for selected spaces.
  4. Enable Fast Minify Mode

    main

    For significant speedups (3x to 5x), you can enable Fast Minify Mode. This mode disables the compress step and only performs whitespace removal and symbol mangling, which accounts for most size reduction.

    CLI Usage:

    uglifyjs file.js -m

    API Usage:

    UglifyJS.minify(code, { compress: false, mangle: true });
  5. Install UglifyJS 3

    main

    UglifyJS 3 is a JavaScript parser, minifier, compressor, and beautifier toolkit. It supports most ECMAScript features. For exotic ECMAScript parts, it is recommended to use a transpiler like Babel before passing files to UglifyJS.

    Note: uglify-js@3 has a simplified API and CLI that is not backwards compatible with uglify-js@2.

  6. Build ArmorCore on Linux

    main

    To build ArmorCore on Linux using OpenGL and Clang:

    1. Generate and compile the project:
      Kinc/make -g opengl --compiler clang --compile
    2. Navigate to the Deployment directory and strip the Krom binary:
      cd Deployment
      strip Krom
    Kinc/make -g opengl --compiler clang --compile
    cd Deployment
    strip Krom
  7. Configure CLI Source Maps

    main

    UglifyJS can generate source maps for debugging compressed code. Use --source-map with the --output flag.

    Common Source Map Options:

    • --source-map "filename='<NAME>'": Sets the file attribute in the source map.
    • --source-map "root='<URL>'": Sets the URL where original files can be found.
    • --source-map "names=false": Omits symbol names to reduce file size.
    • --source-map "url='<URL>'": Specifies the URL to append in the //# sourceMappingURL= directive.

    Composed Source Maps: If you are compressing code that was already output by a compiler (like CoffeeScript), you can map back to the original source by providing the intermediate source map using the content option.

  8. Expose API objects to scripts

    main

    Embedders can define special objects to expose additional capabilities and APIs to ECMAScript scripts (e.g., the HTML DOM in Blink or APIs in Node.js).

    V8 recommends defining these operations following WebIDL and HTML specifications to ensure stability and compatibility with standard web requirements.

  9. Extend recastjs functionality

    main
    To add new functionality to recastjs, you must write the implementation in recastjs.cpp and then expose the new structures, classes, or methods to JavaScript using the IDL file. The make.py script handles the glue generation and build process. For detailed implementation of the binding layer, refer to the Emscripten Web IDL Binder documentation.
  10. Build API documentation

    main

    To generate HTML API documentation, you must first build an XML description using Haxe and then use dox to convert that XML into HTML files. The output will be placed in the pages/ directory.

    Prerequisites:

    Steps:

    1. Open your terminal in the armsdk/api directory.
    2. Build the XML description using the following command: haxe api.hxml -xml build/api.xml -D doc-gen
    3. Generate the HTML documentation using dox: haxe dox.hxml
  11. Use UglifyJS via Command Line

    main

    The CLI follows the pattern: uglifyjs [input files] [options].

    • You can pass multiple input files. UglifyJS parses them in sequence within the same global scope, allowing references between files to be resolved correctly.
    • If no input file is specified, UglifyJS reads from STDIN.
    • To pass options before input files, use a double dash -- to separate them so that input filenames are not mistaken for option arguments.
    • By default, output is sent to STDOUT. Use the -o or --output flag to specify a file path.