Fluid fueled locomotives?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2547
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Fluid fueled locomotives?

Post by FuryoftheStars »

Hi,

I was wondering if anyone knew if with the changes in 0.17 if the concept of liquid/diesel powered trains was a little easier to achieve?

I've been working on updating evildogbot100's Diesel Locomotive mod for personal use but have run into trouble with the pumps he had setup for taking the fluids. Off-hand I'm guessing it might have something to do with the changes to where you can't have a negative power consumption value....

But I would be more interested to see if it was possible to get this concept to work with less hacky methods.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Fluid fueled locomotives?

Post by ownlyme »

you can use energy_source.type = "void"
does that help?
Can you add much more input connection points so you don't have to align the trains so precisely anymore? maybe you can disable the "placeable-off-grid" for the pumps
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2547
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Fluid fueled locomotives?

Post by FuryoftheStars »

Hi ownlyme, thanks for the reply!

I gave both the energy_source.type = "void" and removing the "placeable-off-grid" a try to see if they'd help and I couldn't see any effect.

I'm not sure about defining more connection points? It seems like there were 243 pump variations defined in the original setup of the mod. I'll confess that I'm not able to follow everything the code is doing.

In the original mod, it looks like he created 3 "proxy tanks" (pumps) on each locomotive when it was stopped, the rear feeding into the middle and the middle feeding into the front. I'm curious to know if we still had to do it this way, or if there's something else that could be used? Like a regular pipe/tank or even the fluid wagon? I seem to remember asking him once about why the 3 pumps and if they could be reduced/combined into one and he said something about the game crashing if he didn't use exactly 3.

I lost some time tonight trying to pull the changes and fixes I did for his mod out of another mod I was working on so it could stand alone. It's getting late here now, but I'll see if I can figure anything else out later. If you think of any else or want to see the updated mod to look at it, let me know.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2547
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Fluid fueled locomotives?

Post by FuryoftheStars »

I've had some success. Changed the pumps into storage-tank and then removed the input/output designations on the pipe connections. There is now fluid flowing in, so that's progress. :)
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: Fluid fueled locomotives?

Post by evildogbot100 »

Hi, I'm the creator of Diesel Locomotive mod. Thank you for giving so much effort into diesel locomotive. Regarding the pumps, if I'm not mistaken, you can give its energy requirement very small number like DBL_EPSILON or FLT_EPSILON and it will works just fine without any power pole. I believe it is due to the quirks of the game engine itself when checking float number equality.

Now, the reason I used pump instead of just simple connection or whatever, is because of the unmodifiable behavior of the locomotive's fuel inventory. It tends to shift right any fuel item in its inventory when it starts moving, so in order to maintain behavioral consistency, I force the fluids to push-to-front with the pumps.

I'm sorry that the code is super messy, it was written when I didn't know any software engineering principles. Even now, I can barely read my old code :oops: .

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2547
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Fluid fueled locomotives?

Post by FuryoftheStars »

Hey, I sent you a PM back earlier with the updated mod attached. :)

Yeah, onlyme and myself Pm’d back and forth a few times. We got the pumps to work with the energy_source.type = “void”... I was using it wrong. :lol:

When using them as tanks, I noticed a couple issues with the speed of pumping the fluids in while the storage capacity was high, and then when doing short bursts and stopping with the train, the fluids would attempt to rebalance and because of rounding, you could essentially end up creating fuel out of thin air.

Next thing I looked at was using a single tank to eliminate this. While this looks doable, if I wanted to maintain the same ability to allow a user to hook up a pump anywhere on the train (and limiting it to just pumps), I’d need something like 4096 variations of the tank to allow any combination of hookups. I could decrease this to something like 64 if I just cut the number of connection points in half, or even 16 if I only allowed 4 valid connection points, but I’m unsure how users would react to it, so I’m going to leave the pump system you have unless I get other feedback that makes me think doing the above would be well received.

Thanks so much for having created this mod in the first place and giving me a chance to keep it going!
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Post Reply

Return to “Modding discussion”