Page 1 of 1

What *is* the 'bomb equation'?: A newbie question

Posted: Mon Jul 06, 2015 7:55 pm
by Cavoglave
I see that an algorithm for the strength of an explosion exists as ignite() in bomb.dm, but the comments in that file explicitly state that the proc is only valid for single-tank bombs.
However, in the code for the tank transfer valve, no equivalent explosion function exists; all that seems to happen on opening the valve is that all the gas is crammed into the second tank.
Is it that, once the valve is opened, the tanks combine to form a single (abstract) tank, upon which ignite() is called to make the explosion TTVs are known for?
Any clarification would be helpful.

Re: What *is* the 'bomb equation"?: A newbie question

Posted: Mon Jul 06, 2015 8:42 pm
by imblyings
I'm pretty sure what you're wanting to check is the tank code itself.

Spoiler:
/obj/item/weapon/tank/proc/check_status()
//Handle exploding, leaking, and rupturing of the tank

if(!air_contents)
return 0

var/pressure = air_contents.return_pressure()
if(pressure > TANK_FRAGMENT_PRESSURE)
if(!istype(src.loc,/obj/item/device/transfer_valve))
message_admins("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast].")
log_game("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast].")
//world << "\blue[x],[y] tank is exploding: [pressure] kPa"
//Give the gas a chance to build up more pressure through reacting
air_contents.react()
air_contents.react()
air_contents.react()
pressure = air_contents.return_pressure()
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
var/turf/epicenter = get_turf(loc)

//world << "\blue Exploding Pressure: [pressure] kPa, intensity: [range]"

explosion(epicenter, round(range*0.25), round(range*0.5), round(range), round(range*1.5))
if(istype(src.loc,/obj/item/device/transfer_valve))
qdel(src.loc)
else
qdel(src)

else if(pressure > TANK_RUPTURE_PRESSURE)
//world << "\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]"
if(integrity <= 0)
var/turf/simulated/T = get_turf(src)
if(!T)
return
T.assume_air(air_contents)
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
qdel(src)
else
integrity--

else if(pressure > TANK_LEAK_PRESSURE)
//world << "\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]"
if(integrity <= 0)
var/turf/simulated/T = get_turf(src)
if(!T)
return
var/datum/gas_mixture/leaked_gas = air_contents.remove_ratio(0.25)
T.assume_air(leaked_gas)
else
integrity--

else if(integrity < 3)
integrity++
yeah

as far as I know, ttv's mix the bombmix. What that does is mix your plasma and oxygen together which ignite and create super hot CO2 which also expands like hell creating a lot of pressure. The higher the pressure that results from the two gasses mixing, the higher the bang. Where the bang actually does come from is the sheer pressure overwhelming both tanks and causing them to explode.

edit- now figuring out the equation for making an optimal bombmix, that's another thing altogether

Re: What *is* the 'bomb equation"?: A newbie question

Posted: Mon Jul 06, 2015 8:59 pm
by Remie Richards
Research on the best bombs is still actually on going.
the closest (Public) research is by Myself and as334 and as far as I'm aware we've hit a brick wall with some bad maths.

Re: What *is* the 'bomb equation"?: A newbie question

Posted: Mon Jul 06, 2015 9:42 pm
by invisty
As I understand it...

From global vars:
TANK_LEAK_PRESSURE = 3000kPa
TANK_RUPTURE_PRESSURE = 4000kPa
TANK_FRAGMENT_PRESSURE = 5000kPa
TANK_FRAGMENT_SCALE: 1000kPa

The pressure has to build faster than it can leak, and this can take a varying amount of time depending on how well your reaction occurs. You can have very slow reactions that take several ticks of atmos processing before they go off - but if they're too slow they'll either just leak or rupture, not fragment. The best bombs go off in one tick of atmos processing.

Note that:

air_contents.react()
air_contents.react()
air_contents.react()

This is what TTVs have that make them more bombworthy than single-tank/canisterbombs. It gives three calls of atmos processing on the TTV, allowing for far greater yields before the actual explosion is calculated.

How much a canister/TTV explodes depends on the pressure. Where the pressure exceeds the TANK_FRAGMENT_PRESSURE, it will explode. How big depends on how far over that pressure threshold it is.

So that's basically RANGE = (PRESSURE_AFTER_REACTION - 5000)/1000

Devastation: 0.25 * RANGE,
Heavy damage: 0.5 * RANGE,
Light damage: 1.5 * RANGE.

Re: What *is* the 'bomb equation'?: A newbie question

Posted: Tue Jul 07, 2015 3:03 am
by Bluespace
It's fairly easy to make maxcap bombs.
The challenge is making bombs that blow up half the station when bomb cap is removed.
There's also different types of bombs. Some blow up slow, some blow up fast, some cause a giant fireball, some cause immense damage to organics.

Re: What *is* the 'bomb equation'?: A newbie question

Posted: Tue Jul 07, 2015 6:20 am
by DemonFiren
I am ashamed to say that, despite my atmospheric robustitude, I never figured out how to make non-fizzles in fastmos.

Re: What *is* the 'bomb equation'?: A newbie question

Posted: Tue Jul 21, 2015 3:51 pm
by Oldman Robustin
>Get CO2 can, Plasma can, Oxy can, mix them all together.
>Put mix can on a heater
>Contents inside ignite and burn
>Left with SUPERHOT/SUPERPRESSURE mix (40k) that is 80% CO2, 20% Oxy

>Get pure plasma can
>Put on heater
>Plasma magically ignites (maybe some of the tiny amount of air between the pad and the heater, even though I formatted the setup to make them adjacent
>Left with SORTAHOT/SORTAPRESSURE (2k temp) mix that is 90% plasma, 10% CO2

Take 2 plasma tanks, empty one, leave the other with the default plasma contents.

Put empty tank into the plasma tank to maximize the amount of hot plasma, Put the default tank into the HOTHOTHOT mixtank.

Here's where it gets weird. The empty plasma tank into the plasma can (full pressure releave) ends up getting you a superhot tank that is 80% plasma. The 300kpa plasma tank into the superhotmix (I have to do roughly 50% pressure because full leads to rupturing) leaves me with a tank that is 90% plasma but only gets to about 2k temp (which is weird because 2k is precisely what the other can got to, while this can is like 40k+ temp).

So basically, putting a little bit of plasma into a hot tank with no plasma yields more plasma and less heat than putting an empty tank into a warm plasma can.

The "warm" tank with 90% plasma also yields huge (overcap) explosions while the hotter 80% tank yields kinda sub-cap explosions. (They were matched with identical chilled o2 tanks)

So yea atmos mixing is voodoo and I'm not closer to understanding it. The most powerful bombs I've seen (double maxcaps) actually use co2 to dilute the hot mix... making your hot/plasma tank with only a few hundred (300-700) degrees and intentionally diluted with CO2. Even if you cut out all the "player added" co2 and launch the bomb fast to avoid rupturing issues, the bombs seem to inevitably lose potency despite being hotter/more plasma than the diluted oven-temperature tanks.

Re: What *is* the 'bomb equation'?: A newbie question

Posted: Tue Jul 21, 2015 11:04 pm
by rdght91
I used to be a decent bombmakers before the new atmos system (like 2-3 years ago) and now my bombs are literally party poppers. Most won't even gib you holding it.

Re: What *is* the 'bomb equation'?: A newbie question

Posted: Wed Jul 22, 2015 1:22 am
by CPTANT
a plasma tank with the standard full pressure of 1000kpa seems to be most effective at around 1000 degrees celsius.

Mix with a full tank of room temp oxygen for almost maxcap.
mix with chilled oxygen for guaranteed maxcap.