BAR tweakdefs vs tweakunits: what modders need to know

Why your tweakdefs changes are not applying, and when tweakunits is the right tool instead.

Tags: bar modding, tweakdefs, tweakunits, lua, unitdefs, BAR modding troubleshoot

The difference matters

If you have ever pasted a block of unit stats into a tweakdefs file and watched the game ignore it, the reason is almost always a mismatch between how tweakdefs and tweakunits work under the hood. They look like they do the same thing. They do not.

tweakunits runs through a table-merge function inside unitdefs_post. It merges your changes on top of the existing unit definition, which makes it forgiving for partial edits.

tweakdefs runs as its own function. It does not append tables the same way. If you drop a table into the wrong spot or leave a subtable nil, the entire block gets silently skipped.

Common tweakdefs mistakes

Quick fix: check your format

Run a side-by-side comparison. Look at a working mod file from an established project like BAR Battle Blitz, compare its structure to what you are writing, and match the nesting level exactly. A common mistake is flattening a table one level too far or nesting it one level too deep.

If you are unsure whether to use tweakdefs or tweakunits, start with tweakunits. Its merge behavior is more forgiving and works well for stat tweaks, damage changes, and build-time adjustments. Reserve tweakdefs for cases where you need the full isolation of a standalone function.

Making a flying unit hover

A recurring question for modders is how to make a flying unit behave like a hover unit rather than a plane. The key field is hoverAttack in the unit definition. Set this to true and the unit will use hover targeting logic instead of aircraft movement rules. This lives in the standard UnitDefs that BAR inherits from the Spring RTS engine.

Debugging the silent failure

The hardest part of BAR modding is that most mistakes do not crash the game. They just do nothing. When a tweak is not taking effect, check these three items first:

Why this matters for players too

Even if you are not writing mods yourself, understanding how tweakdefs works helps when you are using community-made balance mods or custom game lobbies. If something in a mod feels off or does not match the description, a malformed tweakdef could be the culprit.

Creed of Champions and modded play

Whether playing vanilla or with custom tweaks, Creed of Champions runs balanced matches with clear communication and zero toxicity. Players who want a serious environment where mistakes are coaching moments instead of blame sessions find the right home here.

[Crd] One of the few places where you can for sure coordinate with people in matches with a good supportive attitude. Everybody tends to be understanding and constructive.