Skip to content

DanielHatakeyama/BoidEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoidEngine

An ECS-Based Java Game Engine Abstraction Interface

Developed By: Daniel Hatakeyama, Ben Xiang, River Jordan

Description

BoidEngine is a high-level game engine abstraction built over Processing[1] utilizing an advanced Entity Component System (ECS)[2] for arbitrary virtual object interaction and behavior.

BoidEngine is not a full-stack implementation—it relies on Processing for graphics and is designed as a lightweight abstraction layer. Future enhancements (e.g., more support for user scripting, asset management, redesigned interface) are planned to further extend its capabilities.

Key Features

  • Game Engine "Unity-like" abstraction:

    Efficiently manages diverse game objects via a comprehensive abstraction layer built on Processing, leveraging primitive batching optimizations for rendering performance.

  • Robust ECS Architecture:
    Implements a modular ECS design inspired by industry standards, favoring "Composition over inheritance".

    • Entities: Act as "game objects" in the scene, acting as attachment points for components.
    • Components: Hold modular data and state for entities, allowing for arbitrary configuration and behavior.
    • Systems: Process and govern behavior through a robust event-driven approach, ensuring scalable and maintainable game logic.
  • Integrated Boid Simulation Demonstration:
    Features an interactive boid simulation[3] that showcases the engine’s capabilities. The demo supports several thousand boids—with multiple clans that can be spawned via left, right, or middle mouse clicks.

  • Extensibility & Future Roadmap:
    Although currently focused on core game object and ECS functionality, BoidEngine is designed with extensibility in mind. Planned enhancements include integrating a consistent and easy-to-use user scripting interface, paving the way for a future comprehensive game engine library built on top of Processing.

“Me and da Boids”

Video Demonstration: This interactive boid[3] demonstration showcases the engine’s capabilities by using the ECS game engine to handle all objects, interactions, and behaviors for a flocking simulation.

boid_demo.mp4

Design Overview

Project Structure

Below is the current repository layout. Each .pde file handles a distinct aspect of the ECS and is coupled with a brief description.

├── ProcessingMockup  
│    ├── BoidSystems.pde    // FUTURE: Implement formal script loader
│    ├── Component.pde      // Defines base component
│    ├── Entity.pde         // Defines base entity
│    ├── EntityBuilder.pde  // Builder for entity-component construction
│    ├── EntityManager.pde  // Entity Creation, Deletion, Handling
│    ├── EventManager.pde   // Decoupled event system
│    ├── Event.pde          // Defines base event
│    ├── ProcessingMockup.pde  // "Main"
│    ├── RenderFunction.pde // Base renderer and concrete extentions
│    ├── SystemManager.pde  // Manages and updates all systems
│    ├── Systems.pde        // Defines base system
│    └── ... (additional files as needed)  
├── resources 
├── report  
├── .gitignore  
├── LICENSE  
└── README.md 
Fig 1: Project layout with descriptions.

UML Diagram

UML Diagram ECS Boid Engine
Fig 2: resources/images/UML_Diagram_ECS_Boid_Engine.png

Main Utilized Design Patterns

  • Entity Component System (ECS) Architecture – Separates data (components) from functionality (systems) to keep entities lightweight.
  • Builder Pattern – Easily assemble complex entities using the EntityBuilder class.
  • Event-Driven Architecture – Facilitates loose coupling between components and system logic.
  • Strategy Pattern – Used in rendering, providing multiple render strategies for different entity types.
  • Composition – Components attach to entities, avoiding deep inheritance hierarchies.
  • Dependency Injection – Decouples object creation from usage by injecting required dependencies into components at runtime, enhancing modularity, flexibility, and testability.

Running the Engine

Requirements

  • Processing 4.x
  • Java Runtime Environment (JRE) 8 or higher

Processing[1] is an open-source software environment and programming language built on Java, designed primarily for visual and interactive projects. It’s widely used by artists, designers, and hobbyists to quickly prototype animations, generative art, data visualizations, and user interface experiments. By providing a simplified API and an intuitive IDE, Processing makes it easy to learn and apply creative coding techniques.

Installation

  1. Install Processing 4.
  2. Clone or download this repository to your local machine.
  3. Ensure the ProcessingMockup directory structure remains intact.

Method 1: Using Processing IDE

  1. Open Processing.
  2. Select File > Open.
  3. Choose ProcessingMockup.pde from the ProcessingMockup folder.
  4. Click Run or press Ctrl/Cmd + R.

Method 2: Command Line

Use the Processing command line tool processing-java to run the program:

Windows:

"C:\Program Files\processing-4.x\processing-java" --sketch="%USERPROFILE%\path\to\repo\ProcessingMockup" --run

macOS / Linux:

processing-java --sketch="$HOME/path/to/repo/ProcessingMockup" --run

License

This project is licensed under the Mozilla Public License. See the LICENSE file for details.

Questions or Feedback?

Feel free to reach out or open an issue! Contributions and suggestions are welcome.

Sources

  1. Processing Main Website - Download, View documentation, and explore Processing.
  2. Entity Componenent System - ECS Wikipedia Overview.
  3. Boid Flocking Simulation Wikipedia - Boids Wikipedia Overview.
  4. Sebastian Lague Boid Demonstration - Inspiration for the project

About

Boid simulation with game engine structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •