IRC logs for #openttd on OFTC at 2026-04-14
β΄ go to previous day
00:04:00 <peter1138> But that's just nitpicking.
00:06:28 <talltyler> Nitpicking is fine π
00:26:08 <peter1138> I like this approach, it doesn't rely on any of the move-things-out-to-a-consist ideas, nor does it prevent any of them.
00:28:13 <peter1138> Also I should've gone to bed but too late.
00:28:14 *** Flygon_ has quit IRC (Read error: Connection reset by peer)
00:32:44 <talltyler> Uh hang on one moment, I'm about to push fixes to your nitpicks π
00:33:20 <peter1138> Right, night night.
00:34:52 <talltyler> Sorry, my force push dismissed it :
00:41:27 <talltyler> Now you are free to go to bed, thanks for the reviews β€οΈ
00:58:19 <peter1138> Are you sure about squash vs rebase?
01:04:59 *** MinchinWeb[m] has quit IRC (Ping timeout: 480 seconds)
01:06:14 *** MinchinWeb[m] has joined #openttd
01:06:35 <talltyler> I could rebase if you think it's better
01:07:46 <talltyler> I guess I wish there was a partial squash option, to combine the first six commits and then keep the [script] and [NewGRF] commits separate
01:08:36 <peter1138> You can rebase it locally to do that first.
01:11:43 <talltyler> Hmm, the script commit can be squashed too, authors don't need to know about it since there's no change.
01:12:32 <talltyler> Oh interesting, I figured that would dismiss your review. Git is smarter than I thought π
01:23:13 *** MinchinWeb[m] has quit IRC (Read error: Connection reset by peer)
01:24:10 *** MinchinWeb[m] has joined #openttd
02:01:29 *** Wormnest has quit IRC (Quit: Leaving)
02:02:36 <talltyler> 15391 is much smaller now π
02:13:37 <ragin_> talltyler: I will tonight π
02:14:19 <ragin_> Is there any more info on how that flag works btw? Or any example switches using it?
02:15:01 <talltyler> The variable is true when the vehicle is driving backwards, and false when it's driving forward π
02:15:19 <talltyler> It's not a flag in NML, just a boolean
02:21:59 <ragin_> Oh easy, I'll see what I can do with it then
02:40:36 *** ChanServ sets mode: +v tokai
02:47:20 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
03:02:52 *** Philemon has joined #openttd
03:10:35 *** Phileman has quit IRC (Ping timeout: 480 seconds)
04:53:17 *** androxarev has quit IRC (Quit: User went offline on Discord a while ago)
05:19:09 <DorpsGek> - Update: Translations from eints (by translators)
05:53:45 *** toktik is now known as Guest7232
05:59:34 *** Guest7232 has quit IRC (Ping timeout: 480 seconds)
07:19:43 <andythenorth> wonder if my compile works
07:19:50 <andythenorth> I don't like to touch it too often π
07:23:03 <andythenorth> trains driving backwards eh π
07:25:31 <andythenorth> yeah this will be popular
07:25:41 <andythenorth> much as I like train flipping, because Game World
07:25:45 <andythenorth> this also is good
07:44:16 <reldred> andythenorth: Iβm honestly keen to see how youβd build networks around it in a mandatory no-flip type scenario.
07:46:40 <__abigail> All-VLocity playthrough
07:49:05 <_zephyris> Yeah no-flip or only-very-slow-when-not-flipped.
07:49:30 <_zephyris> Even as a fun>realism player, that sounds great, good extra challenge
07:55:59 <reldred> _zephyris: Same, Iβm far from a foamer or ultra realism player, and Iβve been really enjoying playing with #15391
07:56:19 <reldred> Gives a lot of weight to the choices rail grfβs give you
07:56:38 <peter1138> Don't worry, someone will complain that's being forced on them.
07:59:52 <__abigail> peter1138: Shunting PR when?
08:00:18 <peter1138> Not from me. I can't fathom how it would work from a UI point-of-view.
08:00:41 <emperorjake> It'd be easy to get around the forced flipping, just top-and-tail every train
08:01:36 <peter1138> Not to mention that parts of the consist depend on attached engine, which might no longer be attached... while on the track.
08:02:49 <andythenorth> so with the `ExtraEngineFlag::HasCab` flag, the consist still has to be built with engine leading, then will reverse later?
08:03:15 <andythenorth> `ExtraEngineFlag::HasCab` won't permit that vehicle to be first vehicle of consist in depot view?
08:06:46 <peter1138> The rules about building a train are not changed.
08:13:02 *** Smedles has joined #openttd
08:20:33 <andythenorth> wonder what happens when I give these brake vans a cab falg
08:20:41 <andythenorth> (dual head engine)
08:21:12 <andythenorth> I could just patch my nml and find out π
08:28:59 <andythenorth> so can RVs back up? π
08:29:17 <andythenorth> zellepins probably can
08:51:47 <peter1138> You can use the numeric literal, no?
09:17:38 <peter1138> Well I'm not going to be using any github extensions/aliases.
09:29:18 *** quast65 has joined #openttd
09:29:18 <quast65> Is this still a thing?
09:32:27 <quast65> I am asking, because it looks like someone made a fix
09:32:41 <LordAro> there is an open PR addressing the issue, yes
09:41:29 <brickblock19280> andythenorth: Yes they already do in non drive through stops
09:42:02 <peter1138> I bet they just rotate on the spot.
09:42:14 <mmtunligit> Pretty sure the do
10:45:23 <talltyler> Dual head engines are already handled, anything between them doesn't make a difference.
10:46:59 <reldred> circle strafing helicopters
10:48:28 <reldred> helicopters doing an inverted half loop to land while under fire, and the pilot is in his underwear. the tiktoks of arma reforger gameplay tell me this is how helicopters work.
10:51:01 <reldred> also at the risk of being greedy, yolo merge 15391 wen :widdle_goblin:
10:51:31 <reldred> itβs such an itty bitty pr now
10:55:58 *** WormnestAndroid has quit IRC (Remote host closed the connection)
10:56:11 *** WormnestAndroid has joined #openttd
11:13:11 <peter1138> Articulated helicopters?
11:27:05 <talltyler> Vertical articulation π
11:30:23 <talltyler> New disaster: the bottom part falls off and explodes when it hits the ground, destroying whatever it lands on
11:59:01 <jfkuayue> Is there a Presley in AV9.8
12:09:05 *** toktik is now known as Guest7244
12:11:39 <talltyler> Yes, the pathfinder should probably consider the lower speed limit of backing up. I'll look into that later.
12:14:00 *** Guest7244 has quit IRC (Ping timeout: 480 seconds)
12:20:45 <talltyler> Hmm, not sure how to figure out if the train will have to reverse when computing a hypothetical path...
12:30:58 <_zephyris> talltyler: I'm not sure the reversing route is worth going down
12:31:40 <_zephyris> ie. Everything about pathfinding now treats a dead end rail as a lost train, I think. So trying to convert that into part of pathfinding seems tricky.
12:32:33 <_zephyris> (though, would be kinda cool)
12:34:20 <_zephyris> Only deciding when leaving a station seems simpler, but I don't know anything about how it's implement!
12:42:32 <talltyler> Oh, I don't mean whether the train will reverse along it's route, I mean when it's deciding to leave a station, should it go forwards along a longer (but faster) route, or back up along a shorter (but slower) route.
12:46:11 <rito12_13[d]> Train doesn't have to go all the way to the dead end, it only needs to pass the tile with the junction, or does it?
12:46:42 <peter1138> Pathfinder is not design to handle reversing and crossing previously considered track.
12:47:02 <_glx_> IIRC PF run from station can have two starting tile/direction
12:47:26 <Borg> hmm yeah, there is reverse at station setting.. or.. and line ends
12:47:30 <Borg> going to have 3th option?
12:47:34 <peter1138> talltyler, add a per-tile penalty when the train can only reverse at a slow speed. That penalty is then not applied when travelling forwards.
12:51:10 <andythenorth> (not specifically about reddit)
12:54:32 <LordAro> post a picture of the warning they ignored
12:55:21 <LordAro> "I had spent an exorbitant amount of time on this particular saved game"
12:55:28 <LordAro> "My former thoughts were, that, the former industries would just disappear.... while the common industries might remain... and while the new industries would either spawn anew or can be privately funded."
12:56:17 <andythenorth> I did used to switch industry sets in game
12:56:27 <andythenorth> so I don't think the OP was being irrationally silly
12:56:41 <andythenorth> but if you know at all how the game works, it's "huh? :o"
13:07:26 <LordAro> sure, but you still have to ignore all the warnings to do so
13:12:29 <talltyler> Right, but how to figure out if the train will have to reverse?
13:15:17 <talltyler> We know the direction of the TrackDir on the tile being evaluated, but not the direction the train will face when it gets to said tile.
13:18:17 <talltyler> Maybe we could add a fixed cost to the first tile evaluated if the train has to reverse, but I'm not sure how to get that either. π
13:18:54 <peter1138> That basically already exists, but is not the correct thing to do, as the train may already be travelling backwards, in which case reversing should be preferred.
13:21:47 <peter1138> Might be fine though. In `YapfTrainCheckReverse`, there is `int reverse_penalty = 0;`
13:22:47 <peter1138> Might be feasible to extend it to "forward_penalty" and "reverse_penalty", and set whichever one is appropriate for the current flags.
13:23:33 <peter1138> Nah, I'm not really following how this code works right now. Best get back to JBEX.
13:23:43 <talltyler> If we are considering the case where the train is stopped in a station after unloadng and can either back up or go forward, its flags won't be set yet.
13:24:13 <talltyler> We need to figure out if the train will reverse, before the train itself knows if it will reverse π
13:24:26 <peter1138> It will have a flag set if it's already reversing.
13:24:48 <talltyler> Oh wait, I see what you mean
13:25:35 <talltyler> Hmm, so `if we are already backing up and want to reverse to go forwards` or vice versa.
13:28:48 *** x1vi_zi has quit IRC (Quit: User went offline on Discord a while ago)
13:46:39 <talltyler> Okay, that works perfectly if I set a high enough penalty (10,000 currently) but I get an `assert(n.estimate >= n.parent->estimate);` in `yapf_destrail.hpp` -> `PfCalcEstimate`
13:48:17 <talltyler> It doesn't consider the length that the train will have to reverse either, just solves most issues where you provide a loop and want the train to use it.
13:50:00 *** MinchinWeb[m] has quit IRC (Ping timeout: 480 seconds)
13:50:06 *** MinchinWeb[m] has joined #openttd
14:20:02 <kuhnovic> talltyler: That check is there to guarantee consistency/admissibility of the A* pathfinder. Without it you can't guarantee that A* finds the best path. And while that by itself isn't such a big deal, it can lead to cases where a train could end up going in circles.
14:20:35 <peter1138> The pathfinder expert has entered the chat ;-)
14:21:27 <peter1138> "expert" -> "you changed it you own it" ;-)
14:22:55 <talltyler> Any suggestions for how to fix the check, instead of removing it?
14:23:33 <kuhnovic> Trains (and ships / RV for that matter) don't store the entire path, they rerun their pathfinder quite often. Trains do it at the end of each segment. With consistency/admissibility broken It could happen that a train finds a path, moves to the next segment, and then finds a path that sends it back to the segment it came from. I had similar issues when working on the ship PF.
14:24:28 <kuhnovic> I see that you did: reverse_penalty -= DRIVING_BACKWARDS_PENALTY; . In my experience you should only ever add to the penalty, never subtract, as that leads to these types of checks failing.
14:25:42 <talltyler> Hmm, I guess I could just not apply the penalty if going forwards.
14:27:02 <kuhnovic> Yes that's generally the way to go
14:27:02 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
14:27:54 *** WormnestAndroid has joined #openttd
14:29:04 <_jgr_> Trying to make something very attractive by using a negative penalty is not going to produce the desired result
14:29:10 <talltyler> I was trying to create an incentive for the train to change from backwards to forwards, but my logic might be flawed, if both reversing and non-reversing paths are evaluated before one is chosen. π
14:29:21 <talltyler> Half-cooked idea π
14:29:40 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
14:30:32 *** WormnestAndroid has joined #openttd
14:31:46 *** Wormnest has joined #openttd
14:32:06 <peter1138> Yes, that bit of code in the reversing check is a bit confusing because it does remove from the penalty -- but then it adds it on again.
14:33:20 <_jgr_> Also if you have any kind of penalty/incentive for reversing mid-pathfinder you'll need to keep track of previously passed reverses so that you only incentivise an odd number of reverses
14:35:16 <peter1138> A per-tile penalty instead of a one-off penalty would presumably mean it prefers to go forwards, so would (spend more time) trying to find a forward path.
14:36:45 <kuhnovic> In general a way to add a negative penalty is to always apply the penalty expect for the case you want to incentivise
14:42:13 <peter1138> Pretty sure a regular positive penalty is all that's needed :)
14:42:28 <peter1138> Then we get on to arguing about the costs and configurability...
14:42:32 <peter1138> LordAro had a patch for that.
14:43:37 <_jgr_> The reverse penalty changed in the PR is the one for whether to reverse at the origin
14:45:12 <_jgr_> So simpler to deal with than I was first thinking
14:45:41 <_jgr_> You could also just rotate the origin around to prefer the reversing instead of non-reversing case π
14:52:24 <_jgr_> If the reverse penalty ends up negative as in the PR, reversing the sign, swapping the two origin values and then inverting the result should work without needing to change anything in the pathfinder
15:00:05 <chujo> hey @peter1138, you mentioned the Opus format some time ago (re base sounds).
15:00:38 <chujo> because I don't think the current official version works with OPUS (?)
15:01:09 <peter1138> Hmm, I probably just sat on it, indeed.
15:02:12 <talltyler> Fixed my bad pathfinder shenanigans π
15:03:21 <peter1138> chujo, I'll see if I can resurrect it later.
15:03:58 <peter1138> There was a certain amount of getting distracted by switching to CMake and tidying up the code.
15:09:31 *** urdh has quit IRC (Quit: Boom!)
16:30:43 <peter1138> Heh, some of that patch looks familiar.
16:36:11 <kuhnovic> Somehow I read Deletion instead of Detection
17:39:16 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
17:46:14 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
17:47:55 *** WormnestAndroid has joined #openttd
17:58:36 <peter1138> Squirrel compatibility types are a pain in the bum.
17:58:56 <peter1138> All these duplicated enums.
19:17:32 <andythenorth> trying to figure out what that needs for merge ^
19:17:48 <andythenorth> currently Horse main branch uses it, because I have a patched nml
19:17:55 <andythenorth> nobody else will be able to compile π
19:18:02 <andythenorth> `tile_has_railtype_badge`
19:19:58 <andythenorth> `Change: add support for vehicle var 0x65 (OpenTTD #14312)` fails the commit format
19:20:22 <rito12_13[d]> `Merge branch 'master' into vehicle-var-65`
19:28:12 <andythenorth> maybe I just make an nml merge stack π
19:35:45 <peter1138> Your patch doesn't make sense.
19:37:29 <peter1138> tile_has_roadtype_badge and tile_has_tramtype_badge are the same.
19:37:45 <peter1138> The code makes no distinction.
19:38:40 <peter1138> Maybe it does make sense, but multiple names for the same thing is, uh.
19:46:20 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
19:47:59 *** WormnestAndroid has joined #openttd
20:02:11 *** urdh has quit IRC (Quit: Boom!)
20:02:34 *** Wormnest has joined #openttd
20:06:54 *** Borg has quit IRC (Quit: leaving)
20:08:39 <andythenorth> it's just copy-paste of the pattern
20:08:52 <andythenorth> it's so long ago, I've forgotten what it's for π
20:10:07 <andythenorth> oh ok, same parameter
20:10:13 <andythenorth> so what's the naming convention then?
20:12:02 <andythenorth> tile_has_roadtramtype_badge?
20:18:29 *** toktik has quit IRC (Remote host closed the connection)
20:22:27 <peter1138> I dunno, maybe it's fine.
20:22:54 <peter1138> Also I'd forgotten it is for the rail/road type, not the tile itself.
20:23:33 <peter1138> Okay, now I need to make a NewGRF with trees in it.
20:27:13 <andythenorth> I _think_ there's a pattern of just replicating token names for rail and road types but eh
20:27:18 <andythenorth> I'm not a programmer π
20:29:49 <andythenorth> who reviews nml these days anyway? π
20:34:53 <andythenorth> should I get nml merge rights back?
20:35:28 <andythenorth> I handed my keys in because I didn't like the responsibility π
20:39:07 <peter1138> How do you make a NewGRF?
20:39:59 <andythenorth> copy an existing one
20:43:17 <andythenorth> do we squash and merge, or rebase and merge?
20:45:16 <_zephyris> Essentially identical for one commit PRs, squash and merge gives a chance to fix the commit message
20:46:15 <_zephyris> (if you trust my somewhat noob-level advice π )
20:55:45 <andythenorth> pff that was a merge not a rebase π
20:56:37 <talltyler> I can do a rebase π
20:57:26 <andythenorth> I have a bad habit of clicking buttons if they sound imperative
20:57:40 <andythenorth> GH does have a rebase option though, it's just on a segmented dropdown
20:57:52 <andythenorth> this is why I handed in my keys every other time
20:58:01 <andythenorth> they give enough power to break things, but not fix things
20:58:06 <talltyler> Donβt worry about it π
20:58:51 <andythenorth> I am better in two-pizza-slice teams
20:58:56 <andythenorth> not two-pizza teams
20:59:55 <talltyler> I donβt know this pizza reference π
21:01:17 <andythenorth> ideal team size can be fed by two pizzas
21:01:24 <andythenorth> my preference is a team size of 1 π
21:01:48 <andythenorth> I triggered an assert, but unsure if it's related to driving backwards
21:04:15 <andythenorth> @cached_property
21:04:15 <andythenorth> def is_caboose(self):
21:04:15 <andythenorth> # predicate for wagons which act as caboose (or similar)
21:04:15 <andythenorth> makes this driving backwards patch easy π
21:07:47 <_jgr_> It looks like a c++ exception was thrown, so you've ended up at the NOT_REACHED in StartNewThread, so the stack trace is mostly useless unfortunately
21:08:27 <andythenorth> it's apparently reproducible
21:08:39 <andythenorth> but as I have broken grfs in my savegame π€·ββοΈ
21:09:10 <andythenorth> talltyler: patched Horse
21:09:17 <andythenorth> brake vans, spacer wagons have cabs
21:09:35 <andythenorth> weird side effect is that all trains with brake vans now reverse π
21:14:49 <andythenorth> propelling brake van variants? π
21:15:11 <andythenorth> 1/8 long invisible 'reversing' wagon?
21:25:30 *** urdh has quit IRC (Ping timeout: 480 seconds)
21:29:53 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:35:02 *** Flygon_ has joined #openttd
21:41:52 *** Flygon has quit IRC (Ping timeout: 480 seconds)
22:14:31 <talltyler> Surely you just want this PR instead of a NewGRF hack?
22:58:17 <_glx_> _jgr_: yeah and the hard part is to find where an exception is thrown outside of a try/catch
23:01:40 <_jgr_> If the try catch is removed entirely and the function is made noexcept, std::terminate will get called instead which is generally more useful as you will get a stack trace
23:02:18 <_jgr_> You can use std::set_terminate to make that a bit nicer but it's not all that necessary
23:03:41 <_glx_> generic exception should trigger a FatalError
23:10:57 <talltyler> Can you reproduce it without the broken GRFs? I am not triggering it by building the same trains from your screenshot.
23:18:29 <_glx_> oh there's a `no_thread` param for video driver
continue to next day β΅