Skip to content

ocentra/ocentra-games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

99 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Ocentra Games

A modern, blockchain-powered multiplayer card game platform featuring intelligent AI opponents, decentralized match verification, and a flexible asset-based game system.

Ocentra Games Homepage

Experience the future of multiplayer card gaming with blockchain verification, intelligent AI opponents, and seamless cross-platform gameplay.

๐ŸŽฎ Play Now | ๐ŸŒ Visit Website


๐ŸŽฏ What is Ocentra Games?

Ocentra Games is a next-generation multiplayer card game platform that combines:

  • Solana Blockchain for decentralized match state and escrow management
  • Local & Cloud AI for intelligent opponents powered by LLMs
  • Asset-Based Game System for flexible, data-driven game modes
  • Event-Driven Architecture for clean domain separation
  • Web3 Integration for true ownership and verifiable gameplay

We're building a platform where game rules, AI behavior, and game modes are all data-driven assets, making it easy to create, modify, and deploy new games without code changes.


โœจ Key Features

๐ŸŽฒ Multiple Card Games

  • Claim - High-stakes strategic card collection with psychological warfare
  • Three Card Brag - Fast-paced British card game with hand rankings
  • Texas Hold'em - Classic poker with blockchain verification
  • More games coming...

๐Ÿค– Intelligent AI Opponents

  • Local LLMs - Run AI models directly in the browser (Transformers.js)
  • Cloud LLMs - Support for OpenAI, OpenRouter, LM Studio, and more
  • Chain of Thought - AI reasoning is captured and verifiable
  • Personality-Based - Each AI has distinct playing styles

โ›“๏ธ Blockchain-Powered

  • Solana Integration - Match state stored on-chain via Anchor program
  • Decentralized Escrow - Player funds held securely on-chain
  • Verifiable Matches - Full match records stored in Cloudflare R2
  • Leaderboard Snapshots - Top 100 players recorded on-chain

๐Ÿ—๏ธ Flexible Architecture

  • Asset-Based System - Games defined as .asset files (Unity ScriptableObject pattern)
  • Event-Driven - Clean separation between UI, Engine, Solana, and AI domains
  • Phase-Based Development - Systematic, spec-driven implementation
  • Multiplayer-First - All games use multiplayer architecture, even single-player (1 human + AI)

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 19 + TypeScript + Vite
  • Zustand for state management
  • React Query for data fetching
  • EventBus for cross-domain communication

Blockchain

  • Solana - On-chain game state and escrow
  • Anchor Framework - Rust-based Solana program
  • Web3.js + Anchor Client - TypeScript integration

AI & ML

  • Transformers.js - Local LLM inference in the browser
  • Multiple Providers - OpenAI, OpenRouter, LM Studio, Native
  • Model Manager - Dynamic model loading and switching

Infrastructure

  • Cloudflare Workers - Backend API and match coordination
  • Cloudflare R2 - Off-chain full match record storage
  • Durable Objects - Stateful match coordination
  • IndexedDB - Local caching and persistence

Testing & Development

  • Vitest - Unit testing
  • Playwright - E2E testing
  • Anchor Tests - Solana program testing
  • TypeScript - Full type safety

๐Ÿ“š Documentation

๐Ÿ“– Start Here: docs/ocentra/REPO-MINDMAP.md - Complete repository structure overview

Quick Navigation

Implementation Phases


๐Ÿš€ Getting Started

Prerequisites

  • Node.js 22+
  • Rust (for Solana program)
  • Anchor Framework (for Solana development)
  • Cloudflare Account (for R2 storage)

Quick Setup

  1. Clone the repository

    git clone <repository-url>
    cd ocentra-games
  2. Install dependencies

    npm install
  3. Set up environment

    cp .env.example .env
    # Edit .env with your configuration
  4. Start development server

    npm run dev

    The game will be available at http://localhost:3000

  5. Run Solana tests (in separate terminal)

    cd Rust/ocentra-games
    anchor test

Live Demo

๐ŸŽฎ Try it now: game.ocentra.ca
๐ŸŒ Visit our website: ocentra.ca

Full Setup Guide

For detailed setup instructions, see:


๐ŸŽฎ Current State

โœ… Implemented

  • โœ… Solana Program - Complete Anchor program with match lifecycle, escrow, and leaderboards
  • โœ… Event-Driven Architecture - EventBus system connecting UI, Engine, Solana, and AI domains
  • โœ… Game Engine - Core game logic, rules, state management
  • โœ… AI System - Local and cloud LLM integration with chain of thought
  • โœ… Match Recording - Canonical serialization and verification
  • โœ… Cloudflare Infrastructure - Worker API and R2 storage
  • โœ… UI Framework - React components and pages for Claim and Three Card Brag
  • โœ… Test Infrastructure - Comprehensive test suite (unit, integration, E2E)

๐Ÿšง In Progress

  • ๐Ÿšง Asset-Based Game System - Migrating from code-based to asset-based game modes
  • ๐Ÿšง Rules Asset System - Extracting rules into separate .asset files
  • ๐Ÿšง Game Editor - Visual editor for creating and editing game assets
  • ๐Ÿšง Additional Games - Texas Hold'em implementation

๐Ÿ“‹ Planned

  • ๐Ÿ“‹ More Card Games - Bridge, Spades, Hearts, Rummy variants
  • ๐Ÿ“‹ Tournament System - Organized competitions and brackets
  • ๐Ÿ“‹ NFT Integration - Card collections and ownership
  • ๐Ÿ“‹ Mobile Apps - Native iOS and Android via Capacitor
  • ๐Ÿ“‹ Social Features - Friends, chat, spectating

๐ŸŒŸ What Makes Us Different?

1. True Decentralization

Unlike traditional game servers, Ocentra Games uses Solana blockchain for match state and escrow. This means:

  • No Central Server - Match state is stored on-chain
  • Transparent Rules - Game logic is verifiable on-chain
  • Player Ownership - Funds held in smart contracts, not our wallets
  • Censorship Resistant - No single point of failure

2. Verifiable AI

AI opponents use chain of thought reasoning that's captured and stored:

  • Transparent Decisions - See why AI made each move
  • Reproducible Games - Replay matches with same AI behavior
  • Fair Play - AI reasoning is auditable
  • Research Platform - Perfect for AI research and development

3. Asset-Based Flexibility

Games are defined as data assets, not code:

  • No Code Changes - Create new games by adding .asset files
  • Rapid Iteration - Modify game rules without redeploying
  • User-Generated Content - Players can create and share game variants
  • Unity-Like Workflow - Familiar ScriptableObject pattern for game developers

4. Multiplayer-First Architecture

Every game uses multiplayer architecture, even single-player:

  • Consistent Codebase - Same code path for all games
  • Easy Scaling - Add AI or human players seamlessly
  • Unified State - One state management system for everything
  • Future-Proof - Easy to add new player types (AI, human, spectator)

5. Open & Extensible

Built with openness in mind:

  • Documentation-First - Comprehensive, spec-driven documentation
  • Phase-Based Development - Clear roadmap and milestones
  • Modular Design - Easy to extend and customize
  • Developer-Friendly - Clean architecture and patterns

๐Ÿ—๏ธ Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    CLIENT LAYER                          โ”‚
โ”‚  React UI โ†’ EventBus โ†’ Game Engine โ†’ AI System         โ”‚
โ”‚              โ†“              โ†“            โ†“              โ”‚
โ”‚          WebRTC P2P    Solana Client   Local LLM       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ†“         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   BLOCKCHAIN LAYER                       โ”‚
โ”‚  Solana Network (Anchor Program)                        โ”‚
โ”‚  - Match State PDAs                                     โ”‚
โ”‚  - Escrow Accounts                                      โ”‚
โ”‚  - Leaderboard Snapshots                                โ”‚
โ”‚  - Game Registry                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    STORAGE LAYER                         โ”‚
โ”‚  Cloudflare R2 (Hot Storage)                           โ”‚
โ”‚  - Full Match Records                                   โ”‚
โ”‚  - Chain of Thought                                     โ”‚
โ”‚  - Match History                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Principle: All cross-domain communication is event-driven via EventBus

  • UI Domain - React components and pages
  • Engine Domain - Game logic and state
  • Solana Domain - Blockchain integration
  • AI Domain - LLM integration

๐Ÿ“Š Project Statistics

  • Languages: TypeScript, Rust, JavaScript
  • Total Lines of Code: ~50,000+ (estimated)
  • Games: 3 (Claim, Three Card Brag, Texas Hold'em)
  • AI Providers: 4+ (OpenAI, OpenRouter, LM Studio, Native)
  • Test Coverage: Comprehensive (unit, integration, E2E)
  • Documentation: 100+ markdown files, spec-driven

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Read the Documentation - Start with REPO-MINDMAP.md
  2. Follow the Phases - Check Phases for implementation roadmap
  3. Code Style - Follow ESLint + Prettier rules
  4. Write Tests - Add tests for new functionality
  5. Update Docs - Keep documentation in sync with code

๐Ÿ“ License

This repository is public for transparency and educational purposes, but the codebase is not open source.

All code, documentation, and assets in this repository are proprietary and remain the intellectual property of Ocentra AI. See LICENSE for full terms.

Key Restrictions:

  • โœ… You may view and study the code for learning purposes
  • โŒ You may NOT copy, modify, distribute, or use commercially
  • โŒ Unauthorized use is strictly prohibited

For licensing inquiries or collaboration opportunities, please contact us at ocentra.ca.


๐Ÿ”— Links

Live Platforms

Code & Documentation

Connect

  • ๐Ÿ’ผ LinkedIn Company: Ocentra AI - Official company page
  • ๐Ÿ’ผ LinkedIn: Sujan Mishra - Project creator

๐Ÿ™ Acknowledgments

Built with:


Last Updated: 2025-01-20
Status: Active Development
Version: 0.1.0-alpha

About

AI Card Game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published