Skip to content

ghovax/GraphicsEngine

Repository files navigation

GEServer

A Flask-based entity-component system server for managing 3D game entities with real-time rendering.

Features

  • Entity-Component System: Built on the esper ECS library
  • REST API: Create, update, and remove entities via HTTP endpoints
  • WebSocket Support: Real-time communication using Flask-SocketIO
  • 3D Rendering: Vispy-based rendering with GLFW backend
  • Component Types:
    • Transform: Position and scale
    • Script: Custom Python scripts attached to entities
    • Renderer: 3D mesh rendering from .obj files

Installation

This project uses uv for dependency management:

uv sync

Usage

Start the server:

python -m server.main

The server runs on http://localhost:5001.

Example: Create a Cube Entity

make cube

This will:

  1. Create a cube entity
  2. Attach a custom script component
  3. Load a 3D mesh renderer
  4. Remove the entity after 5 seconds

API Endpoints

  • POST /create_entity - Create a new entity
  • POST /add_component_to_entity - Add components to an entity
  • DELETE /remove_entity - Remove an entity

Project Structure

server/
├── main.py              # Server entry point
├── api.py               # REST API endpoints
├── configuration.py     # Server configuration
└── entity_components.py # Component definitions

custom_scripts/          # User-defined entity scripts
assets/                  # 3D models and resources

Requirements

  • Python >= 3.13
  • See pyproject.toml for full dependency list

About

Real-time entity-component system (ECS) managed via a Flask-based REST API. Integrates a Pyglet event loop for synchronized state management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors