Helicopters

by kumpu

Adds a fully animated attack helicopter to the game. Ideal for getting from A to B quickly, exploring the map, building islands and nuking biters from the sky. Now 84% less buggier!

Content
5 years ago
0.15 - 0.17
344
Transportation

b Two old bug (Missing terrain decoration & Fuel gauges) - FIXED

5 years ago
(updated 5 years ago)

Thanks for continuing kumpu work while he's (or she ?) unavailable.
Anyway there's two old bug that didn't get fixed, namely:

  1. Terrain Decorations disappear in the whole map when placing Helicopter Pad
    This is being addressed / fixed in the past in this thread:
    https://mods.factorio.com/mod/Helicopters/discussion/5caf4b1dbaf027000cbde4d6
  2. Fuel Gauge Doesn't work for All Fuels
    Same like above, this has been addressed / fixed in the past:
    https://mods.factorio.com/mod/Helicopters/discussion/5ccc10dda2e6cc000cf65467

Did you aware of the issue but didn't implement (want to fix with your own way / code)
Or were you not aware at all ?

Thank you.

5 years ago

Hi, I wasn't aware. I just recently found this mod, and started to help maintain it. I will look into these.

5 years ago

I have an update ready for the decorations, but the fuel gauge is a little more difficult. From the code, it appears as though kumpu was basing the fuel gauage on a 10minute tank. Different fuels will give a different fuel tank flight time. The other issue is that because you don't know what fuel they will put in it, you can't calculate a max tank. The only way I can really see making the gauge somewhat properly, is by seeing if it's possible to take a snapshot of the fuel contents when fuel is added, and base the fullness off of that value.

5 years ago

Okay, I uploaded my take on how the fuel gauge should be handled. It takes the currently burning fuel value, and bases the full tank on that.

5 years ago
(updated 5 years ago)

OK, i just test it, the terrain is fixed.

About the fuel gauges, i'm personally okay with the current implementation.
I'm just passing through the bug report from another user.

How about this, the mod see the fuel per slot basis,
Extreme case where user use a mixed fuel,
The mod only need to know the max stack of that fuel.

Say,
Slot 1 : Nuclear
Slot 2 : Rocket, 10 stacks
Slot 3 : Solid Fuel , 50 stacks
Slot 4 : Wood, 100 stack
Slot 5 : Mod fuel, 20 stack
Each slot, if full..have 20% that will be added to the fuel gauges.

As subdivider for the individual fuel slot (a.k.a how to know the slot itself is half filled)
The mod had to do is calculate the percentage of the max slot.

Say,
Slot 1 : Nuclear, 1 stack left = 1/1 * 20 = 20%
Slot 2 : Rocket, 5 stacks left = 5/10 * 20 = 10 %
Slot 3 : Solid Fuel , 10 stacks left=10/50 * 20 = 4 %
Slot 4 : Wood, 30 stack left = 20/100 * 20 = 6%
Slot 5 : Mod fuel, 1 stack left = 1/20 * 20 = 1 %

So there are only 41 % on the fuel gauges.

I mean internally, the heli will use joule for engine calculation, but the gauges is simply a visual aid, what matter is the number of item in the slot, not the energy / joule left.

Hope that makes sense to you.
Sorry if that's would be too complicated to implement, there are will be cases where user want to calculate based on joule instead.

It's only suggestion after all, it's up to you.

5 years ago

The problem with mixed fuel is that a stack of each fuel type doesn't necessarily give the same fuel fullness. A stack of wood will run the helicopter for maybe 10 seconds, a nuclear fuel will run the helicopter for for over 5min. Both implementations will show an incorrect tank size for mixed fuels. I have an idea to make it work with mixed fuels, but I can't work on it until later tonight.

5 years ago

Take your time, no need to rush.
Personally i'm just glad that you spare your time to maintained this mod after that 0.17.35 mod break.
What matter the most is the mod is now functional again๐Ÿ˜

5 years ago

No problem. I found this mod and really like it, I'm glad kumpu was willing to let me help keep it going ๐Ÿ˜€.

My plan for fixing the fuel is this:
Check burning fuel value, and all fuel stacks in the tank. Look for the fuel with the largest fuel value, then make that 20%. Then compare all the other fuel values to the max, and make those a percentage of that value, and then take that percent times 20%. That way all the fuel types I the tank are normalized.

5 years ago

Yeah that's a better, more precise approach.
Just a reminder that a player often refuel mid-flight (i do),
Maybe start with lesser fuel preflight, then add a bigger fuel value mid flight, vice versa.

5 years ago
(updated 5 years ago)

I just tested scaling the tank size with mixed fuel sources, and I realized that it doesn't work well for this reason: If a tank has solid fuel, then coal, it's tank size will be 5*solidfuel stacks for full. once the solid fuel is consumed, it will now only see coal, and change the tank size to 5*coal, which while is less fuel, is a fuller tank now, since the size changed.

5 years ago

I don't think there is a perfect solution to this problem, other than hardcoding the tank size. It makes sense on paper, but in game when you fill all the slots you would expect the tank to be full. If the tank is set to 5*nuclear fuel, it means 5 slots filled with nuclear will be full. 5 slots of coal will be almost empty, even though the slots are completely filled. But technically the tank is almost empty because 5 slots of coal is barely the same amount of energy.

5 years ago
(updated 5 years ago)

I think this is why kumpu originally had the tank based on flight time, hahaha. It is easier to say a full tank is 10minutes of flight, and your 1 stack of coal is an almost empty tank because it will get you 30seconds of flight time. It's the same as hardcoding the tank size to nuclear, just with a smaller tank size.

5 years ago
(updated 5 years ago)

That's why i said you calculate based on the max stack of entity , per slot basis.

Even if someone put 1 coal in each slot, it would not give them a full tank.

1/50 * 20 = 0.4%
0.4% * 5 slot = 2%

So, they only had 2% instead.

5 years ago

Ah, I see what you are saying. The downside of doing what you say, is that your tank will not update smoothly. If you have, say, nuclear fuel with a stack of 1, your tank will jump in 20% increments.

The old and current code both look at the fuel values, rather than just the amount of stack perslot, which gives a gradually changing fuel gauge.

5 years ago
(updated 5 years ago)

Not to mention, how long you can fly will be inconsistent with your gauge. If your first 50% of tank gave you 3minutes of flying, you would expect the last 50% to give you the same. But if your other 50% is wood, your flight time will be like 30 seconds. Which should have been showing an almost empty if that were the case.

5 years ago
(updated 5 years ago)

Darn it, i edit the wrong comment, too lazy to write up again.

Indeed, the downside would be a "jump".

But hey, it's the player fault to mix the fuel.
If they only give it a single type, it would progress smoothly, and it will give them the expected flight time accordingly.

The other benefit would be, it doesn't really matter if the player changed the amount of max stack with other mods, or increase the fuel value. The tank gauges will stlll calculate properly, all what matter is the max stack.

In case someone protest, just point them to this thread ๐Ÿ˜

5 years ago
(updated 5 years ago)

I'm still thinking about this dilemma.

New response