3D Virtual Environment Creator

Godot EngineGDScriptDesign Patterns3D Modeling

Interactive application for generating and customizing 3D virtual worlds using Godot Engine, featuring dynamic population and state-driven characters.

3D Virtual Environment Creator
ArhitecturăBuilder, Strategy, Decorator, State
ContextGame Development / Simulation
Cod Sursă / ReferințeGitHub Repository

Overview

This project is an interactive 3D virtual environment generator built utilizing the Godot Engine and GDScript. It is designed to allow users to procedurally create, decorate, and populate customized virtual worlds, such as forests or villages. The architecture is heavily driven by established software design patterns to ensure modularity and scalability.

Core Features and Architectural Patterns

The application’s functionality is structured around four primary design patterns, each governing a specific aspect of the environment’s creation and interaction:

  • Environment Construction (Builder Pattern): The procedural generation of the 3D environments is managed by builder classes. Specifically, ForestBuilder and VillageBuilder are used to construct the distinct terrains and base layouts for the virtual worlds.
  • Dynamic Population (Strategy Pattern): The placement and distribution of natural elements and structures within the generated environment are determined dynamically. Users can select between different population algorithms (RandomPopulationStrategy, ClusteredPopulationStrategy, and VillagePopulationStrategy), allowing the system to swap population behaviors at runtime without altering the core builder logic.
  • Visual Effects (Decorator Pattern): Atmospheric elements are layered onto the constructed environments dynamically. Classes like FogDecorator and RainDecorator are utilized to add real-time visual effects (fog, rain) to the scene without modifying the underlying environment objects.
  • Character Management (State Pattern): The virtual world is inhabited by an animated main character. The character’s behavior and animation transitions (such as transitioning between Idle, Walking, and Jumping states) are strictly managed via a State machine, ensuring clean, decoupled logic for character control.

System Use Cases

The application primarily handles two complex workflows:

  1. Environment Generation: The system processes user selections regarding the type of environment and the preferred population strategy. It then delegates the construction to the appropriate Builder and Strategy classes, transitioning the user interface from the main menu to the active Heads-Up Display (HUD) once the 3D world is fully rendered.
  2. Environment Modification: Once the base environment is active, the system listens for user inputs via the HUD to inject Decorators (like fog or rain) or to spawn the state-driven character into the scene dynamically.