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

How, what and why to code in BYOND.
Post Reply
User avatar
Cavoglave
Joined: Sun Apr 20, 2014 12:39 pm
Byond Username: Cavoglave

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

Post by Cavoglave » #102081

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.
Last edited by Cavoglave on Mon Jul 06, 2015 9:45 pm, edited 1 time in total.
User avatar
imblyings
Joined: Fri Apr 18, 2014 5:42 pm
Byond Username: Ausops
Location: >using suit sensors

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

Post by imblyings » #102092

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
The patched, dusty, trimmed, feathered mantle of evil +13.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

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

Post by Remie Richards » #102097

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.
私は完璧
User avatar
invisty
Joined: Tue May 26, 2015 12:02 am
Byond Username: Invisty

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

Post by invisty » #102101

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.
Mime: Depresso
User avatar
Bluespace
Joined: Fri Apr 18, 2014 1:04 pm
Byond Username: Bluespace
Location: UK

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

Post by Bluespace » #102138

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.
I play Boris Pepper.
Image
User avatar
DemonFiren
Joined: Sat Dec 13, 2014 9:15 pm
Byond Username: DemonFiren

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

Post by DemonFiren » #102163

I am ashamed to say that, despite my atmospheric robustitude, I never figured out how to make non-fizzles in fastmos.
Image
Image
Image
ImageImageImageImageImage

non-lizard things:
Spoiler:
Image
User avatar
Oldman Robustin
Joined: Tue May 13, 2014 2:18 pm
Byond Username: ForcefulCJS

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

Post by Oldman Robustin » #106221

>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.
Image
rdght91
Joined: Thu Feb 12, 2015 3:36 am
Byond Username: Roadhog1

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

Post by rdght91 » #106308

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.
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

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

Post by CPTANT » #106329

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.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
Post Reply

Who is online

Users browsing this forum: No registered users