Is it possible to mod a train with lower top speed on curves

Place to post guides, observations, things related to modding that are not mods themselves.
User avatar
Gergely
Filter Inserter
Filter Inserter
Posts: 616
Joined: Sun Apr 10, 2016 8:31 pm
Contact:

Is it possible to mod a train with lower top speed on curves

Post by Gergely »

I did not say that I am about to make a mod about this.

Is there a way to lower a train's top speed when going over a curved track (in automatic mode only) so that it will slow down as anticipation and takes the turn... realistically? I am thinking of a bullet train mod, with a train that moves on a very extreme top speed but is unable to take turns with it, and must slow down to a rather slow approach with a turn.

Or... is it possible to set something like this on the curved track itself like... top speed or top speed multiplier?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by eradicator »

Nope, nope and nope. Unless you want to do tons of scripting.
User avatar
Gergely
Filter Inserter
Filter Inserter
Posts: 616
Joined: Sun Apr 10, 2016 8:31 pm
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by Gergely »

eradicator wrote:Nope, nope and nope. Unless you want to do tons of scripting.
I figured...

I was hoping that there was actually a way to do this.
User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 579
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by featherwinglove »

It's probably not as hard as all that. I'm guessing you can add a chain signal-like property to the curved section of the track, by which means detect when a train is approaching a curved section and thus command it to put on the brakes. A likely downside to this is that it will slow down at any branch even if it is taking the straight option, as it would probably be quite hard for it to tell the difference between a curved rail it is about to travel on, and one it is about to fly by. In the mean time, it won't slow down at an intersection it doesn't have the option to turn onto if all the tracks passing through it are straight. I recommend starting your mod by adding a speed limit to a normal chain signal.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by impetus maximus »

probably possible featherwinglove. i played on a friends server that had an intersection that seem to make trains slow themselves down. :?
User avatar
Gergely
Filter Inserter
Filter Inserter
Posts: 616
Joined: Sun Apr 10, 2016 8:31 pm
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by Gergely »

Well... hmm it could be possible to make trains take significant damage and possibly blow up when taking turns at very high speeds forcing players to set up circuit network contraptions with train signals before the turn. ...or just place turns at the beginning/end of the route like the following. This could however cease functioning after a number of upgrades to the brake system, and making something stop functioning after a while is not a good way to nerf it.

Code: Select all

-A------<--------------------------------------------------<------B-
    \/                                                        /\
-A------>-------------------------------------------------->------B-
Slashes are intersections.
d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by d3x0r »

Yes.

https://mods.factorio.com/mod/train-speed-limiter

I'm working on updating it...

was looking to see if there were classes of tracks yet...
Could add an option for slow on curves...
jim lee
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Wed Feb 13, 2019 6:25 am
Contact:

Re: Is it possible to mod a train with lower top speed on curves

Post by jim lee »

I notice that trains in V17 can now can show you the route they plan on taking. If I were to do some sort of code like this, a solution is to start at the end of the route and work backwards. At the end you start your speed limit at zero. Then, moving backwards bring the speed limit up, noting every curve and switch. At the curves and switched you set the speed limit back down to whatever you like for curves and switches. After each curve and/or switch start building back up to the top allowable speed again. This gives the train a speed limit profile that allows for braking.

The rate you use to bring up the speed limit after stopping, switches & curves is the rate your train brakes can handle.

I know this works because I used it on a programmable XYZ positioning robot, many many years ago.

-jim lee
Post Reply

Return to “Modding discussion”