IRC logs for #openttd on OFTC at 2025-10-22
            
00:53:58 *** Wormnest_ has quit IRC (Quit: Leaving)
01:51:09 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
01:57:56 *** tokai has joined #openttd
01:57:56 *** ChanServ sets mode: +v tokai
02:03:26 *** herms2 has quit IRC (Quit: bye)
02:04:18 *** herms2 has joined #openttd
02:11:32 *** gnu_jj_ has joined #openttd
02:15:09 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:59:52 *** Zathras has joined #openttd
04:03:21 *** Zathras_11 has quit IRC (Ping timeout: 480 seconds)
04:15:37 *** keikoz has joined #openttd
05:25:32 *** Flygon has quit IRC (Read error: Connection reset by peer)
06:10:33 <pickpacket> What's the difference between "total waiting cargo" and "available waiting cargo"?
06:10:47 *** Rikests has joined #openttd
07:02:05 *** jinks_ has joined #openttd
07:03:27 *** jinks has quit IRC (Quit: ZNC - http://znc.in)
07:03:27 *** jinks_ is now known as jinks
07:58:21 <ahyangyi> _jgr_: Ah, bad news but better than what I assumed (undefined behavior)
08:28:12 <peter1138> ?
08:41:07 <xarick> dang it, place sign used to be 1 click, now it's 2
09:19:49 <xarick> there is an innefficiency I'd like to tackle
09:20:21 <xarick> GetTileMaxZ on a TileArea
09:22:03 <xarick> I wanna make an efficient GetTileAreaMaxZ
09:22:36 <xarick> one that does not repeat TileHeight on the same tiles
09:32:47 <peter1138> Is it done often enough to warrant it?
09:33:20 <LordAro> https://xkcd.com/1205/
09:33:31 <LordAro> change units as you see fit
09:35:53 <peter1138> Maybe you can consider the existing tile height test to be checking a 1x1 tile area.
09:56:53 <xarick> where do i find that test
09:57:36 <peter1138> The one you are looking at replacing...
09:59:42 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430495826207051776/image.png?ex=68f9fc8e&is=68f8ab0e&hm=9e4e080faa5d270dddf412a59e69681040ab1c18c22f855d699762f0ea5c4124&
09:59:42 <xarick> oops
10:15:06 <xarick> mystery solved
10:15:37 <xarick> `TileArea tile_area2 = TileArea(tile, 1, 1).Expand(16);` fixes it
10:23:07 <xarick> FindSpring 3.4s to 2.7s
10:24:08 <xarick> let me try this approach for the other check above this one
10:25:18 <peter1138> For tile height you need to have 1 extra tile, so start with TileArea(tile, 2, 2), right?
10:30:49 <xarick> but then that would also add an extra to the NE and NW which I don't need πŸ™
10:31:15 <peter1138> No?
10:31:38 <xarick> hmm, let me try
10:35:24 <peter1138> https://bbcmic.ro/?t=cYuMY
10:35:37 <peter1138> That's uh, definitely obscure coding :)
10:37:01 <peter1138> ? and ! are indirection operators, being used to write to video memory.
10:40:09 <andythenorth> kids of today eh
10:41:17 <xarick> nice, peter's method is even cleaner
10:41:19 <xarick> works!
10:42:25 <xarick> no need to increase w or h or clamptomap
10:46:43 <xarick> 2.779 s to 2.700 s, nice!
10:47:52 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430507947984687134/image.png?ex=68fa07d8&is=68f8b658&hm=f76da47934c87fb1c97a394fa46f4d6c6dbcae948d0a057387d642ec2f119de0&
10:51:17 <peter1138> You should not exclude MP_VOID tiles.
10:51:38 <peter1138> At least not on the south and east sides.
10:52:08 <peter1138> One of the reasons MP_VOID tiles exist there is for the purpose of providing tile height :)
10:57:47 <xarick> using yapf as a pseudo bfs isn't all too fast πŸ™
11:01:03 <xarick> findpath takes 10.416 s
11:01:46 <xarick> PfFollow node is the "bfs" part
11:03:21 <xarick> GetTileSlopeZ is called there incessantly
11:06:42 *** nebulabc has quit IRC (Remote host closed the connection)
11:06:42 *** asymptotically2 has quit IRC (Remote host closed the connection)
11:07:43 <kuhnovic> Yapf is an A* / Dijkstra pathfinder. That means you have overhead in calculating costs and keeping a binary heap so you can always get the node with the lowest cost. You don't have this overhead with a BFS, but you don't have the ability to say "this node is better than the other". You just add nodes in the right order and that's how they get processed.
11:11:07 <xarick> I mean, it's still faster than FlatSet
11:11:19 <xarick> oh, nvm, not always
11:12:16 <xarick> https://discord.com/channels/142724111502802944/1008473233844097104/1430212598795599923
11:16:54 <peter1138> Can't open that.
11:17:18 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430515354110791730/image.png?ex=68fa0ebe&is=68f8bd3e&hm=a0e6a994f5cb8c8fa9a2828906660c1a4a3a87ff36aa455912f98921099370d2&
11:17:30 <xarick> it's a link to this image
11:18:01 <xarick> Alpinist is a problem for yapf
11:18:18 <xarick> very flat 1% sea is a problem for flatset
11:23:02 <peter1138> I'm not against replacing FlatSet there. It wasn't done as a performance optimisation, and I probably completely neglected to test that aspect.
11:24:07 <xarick> yapf uses its own Hashtable Open/Close stuff...
11:25:43 <xarick> it seems to me there's a overhead issue in initializing tons of pathfinder instances? I'm not sure
11:27:42 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430517970123100310/image.png?ex=68fa112d&is=68f8bfad&hm=b352069d54fd7d39bdd2629d4fdde722305a3757dd8b203fdae9b6b0ad846d0f&
11:27:42 <xarick> this river at this height, must have initialized yapf x height times only to find a path in the next node, as it flows down the hill
11:29:02 <xarick> hmm nah... this would also occur on the master
11:29:15 <peter1138> Dear Outlook, please stop capitalising the h in https:// ...
11:34:23 <kuhnovic> A lot of yapf stuff is stored on the stack. This makes initialization pretty quick. Visual studio does show a warning about large stack usage though.
11:43:26 <andythenorth> hmm
11:43:40 <andythenorth> fireside chat time
11:44:00 <andythenorth> it's possible to make a web app go faster by adding ram caches
11:44:27 <andythenorth> and it's possible to make a web app perform better under sustained heavy load by adding CPU and multiple threads or processes
11:45:13 <andythenorth> but for the actual real structure (including memory safety and security), it's plausible that more processes will cause more cache misses
11:45:21 <andythenorth> or latency picking up workload due to cold cache
11:45:48 <andythenorth> overly optimising for one dimension is highly appealing to tidy minds
11:47:31 <andythenorth> even watching it in production, and then optimising, is prone to optimising the most common case, that has pathogical performance in other reasonably common cases
11:47:37 <andythenorth> due to tradeoffs
11:47:48 <andythenorth> the moral here: how fast do rivers need to generate?
11:48:49 <peter1138> IMHO in Xarick's testing, cases 2 is not worth caring about.
11:49:32 <peter1138> But case 3 between master and #13264 is quite compelling. IIRC that's the one that "only" changes the data structure instead of algorithm.
11:50:00 <peter1138> Case 1 is mostly ignorable except for sub-tropic.
11:51:35 <peter1138> Equally, if the tile height-tile area change is dropping from 3.4s to 2.7s over the whole generation, then it's not worth it.
12:23:00 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic approved pull request #13264: Codechange: Optimize FlowRiver https://github.com/OpenTTD/OpenTTD/pull/13264#pullrequestreview-3365537072
12:23:21 <kuhnovic> Should we add <unordered_set> to stdafx?
12:26:25 <peter1138> I would suggest unordered_map is more of a candidate.
12:27:21 <kuhnovic> That one definitely
12:27:42 <kuhnovic> Both <set> and <map> are in, it would make sense to add their unordered counterparts
12:28:30 <kuhnovic> Do you want to merge Xarick's PR or do you want to wait for more test results?
12:28:50 <xarick> hmm... is the 100% yapf toast?
12:29:25 <kuhnovic> Not if you can make it quicker πŸ˜›
12:30:31 <xarick> i doubt i can
12:31:00 *** nebulabc has joined #openttd
12:31:37 <xarick> it doesn't make use of std::unordered_set
12:31:47 <xarick> if that's something to worry
12:32:53 <kuhnovic> std::unordered_set is not a silver bullet. The hashmap used by yapf is surprisingly fast.
12:34:05 *** asymptotically2 has joined #openttd
12:34:10 <xarick> however, there's some advantages in relation to river connectivity. since the whole search is done inside yapf, it is always going to connect the rivers to lakes
12:34:30 <xarick> except... when rivermakewider screws some slope...
12:34:43 <xarick> but that's not yapf's fault
12:36:51 <xarick> the current way in master and PR 13264, there's 2 search methods involved, and they can disagree with the resulting paths
12:37:13 <xarick> leading to some extremely edge cases of river disconnections
12:41:47 <peter1138> kuhnovic, I can't right now but feel free to merge, it was 2 approvals now.
12:42:21 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic merged pull request #13264: Codechange: Optimize FlowRiver https://github.com/OpenTTD/OpenTTD/pull/13264
12:43:33 <kuhnovic> And Xarick, this doesn't mean that your yapf proposal is off the table. But it is fundamentally a different algorithm than the one that already existed. That means it needs to be looked at more thoroughly, and needs testing.
12:45:59 <kuhnovic> It can even be slower if you can show it's better than the existing algorithm. I think we all prefer a good and fast enough algorithm over one that leaves weird artifacts.
12:51:16 <xarick> btw... there is strongtype stuff added in required by std::unordered_set, not sure you noticed it.
12:51:46 <xarick> i rarely mentioned it, but hmm yeah...
12:52:09 <xarick> hash stuff or whatever requirement
12:58:52 <xarick> oh, you merged the 2 commits I had
12:58:55 <xarick> πŸ™‚
12:59:37 <xarick> the first commit was solely for strongtype, separate from the river changes
13:00:26 <xarick> squashed/merged?
13:00:39 <peter1138> kuhnovic, re adding includes, it's possible it slows the overall compile time down, not sure. Not that it matters too much.
13:00:56 <peter1138> I remember there was one include that just breaks compiling on some platforms :o
13:15:20 <kuhnovic> xarick: Yes squashed, keeps things a bit clean. I saw the strongtype stuff. You can use the base type as well, but what you did was nicer.
13:18:18 *** Flygon has joined #openttd
13:18:55 <kuhnovic> peter1138: This header is precompiled right? So it should only matter once...
13:26:34 <rito12_51026> Is this a correct spelling ` * @return true iff on water`?
13:27:04 <kuhnovic> iff means if-and-only-if
13:47:36 *** Rikests has quit IRC (Remote host closed the connection)
14:04:14 *** WormnestAndroid has quit IRC (Remote host closed the connection)
14:05:08 *** WormnestAndroid has joined #openttd
14:11:26 <xarick> I'm still thinking about a GetTileAreaZ
14:11:56 <xarick> for connected points
14:13:29 <xarick> Wondering about TileArea Intersects function...
14:14:40 *** Zathras_4 has joined #openttd
14:15:43 *** Wormnest has joined #openttd
14:20:18 <DorpsGek> [OpenTTD/OpenTTD] mmtunligit closed pull request #14719: Change: Adjust landscape toolbar placement if linking to construction toolbars enabled https://github.com/OpenTTD/OpenTTD/pull/14719
14:21:09 <DorpsGek> [OpenTTD/OpenTTD] mmtunligit commented on pull request #14719: Change: Adjust landscape toolbar placement if linking to construction toolbars enabled https://github.com/OpenTTD/OpenTTD/pull/14719#issuecomment-3432618950
14:24:35 <rito12_51026> That's funny, you're scratching your head just to improve performance a little bit, while I'm replacing implicit conversion with a while loop of explicit conversions.
14:40:08 <xarick> TileArea.Intersects doesn't do what I wanted πŸ™
14:41:11 <xarick> i want points of intersection
14:41:46 <xarick> this Intersect really wants to know if an area is inside the other at some tile
14:42:15 <xarick> i was hoping for any of the corners of the ara to intersect
14:45:52 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430567843220422848/image.png?ex=68fa3fa0&is=68f8ee20&hm=a79a6c68ad5e50dcedf53282b1e10a35aa036b407bce74c772da8353f1e4d911&
14:45:52 <xarick> misleading variable names...
14:47:14 <xarick> start_x, start_y, end_x, end_y
14:48:19 <xarick> left right top bottom on the openttd map is just confusing.. forces me into mental gymnastics
14:51:00 <xarick> that return is also confusing
14:53:01 <xarick> return start_x2 <= end_x1 && end_x2 >= start_x1 && start_y2 <= end_y1 && end_y2 >= start_y1
14:54:16 <xarick> the 1 and 2 are the areas
15:39:25 *** gelignite has joined #openttd
16:02:01 <xarick> wondering if i can make checking the heights of 2 tiles diagonally adjacent fater
16:02:56 <xarick> but i also need the slopes πŸ™
16:03:26 <xarick> it's for RiverFlowsDown
16:57:23 <DorpsGek> [OpenTTD/OpenTTD] mmtunligit opened pull request #14725: Change: Clamp terraform toolbar to main toolbar. https://github.com/OpenTTD/OpenTTD/pull/14725
17:55:10 <xarick> seems like I can't come up with something simple
17:56:12 <xarick> there might be a way to check heights and slopes of 2 tiles diagonally adjacent in a more performant way, but I just can't think properly
17:57:54 <xarick> the complexity comes when I want the min and max heights of each individual tile
18:00:20 <xarick> both tiles share the same 2 tile heights, but not 2 others
18:00:59 <xarick> ideally I compute the min height of the shared heights only once
18:01:38 <xarick> but this added complexity might end up crushing any hope for performance if i have to keep track which is which
18:12:14 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
18:16:49 <kuhnovic> Are you sure that that is the bottleneck, or are you just guessing?
18:26:49 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
18:27:10 *** WormnestAndroid has joined #openttd
18:32:54 <peter1138> Heh... yeah... that'll happen... https://www.tt-forums.net/viewtopic.php?p=1276212#p1276212
18:51:53 <xarick> it's not capturing RiverFlowsDown for some reason
18:52:09 <xarick> i wonder
18:52:53 <xarick> I moved RiverMakeWider to inside yapf
18:53:02 <xarick> is that why?
18:54:12 <xarick> oops wrong function
18:54:16 <xarick> RiverFlowsDown
18:54:19 <DorpsGek> [OpenTTD/OpenTTD] ldpl opened issue #14726: [Crash]: Assertion failed when loading a save file: v->load_unload_ticks != 0 https://github.com/OpenTTD/OpenTTD/issues/14726
18:54:19 <jfkuayue> Capturing RiverFlowsInYou…
18:58:37 <locosage> btw, is there some way to remove templating junk from the StrongType and such? Makes any kind of type completely illegible in debugging and compiler errors.
19:01:39 <_jgr_> Not easily, you need to re-arrange the templates and typedefs a fair bit
19:01:56 <_jgr_> You can do something like this though: <https://github.com/JGRennison/OpenTTD-patches/commit/ee35c199d89c93e92c577fc1f38c5d2f029b76af>
19:03:44 <locosage> iteresting, but it's not just strongtype that's responsible for the junk
19:03:53 <locosage> guess I could always ask chatgpt to remove it...
19:04:43 <locosage> but it's kinda dumb that you now need llm to understand compiler errors
19:07:42 <xarick> llm = low level machine?
19:08:10 <locosage> large language model
19:20:56 *** Wolf01 has joined #openttd
19:25:29 <xarick> when RiverFlowsDown is outside yapf, the debugger can capture it.
19:25:33 <xarick> interesting
19:25:42 <xarick> why's that?
19:29:20 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430639177728528565/image.png?ex=68fa820f&is=68f9308f&hm=868f7eb82a13848a0680f2fcb69deaa7f567803316798df54dfecddeb4305f8d&
19:29:20 <xarick> anyway, it's 3 seconds. This is called from PfFollowNode taking 8,5 seconds
19:30:10 <xarick> something in PfFollowNode is taking the rest of the time...
19:30:38 <xarick> CreateNewNode and AddNewNode...
19:31:54 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430639823223259196/image.png?ex=68fa82a9&is=68f93129&hm=fb6a7ff4f2f7a9271f81b15b642d495ea6fda378c74c6b4a4740103a2d794e2b&
19:31:54 <xarick> πŸ™
19:36:02 <xarick> AddNewNode isn't tracked by the debugger πŸ™
19:51:07 <DorpsGek> [OpenTTD/OpenTTD] janisozaur updated pull request #14365: Add: Gamepad viewport scrolling https://github.com/OpenTTD/OpenTTD/pull/14365
19:51:34 <DorpsGek> [OpenTTD/OpenTTD] janisozaur updated pull request #14365: Add: Gamepad viewport scrolling https://github.com/OpenTTD/OpenTTD/pull/14365
19:57:29 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430646263514271774/image.png?ex=68fa88a9&is=68f93729&hm=5aef2e6336a30bfa8ab4520fd731e3091259778dd20a11f9451b940f3e4badcd&
19:57:29 <xarick> Thx AI
19:59:44 <xarick> so much money thrown at LLM πŸ™
20:05:34 <kuhnovic> The functions were probably inlined so they don't show up any longer
20:08:02 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on issue #14726: [Crash]: Assertion failed when loading a save file: v->load_unload_ticks != 0 https://github.com/OpenTTD/OpenTTD/issues/14726
20:25:08 <xarick> there's "dead code" in nodelist.hpp
20:27:58 <xarick> or currently unused as some of you say
20:29:28 <kuhnovic> You're probably talking about PopBestNode? I saw that one too
20:29:44 *** keoz has joined #openttd
20:30:39 *** keikoz has quit IRC (Ping timeout: 480 seconds)
20:30:46 <kuhnovic> It seemed like a more efficient way of removing the best node from the open list compared to what Yapf does now. But it needs a performance comparison to see if it matters at all, and I never got around to that
20:30:53 <xarick> TotalCount, FoundBestNode, PopBestOpenNode, and ItemAt
20:31:46 <kuhnovic> AyStar probably used those, but AyStar is no more
20:36:08 <xarick> in binaryheap.hpp, these are unused: Length, Shift
20:38:20 <xarick> hmm
20:39:14 <xarick> maybe im wrong... hmm
20:43:15 <xarick> hashtable is confusing...
20:44:32 <xarick> I've been deleting functions, it still compiles
20:56:11 <xarick> std::priority_queue exists
20:56:16 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
20:56:47 *** WormnestAndroid has joined #openttd
20:58:13 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430661545771143330/image.png?ex=68fa96e4&is=68f94564&hm=119dd52c44217b39827adb6d3b33ff4b1110c61ff1a7e7efa831ad9091064b52&
20:58:13 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430661546543022162/image.png?ex=68fa96e5&is=68f94565&hm=b00e82b721f6a55582552b1e090f61254a99968cf8a375d147eeb1e00cb95807&
20:58:13 <xarick> kek
20:59:16 <xarick> or multiply by -1
21:08:14 *** Wormnest has joined #openttd
21:11:19 *** keikoz has joined #openttd
21:12:55 *** keoz has quit IRC (Ping timeout: 480 seconds)
21:19:41 *** keoz has joined #openttd
21:21:20 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:24:55 <kuhnovic> I looked into std::priority_queue at some point. The deal breaker was not being able to remove items that were not the best item
21:33:05 <locosage> if you don't do that often you can mark them "dead"
21:36:12 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:45:41 <_jgr_> It's generally more practical to just use std::push_heap and friends directly, which is what std::priority_queue uses under the hood
21:49:45 *** keoz has quit IRC (Ping timeout: 480 seconds)
22:06:33 <peter1138> Yawn.
22:07:48 <xarick> Find Spring in master actually takes 6,3 seconds
22:08:34 <xarick> Find Spring in mine + plus a plethora of optimizations: 2,7 seconds
22:09:56 <xarick> those 3,4 seconds I mentioned earlier today already had a few optimizations except for the FindSpring itself
22:10:09 <xarick> it's optimizations on top of optimizations
22:10:16 <peter1138> 6.3 seconds though.
22:12:25 <xarick> one of the optimizations is PR#13067 but it's compiler specific it seems
22:17:03 <xarick> i can't run the linux virtual machine anymore, microsoft updates broke it
22:17:13 <xarick> and i can't compile with clang atm
22:21:15 <xarick> is ubuntu 22.04 LTS the latest?
22:22:01 <xarick> nep
22:22:06 <xarick> thx microsoft
22:22:53 <peter1138> The latest version is 13.1.
22:23:26 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430682992430415912/image.png?ex=68faaade&is=68f9595e&hm=9ac11446396be48cb0b806229fba87a9700b569e32bf9b39c7270e84c95ecd2f&
22:23:26 <xarick> gonna see what happens
22:35:03 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430685916032270467/image.png?ex=68faad97&is=68f95c17&hm=85738e2eeccd42ac361a6f9281919bebaa9466b4349c3bda3c1bccbc3651d0d8&
22:35:03 <xarick> oh nice, it booted
22:35:17 <_glx_> using wsl is easier
22:44:23 *** gelignite has quit IRC ()
22:44:49 <xarick> i'm stuck on a blue screen, can't do anything
22:46:26 <xarick> now it's a black screen... oh well
22:47:23 <xarick> now it's blue again
22:47:29 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430689046291546306/image.png?ex=68fab081&is=68f95f01&hm=0dab5fe93d01e31140362b42af5f3574a2aa588af114a8b29c9ed230cead986a&
22:47:29 <xarick> what is this?
22:47:56 <xarick> nevermind, I'm uninstalling
22:56:17 <reldred> Wtf did you do to it
22:57:42 <xarick> Hyper-V is outdated is my guess...
22:59:53 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430692163791884358/image.png?ex=68fab368&is=68f961e8&hm=e6eb6e74ed79a942ccd06424737ef2e14f2d2ed76f11dfb383d42ecf4b1ee4f5&
22:59:53 <xarick> well take a hint...
23:00:05 <xarick> i dont want a password ffs...
23:01:10 <dwfreed> too bad
23:02:16 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1430692767008559244/image.png?ex=68fab3f8&is=68f96278&hm=ae467db03e8b0930c292f2da61745b0d40ad5f1d00d806ccc64282b731f703b2&
23:02:16 <xarick> is this command line only?
23:02:48 <xarick> I'm disappointed already
23:02:53 <dwfreed> what version of windows are you running
23:02:58 <xarick> 11
23:03:20 <dwfreed> then graphical apps work
23:03:26 <dwfreed> https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
23:08:48 <_glx_> yeah it's terminal to navigate, but you can run gui apps, and they even are added to start menu
23:17:30 <xarick> I don't get it
23:20:29 <xarick> how do I uninstall this?
23:23:33 <xarick> great... it's uninstallable
23:23:40 <xarick> i hate myself
23:23:45 <xarick> well good night