# yksen/everland architecture

> Architecture diagram of the GitHub repository yksen/everland, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yksen/everland
- Repository: https://github.com/yksen/everland

## Overview

##### Project Type and Purpose
- The single-word README “Everland” combined with the file tree structure (directories like src/logic, src/world, and resources/shaders) and libraries (raylib, PerlinNoise) indicates this is a game-like application, likely focusing on a simulation or procedural world generation.
- Key indicators:
- Use of raylib and raylib-cpp implies graphics/rendering.
- Involvement of PerlinNoise for terrain generation.
- Components named Game, Player, World, and Generator suggest a decoupled game logic.

##### File Structure
- Top-Level Directories:
- lib: Contains external dependencies (e.g., PerlinNoise, raylib, fmt) integrated into the project.
- src: Devoted to source code including core application (Application.cpp/hpp), game logic in the logic subfolder, world generation in the world subfolder, and parser for additional data processing.
- resources: Holds shader files (vertex and fragment shaders) indicating graphics pipeline integration.
- test: Contains build scripts and possibly unit tests.
- Build and Configuration Files:
- CMakeLists.txt files at both the root, in lib, src, and test directories imply a modular, CMake-driven build.
- GitHub workflows indicate integration/CI practices.

##### README
- The minimal README “Everland” confirms the project’s title but does not add additional diagrammatic details. The provided file tree and library usage fill in the context.

a. Main Components:
- Application Layer:
- Main entry point (src/main.cpp) and Application class (src/Application.cpp/hpp) that coordinate initialization.
- Game Logic:
- Encapsulated under src/logic with Game and Player modules that govern in-game behaviors.
- World/Environment Engine:
- Managed in src/world (World, Generator) possibly using Perlin noise for procedural terrain.
- Rendering & Graphics:
- Shaders in resources/shaders and integration with raylib for graphics rendering.
- External Dependencies:
- Libraries in lib (PerlinNoise, raylib, fmt, etc.) which influence design by providing low-level functionality.
- Testing:
- A dedicated test folder to ensure component correctness.

b. Relationships and Interactions:
- The Application component initializes and manages game loop control.
- Game Logic communicates with the World Generator for dynamically creating and updating the game environment.
- The Player module interacts with both the Game and World components for input, state updates, and movement.
- The rendering layer (in conjunction with the Application component) leverages the shader files and raylib frameworks to display visuals.
- External libraries (e.g., raylib) are tightly integrated into rendering and possibly game loop management.
- The Parser may bridge external configuration/data into game logic.

c. Architectural Patterns and Design Principles:
- Modular Design: Clear folder separation (logic, world, lib) indicates components are designed with separation of concerns.
- MVC-like/Separation between core game logic and rendering.
- Procedural Generation: Specific focus on world generation with dedicated Generator components.
- Use of CMake for managing modular builds and dependencies.

d. Relevant Technologies:
- C++ as the primary programming language.
- raylib/raylib-cpp for graphics rendering.
- PerlinNoise for procedural generation.
- CMake as the build system.
- Shader programming with GLSL (vertex and fragment shaders located in resources).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Game Components"
        MainApp["Main Application"]:::core
        GameLogic["Game Logic"]:::core
        PlayerMod["Player Module"]:::core
        WorldEngine["World/Environment Engine"]:::core
        Generator["ProcGen (Generator)"]:::core
        Parser["Parser for Data Processing"]:::parser
    end

    subgraph "Rendering Layer"
        Renderer["Renderer & Shader Resources"]:::rendering
    end

    subgraph "External Dependencies"
        ExtDeps["External Dependencies"]:::external
    end

    MainApp -->|"initializes"| GameLogic
    MainApp -->|"manages"| WorldEngine
    GameLogic -->|"includes"| PlayerMod
    GameLogic -->|"updates"| WorldEngine
    PlayerMod -->|"interacts"| WorldEngine
    MainApp -->|"parses"| Parser
    MainApp -->|"invokes"| Renderer
    WorldEngine -->|"generates via"| Generator
    MainApp ---|"integrates"| ExtDeps
    Renderer ---|"uses"| ExtDeps
    WorldEngine ---|"utilizes"| ExtDeps

    classDef core fill:#B3D7FF,stroke:#333,stroke-width:2px;
    classDef rendering fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef external fill:#FFCDD2,stroke:#333,stroke-width:2px;
    classDef parser fill:#FFF9C4,stroke:#333,stroke-width:2px;

    click MainApp "https://github.com/yksen/everland/blob/master/src/Application.cpp"
    click MainApp "https://github.com/yksen/everland/blob/master/src/Application.hpp"
    click MainApp "https://github.com/yksen/everland/blob/master/src/main.cpp"
    click GameLogic "https://github.com/yksen/everland/tree/master/src/logic"
    click PlayerMod "https://github.com/yksen/everland/blob/master/src/logic/Player.cpp"
    click PlayerMod "https://github.com/yksen/everland/blob/master/src/logic/Player.hpp"
    click WorldEngine "https://github.com/yksen/everland/tree/master/src/world"
    click Generator "https://github.com/yksen/everland/blob/master/src/world/Generator.cpp"
    click Generator "https://github.com/yksen/everland/blob/master/src/world/Generator.hpp"
    click Renderer "https://github.com/yksen/everland/tree/master/resources/shaders"
    click Renderer "https://github.com/yksen/everland/tree/master/lib/raylib"
    click Renderer "https://github.com/yksen/everland/tree/master/lib/raylib-cpp"
    click Parser "https://github.com/yksen/everland/blob/master/src/Parser.hpp"
    click ExtDeps "https://github.com/yksen/everland/tree/master/lib"
```
