Aircraft


Adds 4 aircraft, each with their benefits and drawbacks, to allow for more biter-killing fun! Now updated for 2.0 and Space Age.

Content
4 days ago
2.0
7.75K
Transportation Armor Logistic network

i [Implemented] AircraftRealism Support

30 days ago

Would you be interested in adding support for the AircraftRealism mod to add optional takeoff/landing support?

I have some example code here, let me know if you need any help

https://github.com/jaihysc/Factorio-AircraftRealism/blob/2.0.0/Docs/AddingNewPlanes.md

30 days ago
(updated 30 days ago)

I'm interested, but since this is a fork of the original Aircraft mod by Thomasnotused, wouldn't all of the work for implementing support for these aircraft already exist in AircraftRealism? This fork adds carbon fiber variants of the existing aircraft, but the original planes are identical in behavior to aircraft from the original mod. I haven't done any testing of AircraftRealism, so I don't know how my fork interacts with it.

29 days ago

https://github.com/jaihysc/Factorio-AircraftRealism/blob/master/Docs/AddingNewPlanes.md#adding-new-planes

for example, under "Factorio-AircraftRealism/support_aircraft/airbornePlanes.lua" ( groundedPlanes.lua; planeSettings.lua) there is a line: "if mods["Aircraft"] then"
most likely, all those patches need to changed into the name of your mod, on the aircraft realism side. or you need to add those patches to your mod with asking for the realism mod.
i never moded factorio, so i don't know what modname is checked. (Mod ID or clear name, mostlike there is no steam mod name check)

29 days ago
(updated 29 days ago)

@MeteorSwarm AircraftRealism no longer supports the aircraft mod, so it will have to be done in this mod.

For context, AircraftRealism supporting the aircraft mod was a legacy thing from when AircraftRealism was first created. Since Factorio 2.0 broke everything, I took this opportunity to remove aircraft mod support. I think it would be better to support AircraftRealism in this mod since you have more flexibility to change the properties (weight, turning speed, etc) of the planes to your liking.

@Xidon You would wrap everything in if mods["AircraftRealism"] then ... end, so it does not run when AircraftRealism is not installed

if mods["AircraftRealism"] then

-- File: data.lua
-- We turn the vanilla car into a plane, we copy the car for the airborne version and tell the API
-- The API needs the setting name for the takeoff/landing speed, the "transition speed"
local api = require("__AircraftRealism__.api")

local car_flying = table.deepcopy(data.raw.car["car"])
car_flying.name  = "car-flying"
data:extend{car_flying}

api.register_plane({
    grounded_name="car",
    airborne_name="car-flying",
    transition_speed_setting="transition-speed-car",
})

-- Modify the prototypes as required (friction, weight, collision_mask, etc)

end

Please note that AircraftRealism 2.0.0 is not fully working, I tried to put a warning ingame but I'm not sure if I worded that well.

29 days ago

Good to know, I'll take a look at your documentation and set up my own integration.

29 days ago
(updated 29 days ago)

I value realism, and there's an opportunity to add more realism to your mod to account for Space Age's support for per-planet variables, using pressure, gravity, (and temperature if the information exists) to change the liftoff speed of aircraft. Allowing users complete control over takeoff speed and only allowing one takeoff speed per planet, as yours does, conflicts with this idea. There are two equations relevant to allowing this: The lift equation and the ideal gas law.

P=rho*R*T --https://en.wikipedia.org/wiki/Ideal_gas_law

L=C*(rho*V^2)/2*A --https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/lift-equation/

Rearranging these equations and replacing lift with weight(mg), you get

v_liftoff=sqrt((2*R*T*m*g)/C/P/A)) --(The velocity when lift = weight)

C(Lift constant), A(Wing surface area), and m(mass) are dependent on the aircraft, and T,g, and P are dependent on the planet.

I'd be a lot more interested in adding support for my mod if it was possible to change liftoff speed based on planet atmosphere, temperature, and gravity. I'd work on doing that myself, but with your mod as it is, it's impossible to do anything other than let players have complete control over takeoff speed, and have that takeoff speed apply on every planet. I'd also accept you just making it possible to add different takeoff speed settings for different planets if that would make it easier to implement. That way, I could set the default liftoff speed by doing the calculations myself. Looking at your code, the takeoff speed relying on settings variables looks difficult to undo, but it would be less difficult to change the setting pointed to when the surface changes.

29 days ago

Changing takeoff speed based on planet is a nice idea. The takeoff speed in the settings can be be the "reference speed" based on Nauvis conditions at 20 C, and we scale the reference speed for the other planet conditions.

29 days ago
(updated 29 days ago)

I like that idea. One problem with this idea is that planets don't have any temperature values attached. A lot of mods would benefit from that information, including my mod "Intercontinental Rocketry," so I believe there is a market for a mod that adds more surface properties to the game. Other mods could use this as a dependency to create standardization between mods.

Some possible properties:

Average Temperature: Used for entity placement conditions (Default 20)
Seasonal temperature swing: Can be taken into account in control.lua (Default 0)
Daily temperature swing: Can be taken into account in control.lua (Default 0)
Year length: Used to determine when seasonal changes occur (Default 0)
Seasonal Solar power swing: Changes solar power output based on time of year (Default 0)
Initial Evolution Factor: Value of evolution factor upon landing on planet (Default 0)
Oxygen Specific Pressure: Amount of pressure thanks to oxygen, could allow for high-pressure planets that also forbid burner items. (Default 210)

I could go on. For now, you're welcome to make your own guesses on what the most appropriate temperature values are for the other planets.

29 days ago

@haih_ys I've issued a bug report on your Github showing the current issue with my implementation. I believe the crash is due to AircraftRealism, but I could be wrong. https://github.com/jaihysc/Factorio-AircraftRealism/issues/27

New response