IRC logs for #openttd on OFTC at 2025-05-21
            
00:22:05 *** SigHunter has quit IRC (Read error: Connection reset by peer)
00:22:12 *** SigHunter has joined #openttd
02:02:02 *** herms has quit IRC (Quit: bye)
02:02:49 *** herms has joined #openttd
02:16:31 *** Wormnest has quit IRC (Quit: Leaving)
02:30:29 *** WormnestAndroid has quit IRC (Remote host closed the connection)
02:30:34 *** WormnestAndroid has joined #openttd
02:51:33 *** D-HUND has joined #openttd
02:55:09 *** gnu_jj has joined #openttd
02:58:25 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:33:08 *** godbed has joined #openttd
03:33:23 *** Zathras has joined #openttd
03:36:29 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
03:36:44 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:54:22 *** WormnestAndroid has quit IRC (Remote host closed the connection)
03:54:24 *** WormnestAndroid has joined #openttd
04:09:32 *** keikoz has joined #openttd
04:46:51 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/82876c25e06abd8cb7f1176bed3c56ee9d6f537c
04:46:52 <DorpsGek> - Update: Translations from eints (by translators)
05:20:47 *** Flygon has quit IRC (Read error: Connection reset by peer)
06:26:53 *** felix has joined #openttd
06:29:36 *** felix_ has quit IRC (Ping timeout: 480 seconds)
09:16:00 <xarick> hi
09:21:26 <pickpacket> xarick: yes. Very much so.
09:21:33 <pickpacket> very hi, much hello
09:21:40 <pickpacket> or the other way aroun
09:21:43 <pickpacket> *around
09:25:36 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374679512910135416/LuDiAI_AfterFix_1980-12-24.sav?ex=682eed90&is=682d9c10&hm=5103cefd9cf3438f49ad2de42a18bdc8b4b3776edc0c73fa5b889c0eacf4bfd9&
09:25:36 <xarick> peter1138[d]: you might need this too https://github.com/SamuXarick/LuDiAI-AfterFix/archive/refs/heads/master.zip
09:34:17 <peter1138[d]> Hmm, just lots of groups, not nested groups. Nested really makes it worse.
09:34:39 <peter1138[d]> 600ms down to 340ms average though.
09:34:47 <peter1138[d]> Still unplayable but.
09:41:48 <peter1138[d]> Can AIs even nest groups? Heh
09:51:36 <xarick> yes, they can
09:54:34 <peter1138[d]> I went overboard and created 50,000 nested groups.
09:56:08 <peter1138[d]> Way beyond the nesting limit, the indentation wraps around 😄
09:57:51 <peter1138[d]> Even 5,000 groups breaks.
09:58:14 <peter1138[d]> With 5,000 groups, drawing the group list window takes about 1.5 seconds in master.
10:02:36 *** Flygon has joined #openttd
10:14:01 <peter1138[d]> The GUI side still scans the list multiple times. Hmm.
10:19:14 <xarick> is there gonna be a problem if one client has vehicle tile hash size different than the server?
10:19:40 <xarick> namely, desyncs
10:22:07 <xarick> because that alone boosts performance so much
10:22:07 <peter1138[d]> Should be fine.
10:22:43 <peter1138[d]> We already have rules about not using the tile hash order.
10:34:58 <xarick> gonna experiment
10:42:00 <xarick> eh rats, version mistmatch
10:54:40 *** michi_cc_ has quit IRC (Ping timeout: 480 seconds)
10:57:38 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374702674242441237/image.png?ex=682f0322&is=682db1a2&hm=da4e0898123c8f9531885714c38aad9f6c3f90b91b982a950feeb9a2ec2630ba&
10:57:38 <xarick> 7 bits server @left vs 11 bits client @top, 7 bits client @bot
10:57:54 <xarick> the pacing is ugly
10:59:29 <xarick> but no desyncs
11:05:50 <xarick> gonna try optimize `RoadVehFindCloseTo` somehow
11:06:35 <xarick> it's the biggest offender so far
11:06:53 <xarick> at least, until the AI maxes out in trains
11:13:17 <DorpsGek> [OpenTTD/OpenTTD] juniwalk commented on issue #14238: [Crash]: Game crashed after Steam crashed https://github.com/OpenTTD/OpenTTD/issues/14238
11:14:53 *** michi_cc_ has joined #openttd
11:23:14 <xarick> isn't it possible to have it iterate from the center and then expand outwards
11:24:39 <xarick> compose the hash from the first vehicle it finds near the center
11:25:39 <xarick> this seems to be only interested in the first vehicle matching that weird criteria, but it's still the one that's closest to the center
11:29:05 <peter1138[d]> What are you talking about?
11:30:55 <xarick> RoadVehFindCloseTo + FindClosestBlockingRoadVeh
11:31:50 *** WormnestAndroid has quit IRC (Remote host closed the connection)
11:31:54 *** WormnestAndroid has joined #openttd
11:43:55 <_glx_> Blocking vehicle can be very very far
11:44:49 <_glx_> The initial one, then there's a chain of blocked vehicle blocking others
11:56:29 <_glx_> Anyway it's only looking for vehicles in a small square
11:57:51 <_glx_> And in normal condition it won't find any
11:58:32 <_glx_> Unless overcrowded station with too many waiting vehicles
12:04:59 *** WormnestAndroid has quit IRC (Remote host closed the connection)
12:05:04 *** WormnestAndroid has joined #openttd
12:07:16 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:11:16 <peter1138[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1374721204358746205/image.png?ex=682f1464&is=682dc2e4&hm=6f033dcd99c9fded7ee0dadb6eb3b99cf1e1025295f7389608cd800f648bd890&
12:11:16 <peter1138[d]> Heh
12:11:40 <peter1138[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1374721305655513199/image.png?ex=682f147c&is=682dc2fc&hm=e8837188e92eea7760fbc181193b8f648648f76ab5b81d0b295e45386aa5b4fa&
12:11:44 <peter1138[d]> Slightly different?
12:25:49 <_glx_> Almost unnoticeable 😉
12:36:14 <andythenorth> both charts have spikes
12:36:37 <andythenorth> "I see no difference"
12:52:22 <yiffgirl> how far off is 15.0 again? it's been a while
12:55:40 <talltyler> We need at least one more beta, then an RC or two
12:57:39 <yiffgirl> anything i can do to help speed things along?
13:16:16 <xarick> computex showing ddr5-10600 memory kits... insane
13:17:52 <LordAro> fast
13:23:31 *** Extrems has quit IRC (Ping timeout: 480 seconds)
13:25:18 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374739833611747378/image.png?ex=682f25bd&is=682dd43d&hm=5adfe854e7a7c40d39f534c11de89500993bbd0394f8d30216783c3e9a03b10b&
13:25:18 <xarick> someone forgot this->
13:31:25 <peter1138[d]> Then you know what to do.
13:37:48 <xarick> that clamping feels wrong
13:37:57 <xarick> or am I missing something obvious
13:38:38 <xarick> std::max<int>(0, x + max_dist); but max_dist is already unsigned
13:38:54 <xarick> x can go negative?
13:41:53 <peter1138[d]> If you want to add missing `this->` do so, but don't try to rewrite the algorithm at the same time.
13:43:26 <xarick> ok
13:57:49 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick opened pull request #14288: Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator https://github.com/OpenTTD/OpenTTD/pull/14288
13:58:44 <xarick> i really am bad at describing
13:58:51 <xarick> feels so poor
13:59:18 <xarick> actually that looks wrong
14:00:42 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #14288: Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator https://github.com/OpenTTD/OpenTTD/pull/14288
14:00:50 <xarick> fixed
14:03:06 <peter1138[d]> Yeah, so what about lines 442-445?
14:04:09 <_glx_> yup it's half done
14:04:10 <xarick> oh, i see
14:05:46 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #14288: Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator https://github.com/OpenTTD/OpenTTD/pull/14288
14:23:09 *** Extrems has joined #openttd
14:40:34 <xarick> max_dist of 8, isn't that gonna imply at least 3x3 tiles?
14:41:02 <xarick> maybe just 2x2
14:41:51 <xarick> 8-8 = 0, still same tile_x ; 8+8 = 16, tile_x + 1
14:42:24 <xarick> 7-8 = -1, tile_x - 1 ; 7+8 = 15, still same tile_x
14:42:31 <xarick> ok, it's 2x2
14:47:23 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374760491267789000/image.png?ex=682f38fa&is=682de77a&hm=564394effdd043fbdab7b8a89204c59ffd2edf914f180ce5b1261c20412fa295&
14:47:23 <xarick> moved some stuff around, probably not where the problem lies
14:47:46 <xarick> but no need to calc the diffs before the first 2 tests
14:54:34 <_glx_> moving the static arrays is useless
14:56:40 <LordAro> and the compiler will almost certainly move the assignments around
14:56:49 <LordAro> learn to profile
15:03:39 <peter1138[d]> Whack-a-mole.
15:05:44 <xarick> oh, this is called a lot!
15:05:57 <xarick> i tested a TicToc sample of 100
15:06:07 <xarick> i guess i need 10000000 or so
15:09:26 <xarick> derp that was too much
15:10:13 <xarick> > 2025-05-21 16:09:47] dbg: [misc:0] [RoadVehFindCloseTo, 10000000] 44696515 us [avg: 4.5 us]
15:10:13 <xarick> maybe not
15:19:04 <_glx_> average shows it doesn't really matters 🙂
15:22:21 <_glx_> knowing the number of calls per tick would give more info
15:24:07 <peter1138[d]> A TicTic that hooks into the gameloop to automatically output every tick instead of a fixed number of goes would be oka.
15:57:49 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374778219038773249/image.png?ex=682f497d&is=682df7fd&hm=0199a46f499caab25b0ee96122442927bbabf1e4900818c86011bd65265a9c8f&
15:57:49 <xarick> like this?
15:59:46 <peter1138[d]> I don't mean measuring the entire gameloop 🙂
16:00:42 <xarick> number of calls per tick, hmm gonna try do this
16:00:51 *** Zathras is now known as debdog
16:10:28 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374781399961309234/image.png?ex=682f4c73&is=682dfaf3&hm=19c5e5082d882bf7509a3255937bb33f299be5c88009c2f08aee556e9ca593e3&
16:10:28 <xarick> think I got this
16:11:19 <xarick> maybe I should do it on FindClosestBlockingRoadVeh?
16:13:27 *** f_ has joined #openttd
16:14:45 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #14287: Codechange: Improve performance of evaluating group hierarchy. https://github.com/OpenTTD/OpenTTD/pull/14287
16:14:51 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374782504891846696/image.png?ex=682f4d7b&is=682dfbfb&hm=7c5e1e001dec9e5809ead97b9f25932f2ecbabf50d52444e7e6cc483bd48dc62&
16:14:51 <xarick> it's about double
16:15:29 <yiffgirl> hang on a sec, did the option to turn off vehicle previews make it in?
16:15:29 <yiffgirl> ... oh no, it didn't
16:16:26 <kuhnovic> yiffgirl: Whatever you do, don't do what Xarick is doing 😉
16:17:42 <yiffgirl> i like to imagine i have some level of competence.
16:21:06 <xarick> yeah, I don't know what I'm doing
16:25:45 <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #14288: Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator https://github.com/OpenTTD/OpenTTD/pull/14288#pullrequestreview-2858429139
16:46:07 <xarick> why was the threshold increased from 6 to 8
16:47:45 <xarick> pretty sure this impacts performance
16:48:24 <peter1138[d]> If only it was documented... <https://github.com/OpenTTD/OpenTTD/pull/14114>
16:48:26 <kuhnovic> I thought you knew how to run a profiler. I guess you un-learned that.
16:49:00 <xarick> oh, i only checked file history
16:49:15 <xarick> I always forget there was a PR attached to the changes
16:49:17 <xarick> my bad
16:51:16 <xarick> ah, makes sense
16:56:03 <xarick> what if... 6
16:56:20 <xarick> ``` static const int8_t dist_x[DIR_END] = { -4, -6, -4, -1, 4, 6, 4, 1 };
16:56:20 <xarick> static const int8_t dist_y[DIR_END] = { -4, -1, 4, 6, 4, 1, -4, -6 };```
17:03:35 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374794768969633902/image.png?ex=682f58e7&is=682e0767&hm=b8dd91e16be6241f5c7927855e151277e3abdd4c3639abe5b3e5f4cf1819943f&
17:03:35 <xarick> it actually makes a difference
17:03:55 <xarick> 228 -> 170
17:06:43 <_glx_> <https://gist.github.com/glx22/29f917a8c9650837f744d1d90601c6ca> <-- probably not the ideal place to plug it
17:07:31 <peter1138[d]> Something like that, yeah.
17:17:17 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14287: Codechange: Improve performance of evaluating group hierarchy. https://github.com/OpenTTD/OpenTTD/pull/14287#issuecomment-2898691110
17:19:38 <peter1138[d]> Pom te pom.
17:20:54 <_glx_> not bad
17:21:25 <xarick> fantastic!
17:21:55 <peter1138[d]> The worst case with 50,000 groups was all 50,000 nested. But that's too unrealistic 🙂
17:23:30 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374799767770497035/image.png?ex=682f5d8f&is=682e0c0f&hm=46e354e128faf46bc682f09f0939f40385dfa876384b1b85ee606693f273ef5c&
17:23:30 <xarick> interesting
17:23:35 <xarick> testing glx
17:24:11 <xarick> are the averages also over the number of calls registered?
17:24:12 <peter1138[d]> To me, those numbers say "this is irrelevant"
17:26:04 <_glx_> yes average is per number of calls (as it was before, but now it does it by tick)
17:26:19 <xarick> great! this is awesome
17:26:23 <xarick> I like it
17:27:10 <peter1138[d]> So add this as TicTocTick? 😄
17:27:16 <peter1138[d]> TickTock
17:27:50 <_glx_> hard part will be where to put the Tick() call
17:28:04 <peter1138[d]> Or maybe the usefulness of per-tick measurements means the regular TicToc is not needed.
17:28:12 <xarick> max_count is unused now
17:29:39 <peter1138[d]> _glx_: probably near where the regular timer system events are triggered.
17:30:08 <peter1138[d]> Depends if pause-mode matters.
17:30:47 <xarick> max_count could become the max ticks?
17:31:09 <_glx_> there's also video thread vs game thread
17:35:12 *** Wormnest has joined #openttd
17:39:57 <peter1138[d]> Hmm
17:40:13 <peter1138[d]> Ah yes, sometimes I'm measuring non-game tick stuff.
17:45:19 <xarick> I expanded functionality a little
17:47:08 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #14235: Fix #14234, 5aa4ad5135: Crash due to NUL chars in external strings. https://github.com/OpenTTD/OpenTTD/pull/14235
17:48:05 <peter1138[d]> Hmm, 2 thumbs up but no comments.
17:48:34 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic opened pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289
17:50:46 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289#issuecomment-2898771172
17:51:43 <xarick> <https://gist.github.com/SamuXarick/06cb2010f46b7c0c541026430544c02e>
17:52:41 <xarick> hope it's not buggy
17:55:08 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic commented on pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289#issuecomment-2898782979
17:56:46 <kuhnovic> https://cdn.discordapp.com/attachments/1008473233844097104/1374808153362923530/image.png?ex=682f655e&is=682e13de&hm=caef133a385e980d28e5082af94fa2477f6e217b8d0fc1097b2d490878c46f53&
17:56:46 <kuhnovic> peter1138[d]: The buttons main menu looks a bit funny when the interface scaling is set to 1.75. Much more padding on the left than on the right. Is that because the icons can't scale by non-integer amounts?
17:58:18 <peter1138[d]> It's because the icon is centred within its scaled area, and the text is centred with its scaled area.
18:00:03 <peter1138[d]> <https://github.com/OpenTTD/OpenTTD/pull/14220#discussion_r2076277328>
18:00:41 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374809137367486524/image.png?ex=682f6649&is=682e14c9&hm=1e3b03dea49ec9faf3bdf8114a7fd62a432b6d2f2ed06899bd10fa5f9bf31dcf&
18:00:41 <xarick> seems about right
18:00:52 <xarick> tons of calls per day
18:01:07 <xarick> the averages are kind of meh
18:02:00 <peter1138[d]> Per tick probably a more useful metric.
18:03:05 <peter1138[d]> kuhnovic: There is also a fixed width space (scaled) between the icon and the text.
18:05:20 <peter1138[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1374810306873786398/image.png?ex=682f675f&is=682e15df&hm=b67cd70da7069cfcb928c24248bfc9f239f4107f4894e5b9c7ac89dee4221b86&
18:07:18 <kuhnovic> Hmm, the setup makes sense. It's just that the not-scaled icon gives off the appearance of additional padding that isn't present on the right...
18:07:55 <peter1138[d]> The "additional padding" is present... just it's on the right of the image itself.
18:09:06 <peter1138[d]> My non-power-of-two scaling stuff could fix this issue, but that's a marmite option.
18:10:18 <peter1138[d]> Even if we add extra hsep_indent padding to the right, it still wouldn't be equal to the sprite size difference.
18:10:55 <kuhnovic> It would need some additional magic to make it have the right size
18:11:01 <peter1138[d]> One of those "I wish we could just let OpenGL handle it" times ;D
18:11:29 <peter1138[d]> Right, and to make that balanced means stealing some of the space that the image would take up.
18:12:04 <kuhnovic> INFINITE LOOP
18:12:06 <peter1138[d]> And imho that's a no-no.
18:12:41 <peter1138[d]> In my picture it just happens to coincide and look like the hsep_indent is the same as the sprite's extra padding.
18:12:53 <peter1138[d]> But that is just coincidence.
18:13:04 <kuhnovic> Sounds like more trouble than it's worth
18:13:25 <peter1138[d]> As per my comment, centring the image in its box does look better than not doing that.
18:14:00 <peter1138[d]> Alternatively we go with drawing it differently but i'm not keep on that 🙂
18:14:03 <peter1138[d]> Also, don't try zBase.
18:14:23 <peter1138[d]> *keen
18:15:18 <kuhnovic> You like the first screenshot in your comment best you mean?
18:15:35 <peter1138[d]> Hah, no.
18:16:02 <peter1138[d]> First image is aligned to the edge, second image is centre aligned in the sprite's allocated area.
18:16:34 <kuhnovic> I like the centre aligned one a lot better
18:17:19 <kuhnovic> Alright, not touching this, that's for sure
18:17:50 <peter1138[d]> Yes, it's just a limiation of non-powers-of-two sprite scaling. Not really a UI design issue, IMHO.
18:20:23 <kuhnovic> I agree. Now I just have to get my OCD to agree.
18:26:50 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic opened pull request #14290: Codechange: Removed T prefix from water region related types. https://github.com/OpenTTD/OpenTTD/pull/14290
18:28:51 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic merged pull request #14288: Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator https://github.com/OpenTTD/OpenTTD/pull/14288
18:34:42 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289#pullrequestreview-2858763137
18:36:09 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289#pullrequestreview-2858766269
18:37:19 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14289: Codechange: Use strong types for water regions. https://github.com/OpenTTD/OpenTTD/pull/14289#pullrequestreview-2858768926
18:37:36 <peter1138[d]> Should've done a review, but, uh, yeah. I didn't.
18:41:15 <xarick> what if TicToc::Tick is whatever you want it to be?
18:41:38 <xarick> you place it wherever you seem fit
18:44:27 *** gelignite has joined #openttd
18:44:33 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #14287: Codechange: Improve performance of evaluating group hierarchy. https://github.com/OpenTTD/OpenTTD/pull/14287#pullrequestreview-2858785774
18:50:11 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #14287: Codechange: Improve performance of evaluating group hierarchy. https://github.com/OpenTTD/OpenTTD/pull/14287
18:50:49 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:50:57 *** Wormnest_ has joined #openttd
18:51:21 *** Wormnest has quit IRC (Read error: Connection reset by peer)
18:52:07 <DorpsGek> [OpenTTD/OpenTTD] PeterN dismissed a review for pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270#pullrequestreview-2854172994
18:52:10 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270
18:53:41 *** WormnestAndroid has joined #openttd
18:54:01 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270#issuecomment-2898924262
18:54:46 <peter1138[d]> Hmm, github bug?
18:55:18 <peter1138[d]> The "View reviewed changes" button shows the current changes, not the changes that... were reviewed.
18:57:11 *** SigHunter has quit IRC ()
19:00:09 *** SigHunter has joined #openttd
19:00:37 <andythenorth> wine?
19:11:25 <xarick> " Improve performance of exclusive preview engine test." written like that I think of reliability %
19:15:34 <peter1138[d]> Because "reliability" is definitely one of the words in the title... or not.
19:19:50 *** Wolf01 has joined #openttd
19:20:29 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270#pullrequestreview-2858877516
19:22:12 <peter1138[d]> Hmm, still wish I could change #opcodes mid-game.
19:24:08 <xarick> i can
19:24:12 <xarick> on my branch
19:25:53 <xarick> let me check
19:27:51 <xarick> oh the group changes are already in, nice
19:29:03 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270
19:30:09 <peter1138[d]> Yes, if you allow it to be changed, changing it seems to work. But there is
19:30:19 <peter1138[d]> iirc, some reason why it's not allowed.
19:34:51 <xarick> solving a conflict while rebasing, just a min
19:36:33 <xarick> oops, regression failing after
19:36:35 <xarick> typical
19:38:23 <_jgr_> For completeness, if the ops setting is decreased, the current ops until suspend value for each squirrel VM should be clamped to be within that value as well. Other than that there isn't any reason why it wouldn't work in game.
19:39:30 <_jgr_> A bit dated now, but a change along these lines would do it <https://github.com/JGRennison/OpenTTD-patches/commit/45386efcd001528d6e17c758b621f1d208950312>
19:46:23 <peter1138[d]> The memory limit is likely more problematic, at least if reducing it.
19:51:41 <_jgr_> A script being imminently killed off if it uses more memory than the new setting value seems like success rather than a problem to me 😛
19:52:12 *** kuka_lie has joined #openttd
19:52:46 *** gelignite has quit IRC ()
19:54:12 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #14291: Change: Don't measure group name widths in company livery window. https://github.com/OpenTTD/OpenTTD/pull/14291
20:09:42 <peter1138[d]> Yeah, true. It's only a problem for the script 🙂
20:14:36 <xarick> i forgot what vargc and vargv do
20:15:50 <peter1138[d]> C-style things you should want nothing to do with.
20:19:06 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270#pullrequestreview-2859009150
20:19:41 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #14270: Codechange: Improve performance of exclusive preview engine test. https://github.com/OpenTTD/OpenTTD/pull/14270
20:20:03 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #14291: Change: Don't measure group name widths in company livery window. https://github.com/OpenTTD/OpenTTD/pull/14291#pullrequestreview-2859012450
20:25:30 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374845582547353621/image.png?ex=682f883a&is=682e36ba&hm=997e1889cc69af735337feeb660f6d3a3c6a4e3c63d545cdb90d89cd113b6e59&
20:25:30 <xarick> I'm trying to speed this up
20:28:45 <peter1138[d]> Not sure if possible, but use a valuator class instead of a function. The class contains all the required state so it doesn't need to be passed via function call every time, and you only need to pass the item.
20:37:56 <xarick> oops, infinite valuate test in regression is really infinite
20:38:11 <xarick> how does openttd reaches the end of the test then?
20:44:47 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #14292: Codechange: Use StrongType and StrongBitSet for CargoType and CargoTypes. https://github.com/OpenTTD/OpenTTD/pull/14292
20:46:35 <_glx_> xarick: script crashes because valuate took too long
20:46:54 <xarick> i made it not crash though
20:47:01 <xarick> so, how does it knows when to bail out
20:47:29 <peter1138[d]> Your version won't because you broke it.
20:47:42 <_glx_> it can't, it's an infinite loop, purposely done to trigger a crash
20:49:54 <xarick> in my beautiful slow valuate version, scripts are happy to use valuate without crashing, but regression test eventually ends though, is there a timer?
20:50:16 <xarick> openttd just closes?
20:50:30 <_glx_> if ran via ctest there's a time limit for the whole run yes
20:50:41 <xarick> ah, that explains it
20:51:19 <_glx_> because sometimes openttd crashes and shows an error box and CI needs to finish
20:51:54 *** kuka_lie has quit IRC (Quit: Lost terminal)
20:52:18 <peter1138[d]> Usually when I've done something bad with references or iterators 😄
20:58:33 <_glx_> now with thread support <https://gist.github.com/glx22/29f917a8c9650837f744d1d90601c6ca>, and I think in the ideal place
21:00:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374854394889113710/image.png?ex=682f906f&is=682e3eef&hm=9df52d72f059a1ffeefb10c4983115bd9e2f12e7354e959ee189e4216ffd58cb&
21:00:55 <_glx_> added commands ?
21:01:06 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374854539198332988/image.png?ex=682f9091&is=682e3f11&hm=5d279c1f8597ffb54a2e811663a23ba54d6b7a77faa7c8c3ac203d105e75d408&
21:01:12 <xarick> no, slow_valuate
21:01:27 <xarick> i'm trying to make slow_valuate fast
21:01:34 <xarick> i mean, as fast as it can be
21:01:58 <andythenorth> use a smaller map?
21:02:03 <andythenorth> with fewer things to valuate?
21:02:04 <xarick> it's regression test
21:02:09 <andythenorth> oh I see
21:02:13 <_glx_> it depends on list size
21:02:16 <andythenorth> hmm I should follow good advice
21:02:24 <_glx_> it's basically a foreach
21:02:27 <andythenorth> Iron Horse compile would be half the time if it was half the trains
21:02:41 <_glx_> then there's the cost of the valuate function itself
21:04:48 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374855473291067412/image.png?ex=682f9170&is=682e3ff0&hm=37db804d80aee1882b764bbb364f3480662d1c4594669d1743529e0937701e5e&
21:04:48 <xarick> <https://github.com/OpenTTD/OpenTTD/compare/master...SamuXarick:OpenTTD:slow-valuate>
21:05:09 <xarick> if it can be made faster, i need to know
21:05:27 <xarick> all the possible tricks
21:07:29 <_glx_> I don't think it's possible
21:10:21 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13661: Add: Variable to test for a badge on a nearby tile. https://github.com/OpenTTD/OpenTTD/pull/13661
21:10:31 *** treky97 has quit IRC (Quit: User went offline on Discord a while ago)
21:12:57 <xarick> wondering if case works
21:13:04 <xarick> of vargc thing
21:16:07 <_glx_> maybe <https://gist.github.com/glx22/73756c7ad7531e7add67602efddce50c>
21:16:34 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:18:04 <_glx_> oh can even keep `list[item] =` actually
21:19:59 <_glx_> but SwapList should be faster than Clear+AddList I think
21:22:23 <_glx_> oh and Clear was not needed before AddList anyway, values from added list replaces values of existing items
21:22:50 <xarick> I'm worried about the sort method by the original list
21:22:51 <_glx_> but all this won't reflect in tick/ops as they are native calls
21:23:06 <xarick> must keep it
21:23:24 <_glx_> ah yes swap will transfer sort
21:24:24 <_glx_> anyway you can still remove the first AddList, and use `foreach(item, _ in this)` and remove the Clear
21:26:24 <xarick> really? isn't it going to double iterate the same items?
21:26:29 <xarick> or skip some
21:26:37 <xarick> gonna test
21:26:56 <_glx_> so <https://gist.github.com/glx22/73756c7ad7531e7add67602efddce50c>
21:27:47 <_glx_> you iterate to original list to fill the new one, then add the new one to old list, overriding the values
21:28:32 <_glx_> no need to prefill new list or clear old list
21:29:11 <xarick> ah, I got it
21:29:20 <_glx_> but theses changes won't have any effect on ticks/ops
21:29:38 <_glx_> or very little
21:30:07 <_glx_> less ops, since less squirrel code
21:31:29 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374862186199121940/image.png?ex=682f97b0&is=682e4630&hm=243a66feb0cb5c47c8663364e425e84ba800646af3972bf540d4a2ecb575b67b&
21:31:29 <xarick> previous record:
21:31:35 <xarick> let's test yours
21:32:38 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374862475249582161/image.png?ex=682f97f5&is=682e4675&hm=106450ddb651154149efdec3d1b8651b3394d8840ab8bf210e7ef535b19acc02&
21:32:41 <xarick> yeh!
21:33:17 <xarick> what else can i test
21:35:24 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374863173579964436/image.png?ex=682f989c&is=682e471c&hm=6f25e3fc8a0ba390b1a59796f8259311b65d7ad0338fd324e5df3fc530b5e960&
21:35:28 <xarick> nice!
21:35:34 <xarick> squeezing it
21:37:07 <xarick> [I got this](https://gist.github.com/SamuXarick/ac74f99666c337da5f7ea63a6ca09372)
21:37:14 <_glx_> switch(vargc) might be better than the ifs
21:38:01 <xarick> not sure about the return
21:38:06 <xarick> gonna try swap
21:38:11 <peter1138[d]> I guess you can't just forward the args on?
21:38:30 <_glx_> no would be too easy 🙂
21:39:13 <_glx_> and vargc/vargv have even been removed in squirrel 3 (that's why we are still on squirrel 2)
21:40:00 <xarick> 174 ticks and 889 ops same result with `this.AddList(list); return;`
21:41:12 <xarick> does parsing the commas and ";" and { } cost operations?
21:41:29 <_glx_> no
21:41:51 <_glx_> ops are from compiled code
21:42:53 <xarick> well I'm happy with the result, i think
21:43:06 <xarick> will do a big test with some AIs at some point
21:45:58 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1374865832122777651/image.png?ex=682f9b16&is=682e4996&hm=cc77d60ec4a8474bca975f1b1e430b89086990e2c72f152d80f821ddbc19670f&
21:45:58 <xarick> yay, didn't even trigger those time sensitive changes
21:47:01 <xarick> 174 ticks and 849 ops with the openttd's valuate
21:47:41 <xarick> cost only 40 ops, that's too good to be true
21:48:09 <xarick> probably gonna cost cpu now, but at least it won't crash 🙂
21:50:02 <_glx_> AIs might go to sleep until next tick yes
21:50:24 <_glx_> if very expensive valuator on huge list
21:56:00 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)