Skip to content

novff/AERengine

Repository files navigation

AERengine - Minecraft Voxel Game Clone

AERengine is a modular voxel game engine built from scratch in C#

A Minecraft-like voxel game with destruction mechanics, chunk-based world generation, and a powerful addon system.

Features

  • Voxel World System: Chunk-based world (16x16x16 voxels per chunk)
  • Voxel Destruction & Placement: Left-click to destroy, right-click to place blocks
  • First-Person Camera: WASD movement with mouse look
  • Modular Addon System: Plugin architecture for extending functionality
  • Event System: Event-driven communication between engine and addons
  • OpenGL Rendering: Efficient mesh generation with greedy meshing
  • Multiple Block Types: Grass, Dirt, Stone, Sand, Wood, Leaves, Water

Controls

  • WASD: Move forward/backward/left/right
  • Space: Move up
  • Left Shift: Move down
  • Mouse: Look around
  • Left Click: Destroy block
  • Right Click: Place block
  • ESC: Exit game

Project Structure

/Core/              - Core engine systems (Engine, Events, Addons)
/Voxel/             - Voxel system (Blocks, Chunks, World)
/Rendering/         - Rendering system (Camera, Renderer)
/Input/             - Input management
/Addons/            - Addon system and sample addons
  /SampleAddons/    - Example addons
/Render/            - Legacy rendering code (kept for compatibility)

Building the Project

dotnet restore
dotnet build

Running the Game

dotnet run

Creating Custom Addons

Addons extend the game functionality. Here's how to create one:

  1. Create a new class that implements IAddon or extends BaseAddon:
using AERengine.Core;
using AERengine.Addons;

namespace MyCustomAddon;

public class MyAddon : BaseAddon
{
    public override string Id => "my-addon";
    public override string Name => "My Custom Addon";
    public override string Version => "1.0.0";

    public override void OnLoad(Engine engine)
    {
        base.OnLoad(engine);
        
        // Subscribe to events
        SubscribeToEvent("VoxelDestroyed", OnVoxelDestroyed);
        
        Console.WriteLine("My addon loaded!");
    }

    private void OnVoxelDestroyed(GameEvent evt)
    {
        Console.WriteLine("A voxel was destroyed!");
    }

    public override void OnUpdate(float deltaTime)
    {
        // Update logic here
    }
}
  1. Compile your addon as a DLL and place it in the ./Addons directory
  2. Run the game - your addon will be automatically loaded!

Sample Addon

The included CustomBlockAddon demonstrates:

  • Event subscription (VoxelDestroyed, VoxelPlaced, WorldInitialized)
  • Tracking game statistics
  • Triggering custom events
  • Lifecycle management

Event System

Available events:

  • WorldInitialized - Triggered when the world finishes initialization
  • VoxelDestroyed - Triggered when a voxel is destroyed
    • Data: position (int, int, int)
  • VoxelPlaced - Triggered when a voxel is placed
    • Data: position (int, int, int), blockType (BlockType)

Technical Details

  • Language: C# (.NET 6.0)
  • Graphics API: OpenGL 4.6 (via OpenTK)
  • Future: Vulkan support planned (Silk.NET.Vulkan)
  • Architecture: Modular, event-driven design
  • Rendering: Greedy meshing for efficient voxel rendering

Dependencies

  • OpenTK 4.7.2
  • Silk.NET.Vulkan 2.17.1 (for future Vulkan support)
  • System.Numerics.Vectors 4.5.0
  • Newtonsoft.Json 13.0.3

Future Enhancements

  • Full Vulkan renderer implementation
  • Infinite world generation
  • Texture support
  • Lighting system
  • Multiplayer support
  • Save/Load world data
  • More block types
  • Crafting system
  • Inventory system

License

This is a learning project. Feel free to use and modify as needed.


Note: This project demonstrates game engine architecture, voxel rendering, and plugin systems. It's a foundation that can be extended with more features!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published