[SA] More flexible thruster API

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
shadow0133
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Aug 08, 2018 2:05 pm
Contact:

[SA] More flexible thruster API

Post by shadow0133 »

TLDR
Current thruster API is very specific to the single thruster that's in the game, which makes adding custom ones much harder.
Why?
I'm making a nuclear thermal thruster mod, which i would like to make such that it consumes propellant liquid and uranium fuel cells, gain temperatures from burning fuel cells, and has bigger thrust than vanilla one. Currently it's not possible to change max thrust or have thruster take anything else than two liquids.
What?
I'm still a novice at modding factorio, so takes this with big grain of salt, but i think thruster API should:
  • add max_thrust field
  • have ability to disable fluid boxes
  • allow more control over "recipe", e.g. allow heat input, etc.
Koub
Global Moderator
Global Moderator
Posts: 7955
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [SA] More flexible thruster API

Post by Koub »

[Koub] Moved to Modding interface requests.
Koub - Please consider English is not my native language.
petrathekat
Inserter
Inserter
Posts: 21
Joined: Fri Apr 19, 2024 7:12 pm
Contact:

Re: [SA] More flexible thruster API

Post by petrathekat »

The way the current thruster mixes fluids would be difficult to express in the current API, but even some kind of modder-only `thruster-interface` prototype, with an EnergySource and an energy/thrust response curve, would be quite invaluable.

You could build more in-depth custom thrusters over that base with compound entities, or whatever. (See: all the creative ways modders have used electric energy interfaces!). As-is, there is *no* way to make a custom thruster.

(Well, I guess you could ... make an invisible tiny thruster, then use a script to insert fuel and oxidizer into it based on the power satisfaction of a different entity. But that is quite janky.)
braxbro
Inserter
Inserter
Posts: 37
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Re: [SA] More flexible thruster API

Post by braxbro »

Failing this, compound entities can do a lot for what you want. Assemblers can take ingredients and spit out fluids. Fluid boxes can now be directly linked, which makes things look even more seamless.

For your example, you could make an assembler turn nuclear cells into a dummy fluid that gets directly output into the thruster via linked fluid boxes, then use the normal fluid input for the other input of the thruster.
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 200
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: [SA] More flexible thruster API

Post by Khazul »

The existing thrusters seem very entwined with the fuel type that they use in that the gfx appear to be tinted according to the relative fuel amounts in the thruster tanks and underlying model consumption/efficiency/thrust model seems highly entwined as well, so not sure what they could usefully abstract that would give devs a meaningful head start.

I kind of do not see the point in making alternative fuel based thrusters unless they work differently as well, for eg a nuclear thruster that comes to come is either an electric thruster (ion etc) or a nuclear pulse drive that would need a very different model, flame effect and thrust profile etc.

You would probably want to just provide a thrust force value back to the game engine and accept a thrust on/off state (can already be read AFAIK from hub state) and otherwise do you own entity and gfx etc in terms of what an API would provide.

Expanse style magnetically accelerated fusion drives might be fun complete with fusion pellet fuel. They might also provide on board power with their own power generation loop for eg.
Post Reply

Return to “Modding interface requests”