Skip to content

I hope you enjoy the widgets, and do let me know if you more ideas. I'll see if I can work on them.

License

Notifications You must be signed in to change notification settings

Relicus/pyrem_bar_widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Build Time Estimator v2 for Beyond All Reason

License: GPL v2 BAR Compatible Version

A sophisticated build time estimation widget for Beyond All Reason that provides real-time, economy-aware predictions for unit construction times.

๐ŸŽฏ Features

Core Functionality

  • โฑ๏ธ Real-Time Build Time Estimates - Calculates accurate construction times based on available builders
  • ๐Ÿ’ฐ Economy-Aware Predictions - Accounts for metal/energy constraints and storage levels
  • ๐Ÿ”จ Smart Builder Detection - Automatically detects builders in range and selected units
  • ๐Ÿ—๏ธ Nano Turret Support - Includes nano turrets in build power calculations
  • ๐Ÿ‘๏ธ Spectator Mode - Fully functional in spectator mode for casting and observing

Visual Indicators

  • ๐ŸŸข Green - Economy can fully support construction
  • ๐ŸŸก Yellow - Partial economy support (60-99% efficiency)
  • ๐Ÿ”ด Red - Economy bottleneck detected
  • ๐Ÿ“Š Resource Display - Shows metal/energy consumption rates and storage levels

Interactive Features

  • Hold backtick (`) - View only idle builders
  • Hover over constructions - See completion time for units being built
  • Dynamic updates - Refreshes calculations as economy changes

๐Ÿ“ฆ Installation

Method 1: Direct Download

  1. Download build_time_estimator_v2.lua
  2. Place in your BAR widgets folder:
    • Windows: C:\Users\[YourName]\AppData\Local\Beyond All Reason\data\LuaUI\Widgets\
    • Linux: ~/.local/share/Beyond All Reason/data/LuaUI/Widgets/
    • Mac: ~/Library/Application Support/Beyond All Reason/data/LuaUI/Widgets/

Method 2: Git Clone

cd ~/.local/share/Beyond All Reason/data/LuaUI/Widgets/
git clone https://github.com/pyrem/bar-build-timer.git
cp bar-build-timer/build_time_estimator_v2.lua ./

Activation

  1. Launch Beyond All Reason
  2. Press F11 to open Widget Selector
  3. Find "โฑ๏ธ Build Time Estimator v2" and enable it
  4. (Optional) Press Ctrl+F11 to adjust widget position

๐ŸŽฎ Usage

Basic Usage

  1. Select a building to construct - The widget activates when placing buildings
  2. View time estimate - Shows above your cursor with builder count
  3. Check economy status - Color coding indicates if you can afford continuous construction

Advanced Features

Idle Builder Check

Hold the backtick key (`) to instantly filter and show only idle builders in range. This helps you:

  • Identify unused construction capacity
  • Optimize builder assignments
  • Spot idle nano turrets

Construction Monitoring

Hover over any unit under construction to see:

  • Remaining build time
  • Current build power applied
  • Resource consumption rates
  • Storage availability
  • Progress percentage

Display Information

โฑ๏ธ 45s                    <- Build time estimate
(3 builders, 2 turrets)   <- Active builders count
Usage โ€ข 125 M/s โ€ข 450 E/s <- Resource consumption
Storage โ€ข 2.5k M โ€ข 8k E   <- Available storage

๐Ÿ”ง Configuration

The widget works out-of-the-box with sensible defaults. Advanced users can modify these constants in the code:

local UPDATE_FREQUENCY = 15        -- Frames between updates (15 = 0.5s)
local HOVER_CHECK_FREQUENCY = 6    -- Hover check rate (6 = 0.2s)
local CACHE_UPDATE_FREQUENCY = 45  -- Cache refresh rate (45 = 1.5s)

๐Ÿ“Š Performance

Optimizations

  • Frame-based throttling - Updates only when necessary
  • Intelligent caching - Reduces API calls
  • Selective rendering - Only draws when active
  • Efficient calculations - Uses squared distance for range checks

Resource Usage

  • CPU: Minimal (< 1% impact)
  • Memory: ~100KB
  • FPS Impact: Negligible

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository
  2. Make your changes
  3. Test in-game with /luaui reload
  4. Submit a pull request

Code Style

  • Use local variables for performance
  • Comment complex logic
  • Follow BAR widget conventions
  • Test in both player and spectator modes

๐Ÿ› Known Issues

  • Build time may show โˆž if no builders are available
  • Estimates assume continuous resource income
  • Does not account for commander assistance bonuses

๐Ÿ“ Changelog

Version 2.0 (Sept 10 - 2025)

  • Added spectator mode support
  • Implemented economy-aware predictions
  • Added nano turret detection
  • Improved performance with caching
  • Added hover information for constructions
  • Color-coded economy indicators
  • Idle builder filtering with backtick key

Version 1.0 (Sept 7 - 2025)

  • Initial release
  • Basic build time calculation
  • Builder detection

๐Ÿ“„ License

This project is licensed under the GNU General Public License v2.0 or later - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Beyond All Reason development team
  • Spring RTS engine developers
  • BAR community for testing and feedback

๐Ÿ“ž Support

๐ŸŽฎ Other BAR Widgets

Check out my other widgets for Beyond All Reason:


Made with โค๏ธ for the Beyond All Reason community

About

I hope you enjoy the widgets, and do let me know if you more ideas. I'll see if I can work on them.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages