Page 1 of 1
Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 4:11 am
by justarandomgeek
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
Posted: Tue May 16, 2017 4:50 am
by Nexela
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)
Re: Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 8:51 am
by bobingabout
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.
Re: Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 11:28 am
by Choumiko
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
Posted: Tue May 16, 2017 3:24 pm
by justarandomgeek
Choumiko 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.
Comments from Rseding on IRC suggested it would be fairly trivial, but needed a proper request

Re: Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 3:25 pm
by Choumiko
Ok then

Guess i should go back to hanging around on irc
Re: Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 3:31 pm
by ratchetfreak
justarandomgeek wrote:
Comments from Rseding on IRC suggested it would be fairly trivial, but needed a proper request

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
Posted: Tue May 16, 2017 3:37 pm
by justarandomgeek
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
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.
Re: Path Cost Multiplier on Rail entities
Posted: Tue May 16, 2017 4:41 pm
by Rseding91
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.
Most likely the train determined it's path long before you stopped the train along the area it wanted to drive.