IRC logs for #openttd on OFTC at 2022-06-10
            
00:49:24 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
01:53:57 *** Etua has joined #openttd
01:54:01 *** Etua has quit IRC ()
02:00:34 *** Etua has joined #openttd
02:00:39 *** Etua has quit IRC ()
02:12:07 *** glx has quit IRC ()
02:16:15 *** Wormnest has quit IRC (Quit: Leaving)
02:46:10 *** D-HUND has joined #openttd
02:49:32 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:31:28 *** Flygon has joined #openttd
03:44:43 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:44:51 *** Smedles has joined #openttd
04:08:32 *** moll has quit IRC (Ping timeout: 480 seconds)
04:16:54 *** moll has joined #openttd
05:12:45 *** andythenorth has joined #openttd
05:51:34 *** Xaroth33 is now known as Xaroth
06:18:54 *** D-HUND is now known as debdog
06:42:56 *** andythenorth has quit IRC (Quit: andythenorth)
07:14:17 *** andythenorth has joined #openttd
07:28:57 *** Etua has joined #openttd
08:13:30 *** felix has quit IRC ()
08:17:47 <andythenorth> trying to understand this https://github.com/OpenTTD/nml/blob/master/nml/main.py#L508
08:18:33 <andythenorth> seems at L544 used_palette will be the palette of whatever realsprite image was checked last
08:19:10 <andythenorth> so the palette of the entire grf is determined by the final check of a spritesheet png?
08:19:14 <andythenorth> this seems...odd
08:19:59 <andythenorth> I guess if the forced value is "ANY" that might be fine?
08:26:14 *** felix has joined #openttd
08:31:47 <andythenorth> the goal here is to not open all the images to check palette, if the output is not grf
08:32:14 <andythenorth> it's 1-2 seconds needlessly on every compile for my grfs, or about 10% of the total nmlc time
08:32:44 <andythenorth> I'm using the nfo output option, and grfcodec will validate the image palettes later
08:41:39 <_dp_> I guess the problem here is that nml needs to write palette in action 14
08:43:20 <andythenorth> well I can use -p and force a palette
08:43:30 <andythenorth> currently I just commented out the whole block, which works :P
08:43:46 <andythenorth> does require -p flag set
08:44:11 <andythenorth> I don't think my diff will be accepted for merge though :P
08:46:32 <_dp_> it still validates palette with -p
08:46:41 <_dp_> but I guess skipping it for nfo output makes sense
08:55:40 *** Samu has joined #openttd
09:15:44 <Samu> retesting 9917
09:29:34 <Samu> uh oh, glx created an underirable effect
09:43:09 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #9917: Fix #9914, 86818e5: prevent more useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9917#issuecomment-1152177295
09:46:32 *** WormnestAndroid has quit IRC (Remote host closed the connection)
09:54:43 *** Mapminik has joined #openttd
09:56:02 *** arikover has joined #openttd
09:56:21 <arikover> Hello everybody!
10:00:18 *** Etua has quit IRC (Ping timeout: 480 seconds)
10:00:18 *** Mapminik is now known as Etua
10:34:30 *** Etua has quit IRC (Quit: Etua)
11:16:47 <Samu> new testings! https://i.imgur.com/BC13ccJ.png
11:39:54 *** WormnestAndroid has joined #openttd
12:12:08 *** glx has joined #openttd
12:12:08 *** ChanServ sets mode: +v glx
12:48:22 <glx> indeed dependabot is very noisy :)
12:51:36 <Samu> hi glx, i'm now been wondering if the v->cur_speed = 0 on 86818e5 was also a bad change
13:25:17 <Samu> testing with v->cur_speed = 0 removed, and with v->cur_speed = u->cur_speed https://i.imgur.com/WHFor7b.png
13:26:39 <glx> oh I found the issue, some vehicles are just continuously turning around (like vehicle #26)
13:27:48 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
13:28:02 *** WormnestAndroid has joined #openttd
13:48:02 *** Etua has joined #openttd
13:55:07 <glx> indeed crash save is in a nice edge case where vehicles after deciding to drive through other ones to unblock are running in circle on a single tile and can't reset blocked_ctr
14:01:07 <Samu> have you seen the bus issue?
14:01:54 <glx> yes, forcing speed to 0 was wrong here
14:02:27 <Samu> yes, i thought so too, and what about in the other place ?
14:02:31 <Samu> in the code
14:04:15 <Samu> this one, from 2021 https://github.com/OpenTTD/OpenTTD/commit/86818e5ae8a170951d00eb0060767c9d1687540c#diff-c7b20601878b09b3bc5dd2b78cd8620999aa7e969c1468011b4d1f2fcc4f04afR1394
14:04:54 <Samu> now that we know better, that one might also been a bad idea
14:06:25 *** Etua has quit IRC (Quit: Etua)
14:07:48 <glx> might be suboptimal, but in this case vehicle just finished turning on the tile
14:08:21 <glx> maybe the same logic as entering on a tile should apply, copy speed from previous and check for 0
14:09:25 <glx> but this logic is broken for now in some very special situations
14:09:56 <glx> like the one in crash save
14:10:30 *** FLHerne has quit IRC (Quit: There's a real world out here!)
14:11:10 *** FLHerne has joined #openttd
14:13:04 <Samu> i'm also inclined to make it copy speed from previous on my PR
14:20:02 <Samu> there is a line just below with if (HasBit(r, VETS_CANNOT_ENTER)) {
14:20:28 <Samu> i wanted to trigger that somehow, do you know how to setup a scenario to reach there?
14:21:49 <Samu> because it may happen past a pathfinder call, wondering if there is also a need to pushfront the same tile into the cache again
14:26:29 <Samu> maybe i need to test tram
14:28:13 <LordAro> i need to set up an email rule to bin all dependabot mails
14:41:24 <glx> and all AIs in the save are dying from excessive cpu usage
14:49:21 <Samu> it's an old ai, before excessive thing was in openttd
14:52:01 <glx> consuming a lot cpu, and not able to build accessible stations
14:57:28 <andythenorth> was it lunch?
15:38:30 *** Flygon_ has joined #openttd
15:40:28 <andythenorth> ok so how can we patch nml to skip palette checks for OutputNFO
15:40:29 <andythenorth> ?
15:41:49 *** Flygon has quit IRC (Ping timeout: 480 seconds)
15:42:39 <andythenorth> maybe wrap all of 512-541 in `if forced_palette == "ANY":` ? https://github.com/OpenTTD/nml/blob/master/nml/main.py#L512
15:43:28 <andythenorth> no that won't work :(
15:43:33 <andythenorth> oof
15:46:33 <_dp_> palette + nfo output check
16:25:36 <andythenorth> are there other output types where checking palette is useless?
16:26:01 <DorpsGek> [OpenTTD/OpenTTD] glx22 updated pull request #9917: Fix #9914, 86818e5: prevent more useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9917
16:28:04 <Samu> nice, what does const do anyway?
16:28:12 <Samu> unchangeable?
16:28:23 <LordAro> got it in one
16:28:46 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #9917: Fix #9914, 86818e5: prevent more useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9917#issuecomment-1152535967
16:30:02 <glx> possibly introduce more cache clearing, but should be less intensive than repetitive pf runs
16:30:13 *** HerzogDeXtEr has joined #openttd
16:31:13 <Samu> will test :)
16:33:43 *** frosch123 has joined #openttd
16:34:04 <Samu> okay i added the const stuff
16:34:08 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #9915: Fix #9914, 86818e5: prevent useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9915
16:34:15 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
16:34:23 *** Smedles has joined #openttd
16:34:29 <glx> oh const is not vital here, it's just a good thing to do
16:34:45 <Samu> also changed speed checking to match yours
16:35:41 <frosch123> andythenorth: the palette stuff should already be part of the sprite-encoding-cache
16:35:42 <glx> I removed speed checks, now it just copy the speed of vehicle in front
16:35:56 <Samu> yeah, i meant that, also copies speed
16:36:06 <glx> and unconditional caching just in case
16:36:11 <frosch123> so you can change it to: iterate-over-spritecache instead of interate-over-files
16:36:18 <andythenorth> oo
16:36:49 <Samu> unconditional caching might be a bad idea, will test
16:37:02 <Samu> if it doesn't result in more pf runs, then fine
16:38:19 <glx> worst case will be for vehicles following another one, but not blocked, their cache will be discarded on each new tile, resulting in pf call on intersection
16:38:24 <glx> I think
16:38:28 <frosch123> since the palette/blitter stuff is part of action14, you cannot just skip it for nfo output, though possibly one could also deprecate the legacy W palette in nml, and error on wrong palette
16:46:01 <andythenorth> hmm
16:47:13 <andythenorth> a check of 'nfo' and '-p is set' would work, but it seems a bit magical
16:47:38 <andythenorth> this is a little bit 3D-chess
16:47:49 <andythenorth> or maybe just 2D chess, but I'm not great at chess
17:01:45 <Samu> tests begin!
17:02:10 <Samu> my connection today is very strange, it's so slow at uploading to both github and imgur, very strange
17:02:42 <Samu> 4 subjects https://i.imgur.com/i4MSsjT.png
17:35:12 <Samu> i think im testing this wrong, none are synced with master anymore
17:35:37 *** Wormnest has joined #openttd
17:39:25 <LordAro> Samu: it's changing how the pathfinder behaves when vehicles are blocked, why are you expecting it to be identical?
17:39:25 *** Samu has quit IRC (Read error: Connection reset by peer)
17:39:30 <LordAro> lol
17:39:37 *** Samu has joined #openttd
17:43:20 *** Flygon_ has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:50:24 <Samu> i need another metric
17:50:33 <Samu> "time spent pathfinding"
17:50:38 <Samu> how do i do this
17:51:00 <Samu> because the number of pathfinding calls alone doesn't tell the whole story
17:51:20 <Samu> some calls can take longer to calculate
17:51:32 <Samu> and it still counts as 1 call
17:52:36 <glx> longest calls are for lost vehicles
17:52:49 <glx> with unexisting path
17:56:23 <Samu> this is of that savegame with all 15 ais non-running, https://i.imgur.com/vlZ16EA.png
17:56:40 <Samu> of 2 days ago
17:56:42 <Samu> or 3
17:56:57 <Samu> so, no changes to the road network
17:57:36 <glx> seems good
18:23:54 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
18:29:45 <Samu> yesterday I was rambling about TileVirtXY(x, y)
18:31:14 <Samu> turns out, i was adding TILE_SIZE to x and y
18:31:35 <Samu> adding 16 would mean i would end on another tile
18:31:45 <Samu> i fixed it with TILE_SIZE - 1
18:32:24 <Samu> that trackdir vs new_td is actually fine, it was false alarm
18:34:07 <Samu> should I post a PR of this? or is it unworthy https://github.com/SamuXarick/OpenTTD/commit/b43be96645a9f7c8dcf18c5f3743d3dca9be6452
18:49:00 <Samu> I can see I can improve the code a bit there
19:18:19 <Samu> hmm this ship reverse cost on the starting tile became complex with the recent ship reversing feature picking up unorthodox trackdirs
19:19:19 <Samu> there are 135 degree turns
19:43:55 <Samu> what shall i call this reverse? unorthodox? need a variable name describing this type of reverse
19:57:54 *** gelignite has joined #openttd
20:04:59 <DorpsGek> [OpenTTD/nml] JGRennison opened issue #253: abs builtin function generates excessively verbose varaction2 output https://github.com/OpenTTD/nml/issues/253
20:09:32 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
20:10:02 *** Wormnest_ has joined #openttd
20:16:55 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
20:24:13 *** wallabra has quit IRC (Ping timeout: 480 seconds)
20:24:33 *** wallabra has joined #openttd
20:26:26 <andythenorth> so is the spritecache populated after the palette check?
20:28:21 <andythenorth> frosch123 with nfo output, cache isn't populated, maybe? :)
20:28:24 <andythenorth> afaict
20:30:51 <frosch123> no idea, you and regression-test are the only ones using the nfo output :)
20:32:08 <andythenorth> maybe I should just maintain an nml fork that skips this palette check :P
20:33:10 <DorpsGek> [OpenTTD/nml] glx22 commented on issue #253: abs builtin function generates excessively verbose varaction2 output https://github.com/OpenTTD/nml/issues/253
20:33:32 <andythenorth> trying to write an appropriate condition for the checks needs a smarter person than me :)
20:36:41 <andythenorth> completely unrelated: bananas has a dependencies field for newgrfs
20:36:57 <andythenorth> that will force download of deps, but won't cause them to be added when the grf is activated for a game?
20:37:14 <glx> exact
20:37:46 <frosch123> it is meant for scenarios and ai/game scripts
20:37:56 <andythenorth> could have been a nice compile time improvement if it was an map-gen dependency :P
20:38:16 *** Wormnest_ has quit IRC (Read error: Connection reset by peer)
20:38:41 <andythenorth> splitting Horse into 2 or 3 sub-grfs
20:39:56 <frosch123> one for each livery
20:39:57 <andythenorth> I did a little speculative test, and I think it would save about 30% of compile time, with make -j and enough thread units
20:40:06 <frosch123> then you do no need an in-game gui to select them
20:40:09 <andythenorth> ooo that is the best bad suggestion for liveries so far :D
20:43:25 *** Wormnest has joined #openttd
20:50:28 *** WormnestAndroid has joined #openttd
20:58:31 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
21:00:24 <FLHerne> _dp_: When you made grf-py, did you consider instead modifying nml itself so it sucks less for that purpose?
21:01:22 <FLHerne> (asking because I've thought about the latter occasionally, but grf-py exists so presumably you thought it was better to make a new lib)
21:01:38 <_dp_> nah, not really
21:01:51 <_dp_> I made is coz I got tired of nml
21:02:00 <_dp_> also it started very small
21:02:06 <_dp_> as nml generator even
21:03:25 <FLHerne> oh, for clarity I meant modifying nmlc to have a reasonably usable Python API
21:03:36 <FLHerne> with `import nml`
21:03:56 <FLHerne> whereas at the moment it's a complete mess, even if some tools do use bits of it
21:04:53 <_dp_> one of the first versions xD https://github.com/citymania-org/debug-trees-grf/blob/c17dc0339fdbc87367e477a5df6682511293f43b/nml.py
21:04:57 *** WormnestAndroid has joined #openttd
21:05:48 <_dp_> yeah, I understood what you mean but I was already half-way into grf-py when I realised that could be an option to consider
21:06:51 <FLHerne> hm, ok
21:07:01 <FLHerne> so you didn't actually rule it out as a terrible idea beforehand
21:08:17 <_dp_> yeah, was never much interested in nml code
21:08:27 *** gelignite has quit IRC (Quit: Stay safe!)
21:08:44 <_dp_> also grf-py has a bit different philosophy than nml in general
21:09:22 <Samu> 135 degree curve penalty "invented"!
21:09:27 <Samu> only ships can do it
21:09:44 <_dp_> for example, on a low level it's not opinionated, it's just matches grf capabilities as much as possible
21:09:56 <_dp_> so as a bonus it can decompile
21:11:26 <_dp_> and higher level tries to build on top of it to making it easier to use
21:13:05 <DorpsGek> [OpenTTD/nml] andythenorth opened pull request #254: Change: skip realsprite palette validation step iff output is nfo AND… https://github.com/OpenTTD/nml/pull/254
21:13:26 <andythenorth> I suspect that could be better but eh ^
21:14:02 <_dp_> funnily one of the reasons for early versions of grf-py was that I got tired of fixing palette in gimp after krita xD
21:14:36 <andythenorth> I suspect there's something flawed about nmlc's "guess the palette for the whole grf by walking over each input file"
21:14:42 <andythenorth> but I can't put my finger on what that might be :P
21:14:45 <Samu> last update before i go sleep https://i.imgur.com/Je0YWid.png
21:16:51 <DorpsGek> [OpenTTD/nml] andythenorth updated pull request #254: Change: skip realsprite palette validation step iff output is nfo AND… https://github.com/OpenTTD/nml/pull/254
21:18:10 <andythenorth> why is palette a compile-time param to nmlc, and not just determined from action 14 or something? :)
21:21:45 <_dp_> any(isinstance(f, output_nfo.OutputNFO) for f in outputfiles) and forced_palette != "ANY"
21:22:32 <andythenorth> PR :P
21:22:50 <andythenorth> strictly I think it should also check for nml output
21:22:58 <andythenorth> because that's a bizarrely valid option afaict
21:23:01 <andythenorth> nml -> nml
21:23:02 <andythenorth> lol
21:23:06 <andythenorth> good use of CPU
21:23:27 <_dp_> lol
21:27:20 <DorpsGek> [OpenTTD/nml] andythenorth updated pull request #254: Change: skip realsprite palette validation step iff output is nfo AND… https://github.com/OpenTTD/nml/pull/254
21:29:45 *** Wormnest has quit IRC (Quit: Leaving)
21:29:52 *** Wormnest has joined #openttd
21:38:40 <Samu> https://github.com/SamuXarick/OpenTTD/commit/4ce61d0c80e2b16abf5e5e28b5dd262644735cb2#diff-65e2e70333e566c0aad5d808d54588a570ec421491d51bd1635c4f1cffeeda4bR299-R304
21:38:57 <Samu> help me with that variable name, unorthodox reverse is bad
21:42:58 <andythenorth> chance anyone will approve my PR? :D
21:43:22 <andythenorth> I can use a forked nmlc, but that might have side-effects :P
21:44:02 <andythenorth> oh black fails?
21:44:26 <andythenorth> I ran black before the forced push though :(
21:45:41 <DorpsGek> [OpenTTD/nml] andythenorth updated pull request #254: Change: skip realsprite palette validation step iff output is nfo AND… https://github.com/OpenTTD/nml/pull/254
21:48:35 *** Samu has quit IRC (Quit: Leaving)
21:50:03 <andythenorth> meh upgraded black, still no change
21:50:54 <frosch123> it's possible that nml uses an old black
21:51:06 <andythenorth> ah
21:51:21 <frosch123> iirc tb did some upgrade+reformat for bananas and eints and such
21:51:30 <frosch123> possibly noone cared about nml :)
21:51:57 <andythenorth> so far I will need to compile about 2400 times to earn back the time I've spent saving time :)
21:52:20 <andythenorth> might stop now :P
21:54:28 <_dp_> andythenorth, did you count the time you spent complaining about slow compilation? :p
21:54:47 <andythenorth> no, that would have been used complaining about _something_
21:56:46 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:56:54 *** Smedles has joined #openttd
21:59:56 <andythenorth> ok 25s Horse compiles from clean with that patch :P
22:01:00 <andythenorth> wonder if it will be faster if I cut out the hundreds of duplicate realsprites :P
22:08:03 *** frosch123 has quit IRC (Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn)
22:10:53 *** HerzogDeXtEr has joined #openttd
22:20:34 *** andythenorth has quit IRC (Quit: andythenorth)
23:48:31 <_dp_> andythenorth[m], you can also try commenting this line and if after it
23:48:35 <_dp_> https://github.com/OpenTTD/nml/blob/master/nml/spriteencoder.py#L374
23:48:51 <_dp_> for debug builds should be good enough without it
23:52:22 *** arikover has quit IRC (Remote host closed the connection)