nrlulz / ACF

Combat damage system for Garry's Mod
110 stars 116 forks source link

We need fuel. #35

Closed Amplar closed 11 years ago

Amplar commented 11 years ago

Combat is hitting breaking point. I can't keep nerfing things to try to supplement the real problem. Tanks are too small. We need fuel to take up interior space. It's the easiest thing to do. It will use ammo crates and each engine will have a specified consumption based on throttle.

Fuel basics:

Same flammability/explode-ability for gasoline/diesel. Use ammo crates. Engines should be rated in liters or gallons per minute (it will be exaggerated obviously.)

Please, tweak, ferv, someone, I'm ready to give up on ACF. Changes need to be made to combat that aren't raw nerfs.

Bubbus commented 11 years ago

This is just another ammo nerf but with a side effect? What needs to change to make combat better: why are small tanks bad? Can't you compete using other small tanks/enforce weight classes more strictly?

Amplar commented 11 years ago

Small tanks are bad because it leads to tanks having way too much armor. enforcing specific rules in weight classes is silly. fuel doesn't necessarily have to explode every time it's hit, it can leak and such. it'd be a diceroll.

Bubbus commented 11 years ago

So "uses ammo crates" means using crate models, rather than putting fuel in the ammo crates. That's what made me think it was another ammo nerf. Thing is if the problem's too much armour then adding more volume requirement isn't as likely to make tanks bigger as it is to reduce ammo capacity: it's much easier to swap out an ammo crate with a fuel crate than it is to make a whole new tank.

I still think that if we change the ammo nerf to a clamped constant volume it'd incentivize big tanks: the smaller crates would have 40% extra wasted space while bigger crates would have something like 10 to 5. (see https://github.com/nrlulz/ACF/issues/25#issuecomment-19499619)

Another idea would be to clamp down the armour tool some more so people can't make their armour values as huge. The ideal solution would be to change the ballistics system to a true path-traced one and replace the armour/health sliders with material properties (steel, ceramic, aluminium etc), it'd remove a lot of the current system's oddities, such as tiny 1in thick props with 200mm rha. You'd end up with realistic ballistics and tiny tanks would get the shaft.

Fervidusletum commented 11 years ago

I can also see fuel tanks as an indirect ammo nerf. Personally, I'd sacrifice some ammo capacity for fuel capacity, rather than build a bigger tank. Although, I think the fuel requirement combined with Bubbus' ammo nerf method, would make small tanks less appealing.

For me, what usually decides the overall size of my tank is the dimensions of the engines I need to get the desired weight class to a desired speed. A lot of people use twin large I6 engines, which allows for smaller tanks. I think we should encourage the use of taller/larger engines like the Vs with a 50kw nerf to both large i6s to bring them more in-line with the b6 and v6 (the large i4 and b6 are already low enough power), and maybe a small buff to large Vs. At the very least, it will at least make pancake tanks less viable.

This could also be considered an indirect ammo nerf, but what about requiring a "mechanical loader" entity? Would reduce the volume and weight a tank had available for armor/ammo/mobility. A mechanical loader makes a bit of sense since most gmod tanks are designed to be manned by a single person who is both driver and gunner. Also, it could replace the magazine/loader currently on the autoloader model (effectively it would just be a cannon with a different mechanical loading system).

I'm also quite interested to see how the path-traced ballistics system would work. If I understand correctly, it would use the length of a bullets' trace through a prop to determine the armor thickness, correct? In my opinon, that would do a pretty good job of increasing the overall size of tanks, as they'd need thick plates to get decent amounts of armor instead of a 50mm thick plating with 350mm+ RHA.

Amplar commented 11 years ago

Can't do prop thickness as armor- props are too varying in size and it would make vanilla props unusable as armor. The armor/health system needs to stay. The ammo change could work as long as it doesn't shaft low caliber munitions in small boxes.

Bubbus commented 11 years ago

Don't see how prop variance counts against the idea, or how it'd make vanilla unusable: they'd all have the same material properties and the bullet trace would use the real collision mesh. It'd make vanilla precisely as usable as other props per unit thickness. The big reason we're seeing small tanks with 1000mm rha is because there's no real space penalty to having 1000mm rha. Regular armouring principles would be in effect and if you want to have 60mm on the front you need to make 60mm of space which is ~2 sprops plates.

Fervidusletum commented 11 years ago

We could try out the trace thickness based armor in an experimental branch, and get some testing going on just how it affects tank size, and the viability of vanilla props.

Personally I don't think vanilla props would be useless in this system. Perhaps different armor materials would make them useful for roles other than sheer armor value -- maybe as ablative ceramics or something.

Amplar commented 11 years ago

I just don't think actual thickness will work out. with phx and sprops you only get 3 variations in thickness.

I really think we need to push and do cooling and fuel.I'm sorry I can't do any coding, and i'm just the ~ideas guy~. ACF is dying and it needs some life.

Bubbus commented 11 years ago

I get your point even if the variance in thickness would come from multiple layers, compositing etc. Could alternatively enact a limit on RHA to some multiple of the prop's actual thickness. We can always return to the idea if the other changes don't work out. I can start contributing once I get my gaming comp back on the web.

You can help out with the coding if you scout out some irl math relations for fuel consumption rate and cooling efficiency regarding rpm, velocity blablabla. It's always easier to go lazymode and drop in some pre-existing equations which work than spend time figuring out new ones.

Amplar commented 11 years ago

Layering would lead to unnecessary complication and amount of props, and acf is centered in the 60s not the 80s. There should be a thickness limitation based on the prop's health or size and it should be so that layering these plates would be heavier than a single plate. As for fuel balance and cooling I'll do that, but it'll be far from real life for balance reasons. I can't math.

Bubbus commented 11 years ago

layering these plates would be heavier than a single plate.

Only way I can think of doing this uncircumventably is to give every prop a constant nerf weight. Less armour props = less nerfed weight. Other ideas?

I'm gonna make a new issue for armour balance idea chat.

Amplar commented 11 years ago

anyone try fuel out? i'm losing interest in acf. need to stop fucking with armor and stuff and attack the real problem, which is small tanks. fuel and cooling.

Fervidusletum commented 11 years ago

How should consumption be measured? I'm guessing it's related to rpm and displacement, something like: fuel used = rpm * displacement * fudge factor

nrlulz commented 11 years ago

It should be based on power. That figures in rpm, torque (which should be somewhat related to engine displacement/size), and throttle position.

Bubbus commented 11 years ago

need to stop fucking with armor and stuff and attack the real problem

i thought the real problem was having 2000mm rha in a prop 20mm thick?

Amplar commented 11 years ago

it is a problem but we need to solve the core of it first.

as for fuel, liters per minute. base it on displacement and a multiplier.

Fervidusletum commented 11 years ago

Next question, I need some sort of baseline usage amount. I know you want liters used per minute, but I would like something more specific to work with.

Here's what I've got atm: the 2x4x2 fuel tank holds 45 liters fuel (typical small car fuel tank); how long should a 5.7L V8 take to burn through that? 15 minutes? The largest (4x4x8) fuel tank holds 425 liters.

Some other engines for comparison. Fuel usage based on kw output: Baseline: 5.7L V8 23L V12: 2.7x 1.5L I4: 0.37x The problem with using kw is that fuel usage would remain constant inside powerband, and would drop as rpm went above powerband, and it would consume no fuel while throttle was off.

Fuel usage based on RPM * Displacement: (using engines' respective upper powerband limit for comparison) Baseline: 5.7L V8 23L V12: 2.4x 1.5L I4: 0.34x I think this is a bit more realistic, but doesn't have enough usage range.

It would be simple to make displacement have an exponential increase on fuel usage. Fuel Usage based on RPM * (Displacement ^ 2): (using engines' respective upper powerband limit for comparison) Baseline: 5.7L V8 23L V12: 9.8x 1.5L I4: 0.09x The exponent on the displacement can be adjust to make the difference more or less extreme.

There's also a multiplier for fuel tank capacity, so it would be no problem adjusting how many liters they contain. Currently it's 0.125x the internal volume of the fuel tank, which is assumed to have 2.5mm walls.

Fervidusletum commented 11 years ago

What about an option for armored fuel tanks? Less capacity, but can take a few hits.

Amplar commented 11 years ago

That's a neat idea. ACF already has the code for ammo explosion dicerolls, fuel should have a bigger diceroll if it explodes based on how much fuel is in the tank. less fuel = more chance of explosion, because more of the tank's volume would be fumes.

also, powerband has nothing to do with fuel consumption as the fuel being input doesn't change as rpm increases. you could keep a steady half throttle and the engine won't consume more fuel as rpm increases to the redline unless you put your foot down more. Fuel consumption should be based on displacement and throttle, not rpm.

I think about two 2x4x2 crates should run the biggest, thirstiest engine (probably the large turbine or 23l v12) for about 3-5 minutes @ full throttle. It will just take testing.

Fervidusletum commented 11 years ago

The exponent on displacement was just an option to create a bit more diversity between engine fuel usages. I updated the above post to make it more clear that only the displacement constant was being exponentiated.

I'm fairly sure RPM factors into fuel usage. The way I understand it, the more combustion cycles (rpm) the engine goes through, the more fuel it consumes, and throttle just limits the amount of fuel injected per cycle.

Amplar commented 11 years ago

how can the engine consume more fuel if you're only inputting a fixed amount? that's not how it works lol

Bubbus commented 11 years ago

This seems helpful, is it accurate? http://ltsc.co.uk/yacht-articles/564-diesel-engine-fuel-consumption-quicl-calculation

Fervidusletum commented 11 years ago

@Amplar Assuming throttle isn't changed, the amount of fuel used per cycle is constant; however the number of cycles per unit of time does change. Say you used 1 unit of fuel per cycle, at 1 cycle per second that would be 60 units fuel per minute. If you increased the number of cycles to 2 per second, it would consume 120 units fuel per minute.

@Bubbus Thanks, that does look helpful. I'll see if I can find any more related information.

Fervidusletum commented 11 years ago

I've done quite a bit more research on this, and I've put together a model that does a fair enough approximate of real fuel usage (I tested it against a specific fuel consumption graph). First, we have to determine the volume of air the engine uses per minute and convert that to mass per minute. From that we can approximate the mass per minute of fuel needed for ideal combustion, which we then convert to fuel volume per minute.

Load = Current Torque / Max Torque @ RPM (which is Throttle % in acf) Air grams/min = Load * Displacement (liters) * RPM * 1.18 (grams per liter) / 2 Fuel grams/min = Air grams/min / 12.5 (ideal air to fuel ratio) Fuel liters/min = Fuel grams/min / 832 (grams/liter for petrol)

To condense it all down: Fuel (L/min) = Throttle * Disp * RPM * FudgeFactor / 17627.12 Where the fudge factor is used to boost fuel use to acf-appropriate levels. Throttle can be scaled a bit so there's always some fuel usage. Something like Load = 0.3 + Throttle*0.7

Amplar commented 11 years ago

You're forgetting that fuel input and rpm only correlate when you put your foot down more to maintain that rpm.. the engine rising in rpm doesn't magically suck more fuel unless whatever is controlling the fuel input puts more in. Is that what you're meaning?

Also getting way too complicated with this, jesus. Paralysis by analysis. Get a basic system coded and working before we get overcomplex with it

nrlulz commented 11 years ago

Not true. 20% throttle at 2000 rpm is less fuel than 20% throttle at 4000 rpm, that is something I have tested IRL plenty of times... and I agree, we should probably focus more on getting SOMETHING in place rather than the little details. Honestly I think (current power output) * (some global multiplier) * (per-engine multiplier) and clamp the low end to whatever idle fuel consumption should be would be close enough. That and the less math we're doing in an entity think function, the better...

Amplar commented 11 years ago

How can two different rpm ranges use different amounts of fuel if all you input is 20%..?

nrlulz commented 11 years ago

Because the engine is running twice as fast?

Amplar commented 11 years ago

The engine cannot input any more fuel than you allow. An engine will only reach a certain rpm by the amount of fuel being input. A fuel system is a pressurized system and only works in one direction- an engine would run out of control if it could suck fuel from the fuel pump and tank by itself. See what I'm getting at?

Just because the RPM is rising does not mean it can physically take more fuel in than what you are putting in. The rpm will only go as high as the amount of input energy allows.

That link to diesel stuff, about fuel consumption, it only means when you put your foot down to maintain maximum rpm, it consumes more fuel because it takes more fuel to maintain that speed. Which means you, physically, the operator, must increase the flow of fuel in order to maintain that. The engine itself cannot demand more fuel.

nrlulz commented 11 years ago

The throttle controls how much air goes into the engine, not fuel directly. Higher engine speed = more air = more fuel. I suggest maybe you read up more on how a carburetor works.

Amplar commented 11 years ago

fuel and air intake are controlled by a rotating plate, which are both controlled by your foot. If an engine was allowed to suck fuel by itself it would be a runaway. I rebuild engines for a living currently, lol.

nrlulz commented 11 years ago

K whatever I'm not going to argue about it any more, it's not going to make that huge of a difference to ACF anyway. I think the risk of exploding is going to be more important than the risk of running out of fuel as far as combat is concerned. Unless you make engines consume a ridiculous amount of fuel which would just end up being annoying.

Fervidusletum commented 11 years ago

http://ecomodder.com/wiki/images/3/39/Saturn_99_1.9l_dohc_bsfc.jpg This is a graph of brake specific fuel consumption for a 1.9 liter engine, which relates fuel grams/hour to engine power. The line at the top is the peak torque graph. To find the actual fuel usage for an rpm and load, calculate the power using the rpm and torque for that load, and multiply that by the BSFC where the torque and rpm intersect on the graph. http://mdmetric.com/tech/powercalc.htm is a simple calculator for power.

For example, take 2000 rpm and 78 nm (78/~156 peak = 44% load). 78 nm at 2000 rpm is roughly 16.3 kw. The BSFC at that intersection is 275 gr/kw.hr. The actual fuel usage is 275 (g/kw.hr) * 16.3 (kw) = 4482.5 (g/hr), or 74.7 grams/minute.

At 5500 rpm and 78 nm (again, roughly 44% load), power output is 44.9 kw and BSFC is 325 gr/kw.hr. Fuel use is 325 * 44.9 = 14592.5 g/hr, or 243.2 grams/minute. For the same engine load (basically throttle) fuel consumption increases with rpm.

Using the formula I mentioned earlier, fuel grams/minute = load * disp * rpm * 1.18 / (2 * 12.5) Fuel g/m = .44 * 1.9 * 2000 * 1.18 / 25 = 78.9 g/min, actual usage of 74.7 g/min. Fuel g/m = .44 * 1.9 * 5500 * 1.18 / 25 = 217 g/min, actual usage is 243 g/min. It's not perfect, but it's a close enough approximation for ACF.

Amplar commented 11 years ago

fuel consumption will be very exaggerated. tanks need to have a reason to carry a good amount of fuel. an average tank shouldn't need more than 15 minutes of fuel.

also, like i stated before, fuel consumption being higher at higher rpms is just because of the required amount of fuel to maintain that rpm increases. the motor itself will not suck more fuel, the operator applies more to maintain.

Think of it this way; if you are pouring water on a water wheel, it will reach a certain rpm and then not accelerate any more. You add more water and it will spin faster, increasing the consumption of water. Friction and things of that nature on what the wheel rotates on will make the amount of water required to maintain higher and higher rpms exponential. An engine is like this, there are various bearings and oil filled joints that will become harder and harder to rotate as heat and speed increases, thus requiring more fuel to spin it harder. That's why in some of those graphs and stuff, fuel consumption can be nonlinear to the increase of rpm and/or throttle, and this is more prevalent in diesels.

Fervidusletum commented 11 years ago

Fuel consumption will be ~5x normal, to get the 23L v12 to empty 2 2x4x2 canisters in 5 minutes. Once everything's set up we can fine tune it from there.

How are electrics going to be handled? Could make the base electric engines lighter, and have batteries (which are just special fuel tanks) which are far more dense than normal fuel tanks.

As for turbines, I think we can use thermal efficiency to convert kw into fuel usage.

Amplar commented 11 years ago

yeah, electrics can just go to the individual motor models and get lighter. Honestly, just make turbines work like all the other engines, but they'll be extremely thirsty.

Amplar commented 11 years ago

I think once we get fuel rolling we should take a break from the combat portion that is a headache and maybe try something new that's really needed- propellers & screws, for aircraft and watercraft, It is high time we make aircraft balance-able. heheh get it

high

Fervidusletum commented 11 years ago

I should have been clearer. Turbines will use the same formula, I just need to figure out the equivalent displacement. It should be fairly straightforward, so don't worry about it.

I like the sound of acf propellers. Always hated how difficult it is to get fin based propellers working with ACF.

Fervidusletum commented 11 years ago

I could use some ideas for amusing fuel tank descriptions. I.e. "What is global warming?" or "Popular with arsonists." I've got most of the small to mid sizes covered by what they'd normally be used in (sedan, landboat, etc) but I'm open to more ideas on those too.

Amplar commented 11 years ago

..wat

Fervidusletum commented 11 years ago

Just continuing with the theme of giving a descriptive blurb on the spawn menus for entities. I added some descriptions to some of the tanks to indicate typical usage for that size, didn't seem appropriate to leave half of them blank. /shrug Just a bit of extra polish to toss on that doesn't require much effort.

Amplar commented 11 years ago

..but shouldn't it just be a dropdown of all the available tank sizes (like ammo)..?

Fervidusletum commented 11 years ago

It is. :) This is what the menu is looking like atm: https://dl.dropboxusercontent.com/u/22691489/GMod/fuelmenu.png

The first dropdown has a list of all the sizes, sorted by capacity. Second dropdown is fuel type, petrol or diesel.

Amplar commented 11 years ago

seriously consider walking, hahahaha

nrlulz commented 11 years ago

How about "trees are gay anyway" for a big tank On Jul 18, 2013 4:11 PM, "Fervidusletum" notifications@github.com wrote:

It is. :) This is what the menu is looking like atm: https://dl.dropboxusercontent.com/u/22691489/GMod/fuelmenu.png

The first dropdown has a list of all the sizes, sorted by capacity. Second dropdown is fuel type, petrol or diesel.

— Reply to this email directly or view it on GitHubhttps://github.com/nrlulz/ACF/issues/35#issuecomment-21221697 .

Bubbus commented 11 years ago

Big fuel, certified 100% t-rex oil. exhaust may contain palaeosaurus ghosts. Fuel menu display looks hot btw.

Amplar commented 11 years ago

How far along are you with the fuel fervi? also, add me on steam Delta091

Fervidusletum commented 11 years ago

Fuel is working at a bare minimum. 1.5L i4 refuses to start without fuel, drains fuel while running, and shuts off when fuel runs out.

Just need to update the rest of the engine definitions with displacement and fuel type, bit of wire io, some display stuff, armored fuel tanks (should be easy to add), handle exploding and leaking, refuelling, and figure out electrics and turbines.

Amplar commented 11 years ago

woot

Fervidusletum commented 11 years ago

Just want to verify this is reasonable for a li-ion battery for electrics: size: 2x4x4 (94 liters) weight: 420 kg energy: 43 kw hours (155 mj)

powers the large electric at full power for 1m 33s powers the small electric for 5m 17s