Shared Turns (BG3 mod)
made-for-public-consumption mod to help speed up large party fights in the game baldurs gate 3
Baldur's Gate 3 · Osiris mod design
Making the whole party share one turn
A design for cutting multiplayer downtime: every player-controlled character acts in a single shared turn, while initiative still decides where that turn lands.
What we're building
In multiplayer, most of a fight is spent watching. Each player's characters take separate turns, so a four-player table waits through three other people before acting. The goal is one shared party turn — everyone moves at once — without flattening initiative into a formality.
- Every player-controlled character shares one turn. Green portrait border is the test, so companions and summons count.
- Initiative still matters. Enemies can act before or after the party, and Dexterity, feats and randomness all influence which.
- Installable through the in-game mod manager.
Two constraints that shape everything
Constraint 1
Script Extender is off the table
Requirement three means shipping through mod.io, and mod.io only accepts mods built with the official Toolkit. Script Extender mods cannot be published there. That rules out writing CombatParticipant.InitiativeRoll directly, which would otherwise be the obvious solution — and it means most combat mods on Nexus can't serve as reference implementations either. What's left is Osiris scripting plus stats data, both of which publish fine.
Constraint 2
Osiris cannot read initiative
The entire Osiris API is declared in a 1,338-line header. Searching it for "initiative" returns exactly one line, and it's an event rather than a query:
event ShareInitiative((GUIDSTRING)_Object)
No getter, no setter, no current-value query. Nothing can ask what a character's initiative is, compare two characters, or read what bonus an item grants. Every design decision below follows from this: the mod cannot react to initiative, so it has to determine it.
The mechanic we ride on
BG3 already merges characters into shared turns. It has a tutorial popup for it and an Osiris event named ShareInitiative. The trigger is adjacency in the turn order — same-side characters with no enemy between them act simultaneously. Their initiative values need not match.
"Party members next to each other in the Initiative Order can act simultaneously. You can switch between them freely, and take their actions in any order."
"…party members may end up acting directly before or after each other. In this case, the characters' actions, bonus actions, and movement may be taken in any order you wish. This is also true for multiplayer characters."
Localization/English/english.loca — the in-game "Shared Initiative" tutorial
This is the whole basis of the design, and it's a generous rule. We never construct a shared turn; we guarantee the condition that produces one. Note the explicit cross-player line — this is not a same-player-only convenience, which is exactly what a multiplayer mod needs.
Worth knowing: initiative in BG3 is d4 + Dex modifier + bonuses, not d20. The numbers involved are small, which is why shared turns already happen by accident in vanilla, and why modest offsets dominate ordering so cleanly.
The design: initiative tiers
Every combatant receives a boost of 1000 × S, where S is a speed score computed in Osiris. Because natural initiative never approaches 500, the S term dominates the ordering completely — the engine's own roll only breaks ties within a tier.
// once per combat, then frozen for its duration
S_party = IntegerDivide(sum of party initiative mods, party size) + 2
boost = 1000 * S_party + 500
// per enemy, as it enters combat
S_enemy = enemy initiative mod + Random(4) + 1
boost = 1000 * S_enemy
No enemy can land between two party members. This is arithmetic, not luck.
Party members occupy [1000·S_p + 500, 1000·S_p + 525]. An enemy occupies [1000·S_e, 1000·S_e + 25]. For any integer scores those windows cannot overlap — so the party is always contiguous, the shared turn always fires, and the party's own internal spread stops mattering entirely.
Confirmed in play. The party held together across every combat tested and enemies landed both ahead of and behind them — including when players joined a fight late, which was the one clamping risk the late-join rules suggested might split the block. Requirements 1 and 2 are demonstrated, not assumed.
One case does not hold, and it is not fixable: a summon conjured mid-combat acts outside the block for that fight. See below.
Osiris can build the passive name at runtime. ConcatenateInteger("SIMTURNS_TIER_", S, out) means one rule applies any score, rather than a rule per value or a binary-decomposition trick. Generate flat SIMTURNS_TIER_0…31 entries and let the score pick one — the applied passive name then is the score, which is the best debugging property available in a language with no text output.
Give every tier passive an AC(N) equal to its score while testing. There is no way to print a number in retail, but AC is visible on the character sheet, so the AC bonus reads out as the character's exact score. It makes the whole computation checkable in game. Strip it before shipping.
There is no comparison step. Nothing in the script ever weighs an enemy against the party; you never need both numbers in scope. Each combatant is scored and boosted independently as it enters combat, and the ordering falls out of the arithmetic:
S_enemy > S_party → enemy acts before the party
S_enemy = S_party → enemy acts after (the +500 gives the party ties)
S_enemy < S_party → enemy acts after
S must be a whole number, and the +500 must stay outside it. Folding the offset in as a fractional +0.5 holds only while the party average divides evenly; any other fraction slides the party band into a neighbouring enemy tier, and the failure is composition-dependent — recruit a companion and it breaks, swap them out and it heals. Compute the average with IntegerDivide, which truncates, then multiply, then add the offset as a constant in the boost expression.
Why 1000 rather than 100. Natural initiative is bounded, but not as tightly as it looks: Dex +5, Alert +5, Rakish Audacity +4, Sentinel Shield +3, Bhaalist Armour +2 and a d4 already reach 23. A 100-wide tier leaves only 25 points of headroom either side of the offset, and a single modded item pushes past it and breaks the guarantee silently. Wider tiers cost nothing.
Keep S non-negative — a Dex 1 character scores below zero, so add a constant +10 to every score. Whether Initiative() accepts negative values is untested and not worth finding out.
Why the party is deterministic and enemies roll
The party's score takes a fixed +2 where enemies roll Random(4)+1. That asymmetry is deliberate.
A single die roll for the party applies to the entire block at once, so it swings all-or-nothing: roll a 4 and the party beats nearly everything, roll a 1 and it loses to nearly everything. The fight is decided before anyone acts. Rolling per party member and averaging is worse still — averaging four d4s halves the standard deviation, so the randomness costs you variance without buying texture.
Leaving the dice entirely on the enemy side gives a better distribution. Each enemy independently lands above or below the party, so a typical encounter has some acting first and some after, and the party's position reflects its build rather than one coin flip.
The balance lands where you'd want it: against an enemy with a matching modifier, the enemy needs to roll 3 or 4 to act first — exactly 50% — and the +500 hands the party the tie at a roll of 2. The half-point the party gives up by taking +2 instead of the d4's 2.5 mean is repaid by winning those ties.
What feeds the score
"Initiative modifier" means Dexterity plus a short whitelist of large bonuses. The same routine runs for every combatant regardless of side.
| Source | How to read it | Cost | Model it? |
|---|---|---|---|
| Dexterity | GetAbility(char,"Dexterity") |
1 query | Yes |
| Feats & features Alert +5, Feral Instinct +3, Dread Ambusher +3, Rakish Audacity +2–4 |
HasPassive(char, id) |
4 queries | Yes |
| Consumables Elixir of Vigilance +5 |
HasActiveStatus(char, id) |
1 query | Yes |
| Gear Sentinel Shield, Bhaalist Armour, Elven Chain, the generic +1/+2 items… |
HasPassive — items grant passives |
9 queries | Yes |
| Elixir of Vigilance the one source that is not a passive |
HasActiveStatus(char,"ALCH_ELIXIR_ALERTNESS") |
1 query | Yes |
Six queries per combatant covers every source of +3 or more in the game.
This whitelist is complete, not a sample. Every initiative source in the game resolves to one of twelve passives plus one status. No item grants Initiative directly — they all route through a passive, and the generic MAG_InitiativeBonus_1/2_Passive are shared across many items, which is why the wiki's twenty-odd sources collapse to twelve. Statuses that grant Passives "Alert" — the Honour-mode enemy buffs — are covered for free, since they hand over the real passive. Only the Elixir of Vigilance sets Initiative on a status directly, and it is checked explicitly.
Four scripted statuses in Act 2 and 3 also carry initiative (+30, +5, −15, −20) and are deliberately ignored: against a 500 offset inside 1000-wide tiers none of them can cross a band, so they cost a little fidelity in three encounters and nothing in correctness.
Unmodelled bonuses are demoted, not discarded. The score picks only the tier; the engine still adds every real bonus — Dex, feats, gear, elixirs, all correctly computed — on top of the boost. So an unmodelled +2 amulet still orders characters within a tier. It simply can't move anyone between tiers. That turns a brittle completeness problem into a cheap question: what deserves the power to jump a tier?
Score both sides identically. Whatever is modelled must be modelled the same way for party and enemies. Counting a party member's amulet while ignoring enemy gear doesn't make the simulation more accurate — it hands the party a standing advantage, fight after fight. An incomplete model applied evenly produces fair ordering from coarse inputs; applied unevenly it produces a mod where the party mysteriously always goes first.
On gear. There's no query that asks an item what boost it grants — only its stat name, compared against a table you maintain by hand. That's nineteen equipment lookups per combatant, roughly 190 per ten-enemy fight, backed by a list that goes stale on patches and is wrong for every modded item. In exchange it models +1 to +3 on gear enemies rarely carry, bonuses that already work within-tier. Ship without it; add it later if ordering feels wrong in play.
This also degrades gracefully, which matters more than completeness. Another mod's initiative item will never appear in the whitelist — under this design it still works, just confined to within-tier ordering.
Scoring the party
Compute once, then freeze for the whole fight
Store S_party in a DB keyed by the combat GUID when the first player character enters, and reuse it for everyone after. Never recompute mid-combat, even when the party changes — characters already boosted keep the old value, so the party splits into two bands and the shared turn quietly stops working. Anyone arriving late inherits the frozen score. A useful consequence: summons conjured during a fight don't drag the average down; only those present at the start do.
Average the whole party, not just who showed up
When one player wanders off and starts a fight alone, the band still comes from every party member. Both options are approximations, so accuracy doesn't decide it — exploit-resistance does. Scoring from characters present creates a degenerate opening: send your highest-Dex character in alone to set a high band, then walk everyone else in to inherit it. Free top-of-order, every encounter. Averaging the whole party removes the incentive entirely, because the band no longer depends on who is standing there when initiative rolls.
Two cases to handle explicitly
A fight with no player characters — two NPC factions brawling — should score the enemies and skip the party band rather than banding nobody. And a player character joining a fight already in progress takes the frozen band, never a fresh computation.
No character ever changes sides mid-fight
Classification runs once, when an entity enters combat, and is never revisited. There's no domination edge case to handle.
Applying the boost
Use a passive. Not a status, and definitely not AddBoosts
All three were tested in game, and only one carries initiative. No status in the game grants Initiative — zero occurrences across all 354KB of Status_BOOST.txt — and a custom status carrying it had no effect over two fights. Exactly one passive grants it: Alert, via Boosts "Initiative(5);StatusImmunity(SURPRISED)". A custom passive modelled on Alert works. Statuses remain the right tool for most things; initiative is not one of them.
AddBoosts is a silent no-op
Worse than undocumented — it fails without erroring. Called side by side with AddPassive in one rule, each granting a differently-sized AC boost as a marker, the passive's AC appeared and AddBoosts' did not. Nothing is logged. Any design built on it will look like a logic bug forever.
Passives don't stack, which removes a whole class of bug
A passive is present or absent, so re-applying is a no-op and there is no StackId to manage, no silent accumulation, and no "works once then initiative is garbage" failure. HasPassive reads state, RemovePassive clears it. This is simpler than the status route it replaces.
AddPassive takes a name, not a number
Boost magnitudes live in stats entries, so 1000 × S can't be passed as a variable. You need one passive per possible score. With the +10 floor the range is roughly 0–25, so generate ~26 entries (SIMTURNS_TIER_00 … _25) plus one party-offset passive. Flat entries beat a binary-decomposition trick: when something misbehaves you can read the applied passive name and know the exact score.
Custom stats load, but the editor indexes them at project open
A stats file created on disk while the Toolkit is running is invisible to it — "reload stats files" only refreshes what it already knows about. Restart the Toolkit after adding a new stats file. A passive that silently does nothing is far more likely to be an unindexed file than a bad entry.
Finding characters before combat
There is no enumerable database of NPCs, and EnteredCombat is too late. Use IterateCharactersAround(host, radius, "EventName", "DoneEvent") on the sweep — its per-character callback arrives as the built-in EntityEvent((CHARACTER)_Char, "EventName"), so no custom event declaration is needed. Pair it with EnteredLevel, which is Larian's own hook for combat-NPC setup and catches spawns, including cutscene and mid-fight arrivals.
Classify on IsPartyMember, never on DB_Players
DB_Players excludes summons, so using it to identify enemies scores a familiar as hostile — its own Dex, its own die, its own tier, split away from the party and breaking the one feature the mod exists for. IsPartyMember(_Char, 1, 1) covers the whole green-border set including summons; the same query with a 0 result identifies genuine enemies. DB_Players is still the right thing to enumerate over, just not to classify with.
Beware rules that share a trigger and a dependency
A rule that computes a value into a DB and a rule that reads that DB must not fire on the same event. The reader evaluates before the row exists and silently does nothing until the next tick — which, on a ten-second sweep, looks exactly like "the mod works from the second fight onward". Trigger the reader off the DB insertion instead.
Surviving save, load and area changes
Statuses live on the entity and survive save/load; duration -1 is permanent. The risk is the opposite of loss — a permanent status outliving its fight. Clear on CombatEnded, and re-assert party membership on level load so newly recruited characters aren't missed.
Settled: boosts must be applied outside combat
Tested in game. Applying at EnteredCombat is too late; applying beforehand works.
A passive granting Initiative(1000) applied on combat entry left turn order completely unchanged, across two fights. The same passive applied before combat moved the whole party to the top of the order by the full amount. There is no per-combat architecture to build — the persistent one is the design.
Initiative is rolled once as a combatant joins, and EnteredCombat fires after that roll resolves. Every character must therefore walk into a fight already carrying its score.
A trap this exposed: a companion boost on the same passive — the test used AC(10) — is not a valid proxy for "the passive was on before the roll". AC is continuous and re-read whenever the sheet is drawn, so it appears the moment the passive lands, even mid-fight. Initiative is sampled once, at the roll. In the test AC read +10 in a fight the party did not lead, which looks contradictory until you notice the two values are read at different times. Judge timing by turn order alone.
Scores can go stale while the world moves. Every hook needed to invalidate them exists, and none is a timer:
| What goes stale | Hook | Header line |
|---|---|---|
| Party composition changes | CharacterJoinedParty / CharacterLeftParty | 361–362 |
| Dex or a feat changes on level-up | LeveledUp(_Character) | 306 |
| Initiative gear swapped | Equipped / Unequipped | 516–517 |
| NPCs in a region that wasn't loaded yet | EnteredLevel(_Object, _Root, _Level) | 1107 |
That last row matters more than it looks. Scoring enemies at CombatEnded only reaches characters that already exist — fast-travel to another region and its NPCs were never touched, so they'd enter their first fight unscored and drop into tier zero beneath everyone. EnteredLevel fires per object as a level streams in, which is precisely when to score an NPC. It also removes any need to sweep a radius around the party: every character is caught once, on arrival.
Re-roll enemy scores on CombatEnded too, so repeat encounters with surviving NPCs don't replay an identical order.
The one thing that cannot be fixed
A summon conjured during a fight acts outside the party block for that fight. Everything else — the four party members, pre-combat summons, enemies — is unaffected, and the summon rejoins the block from the next combat onward.
This is worth documenting rather than retrying, because the obvious fixes were built and tested:
- Score it earlier.
EnteredLevelis the first event that exists for a spawning entity, and it is already too late — initiative is fixed when the creature is created, before Osiris is told anything. - Force a re-roll. Apply the tier, then
LeaveCombatandEnterCombat. This runs correctly: the summon leaves the turn order, rejoins, and carries the right tier — its AC confirms the passive is live. The engine still places it last on its original roll. BG3 reuses the stored initiative rather than recalculating it.
There is no earlier hook and no way to make the engine recompute, so the ceiling here is the engine's, not the design's. The re-roll attempt also has a visible cost — the summon disappears from the tracker and pops back mid-fight — so it was removed rather than left in as a partial measure.
One related trap worth keeping: a Spiritual Weapon is made a player but never becomes a party member, and its CharacterGetOwner stays undefined. Classify summons on CharacterMadePlayer, never on IsPartyMember or ownership.
A side effect to decide on
Coarse tiers cluster enemies as well as the party. Several enemies sharing a score land adjacent with no party member between them, so by the same adjacency rule they merge into shared enemy turns.
For a mod about cutting time spent waiting that's arguably a second win — enemy turns collapse too. But it changes combat feel and it wasn't in the brief. Suppressing it means giving enemy scores finer granularity so ties are rarer, not shrinking the multiplier, which would only erode headroom. Score in tenths — an enemy at 4.3 becomes 43 — and keep the multiplier well clear of the largest natural roll.
Experiments, in order
Ordered so the cheapest falsification of the riskiest assumption comes first.
Does a boost applied at— answeredEnteredCombataffect that same combat?No. It lands too late; the same passive applied beforehand works. Build the persistent architecture. This also established that initiative comes from a passive, not a status, and that
AddBoostsis a silent no-op.Which pre-combat trigger fires early and reliably enough?
LeftCombatis proven — the party led the fight after it.EnteredLevelis not yet trusted: in the first fight after a load the passive was present on the sheet but the party did not lead, consistent with it landing after the roll. Establish a trigger that covers a character's first fight in a session, or the mod does nothing until a fight has already been survived.Does the tier construction hold with a real party?
Four characters with deliberately spread Dex against mixed enemies. Confirm one merged party turn, and that no enemy portrait ever appears inside the party block.
Do summons inherit the frozen band?
Conjure a familiar mid-combat and check it joins the shared turn rather than acting alone. Summons enter after initiative is established, exercising the late-join path the rules treat differently — and green borders include them.
Does an Alert enemy actually jump the tier?
The whitelist's only real test. Give an enemy Alert against a low-Dex party and confirm it lands above the party block often enough that initiative still feels live.
Two clients, one fight.
Osiris runs server-side only, so behaviour should be identical — verify rather than assume, and confirm both players can genuinely act at once rather than merely sharing a slot in the tracker.
A debugging lever worth knowing. Data.txt line 627 reads key "InitiativeDie","4" — the die is moddable data. A local stats override setting it to 1 removes roll variance globally and makes initiative fully reproducible, which turns "chase a d4 across restarts" into a deterministic test. Don't ship it: it deletes randomness for everyone and overriding a global stats key invites mod conflicts.
Primary sources — where each claim came from
Read off the local install rather than secondary documentation, so line numbers refer to files on this machine.
- Osiris API surface —
Data/Mods/Shared/Story/RawFiles/story_header.div, 1,338 lines. Sole initiative reference at 1171.ApplyStatus823,RemoveStatus824,HasActiveStatus828,AddBoosts1045,GetAbility153,Random96,IntegerDivide83,HasPassive838,IsPlayer249,IsPartyMember184,IsSummon881,CharacterGetOwner201,EnteredCombat1161,CombatEnded1166. - Gear readable only by identity —
GetEquippedItem207,GetStatString631. No query returns an item's boosts, which is why any gear table has to be hand-maintained. - Adjacency rule —
Localization/English.pak → english.loca, extracted with LSLib Divine; the "Shared Initiative" tutorial strings. - Initiative die is data —
Shared.pak → Public/Shared/Stats/Generated/Data/Data.txt:627. - Boost syntax —
Passive.txt, Alert:Boosts "Initiative(5);StatusImmunity(SURPRISED)". Status pattern fromStatus_BOOST.txt:1900(BLESS), includingStackId. - Flat-additive only —
bin/bg3.exeexportseoc::InitiativeBoostComponentas its own component; initiative is not aRollBonusorMinimumRollResulttarget, so no "set" or "floor" semantics exist. - Call frequency in shipped scripts — across Shared, SharedDev, Gustav, GustavDev, GustavX:
ApplyStatus1036,AddPassive17,AddBoosts0.
External: bg3.wiki — Initiative (source of the bonus-item list) · Larian docs — Publishing a Mod · mod.io — Publishing a Mod · BG3 Script Extender
Confidence: the Osiris API limits, call-frequency counts, and the absence of any boost-reading query are certain — read directly from the install. The adjacency rule is confirmed both by Larian's tutorial copy and in play. The tier construction is arithmetically sound but has not yet been observed running, and boost timing remains untested — it is the one thing most likely to cost a debugging session.