Thanks to visit codestin.com
Credit goes to github.com

Skip to content

2075/jrpg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Zero Reality - 2.5D JRPG with Blockchain Integration

A real-time multiplayer 2.5D JRPG built with modern web technologies, Rust backend, and blockchain integration for NFT assets. Features server-authoritative game design with client-side rendering and Web3 integration.

๐ŸŽฎ Game Overview

  • Genre: 2.5D JRPG with real-time multiplayer and roguelite elements
  • Art Style: Pixel art with 2.5D rendering and isometric maps
  • Platform: Web browsers (desktop and mobile), Tauri desktop app (planned)
  • Architecture: Server-authoritative client-server with WebSocket communication
  • Backend: Rust with Game Entity System (GES) and ECS architecture
  • Frontend: React with Canvas API, WebGL rendering (planned)
  • Blockchain: Substrate (Ink!) and EVM-compatible chains for NFT assets

๐Ÿ—๏ธ Project Structure

game/
โ”œโ”€โ”€ docs/                          # Project documentation
โ”‚   โ”œโ”€โ”€ 001-initial-project-specification.md
โ”‚   โ”œโ”€โ”€ 002-blockchain-entity-system-architecture.md
โ”‚   โ”œโ”€โ”€ 003-game-design-document.md
โ”‚   โ”œโ”€โ”€ 004-task-registry.md
โ”‚   โ”œโ”€โ”€ 005-data-structures-and-architecture.md
โ”‚   โ””โ”€โ”€ 006-quick-reference-card.md
โ”œโ”€โ”€ packages/                      # Monorepo packages
โ”‚   โ”œโ”€โ”€ client/                   # React frontend application
โ”‚   โ”œโ”€โ”€ server/                   # Rust backend with GES
โ”‚   โ”œโ”€โ”€ shared-types/             # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ shared-logic/             # Rust game logic modules
โ”‚   โ””โ”€โ”€ assets/                   # Game assets and resources
โ”œโ”€โ”€ tools/                        # Development tools and scripts
โ”œโ”€โ”€ Makefile                      # Build and development commands
โ”œโ”€โ”€ package.json                  # Root package.json for pnpm monorepo
โ”œโ”€โ”€ Cargo.toml                    # Root Cargo.toml for Rust workspace
โ””โ”€โ”€ README.md

๐Ÿš€ Getting Started

Prerequisites

  • Node.js: 18.0.0 or higher
  • pnpm: 8.0.0 or higher (we use pnpm instead of npm)
  • Rust: Latest stable version
  • Git: For version control

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/game-2.5d-jrpg.git
    cd game-2.5d-jrpg
  2. Install pnpm dependencies

    pnpm install
  3. Build shared packages

    make build-shared
  4. Build and run development stack

    make dev

Development Commands

  • Build all packages: make build
  • Build client only: make build-client
  • Build server only: make build-server
  • Start development: make dev (runs both client and server)
  • Check status: make status
  • Clean builds: make clean

๐Ÿ›๏ธ Architecture Overview

End-to-End Integration Approach

Blockchain Layer (Web3)
โ”œโ”€โ”€ NFT Assets (Ink!/Solidity)
โ”œโ”€โ”€ IPFS Content Storage
โ””โ”€โ”€ Account Abstraction
    โ†“
Server Layer (Rust)
โ”œโ”€โ”€ Game Entity System (GES)
โ”œโ”€โ”€ AI Movement & Behavior
โ”œโ”€โ”€ Item Spawning & Management
โ”œโ”€โ”€ Combat & Interaction Systems
โ””โ”€โ”€ Blockchain Interface
    โ†“
Client Layer (React)
โ”œโ”€โ”€ Derived Game State
โ”œโ”€โ”€ Canvas Rendering (2.5D)
โ”œโ”€โ”€ Fog of War System
โ”œโ”€โ”€ Input Handling
โ””โ”€โ”€ WebSocket Sync

Server-Authoritative Design

  • Server: Maintains authoritative game state and validates all actions
  • Client: Derives local state from server via WebSocket synchronization
  • Consistency: All clients see identical game world
  • Anti-Cheat: Server validates critical actions before applying
  • Web3 Integration: Server manages NFT asset state and blockchain interactions

Layered Architecture

  1. ECS Layer: Generic entity management with components
  2. Game Logic Layer: Game-specific behavior and state
  3. UI Layer: React components and Canvas rendering
  4. Sync Layer: WebSocket communication with server

๐Ÿ“š Documentation

๐ŸŽฏ Current Implementation Status

โœ… Completed Systems

  • Monorepo Structure: pnpm workspaces + Cargo workspace
  • Type System: Shared TypeScript types and Rust modules
  • Client Foundation: React app with Canvas rendering
  • Game Loop: 60 FPS game loop with input handling
  • Camera System: Zoom, pan, and player following
  • Fog of War: Dual-radius visibility and exploration system
  • AI Movement: Autonomous NPC movement with patrol patterns
  • Item Spawning: Dynamic consumables and collectibles
  • Stamina System: Movement costs and regeneration

๐Ÿ”„ In Progress

  • Server Integration: WebSocket communication setup
  • State Synchronization: Client-server state sync
  • Blockchain Interface: NFT asset integration

๐Ÿ“‹ Planned Features

  • Multiplayer Foundation: Player synchronization
  • Combat System: Turn-based and real-time combat
  • Quest System: Roguelite quest generation
  • Tauri Desktop App: Native desktop wrapper
  • Docker Containerization: Full stack deployment

๐Ÿ› ๏ธ Technology Stack

Frontend

  • Framework: React 18 with TypeScript
  • Graphics: Canvas API (2.5D rendering), WebGL (planned)
  • State Management: Client-side derived state with server sync
  • Real-time: WebSocket communication
  • Build Tool: Vite with pnpm

Backend

  • Language: Rust with latest stable
  • Architecture: Game Entity System (GES) with ECS patterns
  • Networking: WebSocket server with real-time updates
  • Game Systems: AI, combat, item management, blockchain interface

Blockchain Integration

  • Substrate: Ink! smart contracts for NFT assets
  • EVM: Solidity contracts for cross-chain compatibility
  • IPFS: Decentralized content storage
  • Account Abstraction: Simplified Web3 user experience

Development

  • Monorepo: pnpm workspaces + Cargo workspace
  • Git Workflow: Conventional commits with commitlint
  • Build System: Makefile with parallel execution
  • Code Quality: TypeScript strict mode, Rust clippy

๐Ÿค Contributing

  1. Follow the conventional commit format (enforced by commitlint)
  2. Update documentation for any changes
  3. Ensure all tests pass
  4. Follow the DRY principle and layered architecture
  5. Maintain proper separation of concerns
  6. Use the quick reference card for common patterns

Commit Convention

type(scope): description

feat: add new feature
fix: bug fix
docs: documentation changes
style: formatting changes
refactor: code refactoring
test: adding tests
chore: maintenance tasks

๐Ÿ“‹ Development Guidelines

Architecture Principles

  • Single Source of Truth: Server maintains authoritative state
  • Layered Separation: ECS โ†’ Game Logic โ†’ UI layers
  • Reference-Based Relationships: Game objects reference ECS entities
  • Component Composition: Entities composed of multiple components

Common Patterns

  • Entity Creation: Always create both Entity + Game Object
  • State Updates: Use update functions, never direct modification
  • Collection Management: Keep all related collections in sync
  • Server Sync: Client state derived from server, not self-initialized

๐Ÿ”ฎ Roadmap

Phase 1: Core Systems โœ…

  • Monorepo setup and package structure
  • Type system and shared modules
  • Client foundation and game loop
  • Basic rendering and camera system

Phase 2: Game Systems ๐Ÿ”„

  • Fog of War and exploration
  • AI movement and behavior
  • Item spawning and management
  • Stamina and movement systems
  • Server integration and WebSocket sync

Phase 3: Multiplayer & Web3 ๐Ÿ“‹

  • Player synchronization
  • Combat and interaction systems
  • Blockchain interface implementation
  • NFT asset integration

Phase 4: Polish & Deployment ๐Ÿ“‹

  • Tauri desktop app
  • Docker containerization
  • Performance optimization
  • Production deployment

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Zero Reality Team: Core development and architecture
  • JRPG Community: Game design inspiration
  • Pixel Art Community: Aesthetic guidance
  • Rust & Web3 Communities: Technical expertise

For detailed development information, see the docs folder. For current task status, see Task Registry.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published