Skip to content

Installation

This guide will help you set up your development environment for building games with ESEngine.

Quick Start (SDK Only)

For most users, just install the TypeScript SDK:

Terminal window
npm install esengine

You’ll also need the WASM files. Download them from the releases page or build them yourself (see below).

Project Setup

  1. Create your project

    Terminal window
    mkdir my-game
    cd my-game
    npm init -y
  2. Install dependencies

    Terminal window
    npm install esengine
    npm install -D esbuild typescript
  3. Create tsconfig.json

    {
    "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true
    },
    "include": ["src"]
    }
  4. Add build scripts to package.json

    {
    "type": "module",
    "scripts": {
    "build": "esbuild src/main.ts --bundle --format=esm --outfile=build/main.js",
    "dev": "esbuild src/main.ts --bundle --format=esm --outfile=build/main.js --watch"
    }
    }

Building WASM (Advanced)

If you need to build the C++ WASM backend yourself:

Prerequisites

ToolVersionPurpose
CMake3.16+Build system
C++ CompilerC++17 supportGCC 8+, Clang 7+, MSVC 2019+
Emscripten3.1+WebAssembly compilation
Node.js18+SDK build

Installing Emscripten

Terminal window
# Clone emsdk
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
# Install and activate latest version
./emsdk install latest
./emsdk activate latest
# Add to your shell profile
echo 'source "/path/to/emsdk/emsdk_env.sh"' >> ~/.bashrc

Verify the installation:

Terminal window
emcc --version
# emcc (Emscripten gcc/clang-like replacement) 3.x.x

Building

  1. Clone the repository

    Terminal window
    git clone https://github.com/esengine/microes.git
    cd microes
  2. Build WASM

    Terminal window
    # Web build
    emcmake cmake -B build_web -DES_BUILD_WEB=ON
    cmake --build build_web
    # WeChat MiniGame build
    emcmake cmake -B build_wxgame -DES_BUILD_WXGAME=ON
    cmake --build build_wxgame
  3. Build SDK

    Terminal window
    cd sdk
    npm install
    npm run build

CMake Options

OptionDefaultDescription
ES_BUILD_WEBOFFBuild for web browsers
ES_BUILD_WXGAMEOFFBuild for WeChat MiniGames
ES_BUILD_TESTSOFFBuild unit tests

IDE Setup

Visual Studio Code

Recommended extensions:

  • ESLint
  • TypeScript

For C++ development:

  • C/C++ (Microsoft)
  • CMake Tools

Next Steps

Now that you have ESEngine set up, create your first game.