Path Cost Multiplier on Rail entities
-
- Filter Inserter
- Posts: 302
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Path Cost Multiplier on Rail entities
Adding a path cost multiplier to the rail entities would allow mods to make more(/less?) expsensive rails for pathing purposes. This would allow trivially building a mainline with express/local lanes and periodic ramps on/off the express lanes, for example, simply by using higher path cost rails on the local lanes.
Re: Path Cost Multiplier on Rail entities
Allowing the pathfind_penalty to be set on rail prototypes (signals, stations, rails themselves) Would be pretty awesome. (don't forget to make it readable on luaPrototypes)
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Path Cost Multiplier on Rail entities
I had an interesting experience driving a train in my game recently. I needed to AFK so drive my train just past the light of a junction and stopped... to have an automatic train drive right up to that signal and stop... even though there was another path going around the lane I stopped in.
This basically tells me that player driven trains didn't have a high enough penalty set.
edit: and I just realised that this isn't what the topic is about. oh well, I'll leave this here anyway.
This basically tells me that player driven trains didn't have a high enough penalty set.
edit: and I just realised that this isn't what the topic is about. oh well, I'll leave this here anyway.
Re: Path Cost Multiplier on Rail entities
Since i imagine it being fairly costly to do for rails (don't know much about the pathfinder internals) how about having the penalty for trainstops being adjustable via a mod (maybe even only as a prototype and not necessarily changable runtime) Right now the pathfinder has to check for trainstops on the path anyway. Then someone could make a "trainstop" that looks like some sort of sign besides the track.
-
- Filter Inserter
- Posts: 302
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: Path Cost Multiplier on Rail entities
Comments from Rseding on IRC suggested it would be fairly trivial, but needed a proper requestChoumiko wrote:Since i imagine it being fairly costly to do for rails (don't know much about the pathfinder internals) how about having the penalty for trainstops being adjustable via a mod (maybe even only as a prototype and not necessarily changable runtime) Right now the pathfinder has to check for trainstops on the path anyway. Then someone could make a "trainstop" that looks like some sort of sign besides the track.

Re: Path Cost Multiplier on Rail entities
Ok then
Guess i should go back to hanging around on irc

-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Path Cost Multiplier on Rail entities
The only issue is that too many penalties on the track could make the search very expensive as every penalty that needs to be crossed forces the path finder to expand more paths until it searches beyond the penaltyjustarandomgeek wrote: Comments from Rseding on IRC suggested it would be fairly trivial, but needed a proper request
-
- Filter Inserter
- Posts: 302
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: Path Cost Multiplier on Rail entities
So use small modifiers? You shouldn't need much to make a local/express distinction, for example, just a few points of penalty so that the express is consistently "shorter" for long haul trips.ratchetfreak wrote:The only issue is that too many penalties on the track could make the search very expensive as every penalty that needs to be crossed forces the path finder to expand more paths until it searches beyond the penalty
Re: Path Cost Multiplier on Rail entities
Most likely the train determined it's path long before you stopped the train along the area it wanted to drive.bobingabout wrote:I had an interesting experience driving a train in my game recently. I needed to AFK so drive my train just past the light of a junction and stopped... to have an automatic train drive right up to that signal and stop... even though there was another path going around the lane I stopped in.
This basically tells me that player driven trains didn't have a high enough penalty set.
edit: and I just realised that this isn't what the topic is about. oh well, I'll leave this here anyway.
If you want to get ahold of me I'm almost always on Discord.