Skip to content

ggand0/bevy-rts-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy RTS Sim

A real-time battle simulation built with the Bevy game engine in Rust, demonstrating autonomous combat between 10,000 units with basic performance optimizations. Features objective-based gameplay with destructible uplink towers and dramatic sprite sheet explosion effects. The entire codebase was generated with Claude Sonnet 4.

Screenshot from 2025-06-05 04-36-37

Features

  • Massive Scale Combat: 10,000 autonomous units (5,000 vs 5,000) with real-time combat simulation
  • Objective-Based Gameplay: Destroy enemy uplink tower to win, tower destruction triggers cascade explosions
  • Sprite Sheet Explosions: Custom shader-based 5×5 flipbook animation system with billboard rendering
  • GPU Particle Effects: Bevy Hanabi particle system with debris, sparks, and smoke for enhanced explosions
  • Squad Formation System: 50-unit squads with tactical formations and commander promotion
  • Autonomous Combat: Units automatically target, fire, and engage enemies within range
  • Spatial Partitioning: Grid-based collision optimization reducing complexity from O(n*m) to O(k)
  • RTS Camera Controls: Smooth WASD movement, mouse rotation, and zoom controls
  • Audio: 5 random laser sound variations with performance throttling
  • Procedural Generation: Battle droids and uplink towers generated programmatically

Getting Started

Prerequisites

  • Rust (latest stable version)
  • Git LFS (Large File Storage) - for texture and audio assets
  • GPU with Vulkan support (recommended for best performance)

Installation

  1. Install Git LFS (if not already installed):
# Ubuntu/Debian
sudo apt-get install git-lfs

# macOS
brew install git-lfs

# Windows
# Download from https://git-lfs.github.com/
  1. Clone the repository:
git clone https://github.com/ggand0/bevy-rts-sim.git
cd bevy-rts-sim
git lfs pull  # Download LFS assets (explosion textures, audio)
  1. Run the simulation:

For most systems:

cargo run --release

AMD GPU Users (Linux): AMD GPUs on Linux require specific Vulkan loader settings to avoid segfaults:

VK_LOADER_DEBUG=error VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json cargo run --release

Development mode (faster compile times, lower performance):

cargo run
# Or for AMD GPU:
VK_LOADER_DEBUG=error VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json cargo run

Controls

Camera

  • WASD: Camera movement
  • Right-Click + Drag: Rotate camera view
  • Scroll Wheel: Zoom in/out

Combat

  • F: Volley fire (all units fire simultaneously)

Formations

  • G: Advance
  • H: Retreat

Debug/Testing

  • E (during gameplay): Destroy enemy tower (test cascade explosions)
  • Y: Spawn test animated sprite explosion
  • U: Spawn test custom shader explosion
  • I: Spawn test solid color explosion

Documentation

Customization

Game parameters can be modified in src/constants.rs.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published