Sigil Engine — Tactical Card Game Framework

Ship a tactical card battler in days, not months. Full source code for a production-grade grid-based card game with multiplayer, AI opponents, admin panel, deck builder, shop, and more. Built with Next.js + Phaser + Supabase + TypeScript.

๐Ÿ”— Live Demo: unitcards.vercel.app


What You Get

This is a framework  — it's a complete, working engine you can reskin, extend, and ship as your own. Every feature below is implemented and functional.


โš”๏ธ Battle System — 36 Modular Game Systems

  • Grid-based tactical combat — configurable board size, tile types, terrain costs, biomes
  • Turn-based engine — draw โ†’ play โ†’ move โ†’ attack loop with full turn management
  • Realtime multiplayer mode — tick-based battles with 6 dedicated sync systems
  • Pathfinding & movement — straight, diagonal, or both; variable movement steps
  • Combat resolution — melee/ranged/caster attacks, shields (magic/melee), ammo & mana resources
  • Floating damage numbers, projectile animations, VFX, dynamic lighting
  • Camera controls — pan, zoom, follow, with mobile touch support

๐Ÿƒ 5 Card Types

TypeFeatures
UnitsHP, attack, range, movement, shields, resources (mana/ammo), sacrifice & synergy mechanics, flying
BuildingsAttack / defend / summon / utility roles, multi-tile support
SpellsSingle / area / global / line / random targeting
TrapsTile / unit / building placement, multiple trigger conditions
CastlesCollectible player bases with passive/active effects, multi-tile

๐ŸŽฎ 6 Game Modes (All Implemented)

  1. Standard 1v1 — Destroy the enemy castle
  2. Capture the Flag — Dedicated flag system, scoring, and specialized CTF AI
  3. Castle Defense — Survive X turns against attackers
  4. Free-for-All — Up to 4 players
  5. Dungeon Crawl — Roguelike PvE with procedural maps, loot, chests, items, co-op lobbies
  6. Realtime Battle — Live tick-based multiplayer/single player (separate scene & systems)

๐Ÿง  Data-Driven Effect System

The engine's core power — every card ability is defined in JSON, not code. No programming required to create new cards or effects.

  • 21 trigger types — onAttack, onDeath, onTurnStart, onStepOnTile, onFlagPickup, and more
  • Composable conditions — target.hp < 50%, target.isEnemy, board position checks
  • Action types — damage, heal, applyStatus, move, summon, modifyStats, and more
  • Status effects — bleed, poison, freeze, stun — all JSON-configured
  • Rules engine — separate AttackRules, MovementRules, PlacementRules for clean validation

๐Ÿ›ก๏ธ Full Admin Panel — 15 Sections

A complete back-office for managing every aspect of your game without touching code:

SectionWhat It Does
CardsFull CRUD — create, edit, delete cards with all stats and effects
EffectsVisual effect editor with triggers, conditions, and actions
MapsGrid map editor with tile types, biomes, spawn points
FactionsFaction/group manager with shared effects and modifiers
SpritesSprite sheet manager — upload, configure frame dimensions, animations
AnimationsAnimation definition manager
MediaMedia library with image uploads and cropping
Enemy DecksAI opponent deck builder
DungeonsDungeon configuration — biomes, encounters, loot tables
QuestsQuest definitions and progression rules
RewardsReward configuration for all systems
AnalyticsGame analytics dashboard
UsersPlayer management — give cards, currency, view profiles
SettingsSite-wide configuration
TestDebug and testing tools

๐Ÿค– AI Systems

  • AI Opponents — 1,000+ line AI controller with scoring heuristics, attack focus profiles, pinned targets
  • CTF AI — Specialized 780+ line AI with role-based tactics: runner, interceptor, defender, attacker
  • AI Content Generation — OpenAI integration for generating card concepts, effects, and images from the admin panel
  • AI Vision — Analyze card art and game screenshots

๐ŸŒ Multiplayer & Social

  • Realtime multiplayer via Supabase Realtime (WebSockets)
  • Lobby system with matchmaking
  • Friends system — add, remove, search, view profiles
  • Card trading — offer, review, accept/reject trades
  • Collection comparison — compare collections with friends
  • Chat system — conversations, DMs, messaging
  • Notifications — duel invites, friend requests, dungeon invites, trade offers
  • Leaderboard & rankings with rank colors
  • Co-op dungeon lobbies — invite friends to dungeon runs

๐Ÿช Economy & Shop

  • Card packs with configurable rarity weights and faction focus
  • In-game currency (Shards) with bundle tiers
  • Player marketplace — list, buy, cancel card listings
  • Stripe integration — real-money checkout with webhook handling
  • PayPal integration — alternative payment method
  • XP & leveling system
  • Quest rewards
  • Starter card provisioning for new players

๐Ÿ—บ๏ธ Map & Tile System

  • Configurable grid dimensions
  • Tile types: normal, obstacle, spawnPoint, castleTile, flagTile
  • Biomes: grassland, desert, snow, lava, swamp, void — each with lighting configs
  • Variable movement costs, walkable/buildable flags
  • Tile effects (poison swamp, lava burn, etc.)
  • Mode-specific map restrictions

๐Ÿฐ Dungeon Crawler Mode

A full roguelike PvE mode with its own systems:

  • Procedural map generation with seeded RNG
  • Encounter director — spawns enemies based on progression
  • Loot system — 6 chest types (normal, silver, gold, diamond, mimic, cursed, locked)
  • Item system — 11 weapon types, 5 armor types, 10 potion types, 7 equipment slots, 5 rarity tiers
  • Co-op multiplayer — invite friends to dungeon runs via lobbies
  • Dungeon leaderboard

๐Ÿงฑ Tech Stack

LayerTechnology
Frontend & UINext.js 16 (React 19), Tailwind CSS, Framer Motion
Game EnginePhaser 3.90 (embedded in Next.js)
Backend & AuthSupabase (Postgres, Auth, Realtime, Storage)
LanguageTypeScript (strict mode throughout)
PaymentsStripe + PayPal
AIOpenAI API (GPT + Vision + DALL-E)
PlatformPWA (mobile-first, installable, offline-capable)

๐Ÿ“ What's Included

  • Full source code — ~150+ components, 36 game systems, 78 database migrations
  • Complete type system — 1,000+ lines of TypeScript interfaces covering every game entity
  • Database schema & seed data — cards, effects, maps, factions, packs ready to go
  • 5 Phaser scenes — Boot, Preloader, Battle, RealtimeBattle, Dungeon
  • 15-section admin panel — manage everything from the browser
  • 16+ API routes — shop, AI generation, admin tools, webhooks
  • PWA config — manifest, service worker, mobile-optimized
  • Deployment ready — deploy to Vercel in minutes

๐ŸŽจ Easy to Reskin

The engine is designed for data-driven customization:

  • All cards, effects, and maps are JSON data, not hardcoded logic
  • Swap art assets in public/assets/
  • Change colors and branding via Tailwind config
  • Add new factions, card types, and game modes without modifying core systems
  • Admin panel lets non-developers create and balance content

๐Ÿ’ก What You Can Build With This

  • Tactical card battlers (Cards & Castles, Clash Royale-style)
  • Turn-based strategy games (Fire Emblem, Advance Wars-style grid combat)
  • Auto-battlers with the realtime tick system
  • Dungeon crawlers / roguelikes using the dungeon mode



๐Ÿš€ Quick Start

  1. Clone the repo
  2. npm install
  3. Set up a free Supabase project
  4. Run migrations: npx supabase db push
  5. Add your env vars (.env.local)
  6. npm run dev
  7. Open localhost:3000 — you're live

๐Ÿ“‹ License

Commercial license included. Use in your own games, modify freely. You may not resell the engine source code as-is.

๐Ÿ“ข Support & Updates

Active development. Updates are posted as devlogs. Questions? Drop a comment below or reach out via the community.

v0.1.0 — Full Release. Built with TypeScript, tested in production.

© 2026 Sigil Engine. All rights reserved.
THIS ENGINE WILL RECEIVE PERIODIC AND MAJOR UPDATES FOR FREE

Published 8 days ago
StatusReleased
CategoryTool
PlatformsHTML5
AuthorChigooX
TagsGame engine