The Sharing Tab#5704
Conversation
42072dd to
6eca7f7
Compare
6c721e6 to
1069815
Compare
|
I'm going to move this one back to draft because in a downstream branch I moved all of this to lua and simplified some things to make testing sharing_modes easier. Will backport isolated bits of that PR if it fails to merge. That approach has some downsides (like a lack of a schema validation in the CI), but those are compensated for with types and specs. |
1069815 to
78f64cf
Compare
78f64cf to
ef0b26f
Compare
8400bc2 to
f3fbabc
Compare
1f8f474 to
819511a
Compare
Test Results20 tests +4 10 ✅ +3 17s ⏱️ +14s For more details on these failures, see this check. Results for commit ce774d4. ± Comparison against base commit cf64f44. ♻️ This comment has been updated with latest results. |
c819af1 to
a29702b
Compare
273e15a to
461310e
Compare
Integration Test Results18 tests +4 9 ✅ +3 20s ⏱️ +17s For more details on these failures, see this check. Results for commit 53d8685. ± Comparison against base commit 7403bb8. ♻️ This comment has been updated with latest results. |
|
Taking is not supported, regardless of whether sharing is enabled or not. |
|
@Jinxer128 should be sorted. Tried an ambitious refactor and it didn't work out. Went back to the known-working solution. |
|
bugs ☑️ ts fixed good jqob 👍 |
|
To test SPADS locally, from BAR-Devtools, check out the fix_wsl branch and run: just chobby::dev-mode on
just chobby::server local
just spads::export-modes
just services::up
just bar::launch
# get a regular user to login with the default password to join the lobby so votes trigger
just tei::add-user bob
just tei::join-battle bobThe repos.local.conf to test this from BAR-Devtools: |
Related work
!modecommands in battle chat teiserver#1280📚 Stacked split— review bottom-up
Each PR merges into the one below it; together they reproduce the
sharing_tabbranch (bar one intentional change —index.lualazy-loads the mode helpers).The idea
The engine stops being the economy authority and becomes the economy data plane for team redistribution. It keeps measuring (income, pull, expense, per-frame excess) and exposes that state through an API. A registered synced-Lua controller pulls a snapshot on its own cadence, runs redistribution, and writes back its own economy stats directly. Unit transfers, team giveaways (
GiveEverythingTo), and/takeare replaced by game-side gadgets; native overflow sharing is the one piece behind a flag —nativeExcessSharing = falsehands it to the Lua controller.On top of that boundary, sharing is configured by modes — named presets that set, lock, and hide the individual modoptions. The lobby (Chobby) presents them; the game enforces them. Each modoption stays cardinal (one knob, one behavior) so modes compose them freely.
Modes
Enabled (default) — all sharing on, no tax. Today's game, unchanged.

Disabled — no unit or resource sharing

Easy Tax — anti-co-op preset. Taxes resource sharing, assist, and resurrection; gifted eco buildings are stunned and mobile constructors build-delayed, so you can't dodge the tax by handing over production.

/takeruns on a stun delay.Tech Core — tech levels gate what you can build; you raise your level by constructing Keystone buildings. Unit sharing and resource tax both scale with tier (e.g. constructors become shareable at T2; tax eases as you climb).

/takeruns on a 60s delay for Resource buildings (the Take Delay Category in the screenshot below).Customize — every knob editable; roll your own policy.
Note: This is the one mode that preserves the previous mode's values when switching to it, so you can switch from tech core to customize and customize will behave exactly like tech core.
For players and mode developers, Customize provides a lot of benefits for this design:
Other changes
/takemoved into the game (was engine-native), which is what enables the delay/category take modes above.Demos
LLM usage
Tons of AI usage, but this started on much earlier models so I really had to beat it into shape and the code is clearly my style of decompositional functional programming, and that doesn't happen accidentally.