IRC logs for #openttd on OFTC at 2024-09-25
            
00:17:40 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
00:57:22 *** Wormnest has joined #openttd
01:53:14 *** Wormnest has quit IRC (Quit: Leaving)
02:02:44 *** herms61 has quit IRC (Quit: bye)
02:03:37 *** herms61 has joined #openttd
02:17:39 *** gnu_jj_ has joined #openttd
02:20:49 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
02:29:17 *** debdog has joined #openttd
02:32:39 *** godbed has quit IRC (Ping timeout: 480 seconds)
03:14:48 *** Flygon has joined #openttd
04:08:17 *** keikoz has joined #openttd
04:45:49 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/1251638508a1269eaa86499bf805db1ef544a29c
04:45:50 <DorpsGek> - Update: Translations from eints (by translators)
05:36:04 <kuhnovic> xarick: Because the pathfinder uses 4 regions of lookahead, plus one extra which is the current region the ship is in.
05:40:13 <DorpsGek> [OpenTTD/OpenTTD] Release workflow was not successful https://github.com/OpenTTD/OpenTTD/actions/runs/11026693549
06:43:24 *** akimoto has joined #openttd
06:59:35 *** akimoto has quit IRC (Ping timeout: 480 seconds)
07:03:44 *** Smedles has joined #openttd
07:07:12 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1288396368519368704/IMG_7458.jpg?ex=66f5081f&is=66f3b69f&hm=87b9fa7bebf8bdf36ff145d613858e0a5b5117cd21acb40f9487afb67e6b0ee2&
07:07:12 <andythenorth> On topic ๐Ÿ˜›
07:26:23 *** HerzogDeXtEr has joined #openttd
07:53:18 <_pruple> well
08:04:09 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
08:09:29 *** Smedles has joined #openttd
08:22:13 <andythenorth> diagonal roads?
08:41:03 <reldred> yes
08:46:51 <johnfranklin> Where is the Clifton Suspension Bridge?
08:47:49 <LordAro> the fact that you know it's name should enable you to resolve this question
08:49:00 <johnfranklin> May I
08:49:00 <johnfranklin> 1. Go to Bristol
08:49:00 <johnfranklin> 2. Visit Andy
08:49:00 <johnfranklin> 3. Persuade him in person about the consideration of cargo aging
09:04:33 <xarick> vcpkg updates
09:06:18 <xarick> how ugly is this:
09:06:18 <xarick> `pf.SetIntermediateDestination(high_level_path[std::min<size_t>(high_level_path.size(), NUMBER_OR_WATER_REGIONS_LOOKAHEAD) - 1])`
09:07:34 <_pruple> johnfranklin: BAD FEATURES?
10:02:42 <ahyangyi> xarick: `std::min<size_t>(bla bla) - 1` looks a bit dangerous
10:02:57 <ahyangyi> if the `.size()` can ever be zero
10:04:05 <xarick> the line before takes care of it
10:04:09 <ahyangyi> Nice
10:04:25 <xarick> ``` const bool is_intermediate_destination = static_cast<int>(high_level_path.size()) >= NUMBER_OR_WATER_REGIONS_LOOKAHEAD;
10:04:25 <xarick> if (is_intermediate_destination) pf.SetIntermediateDestination(high_level_path[std::min<size_t>(high_level_path.size(), NUMBER_OR_WATER_REGIONS_LOOKAHEAD) - 1]);```
10:04:43 <peter1138> Isn't that the same as `high_level_path.back()`?
10:04:56 <xarick> NUMBER_OR_WATER_REGIONS_LOOKAHEAD = 5
10:05:18 <xarick> it used to be
10:05:32 <ahyangyi> Isn't that the same as `pf.SetIntermediateDestination(high_level_path[NUMBER_OR_WATER_REGIONS_LOOKAHEAD - 1])`?
10:05:32 <xarick> but with my stuff, the size can go higher than NUMBER_OR_WATER_REGIONS_LOOKAHEAD
10:06:11 <xarick> sometimes the size is lower
10:06:19 <xarick> .size() can be lower than 5
10:06:21 <ahyangyi> Then `is_intermediate_destination` is false?
10:06:43 <xarick> yes
10:09:13 <xarick> what im trying to do is
10:10:40 <ahyangyi> find a path to either the final destination (if it's close enough), or as far as you plan to look at at one time.
10:11:03 <peter1138> Trying to make the path finder more complicated and harder to maintain.
10:11:21 <ahyangyi> Well that's what you pay for efficiency
10:11:37 <xarick> I want the intermediate region to always be the 5th, if it is set. high_level_path.size() used to always be 5, so using high_level_path.back() would always get the 5th one. Now I need to retrieve information where the depot tile that is from the last region, so i need the high_level_path to get the entirety of the path
10:12:56 <xarick> there may be another way to solve it, maybe...
10:14:38 <xarick> i still wanna maintain the 5th intermediate region
10:14:43 <ahyangyi> Anyways, the logic looks understandable to me.
10:14:43 <ahyangyi> Alternatively you can make `high_level_path` to be still 5 elements and a `std::range` of the full path, so that you can still use `high_level_path.back()` with the old semantics?
10:14:47 <xarick> but also extract the depot tile
10:22:54 <peter1138> Could be a `std::span`, we don't support `std::range` yet.
10:25:43 <ahyangyi> I'm also a bit out of touch from the C++ world :S
10:27:32 <_glx_> The min is useless since you already checked the size
10:28:56 <_glx_> So you already now it's >= 5
10:32:04 <johnfranklin> _pruple: no
10:40:20 <xarick> i see
10:42:47 <xarick> it still looks kind of ugly
10:42:52 <xarick> `pf.SetIntermediateDestination(high_level_path[static_cast<size_t>(NUMBER_OR_WATER_REGIONS_LOOKAHEAD - 1)]);`
10:43:07 <LordAro> have you considered these things called "variables"
11:06:16 <xarick> I'm giving dual meaning to variables, this is bad
11:07:44 <xarick> @param max_penalty [in] maximum path cost
11:07:59 <xarick> @param max_penalty [out] cost of path found
11:09:07 <xarick> poor ChooseShipTrack... it's becoming unreadable
12:26:49 <peter1138> No shit.
12:27:03 <peter1138> Prefer returning values instead of out parameters.
13:08:11 *** geertop has quit IRC (Quit: User went offline on Discord a while ago)
13:34:36 <andythenorth> FML, forgot about lunch
13:36:43 <LordAro> try again tomorrow
13:38:46 <andythenorth> ok GPT has rate limited me
13:38:51 <andythenorth> reminder to eat ๐Ÿ˜›
13:39:02 <LordAro> that might be the most andy thing ever
13:42:53 <truebrain> even bots are like: andy, you are talking too much
13:43:03 <truebrain> poor andy ๐Ÿ˜›
13:53:57 *** nielsm has joined #openttd
14:32:04 <xarick> alright, i got this part done
14:32:20 <andythenorth> I am going to contextualise: even though I have asked GPT to favour shorter answers in the prefs, the line ratio of 'prompt:answer' is about 1:50
14:32:26 <andythenorth> which outdoes me
14:37:03 <xarick> I got an issue still
14:37:33 <xarick> dealing with the *may_reverse* situation
14:37:59 <xarick> and i guess costs
14:38:06 <xarick> so, 2 issues
14:39:40 <xarick> how can you help me?
14:39:40 *** felix has quit IRC (Read error: Connection reset by peer)
14:39:44 *** felix has joined #openttd
14:42:22 *** felix has quit IRC (Read error: Connection reset by peer)
14:42:26 *** felix has joined #openttd
14:42:47 *** felix has quit IRC (Read error: No route to host)
14:42:52 *** felix has joined #openttd
14:49:06 <xarick> how to check if a tile is inside an area and return it, with std::stuff
14:50:57 <xarick> if tile list A contains at least 1 tile from tile list B, return the first matching tile
14:52:05 <LordAro> i'd be surprised if there wasn't already a helper function for that
14:52:16 <LordAro> but std::set_intersection might work, if all the preconditions are met
14:56:19 *** Wormnest has joined #openttd
14:56:37 <xarick> it's awesome that water regions are also a vector of tileindexes
14:57:16 <LordAro> i'm pretty sure water regions are defined to be distinct though, so i'm not sure what you're up to
14:57:53 <xarick> i am trying to avoid using IsShipDepotTile, since I already got a list
14:59:06 <xarick> i know the water region that contains the depot, and i pre-provided a list of tiles with ship depots
14:59:13 <xarick> i just need a match
15:01:37 <xarick> reduces complexity, hopefully, if I know how to code this right
15:11:53 <peter1138> Edge water region has a patch labels.
15:12:19 <peter1138> Are you associating a region + patch label with a depot?
15:16:58 <xarick> nope ๐Ÿ˜ฆ
15:20:14 <andythenorth> someone just sent me https://icon.horse/
15:20:20 <andythenorth> which is not Iron Horse
15:20:32 <andythenorth> but I maybe should have bought that TLD
15:26:07 <xarick> i wanna get rid of this ugly callback
15:26:39 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1288522060867571834/image.png?ex=66f57d2e&is=66f42bae&hm=64585475ddc84be35f0e15d465310dfcfdb0b0f98c862ae6741d0930e3f33aeb&
15:27:37 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1288522307232600144/image.png?ex=66f57d69&is=66f42be9&hm=4206d590cef23830a38a1340566809fa07311bd3ef600ed9eb7b1c3d1f404d20&
15:57:09 *** gelignite has joined #openttd
16:05:39 <xarick> I wonder now, what's faster
16:06:12 <xarick> `IsShipDepotTile(tile) && GetShipDepotPart(tile) == DEPOT_PART_NORTH && IsTileOwner(tile, Yapf().GetVehicle()->owner);`
16:06:12 <xarick> versus
16:06:12 <xarick> `std::find(m_destTiles.begin(), m_destTiles.end(), tile) != m_destTiles.end();`
16:06:54 <LordAro> those are very different operations
16:08:10 <xarick> hmm....
16:09:59 <xarick> there can be a maximum of 64000 ship depots
16:11:14 <xarick> m_destTiles = 64000 tiles
16:11:32 <LordAro> @calc 4096*4096 / 2
16:11:32 <DorpsGek> LordAro: 8388608
16:11:43 <LordAro> alright, just 64000 then
16:11:57 <LordAro> but still, optimise for the average case before optimising for the worst case
16:12:08 <LordAro> i'd imagine the average to be about 5
16:12:19 <LordAro> and even the worst "normal" case to be a couple of hundred
16:13:30 <xarick> it's called by the pf to detect destination,
16:13:44 <xarick> so... something tells me std::find is gonna be bad
16:15:03 <xarick> need to test, brb
16:15:07 <ahyangyi> andythenorth: Are there `.hog` domains?
16:19:38 *** Wolf01 has joined #openttd
16:29:31 <andythenorth> hmm
16:29:54 <wensimehrp> `.sam` domains?
16:39:32 <_glx_> xarick: that's why the common suggestion we often made was to reverse the logic, instead of searching from ship to multiple tiles, search from multiple tiles to ship
16:43:27 <xarick> [2024-09-25 17:42:55] dbg: [misc:0] [YapfShipFindNearestDepot, 1] 2043081 us [avg: 2043081.0 us]
16:43:44 <xarick> 4096x4096 map, 64000 depots
16:43:57 <xarick> 2 seconds spike, is bad ๐Ÿ˜ฆ
16:45:02 <_glx_> yes extreme case, and as we told yesterday your multiple destination approach can be expensive due to destination check
16:45:46 <xarick> need to check where the spike comes from
16:45:56 <xarick> high lvl pf vs low lvl pf
16:46:09 <_glx_> probably the "are we done yet?" check
16:46:35 <_glx_> as it needs to be done for every possible destination
16:51:34 *** gelignite has quit IRC (Ping timeout: 480 seconds)
16:55:13 <xarick> well well
16:55:16 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1288544361969356913/image.png?ex=66f591f3&is=66f44073&hm=fd11de8bef2f56908c4f7b596ac54e28f48af1c21521c6b8437df9067623f275&
16:55:27 <xarick> that's the ForceUpdate
16:56:15 <xarick> indeed, the depots are randomly placed everywhere
16:57:55 <xarick> gonna try after it's cached
17:02:13 <xarick> oh, it's stumbling upon checking if a region is already in the Origin
17:02:22 <xarick> that one is also a std::find
17:02:48 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1288546260193906758/image.png?ex=66f593b8&is=66f44238&hm=d5850f8995800d4bd4b90409531692e6405f13b235e189d227b5e855bdbed2bb&
17:04:29 <xarick> 64000 searches are initiated, and a max of 65536 water regions can exist, right?
17:11:05 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1288548343537991741/image.png?ex=66f595a9&is=66f44429&hm=fed19b1585b25f6f24fa3ac917b90737bb5107569cb6f82966b2d1fafd89fbfc&
17:11:05 <xarick> on the low lvl pf
17:12:46 <xarick> not the biggest offender, but yeah...
17:13:45 *** gelignite has joined #openttd
17:36:26 <xarick> GetWaterRegionIndex is slow?
17:39:43 <xarick> calculating hask
17:39:46 <xarick> hash
17:52:47 <_glx_> I hope you are not doing that in debug build
17:59:47 <xarick> oh ๐Ÿ˜ฆ
18:11:36 *** tokai|noir has joined #openttd
18:11:36 *** ChanServ sets mode: +v tokai|noir
18:18:28 *** tokai has quit IRC (Ping timeout: 480 seconds)
18:27:49 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
18:42:03 <xarick> GetWaterRegionIndex
18:42:07 <xarick> again
18:43:05 <xarick> 58% of the time spent
18:43:12 <xarick> is in GetWaterRegionIndex
18:43:41 <xarick> is there a way to count how many times it was called?
18:50:41 <xarick> `static inline TWaterRegionIndex GetWaterRegionIndex(int region_x, int region_y) { return GetWaterRegionMapSizeX() * region_y + region_x; }`
19:00:20 <peter1138> It can be improved
19:04:52 <johnfranklin> Rain
19:10:15 *** gelignite has quit IRC (Quit: Stay safe!)
19:14:42 <wensimehrp> wonderland
19:14:56 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12964: Codechange: Mark some water region functions static. https://github.com/OpenTTD/OpenTTD/pull/12964
19:15:18 <johnfranklin> I brought only two paper books to the UKโ€ฆ
19:15:18 <johnfranklin> One is about C++20, another is Britain travel guide by Lonely Planet
19:15:18 <johnfranklin> Other books (mostly pirated) are stored electronically on an SSD and elsewhere.
19:16:30 <FLHerne> You're visiting?
19:16:52 <FLHerne> I'm on my little boat in Cheshire and there is definitely rain
19:17:11 <johnfranklin> Studying for two years and probably moreโ€ฆ
19:18:28 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
19:22:56 *** tokai has joined #openttd
19:22:56 *** ChanServ sets mode: +v tokai
19:30:02 <xarick> merge asap! i wanna see if it improves anything
19:36:52 <peter1138> Absolutely no idea, I didn't test performance.
19:36:59 <peter1138> Nor code generation
19:38:43 <peter1138> 70000 ships no buoys you say?
19:45:39 <peter1138> Oh it failed.
19:46:15 *** tokai|noir has joined #openttd
19:46:15 *** ChanServ sets mode: +v tokai|noir
19:49:49 *** tokai has quit IRC (Ping timeout: 480 seconds)
19:53:44 <andythenorth> johnfranklin: Mud Island
19:58:57 *** audigex has joined #openttd
19:58:57 <audigex> wensimehrp: unsinkable.samsung is possible
19:59:57 <audigex> Brand TLDs are so dumb. `.samsung` I don't mind, but a company being allowed to own something like `.play` is BS
20:00:42 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
20:07:18 <_glx_> and what about https://www.e.leclerc/ ?
20:08:49 <_glx_> very local TLD ๐Ÿ™‚
20:11:33 *** tokai has joined #openttd
20:11:33 *** ChanServ sets mode: +v tokai
20:15:43 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
20:29:44 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:34:01 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #12918: Fix #12914: Fix use of invalidated pointer in viewport drawer. https://github.com/OpenTTD/OpenTTD/pull/12918
20:35:27 *** tokai|noir has joined #openttd
20:35:28 *** ChanServ sets mode: +v tokai|noir
20:38:49 *** tokai has quit IRC (Ping timeout: 480 seconds)
20:44:02 *** tokai has joined #openttd
20:44:02 *** ChanServ sets mode: +v tokai
20:47:23 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
21:16:38 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:18:36 *** tokai|noir has joined #openttd
21:18:36 *** ChanServ sets mode: +v tokai|noir
21:20:56 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:25:34 *** tokai has quit IRC (Ping timeout: 480 seconds)
21:40:44 <xarick> darn penalties
21:41:34 <xarick> i don't know if I want the high level pf to quit it if it goes above a max cost
21:42:03 <xarick> seems to be causing harm
21:42:25 <xarick> ideally, yes
21:47:56 <xarick> i just feel like skipping the hlpf
21:48:17 <xarick> 2000 max cost for llpf
21:48:41 <xarick> but how to translate it to hlpf so that it doesn't expand over too many regions?
21:49:10 <xarick> english ๐Ÿ˜ฆ
21:50:13 <xarick> what if i only get an intermediate region...
21:50:23 <xarick> i'm screwed
23:40:47 <peter1138> <https://github.com/WinampDesktop/winamp> ๐Ÿ˜ฎ
23:41:26 <reldred> the license is a little ugly
23:47:38 <peter1138> Likely
23:47:41 <peter1138> Speaking of ugly.
23:47:59 <peter1138> Why... <https://libcello.org/>