Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuel Leaks #7104

Merged
merged 3 commits into from Apr 10, 2014

Conversation

Projects
None yet
5 participants
@OvenBaker
Copy link
Contributor

commented Apr 8, 2014

This adds a slow gasoline (or water) leak to badly damaged tanks on vehicles. Once the tank is below 50% health, it begins to drip fuel out. Initially it's very slow, but it speeds up as the tank gets closer to being destroyed.

I'm sure some enterprising players will find a way to use it to drive through town, leaving a ready-to-ignite trail of accelerant behind themselves.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2014

We've never actually had luck with that sort of fire-line sort of thing, but maybe yours will be the trick.

;-)

@Wishbringer

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2014

This should apply to batteries as well, since they are liquid based.
Does this affect wrecks with destroyed tanks that erroneously have fuel in them (#7117)?

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Apr 9, 2014

This should apply to batteries as well, since they are liquid based.

No, because batteries don't work like that?

@KA101

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2014

This should apply to batteries as well, since they are liquid based.
No, because batteries don't work like that?

IIRC a breached battery might leak acid, but that wouldn't leak the electric all over. More likely to mess up your engine compartment, I'd guess, and probably wouldn't do the battery's capacity any good.

That opined, Rivet's the automotive engineer here so she'd be the one to know what happens when a vehicle battery gets smashed up.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Apr 9, 2014

As soon as the dielectric leaks out, the battery is dead.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 9, 2014

Two nits. Please use 1tbs* consistently (looks like the following):

if( some_test ) {
}

And please use brackets around all conditionals and loops. The

if( some_test )
    do_stuff;

thing has a rather high chance of introducing bugs somewhere down the line.
Other than that looks nice. If I have the time I'll often format stuff like that when I do a merge, but if it's ready to go it gets merged faster.

*"one true bracket style" yes the name is terrible, it's not a religious thing, it's just waaay better to settle on one style, and that's the one we ended up with.

@Wishbringer

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2014

50% is a bit harsh?
Use a variable, in "void vehicle::slow_leak()",
so one can easily change when something starts leaking.
I'd prefer something from 25% to 40%.
Personally like to use two spaces when doing indentation, but I emulate the style already used.

@OvenBaker

This comment has been minimized.

Copy link
Contributor Author

commented Apr 9, 2014

The speed of the leak scales with the amount of damage. When you're at 45% or so tank health, it's a VERY slow leak. If you drive you'll definitely notice it (from the trail of gasoline) well before it becomes a problem. It also scales with remaining fuel amount, so the rate will naturally drop. 50% seems like as good a start value as any, but trivial to change if balance feedback indicates it's too low / high.

@Wishbringer

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2014

Granted that it's a slow leak, but I'll still feel driven to run around checking all the vehicles lying around for tank damage.
I'm a perfectionist style gamer, every drop lost makes me feel like a failure.
So I guess I'm the one to blame for being psychologically deficient, huh. :)

@ghost

This comment has been minimized.

Copy link

commented Apr 9, 2014

Good change, and I think it can be applied to batteries as well (without leaking anything) if it's thought of as increased self-discharge due to physical damage.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2014

Good change, and I think it can be applied to batteries as well (without leaking anything) if it's thought of as increased self-discharge due to physical damage.

vs.

As soon as the dielectric leaks out, the battery is dead.

You might be able to craft a new battery or seal and add fresh acid, but Rivet was pretty clear there. Maybe have it breach at 25% or whatever, but breached battery is Empty.

@ghost

This comment has been minimized.

Copy link

commented Apr 10, 2014

I believe what Rivet was saying was that you can't recharge a battery once the dielectric leaks out. That is, a dielectric leakage results in a loss of storage capacity, whereas a tank leakage just results in a loss of stored fuel. A damaged tank still has full capacity - you can refill it (though it will still leak), wheres a battery without a dialectric can no longer hold any charge. (Short of repairing it by restoring the dialectric).

What I'm suggesting is that we ignore the dialectric (which we do currently anyway) and/or pretend it is not a liquid (and for many batteries, including some lead-acid batteries, it is not a liquid). Instead, we treat damaged batteries as having a high self-discharge rate which causes them to lose charge with time - though they can still be fully recharged. (i.e. they act like a damaged fuel tank, but don't actually leak any liquid.)

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 10, 2014

the battery thing seems rather complicated considering the results.

@ghost

This comment has been minimized.

Copy link

commented Apr 10, 2014

I'm probably making it sound more complicated than it really is.

The implementation could be as simple as: Damaged batteries work exactly the same as fuel tanks (slow drain of charge), but don't leak anything on the ground.

That's it.

From a realism point of view, we can rationalize damaged batteries losing charge via self-discharge, which gets us around the objection that Rivet raised.

Anyway, not a big deal - I just thought it might add some fun challenges, like to get your car back to base because your solar panels can't keep up with the self-discharge of a damaged battery.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 10, 2014

Oh, that's actually pretty reasonable. I keep thinking of a car battery that I let run dry once that exploded on me, but I have to keep reminding myself "effort vs reward".

@Wishbringer

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2014

Exploded you say, that sounds interesting/dangerous, did it do much damage?
Could be a nice addition to the game, exploding batteries.
Good thing it had to be dry and didn't platter acid everywhere. :/
I wonder what happens to an acid filled battery under high temperatures, like in a fire.
Found an interesting bit of info about battery fires:
In the case of a lead acid battery, there is also an extreme risk of explosion and fire, when short circuited.
Substantial clouds of acid mist and vapor will be present during this type of fire and will typically overwhelm a typical ventilation system.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Apr 10, 2014

I'm not a stickler for 100% realism in cases where it's more bother than it's worth.

The implementation could be as simple as: Damaged batteries work exactly the same as fuel tanks (slow drain of charge), but don't leak anything on the ground.

This works fine.

@kevingranade kevingranade merged commit 42b0225 into CleverRaven:master Apr 10, 2014

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 10, 2014

Not much damage, it could have been dangerous if someone had been right
next to it due to plastic shrapnel and acid spray (it did spray acid all
over, but that's not as dangerous or damaging as you'd think), the
explosive power was in the neighborhood of a M80.
The plastic on top disintigrated (not the terminals), and the side of the
casing cracked. The metal leaves inside were wrecked.

@Wishbringer

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2014

I played around with blowing up capacitors, as a kid, by overloading them. :)

@ghost ghost referenced this pull request Apr 11, 2014

Merged

Improved fuel leaks #7175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.