Axmol Engine Documentation

repository·dev·Indexed 23 days ago

https://github.com/axmolengine/axmol

A high-performance, multi-platform 2D game engine for C++ and Lua, forked from Cocos2d-x v4.0. It supports mobile, desktop, console (Xbox), and WebAssembly, utilizing modern rendering APIs such as Vulkan and D3D12. The engine includes a one-step build script called 1kiss (1k) and integrates third-party libraries including FastLZ for lossless data compression, {fmt} for safe C++ formatting, and jni.hpp for modern C++ wrappers of the JNI API.

Tokens
36.4K
Snippets
79
Records
204
Agent score
80%

What's inside Axmol Engine

  1. Overview of pugixml

    dev
    pugixml is a high-performance C++ XML processing library. It provides a DOM-like interface for tree traversal and modification, an extremely fast XML parser for constructing DOM trees from files or buffers, and an XPath 1.0 implementation for complex queries. It features full Unicode support with automatic encoding conversions during parsing and saving.
  2. Overview of Axmol extensions

    dev
    Axmol provides several extensions to add specialized functionality to the engine, such as animation runtimes, UI frameworks, and particle systems. Note that some extensions are enabled by default, while others (like Effekseer and Live2D) are disabled by default and may require manual configuration or have platform limitations.
  3. Overview of Axmol Engine

    dev
    Axmol Engine is an open-source, C++ multi-platform engine designed for 2D game development. It is a fork of Cocos2d-x v4.0 and supports a wide range of platforms including mobile (iOS, Android), desktop (Windows, Linux, macOS, tvOS), console (Xbox via UWP), and WebAssembly. It supports both C++ and Lua programming languages.
  4. Overview of Axmol Engine capabilities

    dev

    Axmol is an open-source C++ multi-platform engine designed for mobile, desktop, and Xbox devices. It is an evolution of Cocos2d-x v4.0, optimized for speed and lightweight performance.

    Supported Platforms

    • Mobile: iOS, Android
    • Desktop: Windows, Linux, macOS, tvOS
    • Console: Xbox (via Windows Universal Platform/UWP)
    • Web: Major browsers via WebAssembly (WASM)

    Supported Languages

    • C++
    • Lua

    Rendering Backends

    • Vulkan: Windows, Linux, Android (v3+)
    • D3D12: Windows, UWP (v3+)
    • D3D11: Windows, UWP (v3+)
    • Metal: macOS, iOS, tvOS
    • OpenGL 3.3+: Linux, macOS, Win32
    • OpenGL ES 2.0+: Android
    • OpenGL ES 3.0+: iOS
    • ANGLE GLES 3.0+: Win32, UWP
    • WebGL 2.0: WASM

    Physics Engines

    • 2D Physics: Box2D
    • 3D Physics: JoltPhysics

    Key Extensions

    Axmol supports several modular extensions (can be optionally compiled):

    • FairyGUI
    • ImGUI
    • Spine
    • Live2D
    • Effekseer
  5. Overview of the {fmt} library

    dev
    ```{fmt}** is an open-source C++ formatting library that provides a fast and safe alternative to C stdio and C++ iostreams. It implements the C++20 std::format and C++23 std::print standards, using a syntax similar to Python's format method. Key benefits include high performance (often faster than printf), type safety with compile-time format string checking (in C++20), portable Unicode support, and extensibility for user-defined types. It can be used in a header-only configuration by defining the FMT_HEADER_ONLY macro.***
  6. What is OpenAL Soft?

    dev

    OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. It provides capabilities for playing audio in a virtual 3D environment, including:

    • 3D Audio Features: Distance attenuation, doppler shift, and directional sound emitters.
    • EFX Extension: Advanced effects such as air absorption, occlusion, and environmental reverb.
    • Audio Management: Streaming audio, multi-channel buffers, and audio capture.
  7. Overview of xsxml

    dev

    xsxml is an embedded XML SAX (Simple API for XML) parser used within the Axmol engine. It is a hybrid implementation that combines elements from two different parsers:

    • The XML SAX parser logic is extracted from the rapidxml DOM parser.
    • The non-recursive revision logic is extracted from the pugixml DOM parser.
  8. Overview of ntcvt

    dev

    ntcvt is a collection of helper utilities designed for Windows NT encoding conversions. It provides optimized alternatives to standard C++11 std::codecvt by leveraging the native Win32 API. Its primary purposes are:

    • Performance: Utilizing native Win32 APIs which are faster than std::codecvt.
    • Ease of Use: Simplifying conversions between UTF-8, UTF-16, and MBCS (Multi-Byte Character Set) within the NT kernel/system context.
    • Buffer Optimization: Implementing a hack to avoid the overhead of loop-filling \0 when preallocating buffers for std::wstring.
  9. Overview of FastLZ compression

    dev

    FastLZ is an ANSI C/C90 implementation of the Lempel-Ziv 77 (LZ77) lossless data compression algorithm. It is optimized for extremely high compression and decompression speeds at the expense of a lower compression ratio compared to algorithms like zlib.

    Best Use Cases:

    • Series of text or paragraphs.
    • Sequences of raw pixel data.
    • Any blocks of data containing significant repetition.

    When NOT to use:

    • Do not use on data that is already compressed (e.g., images, videos, or other compressed file formats).
  10. Axmol HLSL Shader Authoring Rules

    dev

    Axmol uses HLSL as its primary shader source language. To ensure cross-platform compatibility across D3D11, D3D12, Vulkan, Metal, OpenGL 3.3, and OpenGL ES 3.x, shaders must follow a specific subset of HLSL 2021 syntax.

    Key Rules:

    • No Manual Registers: Do not use : register(...) annotations for textures, samplers, or constant buffers. The axslcc compiler assigns deterministic backend bindings automatically.
    • Semantic Matching: Vertex inputs are matched by semantic name and index (e.g., POSITION, TEXCOORD0), not by variable name.
    • Entry Point: Use main as the entry point for all shader stages.
    • Resource Declaration: Declare textures and buffers by name and type only.
  11. Use axmol-cmdline to manage your game development

    dev

    The axmol-cmdline tool is a command-line utility designed to handle the full lifecycle of an Axmol game, including project creation, running, publishing, and debugging. It operates via a plugin-based architecture where the main command invokes specific plugins for different tasks.

    # starts a new project called "My Game" for multi-platform
    $ axmol new MyGame -l cpp -p dev.axmol.mygame
    
    $ cd MyGame
    
    # Will deploy the project to device and run it
    $ axmol run -p android
  12. Overview of Cubism Native Framework components

    dev

    The framework is organized into several functional components that handle different aspects of the Live2D model lifecycle and behavior:

    • Model: The primary interface for handling the model lifecycle, including generate, update, and destroy operations.
    • Motion: Handles motion playback and parameter blending to apply motion data to the model.
    • Rendering: A platform-agnostic renderer that implements graphics instructions to draw the model.
    • Physics: Manages transformation manipulations driven by physics engines.
    • Effect: Adds automated behaviors like automatic blinking and lip sync.
    • Id: Provides unique types for managing parameter, part, and Drawable names.
    • Math: Contains arithmetic functions for matrix and vector calculations required for model manipulation.
    • Type: Contains C++ type definitions used throughout the framework.
    • Utils: Provides utility functions like JSON parsing and logging.