IRC logs for #openttd on OFTC at 2025-10-14
β΄ go to previous day
01:25:56 *** Wormnest has quit IRC (Quit: Leaving)
02:20:05 *** gnu_jj_ has joined #openttd
02:23:41 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:04:35 *** _auxilian has joined #openttd
03:04:35 <_auxilian> has anyone built the game on arch linux? the cmake step is failing because vcpkg is failing to install something but the logs dont tell me what
03:04:46 <_auxilian> what system packages do i need installed?
03:06:24 <_auxilian> _auxilian: the log just says "subcommand failed"
03:12:07 *** Zathras_1 has joined #openttd
03:12:18 *** Zathras_11 has joined #openttd
03:15:41 *** Zathras_4 has quit IRC (Ping timeout: 480 seconds)
03:15:41 *** Zathras has quit IRC (Ping timeout: 480 seconds)
03:49:22 *** WormnestAndroid has quit IRC (Remote host closed the connection)
03:49:27 *** WormnestAndroid has joined #openttd
04:27:16 <yiffgirl> i have. uhh let me look at that log
04:28:50 <yiffgirl> huh. i don't remember ninja being used
04:30:06 <yiffgirl> _auxilian: just to confirm, you're following the COMPILING.md file, right ?
04:35:42 <_auxilian> I just ran `cmake ..` which invoked vcpkg which then failed
04:36:05 <_auxilian> yiffgirl: Idk why ninja won't tell me WHY the subcommand failed
04:36:11 <_auxilian> It doesn't seem tk be saving stderr anywhere
07:04:56 <LordAro> _auxilian: why are you using vcpkg on Arch?
07:05:40 <LordAro> wait, it invoked vcpkg without you otherwise specifying? that doesn't seem right
07:07:30 <LordAro> regardless, the suggestion from the internet is that the actual error is somewhere further up - can you post the full log somewhere?
07:53:03 *** gelignite has joined #openttd
08:14:38 <peter1138> Using vcpkg on Linux seems a bit odd. COMPILING.md mentions vcpkg only in the Windows section.
08:38:14 <peter1138> Arch still call it "Engine for running Transport Tycoon Deluxe"
08:46:35 <LordAro> didn't we try to get them to change that before?
09:01:06 <peter1138> I think it only came up in a PR where someone had copied the description and we questioned it.
09:02:32 <LordAro> Arch has scrapped their flyspray instance, so who knows :)
09:22:31 <xarick> not sure if 15.0-beta3 already has yapf rivergen
09:27:22 <LordAro> peter1138: disabling SSE by the looks of things
09:28:02 <LordAro> might be enabled differently globally?
10:22:40 <xarick> hmm yapf not even in the equation
10:24:12 <xarick> i dont understand percentages here, this FlowRiver function is also recursive
10:53:23 *** gelignite has joined #openttd
11:03:38 <xarick> FlowRiver down from 64 seconds to 9 seconds
11:04:43 <xarick> flat set to unordered set and list to vector
11:06:00 <xarick> yapf takes 3,6 seconds avg on both tests
11:10:15 <kuhnovic> From what I recall Yapf is only involved in the very last part: finding a path from start to end. Finding the end is done using breadth first search and that's the expensive part in this case.
11:55:38 <peter1138> FlatSet will be slow if it has to insert a huge list of TileIndexes.
12:05:45 <xarick> very flat 4096x4096 map, plausible
12:08:11 <peter1138> Using `std::unordered_set` could break seed reproducibility. If that's a problem.
12:10:25 <xarick> it's not used for anything else
12:11:17 <xarick> marks.insert and marks.contains
12:12:03 <peter1138> The section just after "Maybe we can make a lake"
12:12:34 <peter1138> Ah, you changed that.
12:13:48 <xarick> it doesn't maintain old behaviour, but the new behaviour is consistent for reproducibility
12:14:24 <LordAro> it might be for your platform, but there's no guarantee
12:14:45 <peter1138> No it's fine, the randomness is now a vector index instead of set position.
12:14:50 <xarick> I iterate from std::vector
12:16:33 <peter1138> So the queue is no longer a queue.
12:16:41 <peter1138> Which is what all the comments were about :)
12:26:57 <xarick> what's a queue actually?
12:27:39 <xarick> as std::list the order was by tileindex
12:28:28 <xarick> I thought the intention was to be by order of insertion
12:29:31 <ahyangyi> A queue is a data structure that enforces a FIFO order between pushes and pops?
12:30:25 <xarick> ah, well, it's not a queue anymore, by that definition
12:30:56 <xarick> it's a nothing goes out
12:31:25 <ahyangyi> ( and a priority queue is not a queue, by definition )
12:33:05 <xarick> all in, nothing out π
12:34:17 <xarick> im also wondering whether the tile choice should start from the 32th tile onwards
12:35:07 <xarick> but that would be a more visible change
12:43:15 <xarick> maybe i'm misundertanding the breadth first search
12:43:26 <andythenorth> it's nice to optimise river gen that has weird results anyway π
12:43:45 <andythenorth> rivers: unsatisfying, make strange lakes, but FAST
12:49:51 <xarick> woah, that's on a 128x128 map
12:51:07 <peter1138> andythenorth, there is that. River-gen should "just" be part of an erosion step during landscape generation.
12:52:18 <xarick> the queue has 21% of the map in it
12:52:31 <xarick> clearly we're misunderstanding things
12:54:09 <ahyangyi> river-gen is also part of heightmap-based map generation, where erosion might not be applicable
12:54:48 <xarick> I think i undestand why a deque is desirable
12:56:30 <xarick> keeps the list shorter... "maybe"...
12:58:10 <peter1138> But you "need" all items to find the lake start.
12:58:14 <kuhnovic> No point in keeping data in the "queue" if you're done with it, otherwise you'll keep allocating more and more memory
12:58:28 <peter1138> (Presumably you don't actually need all of them, only 1 random one)
12:58:30 <_glx_> hmm ok nightly fails because we had 2 builds for the same date, and latest is "wrong"
13:01:53 <peter1138> Ok, you could use a deque for the queue, and then store a single TileIndex for the "build a lake" path.
13:03:05 <peter1138> Picking which random tile to use because more awkward though.
13:03:32 <peter1138> Or: you could pick it from the unordered_sort, and not care about reproducibility.
13:03:35 <andythenorth> I know that I'm wrong about picking a coast tile and building a river from it
13:03:56 <peter1138> Or, yes, rewrite the algorithm.
13:04:32 <andythenorth> pathfinding from a coast tile seems intuitively faster to me than picking random tiles and trying to pathfind to a coast
13:04:52 <andythenorth> and we *could* have some structure of pre-listed coast tiles maybe, if that improved anything
13:05:37 <andythenorth> most of mine is just for Firefox
13:07:45 <peter1138> Free memory is wasted memory.
13:09:58 <xarick> on a 4k map the highest queue i've seen was 3600
13:10:17 <xarick> but it's averaginng about 400
13:10:23 <kuhnovic> The current algorithm either flows a river to the sea or creates a lake it seems
13:11:07 <andythenorth> in my days of coding flash games I was always a bit of ruthless shortcut taker
13:11:32 <andythenorth> if we want to get an outcome, then minimise the paths that lead to alternative outcomes
13:12:11 <andythenorth> but I don't like lakes....but removing them probably causes pitchforks
13:12:37 <andythenorth> and also xarick is unlikely to invert and replace the algorithm, if months could be spent making optimisations for specific test cases
13:14:09 <kuhnovic> I don't mind lakes, but I think they should just be part of a river. Create a river that end up at sea, then widen part of the river into a lake.
13:14:10 <ahyangyi> andythenorth: I felt it would help if we assign a pseudo-height to each tile to enforce some gradient-like structure on what is otherwise a huge swath of flat land
13:14:19 <xarick> let me test the worstest case scenario, map height = 1 or 2
13:16:26 <peter1138> xarick, I wouldn't worry about the queue size.
13:16:31 <ahyangyi> Anyways, it's a topic I thought I was interested in, but never actually put my time in. kinda feels badc
13:16:52 <peter1138> xarick, the FlatSet/unordered_set is already that size anyway.
13:17:09 <ahyangyi> So is the map itself
13:18:06 <peter1138> ahyangyi, if the river gen happens *before* the internal height map is converted to tiles then there's a lot more data.
13:18:40 <ahyangyi> I know, though there is still a need to fill out some numbers in the case of height maps
13:19:25 <peter1138> Pfft. I had a patch for 16 bit heightmap support :)
13:20:16 <ahyangyi> And the height values from neither the terrain gen algorithms nor heightmaps are particularly good for generating long rivers at bigger maps...?
13:20:28 <ahyangyi> Too easy to be trapped in a random 1x1 basin and becomes a lake
13:20:58 <ahyangyi> Thought might be fixable in the rivergen algorithm.
13:21:05 <kuhnovic> A* instead of BFS might help here
13:21:15 <peter1138> If you're doing it at heightmap level it possibly becomes easier to flood those bits (raise them to the surrounding height)
13:21:27 <xarick> there's a histogram of heights
13:21:37 <peter1138> Or even at map level, tbh.
13:21:47 <peter1138> The algorithm at the moment looks for lower areas.
13:22:23 <peter1138> If you're looking for higher areas instead, then you can potentially ignore a lower areas that is less than a tile or so.
13:23:18 <xarick> BFS vs pathfinder disagree on the end tile if I recall
13:23:29 <xarick> there were issues with it
13:23:50 <peter1138> Okay, well. If anyone else actually wants to change the river algorithm, then by all means do so.
13:24:03 <kuhnovic> Tbh it should be done in one go, no separate BFS needed. Just use A* (or more accurately, dijkstra) right away.
13:24:10 <kuhnovic> I would like to, but yeah time...
13:24:16 <peter1138> For now what xarick PR does is improves the generation performance of the existing algorithm.
13:24:53 <xarick> I was trying to make pathfinder end tile check to match that of the bfs
13:24:58 <xarick> but didn't come with anything
13:24:59 <peter1138> kuhnovic, tell your boss you're doing important fluid dynamnics research.
13:25:24 <xarick> but maybe removing bfs could be a better idea
13:25:34 <ahyangyi> Computational Fliud Dynamics too
13:25:45 <ahyangyi> Hence we are so worried about algorithms and performance π
13:26:50 <xarick> AAAHogEx would know the solution
13:28:33 <andythenorth> pick a random path length from [range of values]
13:28:47 <andythenorth> build from coast to there, then try to spawn for river tributaries
13:29:07 <andythenorth> repeat until some recursion limit
13:29:20 <andythenorth> perhaps not π
13:32:43 <xarick> know all inclined slopes! pick a random inclined slope! pick another random inclined slope with one less height. PF it
13:33:05 <xarick> repeat until you reach sea?
13:33:35 <xarick> hmm let's see if I can code this
13:35:07 *** audigex has joined #openttd
13:35:07 <audigex> Pick a random tile, see if you can reach the sea, otherwise crash to desktop
13:36:38 <peter1138> Spend 20 minutes generating the map, then abort because no road types are available?
13:41:53 <ahyangyi> feature request: when no road types are available, towns build canals instead π
13:42:16 <andythenorth> build town roads, but only from a hill to the coast
13:42:26 <andythenorth> we didn't discuss locating towns on rivers? π
13:58:32 <_auxilian> Perhaps it noticed that I already had vcpkg set up? And so invoked it anyway?
13:58:46 <_auxilian> I mean, there was a vcpkg.json in the repo
13:59:02 <_auxilian> LordAro: Let me look
14:01:19 <_auxilian> idk how to fix that... thats an error in sdl
14:01:51 <peter1138> I don't think cmake will "just use" vcpkg just because we have that file.
14:02:30 <peter1138> The usual thing is to install your system's development packages for the required dependencies. Not actually build unrelated versions of the dependencies yourself.
14:03:29 <_auxilian> peter1138: ``` ο ξ° ο /mnt/YularenBackup/YularenOffload/Projects/C++/OpenTTD/build ξ° ο ο¦ master ξ° cmake .. ξ² β
14:03:29 <_auxilian> -- Running vcpkg install
14:03:29 <_auxilian> Detecting compiler hash for triplet x64-linux...
14:03:29 <_auxilian> Compiler found: /usr/bin/c++
14:03:31 <_auxilian> this is what happens when i run `cmake ..` in build
14:03:45 <_auxilian> peter1138: idk, its doing it automatically
14:05:03 <_auxilian> ... why does it think im using msvc?
14:05:11 <_auxilian> oh you know whats possible
14:05:36 <_auxilian> well no, i was going to say this is a partition that a windows mount once had where i tried to build openttd on windows
14:05:36 <LordAro> that's a very WSL abspath :D
14:05:50 <_auxilian> but it was empty and i completely cloned a new repo
14:06:21 <_auxilian> LordAro: its not wsl lol its just - basically long story my laptop was rly slow so i installed windows on another partition and moved all of my important stuff to an external drive
14:06:27 <_auxilian> its in my projects directory on the external ssd
14:08:23 <_auxilian> is the sdl2 package in the aur or main repos?
14:08:29 <_auxilian> `yay` is trying to install it from the aur
14:09:01 <LordAro> there's an sdl3 compat package somewhere iirc
14:09:12 <_auxilian> oh is it using sdl3 now?
14:09:34 <LordAro> i only know this because i actually turned my laptop on last week :)
14:09:39 <peter1138> They jumped the gun on that, using the compatibility shim when it wasn't actually compatible.
14:09:39 <_auxilian> i hae `sdl2-compat` and `sdl3` installed
14:10:02 <peter1138> LordAro, was the CMOS battery dead>
14:10:11 <_auxilian> ok i really dont understand why cmake is running vcpkg install
14:10:15 <_auxilian> thats probably just the issue
14:10:48 <_auxilian> im going to reset the build folder
14:10:48 <peter1138> Delete anything in build/ and try again?
14:11:02 <_auxilian> imma try again and manually say use clang
14:11:03 <_auxilian> whats the flag for that?
14:11:17 <_auxilian> peter1138: great minds think alike π₯
14:11:52 <LordAro> -DCXX_COMPILER_PATH or something like that
14:12:22 <_auxilian> its still running vcpkg
14:12:31 <_auxilian> `cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ..`
14:12:49 <_auxilian> its up to date with the master branch so i really dont understand what is happening
14:13:24 <LordAro> mm, i wouldn't expect compiler path to affect it
14:13:31 <_auxilian> hmm this might be the issue
14:13:39 <_auxilian> theres a vcpkg_installed directory in the project directory for some reason
14:13:47 <LordAro> does cmake have a verbose flag?
14:13:48 <_auxilian> is that created when cmake runs vcpkg install?
14:13:54 <_auxilian> LordAro: let me try
14:13:58 <LordAro> i'd have thought the latter
14:15:27 <_auxilian> ```ο ξ° ο /mnt/YularenBackup/YularenOffload/Projects/C++/OpenTTD/build ξ° ο ο¦ master ξ° cmake .. --debug-output ξ² 1 β
14:15:27 <_auxilian> Running with debug output on.
14:15:27 <_auxilian> -- Running vcpkg install
14:15:27 <_auxilian> Called from: [3] /mnt/YularenBackup/YularenOffload/Projects/C++/OpenTTD/CMakeLists.txt
14:15:27 <_auxilian> [2] /usr/share/cmake/Modules/CMakeDetermineSystem.cmake
14:15:27 <_auxilian> [1] /home/aux/.local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
14:15:27 <_auxilian> Detecting compiler hash for triplet x64-linux...
14:16:19 <_auxilian> is my cmake set up to autoinject vcpkg into every script? cause i dont see a reference to vcpkg.cmake in cmake
14:16:59 <_auxilian> do you know how to see what a command is running (expand alias)...
14:18:29 <_auxilian> its not doing it via alias
14:18:44 <_auxilian> idk how else to see let me do some looking
14:20:05 <_auxilian> `CMAKE_TOOLCHAIN_FILE=/home/max/.local/share/vcpkg/scripts/buildsystems/vcpkg.cmake` environment variable
14:20:16 <peter1138> vcpkg hijacked you.
14:20:22 <LordAro> environment variables was going to be my next guess
14:20:41 <_auxilian> thank you guys!!!!!
14:21:19 <_auxilian> peter1138: actually i think i manually put it there assuming that i would ever use it and then it just never helkped me cause i dont use cmake lol
14:22:37 <_auxilian> I assume it wouldn't be a problem without vcpkg.json but most people don't use vcpkg on Linux so it doesn't matter
14:24:51 <_auxilian> I'm not super familiar with cmake, when I modify stuff I only need to rerun `make`, right, not cmake?
14:44:16 <xarick> I have a dumb idea: Water Regions but for TileHeights
14:45:20 <LordAro> river generation is not in need of speeding up that much
14:48:48 <xarick> actually, just the Connected component label thing
14:49:40 <xarick> but use only 1 region, the entire map
14:51:06 <xarick> yeah it's not clear what I require to do
14:57:52 <peter1138> 1 region. Yes. That's definitely perfect.
14:58:59 <peter1138> Hmm, to merge, or to rebase...
14:59:24 <peter1138> The urge for clean development history vs "this is how git should work"
15:56:44 <peter1138> Okay, this is a fucking mess. I think it needs a cherry-pick rebase :S
16:04:26 <andythenorth> if in doubt, `> foo.diff`
16:04:38 <andythenorth> "when all else fails"
16:06:11 <peter1138> Honestly, that is likely what I will do.
16:11:10 <peter1138> Yeah, I can't rebase it because it has merges inside it. And those git rebase does those in chronological order.
16:12:18 <LordAro> there is a --rebase-merges option
16:12:41 <LordAro> but... yeah, might need to just start from the beginning
16:15:22 <peter1138> Completely loses history of course, but.
16:15:50 <LordAro> occasionally more useful too :p
16:24:21 <xarick> very easy to trigger. Start openttd, open console, press enter
16:25:05 <peter1138> No problem for me, so probably a difference between iteration on Windows and Linux.
16:25:25 <xarick> yeah, i'm on a debug build
16:28:41 <xarick> while (IsWhitespace(cmd[0]))
16:31:07 <xarick> it's empty, whatever this thing is
16:39:34 <xarick> funny, there's a if (cmd.empty()) return std::nullopt; right after this line
16:39:58 <peter1138> Yeah, you want a copy of that line before as well.
16:40:42 <peter1138> Or an assert, and don't call that function if it's empty. But given it already checks for being empty once removing whitespace, probably appropriate for it to check empty too.
16:43:28 <xarick> `while (!cmd.empty() && IsWhitespace(cmd[0])) cmd.remove_prefix(1);` this ?
16:44:59 *** Smedles has joined #openttd
17:13:00 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:25:03 <LordAro> oh, this code will add a newline for you if your lines get longer than 256kB
17:27:51 *** tokai has quit IRC (Ping timeout: 480 seconds)
17:29:43 *** ChanServ sets mode: +v tokai
17:30:38 <LordAro> Ada strings are stack-based unless you're really funky with them, so this was (apparently) a workaround to avoid the stack blowing out
17:33:41 *** tokai|noir has joined #openttd
17:33:41 *** ChanServ sets mode: +v tokai|noir
17:38:24 *** tokai has quit IRC (Ping timeout: 480 seconds)
17:46:15 <xarick> RiverFlowsDown is a little bit flawed
17:57:52 <xarick> trying to gather all RiverFlowsDown tiles at their respective heights
18:31:06 *** ChanServ sets mode: +v tokai
18:38:04 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
18:45:25 *** gelignite has quit IRC (Remote host closed the connection)
18:46:06 *** gelignite has joined #openttd
18:58:15 <andythenorth> was it industry badges?
18:59:14 <peter1138> You can have new dock.
19:06:00 <peter1138> Okay, with git reset, I managed to squash all this work down to one commit, and remove the initial stuff that isn't used.
19:06:23 <peter1138> I'm not happy with having to squash 2+ months of work :o
19:09:39 <vondpc> (you can use git rebase -i for that btw )
19:16:30 <andythenorth> I suspect peter knows π
19:23:35 <xarick> 17.14.17 is out, let's see if clang works
20:04:30 <jfkuayue> Till today I didnβt know nuneaton was pronounced as na-nee-ten
20:15:57 <peter1138> I mean, not really. Nuh-nee-ton.
20:17:42 <peter1138> Or perhaps nun-ee-ton
20:18:21 <belajalilija> peter1138: i'd say this minus the t in ton
20:19:03 <peter1138> Not every British persons drops their Ts.
20:19:48 <belajalilija> the best of us do, however
20:20:07 <peter1138> The rest, you mean.
20:24:13 <LordAro> pretty sure it's nun-eet-on
20:24:47 <peter1138> Describing pronunciations without using ipa :)
20:26:52 <jfkuayue> Describe every pronunciation using katakana!
20:34:07 <jfkuayue> You get exactly London, Milan Kundera, and Ankara
20:34:42 <jfkuayue> Located in Igirisu, Cheko, and Toruko, accordingly
20:50:52 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:12:52 *** Extrems has quit IRC (Ping timeout: 480 seconds)
21:13:12 <peter1138> So is a PR forthcoming?
21:30:30 *** Wormnest has joined #openttd
21:34:28 <xarick> trying something replacing bfs
21:39:17 <xarick> oh pff of course it's over producing rivers... yapf actually placing river tiles.!
21:45:08 <xarick> turned out better than I expected
21:47:19 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:02:44 <xarick> possibly the cause being the random cost
22:03:01 <xarick> okay i tried, gonna give up
23:03:38 *** Extrems has joined #openttd
23:23:56 *** Tirili has quit IRC (Quit: Leaving)
23:32:45 <_auxilian> how do you log stuff?
23:33:03 <_auxilian> im trying to figure out why the video driver method isnt being called
continue to next day β΅