[0.15] Train Speed Limiter

Topics and discussion about specific mods
Post Reply
d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

[0.15] Train Speed Limiter

Post by d3x0r »

Extends JunkTrains, BioIndustries and RailPowerSystem mods to modify train speeds based on track type. Updates some of the properties of locomotives to balance them back to near default speeds.

Train Speed Limiter mod

Github

Could use some feedback on balancing. Unfortunately due to the dynamic nature, default trains had to be slowed down slightly.

Wildejackson
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sun Jul 31, 2016 2:40 am
Contact:

Re: [0.15] Train Speed Limiter

Post by Wildejackson »

Fantastic, before this there was no need to use the higher tier rails.

ThorsDragon
Inserter
Inserter
Posts: 45
Joined: Mon Jul 04, 2016 7:29 pm
Contact:

Re: [0.15] Train Speed Limiter

Post by ThorsDragon »

This is a really cool mod!!

Could you possibly add support for More Locomotives? If you can, that'd be SUPER AWESOME!! :D

Thanks for the fantastic mod!! :D

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: [0.15] Train Speed Limiter

Post by d3x0r »

ThorsDragon wrote:This is a really cool mod!!

Could you possibly add support for More Locomotives? If you can, that'd be SUPER AWESOME!! :D

Thanks for the fantastic mod!! :D
Which locomotives?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2919
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [0.15] Train Speed Limiter

Post by Optera »

d3x0r wrote:
ThorsDragon wrote:This is a really cool mod!!

Could you possibly add support for More Locomotives? If you can, that'd be SUPER AWESOME!! :D

Thanks for the fantastic mod!! :D
Which locomotives?
He might be talking about my mod adding upgradable locomotives.
I know I'm terrible at naming my mods. :oops:

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: [0.15] Train Speed Limiter

Post by d3x0r »

Optera wrote:
d3x0r wrote:
ThorsDragon wrote:This is a really cool mod!!

Could you possibly add support for More Locomotives? If you can, that'd be SUPER AWESOME!! :D

Thanks for the fantastic mod!! :D
Which locomotives?
He might be talking about my mod adding upgradable locomotives.
I know I'm terrible at naming my mods. :oops:
LOL Oh my bad :) oh literally; I didn't read the capitalization.

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: [0.15] Train Speed Limiter

Post by d3x0r »

Optera wrote: He might be talking about my mod adding upgradable locomotives.
I know I'm terrible at naming my mods. :oops:
:( You conflict with https://mods.factorio.com/mods/GotLag/N ... ocomotives

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2919
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [0.15] Train Speed Limiter

Post by Optera »

d3x0r wrote:
Optera wrote: He might be talking about my mod adding upgradable locomotives.
I know I'm terrible at naming my mods. :oops:
:( You conflict with https://mods.factorio.com/mods/GotLag/N ... ocomotives
Using both mods is redundant. We both add very similar Nuclear Locomotives with different recipes and slightly different stats. Though mine explodes on destruction, taking half of your base with it. :twisted:

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: [0.15] Train Speed Limiter

Post by d3x0r »

don't know how many other mods use your train names... changing them to be MT- prefixed would avoid conflicts; but you're probably right.

----
I don't have information from the game like 'is this train accelerating or decelerating' especially when there isn't a player in it. So I have to make some guesses; such as comparing the current speed vs the last train speed (I had a bug that was causing me lots of issues by comparing vs the last set speed) To make this work reasonably well, I can only apply track penalties when accelerating, otherwise trains slow to a crawl when approaching train stops because the track is an extra breaking force. If I had a bit of scrap track before normal track ... (s=scrap, S=standard, Z is the stop) say this layout is where the train thinks it should be slowing for approach SSSSsssssSSSSSSSSSSZ ... then after leaving the scrap track, the train doesn't attempt to re accelerate back up to speed after leaving the scrap track; and would also crawl into a station (yes bad design, and purly user error, just an observation)

So anyway; I found this error originally transitioning from concrete rails where the train was able to get up to speed, and then returning to a stretch of standard rails, the first tick the train would be slowing a lot, the next tick, because it was slowing, and I didn't apply the track scalar, it would fully accelerate above what it was originally, and I would apply the track scalar, which would make it seem like it was braking and so it wouldn't apply ... etc, this oscillation allowed the train to way exceed what it should have been on standard track... -0.997, +1.004, -0.997, +1.004, -0.997, +1.004 (where 1.0 is prior speed==current speed) etc... I mention this because in re-scaling conventional trains, with load, on wood, on standard track I'm running into the same situation when the burner runs out of fuel. It stutters 1 tick when there's not enough energy left, which allows it to extra accelerate by internal mechanic... so it gets into a runaway condition where the top with LLCCCC is about 280, when the log changes it goes up to 360+.

I can't write to train max_speed, so I really can't set a low max_speed to cap trains based on their own type, or raise it for concrete rails.

standard trains are kind of highly penalized when carrying a load; and should be rebalanced....

Unmodified W = Wood; S = Solid Fuel, R = Rocket Fuel
-- 219 W-LCCCC 260 S-LCCCC 272 LCC 298.1 R-LCCCC
-- 259.2(MAX) W-LLCCCC , LL CCCC CCCC, LL Anything really.
-- 110(1 lap), 136(2 laps) W-L CCCC CCCC

Newly Modified Stats
-- 267 W-LLCCCC 337 R-LLCCCC
-- 202 W-LLCCCC CCCC
-- 152 W-LCCCC
-- 108 W-LCCCC CCCC

Although newly modified trains accelerate much much faster.... this'll take some time.

ThorsDragon
Inserter
Inserter
Posts: 45
Joined: Mon Jul 04, 2016 7:29 pm
Contact:

Re: [0.15] Train Speed Limiter

Post by ThorsDragon »

Optera wrote:
d3x0r wrote:
ThorsDragon wrote:This is a really cool mod!!

Could you possibly add support for More Locomotives? If you can, that'd be SUPER AWESOME!! :D

Thanks for the fantastic mod!! :D
Which locomotives?
He might be talking about my mod adding upgradable locomotives.
I know I'm terrible at naming my mods. :oops:
Yes I meant this mod: More Locomotives. I'm sorry for not seeing the question and replying to it. Thanks Optera for clarifying!! And thank you d3x0r for getting to this addition so quick!!! I really appreciate it!

Would you be willing to add one more, please?? 0: D [https://mods.factorio.com/mods/folk/folk-shuttle] Here's the mod link this time. XD

ThorsDragon
Inserter
Inserter
Posts: 45
Joined: Mon Jul 04, 2016 7:29 pm
Contact:

Re: [0.15] Train Speed Limiter

Post by ThorsDragon »

d3x0r wrote:don't know how many other mods use your train names... changing them to be MT- prefixed would avoid conflicts; but you're probably right.

----
I don't have information from the game like 'is this train accelerating or decelerating' especially when there isn't a player in it. So I have to make some guesses; such as comparing the current speed vs the last train speed (I had a bug that was causing me lots of issues by comparing vs the last set speed) To make this work reasonably well, I can only apply track penalties when accelerating, otherwise trains slow to a crawl when approaching train stops because the track is an extra breaking force. If I had a bit of scrap track before normal track ... (s=scrap, S=standard, Z is the stop) say this layout is where the train thinks it should be slowing for approach SSSSsssssSSSSSSSSSSZ ... then after leaving the scrap track, the train doesn't attempt to re accelerate back up to speed after leaving the scrap track; and would also crawl into a station (yes bad design, and purly user error, just an observation)

So anyway; I found this error originally transitioning from concrete rails where the train was able to get up to speed, and then returning to a stretch of standard rails, the first tick the train would be slowing a lot, the next tick, because it was slowing, and I didn't apply the track scalar, it would fully accelerate above what it was originally, and I would apply the track scalar, which would make it seem like it was braking and so it wouldn't apply ... etc, this oscillation allowed the train to way exceed what it should have been on standard track... -0.997, +1.004, -0.997, +1.004, -0.997, +1.004 (where 1.0 is prior speed==current speed) etc... I mention this because in re-scaling conventional trains, with load, on wood, on standard track I'm running into the same situation when the burner runs out of fuel. It stutters 1 tick when there's not enough energy left, which allows it to extra accelerate by internal mechanic... so it gets into a runaway condition where the top with LLCCCC is about 280, when the log changes it goes up to 360+.

I can't write to train max_speed, so I really can't set a low max_speed to cap trains based on their own type, or raise it for concrete rails.

standard trains are kind of highly penalized when carrying a load; and should be rebalanced....

Unmodified W = Wood; S = Solid Fuel, R = Rocket Fuel
-- 219 W-LCCCC 260 S-LCCCC 272 LCC 298.1 R-LCCCC
-- 259.2(MAX) W-LLCCCC , LL CCCC CCCC, LL Anything really.
-- 110(1 lap), 136(2 laps) W-L CCCC CCCC

Newly Modified Stats
-- 267 W-LLCCCC 337 R-LLCCCC
-- 202 W-LLCCCC CCCC
-- 152 W-LCCCC
-- 108 W-LCCCC CCCC

Although newly modified trains accelerate much much faster.... this'll take some time.
I don't fully understand this, but if you're working on making your mod better, than go for it! I love trains, and I really appreciate the work and effort that you've put into this mod already! :D

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: [0.15] Train Speed Limiter

Post by d3x0r »

ThorsDragon wrote: Would you be willing to add one more, please?? 0: D [https://mods.factorio.com/mods/folk/folk-shuttle] Here's the mod link this time. XD
I don't see any changes needed for this one... the shuttle is an addon to existing trains and doesn't add a new train type

ThorsDragon
Inserter
Inserter
Posts: 45
Joined: Mon Jul 04, 2016 7:29 pm
Contact:

Re: [0.15] Train Speed Limiter

Post by ThorsDragon »

d3x0r wrote:
ThorsDragon wrote: Would you be willing to add one more, please?? 0: D [https://mods.factorio.com/mods/folk/folk-shuttle] Here's the mod link this time. XD
I don't see any changes needed for this one... the shuttle is an addon to existing trains and doesn't add a new train type
Oh, my apologies- it used to be separate Train. Thank you for looking d3x0r! :D

Post Reply

Return to “Mods”