Page 1 of 1
[SA] More flexible thruster API
Posted: Sat Dec 14, 2024 9:59 am
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.
Re: [SA] More flexible thruster API
Posted: Sat Dec 14, 2024 12:41 pm
by Koub
[Koub] Moved to Modding interface requests.
Re: [SA] More flexible thruster API
Posted: Fri Dec 20, 2024 7:25 pm
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.)
Re: [SA] More flexible thruster API
Posted: Sun Dec 22, 2024 2:52 am
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.
Re: [SA] More flexible thruster API
Posted: Sun Dec 22, 2024 8:35 am
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.