Skip to content

the-void-fox/TextEngien-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Text-Engine: TUI Game Engine powered by Rust + Python

Welcome to Text-Engine โ€” an ambitious project to create a powerful and flexible game engine for building Text User Interface (TUI) games. The engine is designed with a modular architecture, combining the performance of Rust with the simplicity of Python for game scripting.

๐ŸŒŸ Key Features

  • Rust Core: The engine's core is built in Rust, ensuring high performance, memory safety, and reliability. This solid foundation handles all the heavy lifting โ€” from rendering to event management.
  • Python Scripting: Game logic is written in Python, offering a simple and intuitive development experience. We've created a custom Rust-based library that bridges the gap between the Rust core and your Python code.
  • TUI-Focused: Our primary goal is to provide a first-class experience for creating TUI games. We're building a rich set of tools and components specifically designed for text-based interfaces.
  • egui Interface: The engine uses the powerful and easy-to-use egui library for its own interface, providing a modern environment for managing projects and debugging.
  • Flexible Mod System: At the heart of our design is an incredibly flexible mod system, allowing developers to easily extend the engine's functionality.

๐Ÿ—๏ธ Current Architecture

Modular System

Python Bridge

  • โœ… Mod API (python_bridge/api.rs) โ€” Python API for engine interaction
  • โœ… Function Registration โ€” system for registering Python functions callable from Rust
  • โœ… Tab and Menu System โ€” create UI elements from Python code
  • โœ… Console Output โ€” print_to_console() function for debugging

UI Components

  • โœ… Main Application Window (app/app.rs)
  • โœ… Tab System โ€” support for multiple tabs with dropdown menus
  • โœ… Output Console โ€” built-in console for logs
  • โณ Text Editor (in development)

๐Ÿš€ Quick Start

Requirements

  • Rust 2024 edition (or newer)
  • Python 3.x
  • Cargo

Installation and Running

# Clone the repository
git clone https://github.com/yourusername/TextEngien-Rust.git
cd TextEngien-Rust/text_engine

# Build and run the project
cargo run

๐Ÿ“ Project Structure

TextEngien-Rust/
โ”œโ”€โ”€ text_engine/              # Main Rust project
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ main.rs          # Application entry point
โ”‚   โ”‚   โ”œโ”€โ”€ mod_system/      # Mod loading system
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ loader.rs    # Mod loader
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dependencies.rs  # Dependency resolution
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ manifest.rs  # Manifest parsing
โ”‚   โ”‚   โ”œโ”€โ”€ python_bridge/   # Python integration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api.rs       # Python API
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ execution.rs # Python code execution
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ registry.rs  # Function registry
โ”‚   โ”‚   โ”œโ”€โ”€ app/             # Application and UI
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app.rs       # Main application
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ state.rs     # Application state
โ”‚   โ”‚   โ””โ”€โ”€ ui/              # UI components
โ”‚   โ”œโ”€โ”€ mods/                # Mods directory
โ”‚   โ”‚   โ””โ”€โ”€ Core/            # Base mod
โ”‚   โ”‚       โ”œโ”€โ”€ manifest.toml  # Mod configuration
โ”‚   โ”‚       โ””โ”€โ”€ main.py      # Mod code in Python
โ”‚   โ””โ”€โ”€ Cargo.toml           # Project dependencies

๐Ÿ”Œ Creating Mods

Mod Structure

Each mod consists of:

  1. manifest.toml โ€” configuration file
  2. main.py โ€” main Python script

Example manifest.toml

[mod_info]
id = "my_mod"
name = "My Awesome Mod"
version = "0.1.0"
authors = ["Your Name"]
main = "main.py"
load_order = 100

[dependencies]
# id = "version"
# core = "0.1.0"

Example main.py

import text_engien

def my_function():
    text_engien.print_to_console("Hello from my mod!")

def run():
    # Register functions
    text_engien.register_function("my_func", my_function)
    
    # Create a tab
    text_engien.register_tab("my_tab", "My Tab", "๐ŸŽฎ")
    
    # Add dropdown menu
    text_engien.add_dropdown_menu("my_tab", "Actions", "โšก")
    
    # Add menu items
    text_engien.add_menu_item("my_tab", "Actions", "Do Something", "my_func", "โœจ")

๐Ÿ“š Python API

Available Functions

๐Ÿ› ๏ธ Technology Stack

  • Rust โ€” systems programming
  • PyO3 โ€” Python โ†” Rust integration
  • egui โ€” graphical interface
  • eframe โ€” application framework
  • Legion โ€” Entity Component System (ECS)
  • TOML โ€” configuration files
  • Serde โ€” serialization/deserialization

๐Ÿ“Š Current Status

โœ… Implemented

  • Basic mod loading system
  • Dependency resolution between mods
  • Python API for creating UI elements
  • Tab and menu system
  • Output console
  • Core mod with usage examples

๐Ÿšง In Development

  • Text/code editor
  • Save/load system
  • Advanced UI components
  • API documentation
  • Plugin system

๐Ÿ“‹ Planned

  • Full-featured TUI rendering system
  • Event system
  • Audio subsystem
  • Networking capabilities
  • Export to executable files

๐Ÿ™ Call for Help

You've made it this far, which means you see the potential of this project. But let's be honest โ€” right now, it's still very raw. There's a mountain of work to be done, and I can't do it alone.

If you have any experience with Rust, Python, game development, or just a passion for TUI games โ€” I personally ask you to consider helping. Whether it's writing code, fixing bugs, improving documentation, or just sharing ideas โ€” every bit of help makes a world of difference.

This project is a labor of love, and with your support, we can turn this dream into reality. Please, help me make this engine something special.

๐Ÿค How to Help

  1. โญ Star the project on GitHub
  2. ๐Ÿ› Report bugs via Issues
  3. ๐Ÿ’ก Suggest new features
  4. ๐Ÿ”ง Submit Pull Requests
  5. ๐Ÿ“– Improve documentation
  6. ๐ŸŽฎ Create mods and share them

๐Ÿ“„ License

This project is in active development. License information will be added later.


Thank you for your time and attention. I hope to see you in the list of contributors! โค๏ธ

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Contributors

Languages