Skip to content

Tesla Revamp - #437

Open
rebaserHEAD wants to merge 14 commits into
Triad-Sector:mainfrom
rebaserHEAD:feat/tesla-wild-economy
Open

Tesla Revamp#437
rebaserHEAD wants to merge 14 commits into
Triad-Sector:mainfrom
rebaserHEAD:feat/tesla-wild-economy

Conversation

@rebaserHEAD

Copy link
Copy Markdown
Collaborator

About the PR

It's time for the Tesla to be good instead of bad.

The ball now has a real energy budget, coils are single-strike capacitors that lightning routes between by charge, and the whole engine scales with how hard you feed it and how many towers you build.

Why / Balance

The tesla was flat: the ball was immortal once spawned, coils filled on one strike into an undersized bank, the strike table ignored charge state, and durability was tuned for rounds a fraction of our length. There was no reason to push the PA and no reason to buy coils.

Every number in this PR is backed by a Monte Carlo sim of the strike economy (bolt cadences, routing rolls, drain cycles, ball wander vs the PA lanes). The resulting ladder: the ball starves without a running PA (this also makes a tesloose self-resolving in a few minutes, which matters on a server with no obtainable particle decelerators), idles at low power, and sheds miniature ball lightning as feed rises. Coils fill from a single strike, arc visibly while charged, trickle out at 500 kW, and lightning prefers whichever coil has the most headroom, so strikes round-robin the array. Output grows with tower count to a peak at 24 towers (~7 MW fully driven); towers past that only spread wear. First tower death lands ~2h on a max array, so a hard-driven engine needs a weld rotation or spare coils. Bolts that overflow the coils and rods now genuinely electrocute crew (insuls apply, and the arc can chain onward once).

New upstreamable hook: LightningStrikeAttemptEvent, raised per candidate before a volley is sorted and rolled so targets can bid from live state. Targets without a subscriber behave exactly as before.

Also: the Edison bulk crate holds 12 flatpacks and gains a cargo listing (Frontier had abstracted the only coil product, so nothing sold coils at all), Edison map stock trims to one bulk crate, and the Tesla Engine guidebook is rewritten for the new mechanics.

Media

image

Requirements

  • I have read relevant guidelines/documentation to this PR found on our devwiki.
  • I have added media to this PR or it does not require an ingame showcase.
  • I can confirm this PR contains either no AI-generated content, or AI-generated content that meets our guidelines.

How to test

Build a standard tesla setup (3x3 field cage, coil ring, rods) and run the PA through its power levels. At standby the ball collapses in about a minute; at Level 1 it idles; higher levels shed motes and output climbs. Strike a coil and watch it arc until drained; let the SMES bank fill and the whole array should sit arcing with bolts spilling to the rods. Stand next to it without insuls at your own risk.

I have not verified the arc indicator visuals in-game yet, that's the one piece the sim can't cover.

Breaking changes

None. New DataFields are all additive with inert defaults (PassiveEnergyDecay, ElectrocuteOnStrike, coil bid fields); TeslaCoilVisuals gains a Charged member. Note the electrocution path fires for every ShootRandomLightnings source, including the electrical anomaly.

Changelog
🆑

  • tweak: The tesla ball now starves without a running particle accelerator, and sheds miniature ball lightning when fed hard. A loose tesla burns itself out in minutes.
  • tweak: Tesla coils are now single-strike capacitors: lightning favors empty coils, charged coils arc visibly while discharging, and total output scales with how many towers you build.
  • tweak: Tesla coils wear out under sustained load. Weld them on a service rotation or stock spares.
  • tweak: Lightning strikes now electrocute crew and mobs. Wear insulated gloves around the engine.
  • add: Bulk tesla coil crates (a dozen flatpacks) can be bought from the cargo console.
  • tweak: Rewrote the Tesla Engine guidebook entry.

The ball bleeds 10 energy/s, pinned to the Level-1 PA feed rate
(3 emitters * 20 energy / 6s wave), so Level 1 is exactly break-even:
alive, no motes. Standby/Level 0 starves it into collapse, Level 2+
nets positive. Despawn floor deepened to -600 (~60s starvation grace)
because feed lands in 6-second lumps and the stock -100 floor would
kill the ball after barely two missed waves.

Decay defaults to 0 on the component so other users are unaffected;
the tesla prototype opts in.
With decay in place the threshold mechanism already scales mote output
with net feed: spawn rate = net feed / needEnergyToSpawn, and motes
live 120s. Threshold 120 lands the ladder at Level 1 = 0 motes,
Level 2 = 5, Level 3 = 20 sustained.
New LightningStrikeAttemptEvent raised on each candidate before a
volley is sorted and rolled, letting targets adjust their effective
priority and hit chance from live state. Targets with no subscriber
keep their static values.

Tesla coils subscribe: an empty coil is a guaranteed catch with a
priority bump above every charged coil, and chance scales down with
charge to a 0.05 floor when full, so overflow falls through to the
grounding rods. At half charge the effective chance is ~0.52, close
to the old static 0.5.
New TeslaCoilVisuals.Charged appearance key driven off
ChargeChangedEvent: while the battery cannot bank a full strike the
coil shows the existing arc sprite on its own layer, so the 4-second
strike flash cannot clobber it. Clears on its own as the coil pushes
charge into the grid.
A strike now banks maxCharge/6 (500k into a 3M bank) instead of 2M
into a 1M bank, so the charge-headroom routing has a real gradient
and the saturation indicator means something. Coil supply cap is
unchanged at 1MW.

Strike damage drops 1 -> 0.05: ~4500 strikes to destruction, about
7 hours per coil at a moderate PA level under the mote-heavy strike
economy. Service intervals stretch by welding or adding coils.
Mobs have been on the strike table (priority 1) since the Mono port
but took zero damage: the strike applies Structural, which no-ops on
Biological damage containers. LightningTarget gains an opt-in
electrocution path (15 shock, 5s, insulated gloves apply) enabled on
the mob base, so bolts that overflow the coils and rods now zap
whoever they land on. Mob lightningResistance stays 1, so a bolt can
arc once more onward from the victim.

Note this applies to every ShootRandomLightnings source, including
the electrical anomaly, not just the tesla.
Simulating the ball wander in a 3-wide cage showed the far side PA
lane misses about a third of waves, so effective Level-1 feed is
~7.3/s, not the ideal 10/s. Decay 10 starved the Level-1 ball dead;
7 idles it as designed. Mote threshold 120 -> 80 lands the target
ladder at the effective feed: ~6 motes at Level 2, ~22 at Level 3,
1.8 MW sustained harvest at a hacked Level-3 PA with a 12-coil ring.
Strike energy back to the upstream 2M but into a 12M bank, keeping
the 6-strike routing gradient. Catch dynamics depend only on the
strike-to-bank ratio, so saturation behavior and durability are
unchanged; output scales linearly. Simulated: ~2.6 MW at stock
Level 2, ~7.2 MW at a hacked Level 3 with a 12-coil ring.
…ghput

maxCharge drops to equal chargeFromLightning (2M) and supply throttles
to 300 kW, so a struck tower saturates, its strike bid floors, and the
routing round-robins bolts across the array while each bank trickles
out smoothly. Tower count becomes the harvest knob: simulated at a
hacked Level-3 PA, 12 towers ~3.5 MW, 24 ~6 MW, ~7 MW asymptote;
stock Level 2 with 12 towers ~2.5 MW. Bigger arrays also spread strike
damage: first coil death ~4.7h at 12 towers, ~11h at 32.
Supply throttle 300 -> 500 kW moves the throughput knee to a 24-tower
array (simulated ~5.3 MW at 12 towers, ~7 MW peak at 24; more towers
add no output, only spread wear). Strike damage 0.05 -> 0.15 lands
the first tower death at ~2h on the max array, ~3.4h at stock
Level 2 with 12 towers. Welding rotation or extra towers stretch it.
The Edison bulk crate holds a dozen flatpacks (was six) and gains a
cargo console listing, since Frontier abstracted the upstream
single-coil product and nothing sold coils at all. Edison map stock
trims to exactly one bulk crate: a 12-tower starter array out of the
box, with expansion bought through the console.
Documents feeding and starvation (including starving out a tesloose),
mote generation scaling with accelerator power, capacitor coils with
the arcing charge indicator, potential-difference strike preference,
wear and welding, and real crew electrocution. Deliberately does not
mention the accelerator limiter.
Containment failure means the ball has left the particle stream, so
it is cut off from feed the moment it escapes. Drop the shut-down-the-
PA advice and document the real behavior: it collapses on its own
within a few minutes, and decelerators just speed that up.
Decelerators are unobtainable on this fork: Frontier abstracted the
cargo product and commented the gun out of research and the lathe
pack. Waiting out the starving ball is the actual tesloose response.
@github-actions github-actions Bot added S: Untriaged size/M C# YML Docs Improvements or additions to documentation/guidebooks Mapping labels Jul 29, 2026
@rebaserHEAD
rebaserHEAD requested a review from DDrakov July 30, 2026 21:41

@DDrakov DDrakov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good

Comment on lines +4 to +12
- type: cargoProduct
id: EngineTeslaCoilBulk
icon:
sprite: Structures/Power/Generation/Tesla/coil.rsi
state: coil
product: CrateEngineeringTeslaCoilBulk
cost: 10000
category: cargoproduct-category-name-engineering
group: market

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly would prefer it to be researchable and craftable rather than buyable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# Docs Improvements or additions to documentation/guidebooks Mapping S: Needs Review size/M YML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants