Skip to content

GriffinCanCode/CopyShaft

Repository files navigation

CopyShaft

A modern voxel-based sandbox game built from the ground up with advanced rendering, physics, and AI systems. Drawing inspiration from block-building games, CopyShaft pushes the boundaries with sophisticated graphics, realistic physics simulation, and intelligent creature behaviors.

🏗️ Technical Architecture

Core Technology Stack

  • Language: Java 17 with modern language features
  • Build System: Gradle with cross-platform support
  • Graphics: LWJGL 3.3.3 (OpenGL 3.3+ Core Profile)
  • Audio: OpenAL 3D spatial audio system
  • Mathematics: JOML high-performance math library
  • Architecture: Custom Entity-Component-System (ECS)

Rendering Engine

  • Modern OpenGL Pipeline: Shader-based rendering with PBR-style lighting
  • Advanced Water Rendering: Dynamic wave simulation, refraction, and transparency effects
  • Atmospheric Sky System: Real-time atmospheric scattering with day/night cycles
  • Procedural Clouds: Volumetric cloud rendering with animation
  • Dynamic Lighting: Sophisticated lighting model with ambient occlusion
  • Performance Optimizations:
    • Frustum culling with view-dependent LOD
    • Render batching to minimize draw calls
    • Chunk-based level-of-detail system
    • Memory-efficient texture management

Physics Simulation

  • Custom Physics Engine: Built from scratch for voxel-world optimization
  • Swept Collision Detection: Prevents high-speed tunneling artifacts
  • Realistic Movement: Gravity, friction, and auto-climb mechanics
  • AABB Collision System: Axis-aligned bounding box collision with fine-grained sampling
  • Performance Focused: Optimized for handling thousands of physics bodies

World Generation System

  • Modular Generation Pipeline: Composable terrain generators for flexibility
  • Advanced Biome System: Temperature/humidity-based biome distribution
  • Procedural Features:
    • Multi-octave noise generation for realistic terrain
    • Cave systems with ore distribution
    • Biome-specific tree and vegetation generation
    • Dynamic water flow and ocean generation
  • Infinite Worlds: Chunk-based streaming with configurable render distances

Artificial Intelligence

  • Flocking Behavior: Emergent group dynamics using separation, alignment, and cohesion
  • State Machine AI: Complex mob behaviors with idle, wandering, chasing, and fleeing states
  • Performance Optimized: Batch processing and spatial caching to maintain 60+ FPS
  • Group Coordination: Mobs form flocks and coordinate movement and responses

Audio System

  • 3D Positional Audio: Spatial sound with distance attenuation
  • Dynamic Soundtracks: Biome-specific music that adapts to environment
  • Sound Effects: Comprehensive audio feedback for all interactions
  • Performance: Efficient OpenAL implementation with audio streaming

Data Management

  • Save/Load System: JSON-based world persistence with chunk streaming
  • Memory Management: Custom memory pools to reduce garbage collection
  • Performance Monitoring: Built-in profiling and performance logging
  • Settings System: Configurable graphics, audio, and gameplay options

🎮 Core Features

World & Building

  • Infinite Procedural Worlds: Explore endless terrain with diverse biomes
  • Block-based Construction: Place and destroy blocks to build anything imaginable
  • 8 Unique Biomes: Plains, mountains, forests, deserts, oceans, swamps, taiga, and jungles
  • Advanced Lighting: Realistic shadows and light propagation
  • Water Physics: Flowing water with realistic behavior and swimming mechanics

Gameplay Systems

  • Comprehensive Crafting: Recipe-based item creation with a 3x3 crafting grid
  • Tool System: Tools with durability, efficiency ratings, and appropriate materials
  • Inventory Management: Organized storage with drag-and-drop interface
  • Mining & Resources: Ore generation with vein-based distribution
  • Item Physics: Dropped items with realistic physics simulation

Creatures & AI

  • Intelligent Mobs: Creatures with sophisticated AI behaviors
  • Flocking Dynamics: Animals form groups and move in coordinated patterns
  • Adaptive Behavior: Mobs respond to player presence and environmental changes
  • Swimming AI: Creatures can navigate both land and water environments

User Interface

  • Modern GUI System: Clean, responsive interface design
  • World Management: Create, load, and manage multiple save files
  • Real-time HUD: Health, inventory hotbar, and game information
  • Settings Screen: Comprehensive graphics and gameplay customization

✨ What Makes It Fun

Creative Expression

The game provides unlimited creative potential through its intuitive building system. Every block placement feels precise and satisfying, while the diverse biomes offer inspiring landscapes to build within. The combination of terrain variety and building freedom means no two worlds ever look the same.

Living, Breathing World

The advanced AI brings the world to life with creatures that feel genuinely intelligent. Watching flocks of animals move together naturally, respond to your presence, and adapt their behavior creates an immersive ecosystem that feels alive and reactive.

Technical Beauty

The stunning visual effects create moments of genuine wonder. Watching the sun set through atmospheric scattering while realistic water reflects the sky, or seeing procedural clouds drift overhead while dynamic lighting illuminates your creations - these technical achievements translate directly into emotional experiences.

Smooth, Responsive Gameplay

Every interaction feels immediate and satisfying thanks to the custom-built physics engine. Movement is fluid, blocks place instantly, and the world responds to your actions without lag or stuttering. The 60+ FPS performance means your creativity never gets interrupted by technical limitations.

Emergent Complexity

Simple systems combine to create unexpected depth. The interaction between biome generation, creature AI, water physics, and building mechanics leads to emergent gameplay that constantly surprises. You might start building a simple house but end up creating complex machines, sprawling cities, or elaborate natural reserves.

Exploration Rewards

Each biome offers unique resources, challenges, and aesthetic experiences. The procedural generation ensures there's always something new over the next hill - a hidden cave system, a perfect building spot, or a beautiful natural formation. The variety keeps exploration engaging for hundreds of hours.

Personal Achievement

The game celebrates both small victories and grand accomplishments. Whether it's successfully building your first shelter, creating an efficient automated system, or constructing an architectural masterpiece, the game provides a constant sense of progress and achievement that keeps you coming back.

The combination of technical excellence, creative freedom, and engaging systems creates a game that's easy to learn but impossible to master - a digital sandbox where your imagination is the only limit.

🚀 Getting Started

Prerequisites

  • Java 17 or higher
  • OpenGL 3.3+ compatible graphics card
  • Minimum 4GB RAM (8GB recommended)

Building and Running

# Clone the repository
git clone <repository-url>
cd CopyShaft

# Build the project
./gradlew build

# Run the game
./gradlew run

Controls

  • WASD: Move around
  • Mouse: Look around and interact
  • Space: Jump/Swim up
  • Shift: Sprint/Swim down
  • E: Open inventory
  • Left Click: Mine blocks
  • Right Click: Place blocks
  • Scroll: Select hotbar items

📊 Performance

The game is optimized to maintain 60+ FPS on modern hardware through:

  • Efficient chunk streaming and LOD systems
  • Batched rendering with minimal state changes
  • Custom memory management to reduce GC pressure
  • Multi-threaded world generation
  • Spatial optimization for physics and AI calculations

CopyShaft represents a modern approach to voxel-based gaming, combining cutting-edge graphics technology with engaging gameplay mechanics to create a truly unique sandbox experience.

About

Minecraft inspired locally-run sandbox game.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published