Times are UTC Toggle Colours
00:09:05 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13104: Fix d450d4743: Division by zero when larger_towns is set to 0. https://github.com/OpenTTD/OpenTTD/pull/13104 00:20:24 <DorpsGek> [OpenTTD/OpenTTD] WenSimEHRP commented on issue #9864: [Bug]: Translation Error https://github.com/OpenTTD/OpenTTD/issues/9864 02:02:12 *** herms has quit IRC 02:03:08 *** herms has joined #openttd 02:32:14 *** tokai|noir has joined #openttd 02:32:14 *** ChanServ sets mode: +v tokai|noir 02:38:59 *** tokai has quit IRC 03:12:27 *** D-HUND has joined #openttd 03:16:00 *** debdog has quit IRC 03:16:59 *** Flygon has joined #openttd 04:46:47 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/1b6a6f1cd2f2f5d6a8ff1cd7a526c992b967d3f0 04:46:48 <DorpsGek> - Update: Translations from eints (by translators) 07:30:49 *** Compu has joined #openttd 07:32:30 *** Compu has quit IRC 07:42:34 <DorpsGek> [OpenTTD/nml] andythenorth commented on pull request #344: Change: add vehicle 'refit' callback (cb 0x163) https://github.com/OpenTTD/nml/pull/344#issuecomment-2487751930 08:28:06 <peter1138> it depends on allowed_cargo_classes being set. 08:38:41 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic commented on issue #13044: [Crash]: when playing TTO savegame from #5965 due to a regression https://github.com/OpenTTD/OpenTTD/issues/13044 08:41:44 <peter1138> kuhnovic: oh yeah, I looked at the one, there is another save someone that I dug out that does crash. Because a ship is ON a dock tile, which has no track bits. 08:42:34 <truebrain> and you didn't add that information to the ticket?! 😛 08:42:37 <truebrain> ❤️ 08:42:48 <peter1138> No I did the usual thing of muttering in chat. 08:43:00 <truebrain> We need an AI that spots these conversations and adds it to the ticket 08:43:04 <truebrain> I am sure that solves this problem 08:43:09 <truebrain> and not at all introduce thousands of others 😛 08:43:18 <peter1138> And I've done it again. 08:47:18 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on issue #13044: [Crash]: when playing TTO savegame from #5965 due to a regression https://github.com/OpenTTD/OpenTTD/issues/13044 08:48:16 <peter1138> There. 08:50:54 <kuhnovic> https://cdn.discordapp.com/attachments/1008473233844097104/1308716189694038098/image.png?ex=673ef46e&is=673da2ee&hm=a015884766dcdaebadfe0435e784803ac6f4914353d8f943be93ae3f0b3458f3& 08:50:54 <kuhnovic> Yeah she's proper stuck 08:51:15 <kuhnovic> Doesn't seem to assert though 08:53:32 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic commented on issue #13044: [Crash]: when playing TTO savegame from #5965 due to a regression https://github.com/OpenTTD/OpenTTD/issues/13044 08:57:28 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308717842341822505/image.png?ex=673ef5f8&is=673da478&hm=9b4b3ff2a4161c0ecd18d381f741db5d55a466c130424eb80dee6fc1b319db11& 08:57:28 <peter1138> Nice. 08:58:21 <peter1138> Both trt03.sv1 and trt04.sv1 assert for me. 08:59:12 <kuhnovic> https://cdn.discordapp.com/attachments/1008473233844097104/1308718276297232404/image.png?ex=673ef65f&is=673da4df&hm=a013701a6c32f2cc702a8a2db32dc04548e8c43bd8d8d506591e47c643945dbf& 08:59:12 <kuhnovic> FML 08:59:24 <LordAro> i did wonder 09:01:19 <peter1138> Ah, performance testing. 09:02:34 <kuhnovic> Yup 09:02:40 <kuhnovic> You should never do that 09:04:13 <truebrain> Haha 😄 09:04:36 <truebrain> I have different build-folders for that exact reason 😄 09:04:44 <truebrain> also clang vs gcc and stuff 🙂 09:10:42 <LordAro> yup 09:10:51 <LordAro> almost like that's what cmake was designed to be able to do :) 09:11:03 <peter1138> I've got a build-gcc and a build-mingw 09:11:13 <peter1138> Actually there's a build-arm but I don't think that ever worked. 09:11:37 <peter1138> The mingw binary is 635MB 09:14:33 <peter1138> Sometimes I load Wentbourne and cry that it's slower these days. 09:14:57 <peter1138> But part of that was 30ms to 27ms per tick... 😄 09:17:07 <LordAro> lol 09:17:32 <LordAro> i'm still surprised how few people actually noticed that 09:23:22 <DorpsGek> [OpenTTD/OpenTTD] felixprigge updated pull request #12683: Fix: Timetable precision https://github.com/OpenTTD/OpenTTD/pull/12683 09:23:50 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic commented on issue #13044: [Crash]: when playing TTO savegame from #5965 due to a regression https://github.com/OpenTTD/OpenTTD/issues/13044 09:26:21 <peter1138> Hmm, 836ms down to 51ms. 09:33:50 <truebrain> MOAR MOAR MOARRRR 09:33:59 <truebrain> (I am just here today for the entertainment) 09:36:17 <Rubidium> shouldn't it be less? ;) 09:51:18 <xarick> hi 09:53:24 <xarick> kuhnovic: hmm... don't ignore start tile might solve? 09:54:03 <xarick> im not fully commited to looking into it yet 09:56:17 <kuhnovic> That won't solve it. We don't consider reversal of the ship to be an option. In these cases reversal is the only way out, so the PF doesn't find a path. 09:56:58 <kuhnovic> I tried always including reversal in the PF search, but that caused more issues than it solved. I need to have another try at this. 10:01:08 <truebrain> Rubidium: yeah, but LESSS LESSS LESSSSSSS, sounds weird 😛 10:08:47 <kuhnovic> What are you optimizing? Still the industry creation? 10:08:54 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308735816255672380/image.png?ex=673f06b5&is=673db535&hm=c1bce133a14785fc3878f47b76b8ddca0e618c691fa492aa4ee245be47b12e2e& 10:08:54 <xarick> after all this work I get disappointing results 😦 10:09:13 <xarick> solo kdtree is bad 10:10:35 <LordAro> ooh, graphs 10:10:40 <LordAro> but yeah, that do happen sometimes 10:11:18 <kuhnovic> Especially if you just try stuff without properly understand what it does and how it's supposed to make things faster 10:11:26 <LordAro> well, that too 10:11:50 <LordAro> but often even when you (think you) do understand it 10:12:31 <kuhnovic> Hehe those are the worst. When it should be faster on paper, but instead it became worse. 10:12:53 <yiffgirl> computers are haunted. 10:15:54 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308737579243278409/image.png?ex=673f085a&is=673db6da&hm=09a30313f8550ed15ac4e2fbd63dd2ab4251a60873152db46a8bcf5046d9588b& 10:15:54 <peter1138> Scary 10:16:08 <truebrain> run 10:16:38 <peter1138> truebrain: Sadly this only affects loading performance. It's kinda irrelevant. 10:16:48 <truebrain> Boooooooo 10:16:59 <peter1138> And to reduce time throws memory at the problem, although that memory can be released once loaded. 10:22:32 <peter1138> Or maybe not, it might help during the game too. 10:42:40 <xarick> IsAnyContained shouldn't be slower 😦 10:42:49 <xarick> my overheads 10:42:51 <xarick> hurt 10:44:14 <peter1138> And you making it slower by TicTocing it every go? 10:45:50 <xarick> if I don't TicToc, how would I measure 10:56:11 <kuhnovic> Tictoc 1000 runs instead, or some other number that makes sense 10:56:56 <kuhnovic> Measuring something in the microsecond / nanosecond scale generally doesn't work, the clocks aren't precise enough and the overhead of timing becomes significant 10:57:59 <xarick> I'm going to do the unthinkable 10:58:07 <xarick> copy paste code 10:58:54 <xarick> almost the same code without the added fluff to suit both original needs (which is fast), and my needs (slow) 11:01:18 <xarick> FindNearestExcept in GetClosestIndustry actually got a gain 11:01:29 <xarick> 624577 down to 504792 11:01:49 <pickpacket> Looking at my donations account now. At the end of the year I'll be donating almost £40 to the project :) Feels good 11:03:34 <xarick> IsAnyContained in FindTownForIndustry went from 96159623 to 54734253 11:04:06 <xarick> but then... you have TypeList with 148804 , absolutely murdering kdtree 11:05:02 <xarick> 148804 is kinda on the too low side... seems suspicious 11:05:12 <xarick> but maybe it is what it is 11:07:03 <xarick> why don't I have results for TownIndustries pairs 😦 11:07:55 <DorpsGek> [OpenTTD/website] auge8472 commented on issue #330: Changelog links on download pages lead to 404 due to text to markdown renames https://github.com/OpenTTD/website/issues/330 11:17:22 <johnfranklin> https://cdn.discordapp.com/attachments/1008473233844097104/1308753046372749393/IMG_5891.jpg?ex=673f16c1&is=673dc541&hm=8fc7793bce0cee57dac29c60fa12ac2832f8a92b070369c4b9ac028aa9fd7869& 11:17:22 <johnfranklin> BAD FEATURE of UK: any good weather goes away in hours 11:27:05 <belajalilija> Are you just finding that out? 11:27:42 <DorpsGek> [OpenTTD/website] LordAro commented on issue #330: Changelog links on download pages lead to 404 due to text to markdown renames https://github.com/OpenTTD/website/issues/330 11:32:09 <DorpsGek> [OpenTTD/website] auge8472 commented on issue #330: Changelog links on download pages lead to 404 due to text to markdown renames https://github.com/OpenTTD/website/issues/330 11:33:43 *** reldred has joined #openttd 11:33:43 <reldred> UK has no good features. 11:34:27 <LordAro> nou 11:36:17 <DorpsGek> [OpenTTD/website] auge8472 opened pull request #331: Fix #330: replace changelog.txt with changelog.md in the changelog link on the download page https://github.com/OpenTTD/website/pull/331 11:39:59 <LordAro> did we get rid of version specific release pages? 11:40:12 <LordAro> /latest would suggest not... 11:41:48 <DorpsGek> [OpenTTD/website] JGRennison commented on pull request #331: Fix #330: replace changelog.txt with changelog.md in the changelog link on the download page https://github.com/OpenTTD/website/pull/331#issuecomment-2488360615 11:48:23 <peter1138> Oh, I've broken things again. 11:49:03 <peter1138> ln -s changelog.md changelog.txt? 11:49:06 <peter1138> 😮 11:50:22 <LordAro> maybe. 12:09:10 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick requested changes for pull request #13094: Codechange: Speed up industry generation using industry-type checks. https://github.com/OpenTTD/OpenTTD/pull/13094#pullrequestreview-2448445512 12:13:36 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308767198357094470/image.png?ex=673f23ef&is=673dd26f&hm=1c33a806e9f240b69c1bbd99479bc80bd77dec34dcfa661ed85097731f58cf4a& 12:13:36 <peter1138> Hmm. 12:14:16 <DorpsGek> [OpenTTD/website] auge8472 commented on pull request #331: Fix #330: replace changelog.txt with changelog.md in the changelog link on the download page https://github.com/OpenTTD/website/pull/331#issuecomment-2488427292 12:23:20 <LordAro> peter1138: nb 12:23:31 <LordAro> how much extra memory usage? :p 12:26:54 <peter1138> Not looked yet. 12:31:00 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308771578779144192/image.png?ex=673f2804&is=673dd684&hm=8760e75ef62c48edce40027f46209423a98e8ad79512a59c0bf916d7b136ef50& 12:31:00 <peter1138> Slight tweak 😮 12:31:44 <kuhnovic> This is where you realize no industries are generated 😛 12:32:36 <peter1138> That would be surprising. 12:35:20 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308772670132715551/image.png?ex=673f2908&is=673dd788&hm=410bbba49ee7c24c23023b8de5210f02153535122d93435f26a7a1d886af53ca& 12:35:20 <xarick> I can't do any better than this with kdtree solo 12:36:32 <xarick> so... kdtree as a solo solution ... rip 12:37:01 <xarick> but as a combination with another, not sure you're willing to have this much complexity 12:38:00 <peter1138> Crash: 12:38:00 <peter1138> Reason: Out of sprite memory 12:38:02 <peter1138> Uh... 12:41:11 *** debdog has joined #openttd 12:42:20 <peter1138> Okay, master did the same. 12:43:02 <peter1138> Memory-wise it's... quite a bit. Hmm. 12:52:09 <DorpsGek> [OpenTTD/website] stormcone commented on pull request #331: Fix #330: replace changelog.txt with changelog.md in the changelog link on the download page https://github.com/OpenTTD/website/pull/331#issuecomment-2488505880 12:55:57 <kuhnovic> Time to download some more RAM 12:56:17 <peter1138> I think it's some interaction with -v null. 13:14:41 <peter1138> Interesting 13:28:02 <peter1138> Recolour sprites are loaded on load. 13:28:45 <peter1138> My NewGRF selection has 3856 recolour sprites for whatever crazy reason. It might be Iron Horse. 13:29:37 <peter1138> Sorry, that's how many it sees before the game crashes. 13:30:02 <peter1138> (257 + some padding) * 3856 is filling the sprite cache on load. 13:34:05 *** XYZ has joined #openttd 13:40:31 <peter1138> Nice, it's full of bugs. 13:41:13 <LordAro> yay! 13:45:06 <peter1138> 360KB of iron horse recolours. 13:46:09 <peter1138> The different sets of xUSSR use a few too. 13:46:35 <peter1138> Okay, so when using -v null the sprite cache is minimal size. 13:46:43 <peter1138> Because... there's no video, why would you load sprites? 13:46:48 <peter1138> Except recolours are always loaded. 13:47:05 <peter1138> Current sets treat recolours as a disposable resource, so they have thousands of them. 13:47:12 <peter1138> This fills up the sprite cache. 13:47:50 <peter1138> Recolours are loaded on load, and never purged, so the sprite cache is filled with thousands of recolours, leaving less space for actual sprites. 13:50:02 <peter1138> My solution... cache recolours just like any other sprite. 13:50:11 <peter1138> Don't load on load, and allow them to be unloaded. 13:50:30 <_glx_> one recolour sprite per variant probably 13:51:06 <peter1138> Which also fixes the other bug: If you replace a recolour sprite, the original recolour sprite is load, but its data is in the sprite cache and never released because recolours are not released from the sprite cache. 13:51:59 <peter1138> Maybe. There's probably some scope for reuse at least 13:52:44 <peter1138> With my rgba colour patch recolours can be 1280 bytes too... 13:53:27 <peter1138> Or maybe it was 1024. M + RGB 13:53:51 <_glx_> nml tends to hide the recolour size, as only the modified slots are in the file 13:54:07 <_glx_> but any unmodified is also written in grf 13:54:53 <_glx_> and with 2cc recolours it's even worse 14:01:56 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308794461207134339/image.png?ex=673f3d53&is=673debd3&hm=1542c6272719aafbcdc16b71b8983678a44b0be06282d0273a88fb7b99a9420a& 14:01:56 <peter1138> Okay, not quite. 14:08:28 <LordAro> nice 14:08:44 <peter1138> Making ReadRecolourSprite seek to the correct place might help. 14:09:03 <peter1138> Bingo. 14:18:46 <peter1138> It does spritecache churn a bit. A lot. I prresume that's the code that scans for the largest sprite on load to work out the depot size. 14:19:04 <peter1138> IIRC JGRPP can load the size separately. 14:52:28 *** nielsm has joined #openttd 15:00:57 <peter1138> Usually. 15:10:22 *** XYZ has quit IRC 15:17:43 <xarick> there's something wrong in the kdtree imo 15:18:04 <xarick> DistT... it isn't defined anywhere 15:18:11 <xarick> but it is assumed int 15:18:58 <LordAro> line 34 15:20:00 <mnhebi> a lot of compilers will assume int if nothing is defined 15:20:13 <mnhebi> there are some that are evil however and go "string" and you got mayhem 15:20:16 <LordAro> only in C, and even then it'll shout about it 15:20:37 <LordAro> and no C compiler in the universe assumes strings 15:20:56 <mnhebi> LordAro: i've used some very custom compilers :3 15:20:59 <xarick> ``` DistT ManhattanDistance(const T &element, CoordT x, CoordT y) const 15:20:59 <xarick> { 15:20:59 <xarick> return abs((DistT)TxyFunc()(element, 0) - (DistT)x) + abs((DistT)TxyFunc()(element, 1) - (DistT)y); 15:20:59 <xarick> }``` 15:20:59 <xarick> this is the only thing that is attempting to define it: "abs" 15:21:31 <LordAro> no. 15:21:45 <LordAro> also you seem to be conflating "define" and "use" 15:22:58 <peter1138> Yeah, it should really be Tdist. 15:23:05 <peter1138> But, uh, it's definitely defined. 15:23:42 <xarick> I don't think so 15:24:03 <LordAro> line 34 15:24:10 <LordAro> kdtree.h 15:24:11 <peter1138> kdtree.h:34 15:24:40 <xarick> uhm,, i give up 15:24:58 <xarick> I wanted to make it uint32_t 15:25:31 <xarick> but it's a misterious "int" out of whatever abs does there 15:25:46 <peter1138> There's nothing mysterious about it. 15:26:03 <mnhebi> I vote we open up a Xarick rubber duck donation fund. 15:27:13 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308815923280613479/image.png?ex=673f5150&is=673dffd0&hm=29e45454852a40cd0237ccdc549ff6cfa9c240f5234858912b597c1555be3ef5& 15:27:32 <xarick> it's int, because only of abs 15:28:13 <LordAro> why do you want to pass in an unsigned in into abs? 15:28:17 <LordAro> what would you expect it to do? 15:28:29 <LordAro> why do you insist on wasting everyone else's time by posting such nonsense? 15:34:55 <xarick> I'm so confused 15:38:05 <xarick> what if I use Delta 15:39:11 <mnhebi> why not int_fast32_t. 15:39:13 <mnhebi> :P 15:40:27 <xarick> I don't understand the magic happening here 15:40:51 *** merni has joined #openttd 15:40:51 <merni> What "magic" 15:41:08 <merni> `abs` is a C function that returns an int 15:41:14 <merni> You can't expect it to return something else 15:41:34 <merni> xarick: This tells you as much 15:42:22 <xarick> I'm talking about who decides what DistT becomes underneath 😦 15:42:52 <LordAro> have you looked at line 34 yet? 15:43:10 <mnhebi> where can I look up line 34, I wanna see this. 15:43:16 <xarick> template <typename T, typename TxyFunc, typename CoordT, typename DistT> 15:43:35 <xarick> typename makes things int? 15:44:34 <LordAro> you've definitely done templates before 15:44:50 <mnhebi> I mean excuse my ignorance, but doesn't typename except something after the name of the thing you want to type? 15:45:40 <peter1138> Here's another clue: station_kdtree.h:25 15:45:55 <peter1138> I shouldn't spoonfeed but it's painful. 15:46:10 <peter1138> (But also this isn't ##c on IRC) 15:46:15 <LordAro> ask copilot to tell you about templates 15:46:34 <xarick> ah thanks peter1138 15:46:39 <xarick> finally making sense 15:47:03 <peter1138> It always made sense. 15:47:29 <peter1138> -v null:ticks=0 doesn't quite do much 😄 15:47:48 <peter1138> It quits before it gets to processing the -g 15:48:07 <xarick> my lack of experience is showing 15:50:54 <xarick> so, for industries, I want this to be uint32_t, now I know where to set it 15:53:58 <peter1138> You don't because ManhattanDistance won't work properly. 15:56:44 <xarick> :/ 16:01:49 <peter1138> I'm not sure why you'd want to do it. 16:02:04 <peter1138> int32_t should be more than enough for all distances. 16:02:15 <peter1138> If it isn't enough there is int64_t, but I find that unlikely. 16:03:45 <xarick> it's for GetClosestIndustry 16:04:04 <mnhebi> yeah but why does it have to be uint32_t? 16:04:21 <xarick> I have a FindNearestExcept... but the "except" part is complicated to deal with 16:05:11 <xarick> so when the node it is comparing against is the "except" one, i want the max value of dist for it, uint32_t would be ideal 16:05:15 <_glx_> most likely doing it wrong 16:05:16 *** HerzogDeXtEr has joined #openttd 16:05:43 <xarick> to match the same as best_dist in the main function 16:05:45 <mnhebi> whats so ideal about uint32_t compared to the other standardized int types? 16:10:55 <xarick> I replaced the abs with Delta in kdtree, wondering if this is fine 16:11:13 <xarick> will it deal with the sign/unsign issue 16:23:48 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308830165538963549/image.png?ex=673f5e94&is=673e0d14&hm=4d9667e5597bdb7c40aa0ffe2158e687be913b490ec04ce6f4893a7d26ba7785& 16:23:48 <xarick> fantastic 16:24:04 <xarick> thx all for the help 16:26:29 <_glx_> can't you just do something like `DistT thisdist = (n.element == <the except one>) ? std::numeric_limits<DistT>::max : ManhattanDistance(n.element, xy[0], xy[1]);` ? 16:27:18 <xarick> I did that 16:27:42 <_glx_> of course if there's only 1 element it will be returned 16:27:54 <xarick> yes, that's the one thing I'm trying to deal with 16:28:03 <_glx_> you can't prevent that 16:28:28 <peter1138> Get the nearest element, then test its distance. 16:29:44 *** Wormnest has joined #openttd 16:29:53 <_glx_> yeah check distance in FindNearest() and return invalid in this case 16:30:59 <_glx_> might need an extra template param for invalid value 16:31:03 <xarick> returning invalid is complicated too 16:31:10 <_glx_> no it's easy to do 16:31:25 <xarick> because invalid is also passed to GetClosestIndustry valid 16:31:58 <xarick> sec, let me show my code 16:33:16 <xarick> oops, conflicts i need to solve 16:33:46 *** gelignite has joined #openttd 16:34:52 <xarick> https://github.com/OpenTTD/OpenTTD/compare/master...SamuXarick:OpenTTD:kdtree-for-industries 17:04:26 *** XYZ has joined #openttd 17:26:53 <xarick> Kdtree_ViewportSignXYFunc uses inline int32_t operator() 17:27:05 <xarick> signed 17:27:37 <xarick> one size fits all 17:37:24 <xarick> hmm, some of these industries producing passengers seems odd 17:37:45 <xarick> or is this how ECS works? 17:41:56 <xarick> nevermind, wrong newgrf 17:42:01 <xarick> this is ITI 17:47:20 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13106: Fix: Error message not set when unable load an old save. https://github.com/OpenTTD/OpenTTD/pull/13106 17:49:37 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #13106: Fix: Error message not set when unable load an old save. https://github.com/OpenTTD/OpenTTD/pull/13106#pullrequestreview-2449326380 17:55:34 *** XYZ has quit IRC 17:59:48 *** XYZ has joined #openttd 18:24:12 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13106: Fix: Error message not set when unable load an old save. https://github.com/OpenTTD/OpenTTD/pull/13106 18:40:07 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13107: Change: Treat recolour sprites as regular sprites in the SpriteCache. https://github.com/OpenTTD/OpenTTD/pull/13107 18:40:30 <peter1138> Even more things to go wrong when andy rewrites newgrfs mid game 😉 18:41:52 <peter1138> Betting there's a size_t issue there somewhere... 18:47:12 <xarick> NewGRF's ... https://gist.github.com/SamuXarick/6f420b316c6c9c7b82a23234e835d38c 18:47:31 <xarick> almost looks like it's broken 18:47:35 <xarick> but it's normal 18:53:13 <xarick> this call stack is quite deep now with kdtree doing recursives on top of NewGRF Resolves 18:53:23 <xarick> is there a limit? 18:59:12 <_glx_> yes, if there's too much you trigger a stack overflow 18:59:29 <peter1138> Might be a problem on a Signetics 2650... <https://en.wikipedia.org/wiki/Signetics_2650> 19:04:58 <peter1138> New it. 19:05:04 <peter1138> Knew it. 19:05:28 <LordAro> old it 19:11:57 <peter1138> Brrrrr 19:12:47 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13107: Change: Treat recolour sprites as regular sprites in the SpriteCache. https://github.com/OpenTTD/OpenTTD/pull/13107 20:10:09 *** keikoz has joined #openttd 20:16:28 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308888718139986011/image.png?ex=673f951c&is=673e439c&hm=e2f1b1c1ef3972aa17a913092b0e9a08d1234802396bb0198519719db53c812a& 20:16:28 <xarick> the first usage of GetClosestIndustry that does not involve INVALID_INDUSTRY 20:16:47 <xarick> and it is to tell the world they're going to close 20:19:13 <xarick> FindNearestExcept is called, maybe to see if there were others of the same type around? 20:19:20 <xarick> to determine closure? 20:28:31 <xarick> is std::optional overhead bad? 20:29:01 *** virtualrandomnumber has joined #openttd 20:29:29 *** virtualrandomnumber has quit IRC 20:30:50 *** gelignite has quit IRC 21:08:56 *** Flygon has quit IRC 21:11:28 *** nielsm has quit IRC 21:42:15 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13108: Codechange: Remove ZeroedMemoryAllocator from ScriptText. https://github.com/OpenTTD/OpenTTD/pull/13108 21:42:45 <LordAro> nice. 21:43:31 <LordAro> what's paramc used for? could it be removed by using a vector? 21:46:58 <xarick> I'd like to make a pointless refactor 21:47:03 <xarick> can I? 21:47:12 <LordAro> no 21:47:23 <LordAro> unless you can justify it 21:47:28 <LordAro> in which case it would not be pointless 21:47:45 <LordAro> working code should not be touched without good cause 21:47:53 <xarick> it's just so I could debug easier :9 21:48:15 <LordAro> then probably not, no 21:48:29 <LordAro> again, unless you can justify it 21:48:58 <xarick> alright, it's ok 21:49:16 <xarick> it would be for this <https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_industries.cpp#L148-L153> 21:50:29 <LordAro> that does feel like a long if condition 21:50:47 <LordAro> but no, i wouldn't change that without other cause to do so 21:50:50 <peter1138> LordAro: Yes, that also removes the arbitrary limit of 20 parameters. 21:51:19 <peter1138> (In fact, I was doing that change first, but wanted to remove the usage of ZeroedMemoryAllocator) 21:51:25 <LordAro> hehe 21:51:37 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #13108: Codechange: Remove ZeroedMemoryAllocator from ScriptText. https://github.com/OpenTTD/OpenTTD/pull/13108#pullrequestreview-2449771735 21:51:47 <LordAro> xarick: you are of course welcome to make the changes for your own debugging 21:52:00 <LordAro> there's no need for anyone else to see it though 21:52:56 <xarick> it would involve a tuple, so i guess bad for performance 21:54:46 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109 21:54:52 <peter1138> Pointless refactors you say? 21:55:17 <LordAro> code is cleaner/more efficient is perfectly valid 21:55:24 <LordAro> it is a sliding scale though :p 21:55:57 <peter1138> There's some that doesn't make to switch. 21:56:01 <peter1138> This is about it for now. 21:57:00 *** HerzogDeXtEr has quit IRC 22:00:16 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1308914840412229632/image.png?ex=673fad70&is=673e5bf0&hm=25eb3acb8b93ce81e24ac17a3c237b87fd3c1b2b5033b3294d2f1e255038f4d0& 22:00:16 <xarick> Delta vs abs 22:01:20 <xarick> I better leave it as is 22:04:51 <xarick> I have a tendency to make tiny changes, only then to revert them 22:05:12 <xarick> but by hand because I don't commit 22:05:47 <LordAro> i recommend `git restore -p` 22:05:56 <LordAro> whatever UI you're using might have an equivalent 22:07:17 <xarick> i squash everything 22:07:23 <xarick> then i regret it 22:07:37 <xarick> bad habits 22:07:44 <LordAro> squashing can happen at the end 22:08:33 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109#pullrequestreview-2449796608 22:16:17 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13108: Codechange: Remove ZeroedMemoryAllocator from ScriptText. https://github.com/OpenTTD/OpenTTD/pull/13108 22:16:56 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109#pullrequestreview-2449808302 22:19:13 <peter1138> I'll try testing it ;p 22:21:15 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109#pullrequestreview-2449814907 22:23:12 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109#pullrequestreview-2449817457 22:24:51 <peter1138> Funny. -1 is the default value of that parameter. 22:25:00 <_glx_> oh it's from the char* time 22:25:08 <peter1138> Nearly every caller uses -1. 22:25:48 <_glx_> yeah the char* version requires the len, while std::string has a default 22:27:18 <_glx_> and most of the code was written before we added std::string support 22:28:09 <_glx_> it's rare, but I think some parts of script API use it 22:28:23 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1308921639802507355/image.png?ex=673fb3c5&is=673e6245&hm=3f925e8326a5280cfd8d1a8436b29e73adcb45acb1d8b660f7b2b20a7406992c& 22:28:46 <xarick> You guys don't use @brief right? 22:28:46 <xarick> copilot likes to put @brief in function descriptions 22:29:20 <_glx_> ah no, only one outside json stuff: * @brief MIDI music player for MacOS X using CoreAudio. 22:35:12 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13109: Codechange: Use std::visit for ScriptDataVariant and ScriptText::Param https://github.com/OpenTTD/OpenTTD/pull/13109 22:35:19 <xarick> pondering whether I want to keep a global kdtree or just remove it and just accept the performance loss which in the grand scheme, is basically 1 second 22:35:35 <xarick> cus it's already too fast 22:36:12 <peter1138> Hmm, ScriptText fills parameters up to 20 to "match FormatString" 22:43:44 <xarick> a variable with a static storage duration cannot be captured in a lambda 22:43:59 <xarick> then why does it work? 22:46:04 <kuhnovic> xarick: Some wisdom is starting to seep through 22:47:10 <_jgr_> xarick: If it is static storage duration it does not need to be captured 22:47:27 <xarick> i got 241 kdtrees 22:47:34 <xarick> i remove one, 240 23:01:06 <xarick> oh btw peter 23:01:17 <xarick> did you create a separate commit? 23:02:46 <xarick> nop, you didn't 23:04:04 <xarick> I'm about to create the PR for Kdtree 23:04:26 <xarick> but it has a fix that was made on 13094 23:05:16 <xarick> that fix would also apply for the kdtree, but not much on the current master, it can live without it 23:05:45 <xarick> not sure how to proceed 23:10:05 <xarick> [CheckIfFarEnoughFromConflictingIndustry] 63539 us [avg: 0.0 us] that's funny 23:10:19 <xarick> I thought I was gonna make it slower, turns out it's faster 23:10:23 <xarick> lol 23:11:23 <xarick> 200929 it's faster! but it's meaninglessly faster 23:12:53 <xarick> well, the FindNearest with the exclusion became slower... hmm 23:13:57 <xarick> and this change is goin to affect everywhere kdtree is used 😦 23:16:57 <xarick> tomorrow I'll think about what to do 23:20:26 <_glx_> peter1138: it could use more parameters, but when it was written there was only _global_string_param IIRC 23:24:13 <_glx_> ah no it was always separate array of the same size 23:24:36 <peter1138> Yeah, when we had all those script string issues I thought it was SetDParam related... 23:24:43 <peter1138> But, uh, it's not using that at all it seems. 23:26:58 <_glx_> I wonder if we could have a VectorStringParameters 23:27:43 <peter1138> I've got a branch to allow Script to have more than 20 parameters, which is why I was wondering about the filling-to-20 bit 🙂 23:28:01 <peter1138> Not sure what purpose that's serving. 23:29:37 <peter1138> I've also got a few... stashes... towards making normal strings more roust. 23:29:42 <peter1138> And robust. 23:31:12 <_glx_> IIRC it fills up to max because some broken strings may try to read not set values 23:31:47 <peter1138> And that's possible with GS? 23:32:16 <_glx_> everything is possible with GS, that's why I added validation 23:32:36 <peter1138> I mean... is it possible to have a test case? heh 23:33:22 <_glx_> and the filled values are only read during validation, they are not actually put in encoded string if not needed 23:33:25 <LordAro> tests? don't be daft 23:36:41 <_glx_> so ScriptText uses a vector like an array of 20 elements 23:37:58 <_glx_> but maybe I added too much safety 🙂 23:41:00 <_glx_> could be to not trigger "not enough parameter" too much, because old pre-validation and unmaintained scripts are still available on bananas 23:41:24 <_glx_> that way they still "work" 23:42:33 <peter1138> Okay, so if I'm extending it to be variable size, then I could fill parameters up to 20 "just-in-case", but if the real paramaters are longer than that then it's doesn't matter, no filling happens. 23:42:49 <_glx_> makes sense yes 23:43:18 <LordAro> what if there's an old prevalidation script that does GetParam(999) or something really daft? 23:43:28 <LordAro> or even a new one 23:43:51 <_glx_> they don't have GetParam 23:44:01 <LordAro> or whatever 23:44:13 <LordAro> something that attempts to get >20 params 23:45:10 <_glx_> they gain a bonus of not crashing 23:45:28 <peter1138> They create 999 parameters, for no reason. 23:46:05 <_glx_> but pre-validation was always limited to 20 params 23:46:12 <peter1138> I can add a new limit, but who's to say what a good limit is? 23:46:23 <peter1138> Authors are hitting 20 and "complaining" 🙂 23:51:50 <_glx_> as long as validation eats params like FormatString would do it should be fine