Skip to content

IngSW-unipv/Progetto-S25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voxel Engine Project

A high-performance voxel engine implemented in Java, featuring strict Model-View-Controller architecture. This academic project demonstrates advanced 3D graphics techniques, efficient data structures, and clean architectural principles.

License: MIT Java Version LWJGL Version

Features

World Generation

  • Procedural terrain using multi-octave Perlin noise
  • Infinite world generation capabilities
  • Dynamic chunk loading/unloading
  • Customizable world seeds

Graphics Engine

  • OpenGL 3.3 Core Profile rendering
  • Advanced shader pipeline
  • Frustum and occlusion culling
  • Dynamic lighting system
  • Day/night cycle with smooth transitions
  • Efficient batch rendering

Physics & Interaction

  • Real-time collision detection
  • Rigid body physics simulation
  • Block manipulation (placement/destruction)
  • Ray casting for abstractBlock selection
  • Player movement with jumping and gravity

Performance

  • Optimized chunk mesh generation
  • Multi-threaded world generation
  • Efficient memory management
  • Render distance configuration
  • Performance monitoring tools

User Interface

  • Settings management
  • Performance metrics display

Prerequisites

Required Software

  • Java Development Kit (JDK) 17 or higher
  • Git (for version control)

Dependencies

  • LWJGL 3.3.2 (OpenGL, GLFW, STB)
  • JOML 1.10.5 (Math library)

Getting Started

Clone repository

git clone https://github.com/IngSW-unipv/Progetto-S25.git

Controls

Movement

  • W/A/S/D: Basic movement
  • Space: Jump
  • Left Shift: Sprint
  • Mouse: Look around

Block Interaction

  • Right Click: Break abstractBlock
  • Left Click: Place abstractBlock

System Controls

  • F11: Toggle fullscreen
  • ESC: Menu/Exit

Architecture

Model

  • World state management
  • Physics calculations
  • Entity management
  • Data persistence

View

  • OpenGL rendering
  • Window management
  • User interface
  • Shader system

Controller

  • Input processing
  • Game logic
  • Event handling
  • State management

Project Structure

SandboxProject/
├── docs/                          # Documentation
│   └── uml/
│                  
├── libraries/                     # External libraries (LWJGL, etc.)
│
├── resources/                     # Resource files
│   ├── shaders/                   # GLSL shader files~~~~
│   │   ├── block_breaking_fragment.glsl
│   │   ├── block_breaking_vertex.glsl
│   │   ├── block_fragment.glsl
│   │   ├── block_highlight_fragment.glsl
│   │   ├── block_highlight_vertex.glsl
│   │   ├── block_vertex.glsl
│   │   ├── hud_fragment.glsl
│   │   └── hud_vertex.glsl
│   └── textures/                  # Game textures
│
└── src/                           # Source code
    ├── Main.java                  # Entry point
    │
    ├── config/                    # Configuration
    │   ├── ConfigManager.java     # Settings manager
    │   ├── GameConfig.java        # Game constants
    │   └── game_config.properties # Configuration file
    │
    ├── controller/                # Controllers (C in MVC)
    │   ├── event/                 # Event system
    │   │   ├── BlockEvent.java
    │   │   ├── EventBus.java
    │   │   ├── EventListener.java
    │   │   ├── EventType.java
    │   │   ├── GameEvent.java
    │   │   ├── InputAction.java
    │   │   ├── InputEvent.java
    │   │   ├── MenuAction.java
    │   │   ├── MenuEvent.java
    │   │   ├── RenderEvent.java
    │   │   └── WorldGenerationEvent.java
    │   │
    │   ├── game/                  # Game control
    │   │   └── GameController.java
    │   │
    │   ├── input/                 # Input handling
    │   │   ├── InputController.java
    │   │   └── PlayerController.java
    │   │
    │   └── menu/                  # Menu control
    │       └── MenuController.java
    │
    ├── model/                     # Game model (M in MVC)
    │   ├── block/                 # Block system
    │   │   ├── AbstractBlock.java
    │   │   ├── BlockDirection.java
    │   │   ├── BlockFactory.java
    │   │   ├── BlockModification.java
    │   │   ├── BlockType.java
    │   │   ├── TerrainBlock.java
    │   │   └── blocks/           # Block implementations
    │   │       ├── BedrockBlock.java
    │   │       ├── DirtBlock.java
    │   │       ├── GrassBlock.java
    │   │       └── StoneBlock.java
    │   │
    │   ├── game/                  # Game state
    │   │   ├── GameState.java
    │   │   └── Model.java
    │   │
    │   ├── physics/               # Physics engine
    │   │   ├── BoundingBox.java
    │   │   ├── CollisionSystem.java
    │   │   └── PhysicsSystem.java
    │   │
    │   ├── player/                # Player handling
    │   │   ├── Camera.java
    │   │   ├── Player.java
    │   │   └── RayCaster.java
    │   │
    │   ├── save/                  # Save system
    │   │   ├── WorldManager.java
    │   │   └── WorldSaveData.java
    │   │
    │   ├── statistics/            # Game statistics
    │   │   ├── DatabaseManager.java
    │   │   └── GameStatistics.java
    │   │
    │   └── world/                 # World system
    │       ├── Chunk.java
    │       ├── ChunkLoader.java
    │       ├── ChunkLoadTask.java
    │       ├── DayNightCycle.java
    │       ├── Frustum.java
    │       ├── OcclusionCulling.java
    │       ├── PerlinNoiseGenerator.java
    │       ├── World.java
    │       └── WorldData.java
    │
    ├── util/                      # Utilities
    │   ├── GameClock.java         # Game timing
    │   └── PerformanceMetrics.java # Performance tracking
    │
    └── view/                      # View system (V in MVC)
        ├── View.java              # Main view class
        │
        ├── menu/                  # Menu UI
        │   ├── MainMenuPanel.java
        │   ├── MenuView.java
        │   ├── NewWorldDialog.java
        │   ├── SettingsPanel.java
        │   ├── StatisticsDialog.java
        │   ├── StatisticsPanel.java
        │   ├── WorldListDialog.java
        │   └── WorldSelectPanel.java
        │
        ├── renderer/              # Rendering
        │   ├── BatchedMesh.java
        │   ├── HUDRenderer.java
        │   ├── MasterRenderer.java
        │   ├── TextureManager.java
        │   └── WorldRenderer.java
        │
        ├── shader/                # Shader management
        │   ├── ShaderProgram.java
        │   └── ShaderUtils.java
        │
        └── window/                # Window management
            └── WindowManager.java

Documentation

Design Documents

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published