Skip to main content

Nate Game Engine

English | 中文

Python package for game scripting (import name: nge2).

PyPI name: nate-game-engine.

Features (MVP)

  • Instance API: engine = nge2.NGE2(...)
  • Screen capture (dxcam / mss)
  • Hardware HID control via ESP32-S3
  • Window client-area coordinates (DPI-aware)
  • Logging under root name nge
  • Find image / find color (engine.find)
  • OCR (RapidOCR) / YOLO (onnxruntime) — engine.ocr, engine.yolo
  • Stubs removed for find/ocr/yolo capability APIs (instance facades)

Managed with Spec Kit — see specs/001-nge2-mvp/.

Prerequisites

  • Windows, Python 3.11+
  • uv
  • ESP32-S3 with compatible HID firmware (for real control)

Quick start

uv sync --extra dev
uv run pytest -q
import nge2

with nge2.NGE2(resource_dir=".", capture="dxcam") as engine:
    frame = engine.capture.grab()
    engine.control.move(100, 100)
    engine.control.left_click()

Hardware smoke (mouse move)

Requires ESP32-S3. See examples/README.md.

Edit constants in examples/move_smoke.py, then:

uv run python examples/move_smoke.py

Validation details: specs/001-nge2-mvp/quickstart.md.

Use from another project (local development)

While developing this engine locally, point your game-script (or other) project at this repo with an editable install. Changes under src/nge2/ are picked up without reinstalling.

From the consumer project directory (adjust the path to your clone):

# Recommended (uv)
uv add --editable D:\GitHub\nate-game-engine

# Or with pip
pip install -e D:\GitHub\nate-game-engine

Then in that project:

import nge2

with nge2.NGE2(resource_dir=".", capture="dxcam") as engine:
    ...

Notes:

  • Consumer needs Windows + Python 3.11+; real HID still needs ESP32-S3.
  • Prefer an absolute path (or a stable relative path) to this repo.
  • For a fixed released version (not live editing), install from PyPI or a git tag — see Install a released version.

Release (GitHub Actions)

This repo uses tag-driven releases: the git tag is the source of truth for the version. Pushing a v* tag builds the package, creates a GitHub Release, and publishes to PyPI via OIDC Trusted Publisher (environment: pypi).

# After merge to main (or on the commit you want to ship):
git tag v0.1.1
git push origin v0.1.1

Workflow .github/workflows/publish.yml will:

  1. Strip the v prefix → 0.1.1
  2. Inject that into pyproject.toml (uv version)
  3. uv build
  4. Create a GitHub Release and attach dist/*
  5. Publish to PyPI (pypa/gh-action-pypi-publish, no API token)

pyproject.toml / local version can stay at a placeholder; published builds always take the tag. Do not re-use a tag / version that already exists on PyPI or as a GitHub Release.

Install a released version

# Prefer: public index
uv add nate-game-engine
# pip install nate-game-engine

# Alternatives: git tag, or download the `.whl` from the Release assets
uv add "nate-game-engine @ git+https://github.com/natewangdev/nate-game-engine@v0.1.1"

License

MIT

Metadata

Release files for nate-game-engine 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nate-game-engine 0.1.2
File Size Uploaded
nate_game_engine-0.1.2.tar.gz 260.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nate-game-engine 0.1.2
File Interpreter ABI Platform
nate_game_engine-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 291.5 kB

Release files / nate_game_engine-0.1.2.tar.gz

Download URL nate_game_engine-0.1.2.tar.gz
Size 260.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dd75dab918e3ee8589c9fdbf3a9a5e76566fe0b7e87e8a5a21e8a3e2edd328d8
BLAKE2b-256 checksum
How to use checksums
e34a94fcd9cdef636f7b904ed9574a5fc5595e69a38beec2876228b136f9ce60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / nate_game_engine-0.1.2-py3-none-any.whl

Download URL nate_game_engine-0.1.2-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0e1fd3be14b3c8ee132eb0335471dd8fda5990f0d283e42cfe0b74178a83d0d
BLAKE2b-256 checksum
How to use checksums
543c904aa631c216f269c1ee1320a42d899f1b43e213aed60581dd6af20c749f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page