Bpcore Engine logo

Bpcore Engine

Organization
CodeAtCode
bpcore-engine

Use when building GBA games with the BPCore Lua engine - entity, sprite and tilemap functions, SRAM save and load, link cable multiplayer protocol, camera and scrolling, or optimization patterns

Overview

PublisherCodeAtCode
Repositoryoss-ai-skills
Skill namebpcore-engine
Stars
30
Forks
3
Bundled files
5
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by CodeAtCode on GitHub. Read the source before you install it.

Installation

Install the Bpcore Engine AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/bpcore-engine
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CodeAtCode/oss-ai-skills.git /tmp/oss-ai-skills
mkdir -p .claude/skills
cp -r /tmp/oss-ai-skills/frameworks/bpcore-engine .claude/skills/bpcore-engine
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Bpcore Engine in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Bpcore Engine on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Bpcore Engine is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

BPCore Engine Skill

Objective: Use this skill to reduce SRAM-corruption incidents, sprite-flicker bugs, link-cable desync, and tilemap-tearing crashes by enforcing save-format discipline, VRAM-budget rules, and sync-protocol patterns below.

Comprehensive guide for building Gameboy Advance games using the BPCore Engine Lua framework.

Overview

BPCore Engine (Blind jumP Core Engine) is a Lua game framework for GBA that combines C++ with embedded Lua, letting developers create games without C++ or compilers. Inspired by Pico-8 and Tic80, it's suited for small minigames given the GBA's limited resources: 240x160 screen, 16.78 MHz ARM7TDMI, and 256KB RAM for Lua/data.

The engine provides sprite rendering, tile-based graphics, entity management with collision, button input, UTF-8 text, audio, save/load via SRAM, and multiplayer through the link cable. The build system uses Lua to package resources into ROM.

Deep Dives

Complex topics are split into reference files loaded on demand from SKILL.md:

Critical Rules (do X because Y)

Memory & VRAM Discipline

  • Pre-allocate entity pools before runtime because runtime allocation during gameplay causes frame stalls and can exhaust the 128-entity limit mid-level.
  • Batch stationary sprites into a single draw loop because scattered spr() calls across update logic increase CPU overhead and risk missing vblank deadlines.
  • Keep tile updates under 10 per frame because each tile() call writes to VRAM during active display, causing visible tearing if it hits vblank.
  • Distribute sprites vertically across scanlines because GBA can only render ~10 sprites per scanline; exceeding this causes flickering on crowded rows.

SRAM Save/Load Discipline

  • Validate save data size before SRAM write because oversized data corrupts adjacent save slots and can overwrite the marker byte.
  • Write checksums after every save because SRAM bit-flips during power loss leave corrupted data that loads silently without validation.
  • Verify marker byte (0x42) before loading because loading uninitialized SRAM returns garbage that crashes game logic expecting valid state.
  • Use atomic writes (temp buffer then commit) because power loss mid-write leaves partial data that passes checksum but contains torn state.

Link Cable Multiplayer Discipline

  • Keep packets under 11 bytes because the hardware queue rejects longer messages, causing silent send failures and desync.
  • Drain recv() in a loop each frame because unprocessed packets overflow the 64-packet receive queue, losing critical state updates.
  • Handle disconnects by resetting game state because stale connections send garbage after cable removal, corrupting opponent position tracking.
  • Use client-server authority model because dual-authority games desync when both players predict differently; one peer validates all inputs.

Camera & Scrolling Discipline

  • Clamp camera coordinates to world bounds because unbounded camera(x, y) exposes blank VRAM edges when player reaches level limits.
  • Update scroll() after camera() because scroll offsets are relative to camera position; reversing the order causes parallax misalignment.
  • Use fixed-point math for scroll interpolation because GBA lacks FPU; floating-point emulation is slow and causes jittery camera movement.

Installation & Project Structure

Getting BPCoreEngine.gba

Important: BPCore Engine requires BPCoreEngine.gba base ROM with compiled C++ code and Lua interpreter. This is not a custom ROM you create.

Where to Obtain
  1. Official Repository: Clone from GitHub

    bash
    git clone https://github.com/evanbowman/BPCore-Engine.git
    cd BPCore-Engine
  2. Required Files: Repository contains:

    • BPCoreEngine.gba - Engine base ROM (~3.5 MB)
    • build.lua - Build script (Lua 5.3)
    • test/ - Example projects
  3. Alternatives:

    • GitHub Releases may have pre-built GBA files
    • mGBA emulator includes BPCore version in some distributions
File Placement
your-project/
├── BPCoreEngine.gba          # Base ROM (required)
├── build.lua                  # Build script
├── manifest.lua               # Your manifest
├── overlay.bmp                # Text/UI tiles
├── tile0.bmp                  # Main background (64x64 tiles)
├── tile1.bmp                  # Foreground (64x64 tiles)
├── spritesheet.bmp           # Sprites (16x16)
├── music.raw                  # Music (mono 16kHz PCM)
├── sfx.wav                    # Sound effects
├── main.lua                   # Entry point
└── data.txt                   # Resources

Build Layout

./
├── src/
│   ├── main.lua              # Main loop
│   ├── game.lua              # Game logic
│   ├── menu.lua              # Menu
│   └── level1.csv            # Tilemap
├── assets/
│   ├── graphics/
│   │   ├── spritesheet.bmp
│   │   ├── tiles0.bmp
│   │   └── tiles1.bmp
│   ├── audio/
│   │   ├── music.raw
│   │   ├── jump.wav
│   │   └── coin.wav
│   └── tilemaps/
│       └── world.csv
├── build.lua                 # Build script
├── BPCoreEngine.gba          # Engine ROM
└── dist/
    └── yourgame.gba          # Output

Building Your ROM

Step 1: Create manifest.lua

lua
local app = {
    name = "My Adventure",
    gamecode = "ABCD",
    makercode = "BC",
    tilesets = { "overlay.bmp", "tile0.bmp", "tile1.bmp" },
    spritesheets = { "spritesheet.bmp" },
    audio = { "music.raw", "jump.wav", "coin.wav" },
    scripts = { "main.lua", "game.lua", "menu.lua" },
    misc = { "level1.csv" }
}

return app

Step 2: Run build script

bash
lua build.lua manifest.lua BPCoreEngine.gba output.gba

Step 3: Verify

Build checks manifest files exist, formats are valid, scripts readable, output ROM created (~3.5-4 MB).

Step 4: Test with mGBA

bash
mGBA output.gba --log --memview

--log shows engine log() output, --memview opens memory viewer for debugging.

File Formats

BMP Tilesets: Indexed color (256 colors), tiles are 8x8 pixels. Overlay: 16x16 tiles, Tile_0/1: 32x32 tiles, Sprites: 8x8 sprites.

Audio: Mono 16kHz signed 8-bit PCM. Convert with FFmpeg:

bash
ffmpeg -i input.mp3 -ar 16000 -ac 1 -f s8 output.raw

Tilemap CSV: Comma-separated tile indices, each row is one tile row. Tile indices start at 1 (0 = empty).

Troubleshooting

  • Emulator vs hardware differences: Test on real hardware because mGBA timing differs from actual GBA clock rates, causing race conditions in fast games.
  • Sprite flickering (too many sprites per scanline): Redistribute sprites vertically because GBA hardware limits ~10 sprites per scanline; excess sprites blink on/off.
  • Audio channel conflicts: Prioritize player-hurt sounds at priority 95+ because only 3 SFX channels exist; lower-priority sounds drop silently.
  • Save data corruption: Write to temp offset then commit because power loss mid-write leaves partial data; atomic writes prevent torn state.
  • Link cable desync: Implement sequence numbers in packets because recv() queue reordering causes state rollback when packets arrive out of order.

References


Summary

This skill covers BPCore Engine development for GBA:

  • Critical Rules: Memory/VRAM, SRAM, Multiplayer, Camera discipline with failure modes
  • Installation & Project Structure: BPCoreEngine.gba sources, build process
  • Deep Dives: API reference, save/load, multiplayer, optimization, error handling
  • Troubleshooting: Emulator differences, sprite flickering, audio conflicts, save corruption, desync

Refer to official repository for updates.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Bpcore Engine AI skill do?

Use when building GBA games with the BPCore Lua engine - entity, sprite and tilemap functions, SRAM save and load, link cable multiplayer protocol, camera and scrolling, or optimization patterns

Why use Bpcore Engine on TypingMind?

Because you install it once and use it with any model. Bpcore Engine is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Bpcore Engine in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/bpcore-engine. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Bpcore Engine?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Bpcore Engine?

As many as you like. As long as a model supports skills, you can use Bpcore Engine with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Bpcore Engine AI skill free?

Yes. It is published on GitHub by CodeAtCode under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇