IRC logs for #openttd on OFTC at 2025-04-05
        
        
        
            ⏴ go to previous day
00:13:02  *** WormnestAndroid has quit IRC (Remote host closed the connection)
 
00:13:08  *** WormnestAndroid has joined #openttd
 
01:40:16  *** Wormnest has quit IRC (Quit: Leaving)
 
02:32:53  *** WormnestAndroid has quit IRC (Remote host closed the connection)
 
02:33:00  *** WormnestAndroid has joined #openttd
 
02:45:49  *** gnu_jj_ has joined #openttd
 
02:49:07  *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
 
02:49:22  *** geizeskrank has quit IRC (Ping timeout: 480 seconds)
 
02:52:54  *** geizeskrank has joined #openttd
 
02:57:13  *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
 
02:57:15  *** WormnestAndroid has joined #openttd
 
02:57:36  *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
 
02:57:37  *** WormnestAndroid has joined #openttd
 
02:57:45  *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
 
02:58:08  *** WormnestAndroid has joined #openttd
 
03:54:01  *** debdog has quit IRC (Ping timeout: 480 seconds)
 
04:31:58  *** D-HUND is now known as debdog
 
04:43:50  <DorpsGek>   - Update: Translations from eints (by translators)
 
05:13:53  <andythenorth> lol I should not reply
 
05:14:15  <andythenorth> I need github to test my recent coffee intake before allowing a reply
 
07:18:54  <kuhnovic> KuhnovicviaGitHub: xarick  It would be great if you could test this one
 
08:35:02  <andythenorth> if you saw `length = len(my_list or [])` would that be a weird idiom?
 
08:50:24  <pickpacket> andythenorth: lunch *now*??
 
08:50:50  <pickpacket> At 9:50 in the morning?
 
08:51:36  * pickpacket hasn't even had breakfast yet
 
08:52:22  <pickpacket> Then I suggest brunch
 
08:52:49  <andythenorth> I was considering an end run
 
08:55:03  <andythenorth> cutting out the first step, going straight to the main event
 
09:01:30  <pickpacket> Yeah, you're right. Might as well
 
09:01:57  *** mindlesstux has joined #openttd
 
09:02:55  <pickpacket> Is a 15.0-beta2 still on the table, btw?
 
09:25:18  <andythenorth> is peter1138[d] on a bike?
 
09:34:37  *** WormnestAndroid has quit IRC (Remote host closed the connection)
 
09:34:41  *** WormnestAndroid has joined #openttd
 
09:40:40  <xarick> checking if my maths at calculating tiles are correct TestRemoveRail().TryRemove(entry_tile_2, exit_tile_2, 2 * exit_tile_1 - entry_tile_1)
 
09:47:12  <andythenorth> flag on badges, option to group in buy menu?
 
09:47:52  <andythenorth> variants implementation could be backwards supported by adding badges from variant prop
 
09:50:19  <xarick> it starts removing from the wrong tile
 
09:50:50  <xarick> this is what I expected:
 
09:51:26  <xarick> seems that first and last tracks are being included?
 
09:51:43  <xarick> gonna check openttd code
 
09:53:27  *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
 
09:54:03  <xarick> the script function I use is ScriptRail::RemoveRail
 
09:58:45  <kuhnovic> Are you still checking the consequences of the PR I merged yesterday? You did see I have another one open since this morning right?
 
09:59:24  <xarick> okay, what Im doing is "wrong"
 
09:59:45  <xarick> or currently it got into a wrong state
 
10:00:36  <xarick> previously, this would fail at removing
 
10:01:19  <xarick> now, why did it add tile 1555 as part of the route
 
10:01:42  <xarick> it's part of the station
 
10:06:02  <xarick> hmm pff, i depend on the ALREADY BUILT error again
 
10:15:11  <xarick> alright, this is it, this is the problem... I was dependant on ERR_ALREADY_BUILT
 
10:15:38  <xarick> if already built, don't push tile 1555 into m_builtTiles
 
10:16:02  <xarick> but now it doesn't fail at building if it's already built, so tile 1555 is pushed into m_builtTiles
 
10:16:31  <xarick> when the ai notices it can't build the 2nd rail line, it removes everything that was pushed into m_builtTiles
 
10:16:51  <xarick> tile 1555 is present now, it was not present before Kuhnovic
 
10:17:47  <kuhnovic> kuhnovic: xarick for the third time...
 
10:18:25  <xarick> it's not a problem doing remove rail
 
10:18:57  <xarick> it's indeed the BuilRail not failing at ERR_ALREADY_BUILT
 
10:20:11  <xarick> oh, 13968, my bad I didn't pay attention
 
10:25:09  <xarick> yay, 13968 fixed it, just tested
 
10:26:04  <kuhnovic> I made the same change for roads, with a little luck it's fixed as well
 
10:42:46  <xarick> i have a lot of already built errors in roads hmm
 
10:42:59  <xarick> wondering which ones are important
 
10:43:05  <xarick> enough to cause issues
 
10:43:38  <kuhnovic> But is it any different to what it was before?
 
10:52:31  <_glx_> Write only discord can be annoying 😉
 
10:55:05  <xarick> I'm not sure, i'm investigating
 
11:08:02  <xarick> oh, i just remembered i have a GS already ready to test it, I'm stupid
 
11:09:44  <xarick> hmm looks like it's not working
 
11:20:27  <xarick> just a typo on line 1026
 
11:27:16  <kuhnovic> That code was there before 13885, I simply reverted that change and started over
 
11:29:15  <xarick> needs further investigation, but it's lunch time now, afk
 
11:58:46  <kuhnovic> xarick: FYI no functional changes, just fixed commit messages
 
12:16:49  <xarick> gonna investigate why it used to work
 
12:21:55  <xarick> ah, it's the had_success
 
12:27:07  *** kuka_lie has joined #openttd
 
12:30:24  <xarick> okay, gonna change my suggestion, or make a new one perhaps
 
12:31:51  <kuhnovic> Oh, I now see that the return value on road_cmd.cpp line 1055 depends on had_success. You might be on to something after all.
 
12:32:10  <kuhnovic> This shit is delicate
 
12:34:43  <xarick> `if (ret.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = !is_ai;`
 
12:36:04  <xarick> `if (!is_ai && ret.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = true;`
 
12:36:43  <xarick> maybe the 2nd is better
 
12:37:57  <xarick> what if the ai builds a partial road
 
12:40:33  <kuhnovic> The first one is simply incorrect as it would set had_success to false even if it was already set to true
 
12:40:57  <kuhnovic> So the second one is better. i can change it.
 
12:43:24  <peter1138[d]> You should find a rock, it would be more useful.
 
12:47:41  <xarick> yeh, 2nd is correct, 1st does something different
 
12:50:35  <_glx_> hehe test was not needed for 1st one, it was clearly wrong
 
12:51:45  <kuhnovic> xarick: Then it would have to be had_success_at_least_once, which is way too verbose
 
12:52:24  <_glx_> had_success is fine, you don't care how many times it had success
 
12:52:51  <_glx_> could even be just `success` (quite common in source code)
 
12:57:27  <xarick> kuhnovic: coming from the guy with `node_water_patch_on_high_level_path`
 
12:58:02  <kuhnovic> xarick: Just buy an ultrawide ok 😛
 
12:58:47  <kuhnovic> In all seriousness, although a bit verbose, that code is quite complicated. A bit code self-documenting doesn't hurt in such cases.
 
12:58:49  <_glx_> we should go back to BASIC time
 
12:59:09  <kuhnovic> 640x480 screens only
 
13:02:23  <kuhnovic> Some colleagues of mine work on a different (ancient) product that has function names like ed15 in them. Turns out the author's initials were E.D. and he was already at number 15 with this numbering scheme...
 
13:03:04  <kuhnovic> Then you start do wonder, should I review this code or just punch the guy?
 
13:06:43  <_glx_> I remember the start on opendune, function names were based on memory addresses
 
13:07:09  <_glx_> same for variables of course
 
13:07:47  <_glx_> hard to do different with decompiled stuff
 
13:08:03  <peter1138[d]> andythenorth: is it lunch?
 
13:09:12  <andythenorth> ran out of coffee
 
13:09:17  <kuhnovic> A former colleague of mine was a judge in an international robotics competition. He once had to take a look at a piece of code that was entirely written in japanese. So all your regular syntax was in english, but everything else was essentially obfuscated (for him) 😛
 
13:09:45  <_glx_> hehe like simutrans with german everywhere
 
13:11:57  <kuhnovic> Haha yeah, although as a dutch speaker I can usually work out what it means. But it is a bit silly for an open source project IMO.
 
13:23:24  <andythenorth> wonder if I should just have one level of variant nesting
 
13:23:30  <andythenorth> less string faff 😛
 
14:26:03  *** blathijs has quit IRC (Quit: brb - reboot)
 
14:28:08  <xarick> changing AIs in scenario editor is no longer crashable, right?
 
14:29:41  <xarick> I can safely permit AI/GS parameter changes inside editor
 
14:40:17  *** blathijs has joined #openttd
 
14:40:17  *** ChanServ sets mode: +o blathijs
 
14:46:11  <xarick> the reload AI button is available in scenario editor
 
15:00:12  <_glx_> it will fully reset the company
 
15:06:38  <kuhnovic> xarick: did you pull my latest changes?
 
15:06:48  <andythenorth> don't set variant_group to self 😛
 
15:08:26  <xarick> i tested road, it works now, did you change anything for rail?
 
15:09:44  <kuhnovic> Yes I made the same change for rail. It only sets had_success if it's called in non-ai mode
 
15:10:08  <xarick> oh, then i suppose it works
 
15:10:14  <xarick> let me just test quick
 
15:10:32  <xarick> oh, im in the middle of a rebase
 
15:11:49  <kuhnovic> It was probably working before, but this check doesn't hurt. Just to make sure there is no use case that I've overlooked.
 
15:22:54  <xarick> can you wait a few hours?
 
15:23:17  <_glx_> andythenorth: I hope OpenTTD validates that
 
15:23:37  <xarick> i'm working on something else
 
15:23:54  <andythenorth> _glx_: crashes 🙂
 
15:23:59  <andythenorth> probably an issue somewhere
 
15:25:16  <andythenorth> I can make a test case
 
15:25:36  <andythenorth> but currently Horse needs the badges branch 😐
 
15:29:04  <_glx_> ```/* Check engine variants don't point back on themselves (either directly or via a loop) then set appropriate flags
 
15:29:04  <_glx_> * on variant engine. This is performed separately as all variant engines need to have been resolved. */``` it should be handled
 
15:29:44  <_glx_> open an issue if you have reproduceable test case
 
15:41:28  <_zephyris> What needs to be done for default badges?
 
15:46:24  <kuhnovic> xarick: Are you talking to me?
 
15:46:53  <xarick> yes, you got me in the middle of a tough rebase, and i can't cancel it atm
 
15:47:05  <kuhnovic> I'll be AFK the rest of the night so knock yourself out 😛
 
15:51:02  <xarick> GetBridgeType does not exist on 15.0-beta1? my AI crashed
 
15:52:50  <_glx_> ah yeah might be from after beta1
 
15:55:11  <_glx_> beta1 is not a stable version, so API 15 is only valid for current master
 
15:55:38  <_glx_> beta1 is a nightly without a moustache
 
16:03:32  <xarick> nop, can't notice anything
 
16:03:53  <xarick> ah, it closes dropdown from the list
 
16:03:59  <xarick> maybe it does something
 
16:07:47  *** kuka_lie has quit IRC (Remote host closed the connection)
 
16:29:06  <peter1138> What should a script list do/return if you call Next() when it's already at the end?
 
16:30:16  <xarick> i think regression tests that. I doesn't crash the script
 
16:30:24  <xarick> what it returns... no idea
 
16:32:41  <xarick> trees in scenario editor in fast forward are planted but don't grow?
 
16:36:42  <peter1138> The regression tests it, but IMHO gives a weird result.
 
16:37:18  <peter1138> It returns an item that is no longer in the list, but then again it 
 
16:37:32  <peter1138> does also return true for IsEnd()
 
16:38:32  <peter1138> As any integer value is valid, there's nothing it could return that could mean 'invalid'.
 
16:47:07  <peter1138> Maybe it should error :)
 
16:47:58  <xarick> does it return a warning message?
 
16:53:58  <xarick> _glx_: have you tested what happens if we change the game script to none in the scenario editor?
 
16:54:24  <xarick> is the instance really gone?
 
16:54:52  <peter1138> Even the errors for calling Next() or IsEnd() before Begin() is called are actually just debug messages, so don't show in the script debug window.
 
17:01:04  <_glx_> xarick: of course it's gone
 
17:13:29  <xarick> IsEditableItem greatly simplified
 
17:15:01  <peter1138> Hmm, and getting an item from a list returns 0 if the item doesn't exist.
 
17:15:08  <peter1138> But 0 could be a valid value. Hmm.
 
17:18:45  <_glx_> that's why there's also HasItem
 
17:20:30  <_glx_> and GetValue() also only reads the first matching item
 
17:21:11  <_glx_> though the list prevents adding duplicates
 
17:21:51  <xarick> what does AddItem do if item already exists?
 
17:22:11  <xarick> changes value if it's different?
 
17:23:02  <xarick> wondering about AddList
 
17:23:47  <xarick> if there's items on both lists does it keep the values or updates the values?
 
17:24:11  <_glx_> AddList is AddItem then SetValue
 
17:25:19  <xarick> okay time to test 13968 for rails
 
17:25:59  <_glx_> btw documentation mention all of that 🙂
 
17:34:17  <peter1138> What are we ruining now?
 
17:34:46  <xarick> there was a bug in my code though while I was figuring out where things were going wrong
 
17:35:01  <xarick> turns out it wasn't it
 
17:35:07  <xarick> but still, good that I looked
 
17:36:32  <andythenorth> peter1138: "yes"
 
17:39:17  <andythenorth> I should de-pluralise these though eh?
 
17:39:36  <andythenorth> even though the group contains multiple variant types
 
17:43:19  <peter1138> Pfft, variants aren't group.s
 
17:44:41  <andythenorth> I could de-group the ones that have high variation
 
17:45:15  <andythenorth> those vehicle transporters look quite different
 
17:45:25  <andythenorth> grey area falls on ones like this
 
17:47:24  *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
 
17:47:28  <_glx_> You can't degroup a non existing group
 
17:48:03  *** WormnestAndroid has joined #openttd
 
17:48:22  <xarick> 4x zoom sprites when? 🙂
 
17:49:59  <andythenorth> who named the nml property variant_group? 😛
 
17:58:12  <peter1138> Vehicle Groups. Engine Groups. What ever next?
 
18:03:48  <andythenorth> dunno, but I might remove the pluralisation
 
18:04:24  <andythenorth> maybe just use a badge, no name string 😛
 
18:29:15  <andythenorth> all "Coil Carrier" and then a badge for "Enclosed"? 👀
 
18:36:39  *** talltyler has joined #openttd
 
18:36:39  <talltyler> Nah, I can use my eyes
 
18:41:30  <frosch123> Did you even try LOAD_TEMP for badges?
 
18:42:34  *** ChanServ sets mode: +v tokai
 
18:45:18  <frosch123> No idea what that topic has to do with badges
 
18:47:12  <andythenorth> badge everything 😛
 
18:49:27  *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
 
18:49:53  <peter1138> Ah, usually it's "I want to combine strings for the extra text callback"
 
18:50:13  <peter1138> Which can be replaced by badges.
 
18:51:21  <andythenorth> wonder how much compile time I save if variants level 0 and level 1 have same name string
 
18:51:34  <andythenorth> 2000 instances of stuffing text stack for level 0
 
19:33:07  *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
 
19:33:08  *** WormnestAndroid has joined #openttd
 
19:57:37  *** WormnestAndroid has quit IRC (Remote host closed the connection)
 
19:58:52  *** WormnestAndroid has joined #openttd
 
20:05:50  <_glx_> oh it's unrelated to this one
 
20:11:30  <xarick> also crashes on master, confirmed
 
20:13:18  <_glx_> yeah I confirmed it too
 
20:14:22  <_glx_> ok it confirms what I suspected
 
20:20:16  <andythenorth> name callback (161) can return 0x400 for default name, but I don't see an nml constant for that
 
20:24:36  <frosch123> CB_RESULT_NO_TEXT :p
 
20:26:36  <_glx_> funny how a "simple" change can reveal stuff
 
20:27:22  <andythenorth> frosch123: dunno why I looked at that, then ignored it
 
20:36:29  <xarick> assert(MayHaveRoad) isn't listed in view call hierarchy
 
20:38:10  <xarick> `GetRoadTypeRoad`, `GetRoadTypeTram`, `GetRoadOwner`, `SetRoadTypeRoad`, `SetRoadTypeTram` need to check hierarchy of these
 
20:47:45  *** Wormnest has joined #openttd
 
20:52:41  <xarick> towns can't own road bridges?
 
20:54:01  <xarick> oh, trams can't own trams, my bad
 
21:04:32  <xarick> suspicious bad code style in smallmap_gui.cpp
 
21:08:15  <xarick> it's called twice, could be put into a variable
 
21:11:37  <_glx_> you mean something like ```if (RoadType rt_road = GetRoadTypeRoad(tile) != INVALID_ROADTYPE) {
 
21:11:37  <_glx_> rti = GetRoadTypeInfo(rt_road);
 
21:12:54  <xarick> if it makes drawing the map faster, yeah i guess
 
21:13:19  <_glx_> it will reuse the value
 
21:23:03  <_glx_> oh actually it does the call 2 times, but should not affect perf
 
21:34:23  <_glx_> but only when asserts are enabled, else the code is inlined
 
21:34:43  <xarick> how can a road tile have no roadtype...
 
21:35:41  <_glx_> tram and road types are stored on different location
 
21:36:21  <_glx_> so a MP_ROAD can have only road, or only tram, or both
 
21:36:46  <xarick> wondering if GetPresentRoadTypes could be used
 
21:37:02  <_glx_> and for smallmap road has priority if present
 
21:39:06  *** nielsm has quit IRC (Ping timeout: 482 seconds)
 
21:39:21  *** keikoz has quit IRC (Ping timeout: 480 seconds)
 
21:45:37  <xarick> ```const RoadType rt_road = GetRoadTypeRoad(tile);
 
21:45:37  <xarick> rti = GetRoadTypeInfo(rt_road != INVALID_ROADTYPE ? rt_road : GetRoadTypeTram(tile));```
 
21:46:39  <_glx_> change probably unneeded
 
21:47:59  <xarick> GetPresentRoadTypes is also meh... i just noticed
 
21:48:45  <_glx_> but `rti != nullptr` check is useless I think (but doesn't hurt)
 
21:53:58  <_glx_> anyway I don't think it will be a huge or even visible performance gain
 
22:00:59  *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
 
22:08:37  <xarick> 2 weaks ago this started
 
22:09:06  <xarick> SingleRail pathfinder gets 4000+ trains, DoubleRail pathfinder gets 2000+
 
22:09:20  <xarick> map isn't good enough for ships 😦
 
22:22:17  *** gelignite has joined #openttd
 
continue to next day ⏵