A practical guide to common BAR widget questions including the WG shared table, Lua weapon range discrepancies, and base64 encoding settings that cause subtle errors.
New BAR modders frequently ask what the WG table is because the documentation does not call it out clearly. WG is simply a shared global table available to all widgets in the luaui environment.
Any widget can read from and write to WG, which makes it the standard communication channel between widgets. The spring articles page on widget communication covers this pattern. Modders who need one widget to share state with another should use WG rather than building custom messaging systems.
The arm assimilator is a common example. The Lua weapon range in the source repository shows 475, but in game the range is 800. This is not a bug.
Units often have multiple weapon definitions, some of which are commented out in the Lua file. The game reads the actual active definition at runtime, which may differ from what a quick grep of the file suggests. The spring engine also applies unitdefs and weapondefs overrides that modify values after the raw Lua file is loaded.
When checking a unit's real weapon range, look at the in-game stats or test in skirmish. The source file alone tells an incomplete story.
BAR tweak strings use base64 encoding. Using a generic base64 encoder with default settings creates subtle errors that are hard to trace. Standard base64 includes characters that spring treats as delimiters or illegal tokens.
The fix is to select URL-safe encoding when using online base64 tools. This replaces problematic characters like plus signs and forward slashes with dash and underscore. The spring docs recommend the Base64URL format for a reason.
Modders who paste tweak strings into the lobby that fail silently should check their encoding first. A single wrong character in base64 can make the entire string unreadable without a clear error message.
New players face dozens of widgets out of the box. The best approach is to disable everything and re-add one at a time based on what the player actually needs. Essential starting widgets include the build bar, unit info, and health bars.
Extra widgets for map reading, economy tracking, and metal spot overlays can wait until the player has the basics down. Widget configuration is saved between games, so take time to tune the interface early rather than carrying clutter through dozens of matches.
BAR modding builds on the spring engine, and spring rewards patience. Read the shared docs on widget communication, test weapon values in skirmish, use URL-safe base64, and trim the widget list to what matters. The rest follows.
"Crd is the first really comfortable community I have been a part of. Everyone is nice and kind, the atmosphere is relaxed, and I am not getting yelled at for not being optimal."
Creed of Champions member