IRC logs for #openttd on OFTC at 2024-10-10
⏴ go to previous day
00:07:58 *** SigHunter has quit IRC (Read error: Connection reset by peer)
00:08:34 *** SigHunter has joined #openttd
02:13:11 *** godbed_ has joined #openttd
02:16:34 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:16:39 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:44:29 *** godbed is now known as debdog
02:58:58 *** gnu_jj_ has joined #openttd
03:02:09 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:45:35 <DorpsGek> - Update: Translations from eints (by translators)
04:50:15 <_pruple> it appears setting house prop 16 prevents cb 1b from running at the start of the game, thus breaking any houses that rely on it to, eg, set the animation frame to orient to the road.
05:39:49 <andythenorth[d]> peter1138: was it apocalyptic?
05:41:58 <reldred> you just went for a nap andy go back to bed
05:42:04 <reldred> it's too early to be up
06:36:43 <andythenorth[d]> pff, bananas GS and AI are on github
06:37:31 <andythenorth[d]> I could somehow read them all to see if they use GSCargo.CargoClass
07:59:44 <LordAro> andythenorth[d]: without clicking on the link, standards?
08:00:07 <andythenorth[d]> someone should fork that XKCD and modify it though
08:00:53 <LordAro> if only we knew someone who could draw
08:45:24 <xarick> what's the function that rounds up to the nearest integer
08:47:16 <xarick> rounds up or down, my bad
08:48:06 <xarick> 5000 * (64 * 12) - 1 = x
08:48:21 <andythenorth[d]> math.round()?
08:48:26 <andythenorth[d]> dunno years since I used it
08:48:49 <andythenorth[d]> have you asked GPT?
08:48:57 <peter1138> "What's the function that rounds" "round"
08:49:18 <xarick> if it's 5.5 = make it 6
08:49:24 <xarick> if it's 5.4 = make it 5
08:49:39 <xarick> and i can't use floating points
08:49:50 <andythenorth[d]> nint or rint apparently, google says
08:49:58 <andythenorth[d]> I didn't ask GPT
08:50:04 <peter1138> Then you can't have 5.5 or 5.4
08:55:37 <xarick> `static const int number_of_water_regions_lookahead = std::round((m_max_search_nodes / 2) / (CurrentWaterRegionNumberOfTiles() * 12 - 1));`
09:00:10 <xarick> std::round is using double 😦
09:11:14 *** ChanServ sets mode: +v tokai
09:18:08 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
09:23:41 <xarick> i shoulf be getting 6, i get 5 😦
09:25:57 <xarick> m_max_search_nodes = 10000, CurrentWaterRegionNumberOfTiles() = 64
09:33:33 <peter1138> All your arguments are integer, so the division is integer.
09:43:03 <xarick> gonna try a solution made at home
10:07:02 <xarick> the solution made at home
10:08:09 <andythenorth[d]> reminds me of FIRS 😛
10:12:03 <leadnaut> if (num % divisor > divisor / 2) {
10:12:03 <leadnaut> return num / divisor + 1;
10:12:04 <leadnaut> return num / divisor;
10:14:57 <peter1138> return (num + divisor / 2) / divisor;
10:15:15 <_pruple> as long as we're all having fun, that's the most important thing
10:15:37 <leadnaut> i enjoy solving the coding problems presented by xarick
10:16:16 <leadnaut> xarick: big fan of the `* divisor / divisor` identity it just throws in here
10:16:16 <peter1138> Oh, I didn't look at the picture 🙂
10:21:40 <_jgr_> There's a `RoundDivSU` function in core/math.hpp which may well do what you want here
10:27:35 <xarick> `static const int number_of_water_regions_lookahead = RoundDivSU(m_max_search_nodes, CurrentWaterRegionNumberOfTiles() * 12 * 2) - 1;`
10:33:33 <peter1138> I bet `static const` is not what you want.
10:34:12 <peter1138> Mind you nobody wants any of this :p
10:54:52 <xarick> InvalidateWaterRegion asserted
10:59:36 <xarick> i want it to be accessible
10:59:53 <xarick> not sure it needs to be a global var
11:05:29 <peter1138> So you do all that rounding down... and then multiply back again anyway.
11:06:42 <_glx_> Hmm looks like CI has issues again
11:10:12 <xarick> i think i can trigger another assert, let me try
11:16:40 <xarick> it is by pure luck that the hlpf is called first
11:16:59 <xarick> so the region edge length it readjusted there
11:17:37 <xarick> hmm however this means...
11:18:34 <xarick> I am passing the old _number_of_water_regions_lookahead value to YapfShipFindWaterRegionPath 😦
12:03:16 <_glx_> Hmm seems to be Ubuntu 22.04 vs 24.04 images
12:12:48 <johnfranklin> The number theory course is held in a lecture hall called “X2”
12:13:55 <johnfranklin> But there is no other nordic element
12:15:11 <_glx_> Oh we want clang-15, image only has 16, 17 and 18
12:16:35 <_glx_> All that because default clang in 22.04 was 14
12:17:10 <_glx_> But our code requires at least 15
12:17:38 <peter1138> Our code doesn't compile with 16.
12:19:47 <peter1138> > gfx_layout.h:162:109: error: use of overloaded operator '<' is ambiguous (with operand types 'const std::stack<TextColour, std::vector<TextColour>>' and 'const std::stack<TextColour, std::vector<TextColour>>')
12:22:00 <peter1138> (Although it may be some combination of issues with libstdc++12.)
13:39:52 <xarick> a call of a non-static member function requires an object...
13:40:11 <xarick> `_number_of_water_regions_lookahead = RoundDivSU(Yapf().PfGetSettings().max_search_nodes, GetUpdatedWaterRegionNumberOfTiles() * 12 * 2) - 1;`
13:40:24 <xarick> complains about PfGetSettings()
13:47:32 <xarick> screw it, i'll just access it directly
13:49:12 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
13:54:50 <andythenorth[d]> shall I get my robot to answer?
14:23:41 <xarick> CoPilot is a master at making comments
14:30:27 *** tokai|noir has joined #openttd
14:30:27 *** ChanServ sets mode: +v tokai|noir
14:36:11 <kuhnovic> Is there a way to get a log output window (or a file) in Release or RelWithDebInfo?
14:37:19 *** tokai has quit IRC (Ping timeout: 480 seconds)
14:37:30 <Rubidium> you mean the result of Debug?
14:37:42 <Rubidium> as in the Debug(pf, x, ...) calls
14:38:02 <peter1138> Does the special handling for CC_SPECIAL need to stay?
14:38:14 <peter1138> Like, if a cargo is special, is it refittable-to?
14:39:10 <peter1138> And if it is, why can't I filter for it in the build-vehicle window?
14:39:51 <andythenorth[d]> peter1138: dunno
14:39:58 <andythenorth[d]> but regearing will start appearing?
14:40:06 <andythenorth[d]> but regearing has a label...
14:40:15 <kuhnovic> Thanks RB, i'll have a look
14:41:00 <andythenorth[d]> also ELTR uses bit 15
14:41:30 <andythenorth[d]> "fortunately nobody depended on classes for town effects"
14:42:12 <_jgr_> kuhnovic: If you use the `-d` switch it should open a console window for debug output
14:42:24 <peter1138> So the Build Vehicle cargo drop down list should actually include CC_SPECIAL, currently it does not.
14:43:24 <andythenorth[d]> it's almost like one person attempted honestly to make a spec in 2005, and then it just....grew 🙂
14:44:21 <andythenorth[d]> FWIW, in my proposal there's still 1 bit spare
14:44:34 <andythenorth[d]> but other proposals might be better, dunno
14:45:25 <peter1138> Oh, NML has extras for CC_SPECIAL too.
14:47:16 <andythenorth[d]> I might patch NML for myself 😛
14:52:28 <peter1138> So CC_SPECIAL is "this ancient thing that could just have been a cargo spec property..."
14:53:20 <andythenorth[d]> probably predates labels or something 😛
14:53:26 <andythenorth[d]> seemed like a bool to me
14:53:48 <andythenorth[d]> it's very important that we keep regearing, as it's the other main use of subtypes 🙂
14:53:59 <peter1138> Hmm, well, filtering NARS 2.03 for "Gear Ratio" does not list any vehicle.
14:54:07 <andythenorth[d]> did anyone do variants yet?
14:54:56 <peter1138> Dunno why, that should be listed, no?
15:03:00 <xarick> feels bad to have pathfinder stuff in water_regions
15:05:52 <peter1138> So it's designed that way -- you can't filter for special cargo types
15:07:52 <andythenorth[d]> just a bit oof
15:09:47 <andythenorth[d]> xarick: "life is messy"
15:26:41 <andythenorth[d]> goes is keep bit 15 as CC_SPECIAL then?
15:30:19 <peter1138> Do people use the class data in var 0x42 and 0x47?
15:40:24 <andythenorth[d]> my guess is yes
15:40:44 * andythenorth[d] looking what the nml maps to_
15:41:42 <andythenorth[d]> `cargo_classes_in_consist` and `cargo_classes`
15:43:15 <andythenorth[d]> I use them to
15:43:15 <andythenorth[d]> - deal with capacity for CC_MAIL etc
15:43:15 <andythenorth[d]> - switch container sprites to tanktainers for CC_LIQUID
15:43:43 <andythenorth[d]> there's nothing there that couldn't be handled in other ways
15:44:09 <andythenorth[d]> or nml could map them to a different var.... 😛
16:05:29 <peter1138> Hmm, it's gone dark.
16:06:05 <LordAro> are you further north than me?
16:06:11 <LordAro> or are you looking at a wall?
16:06:35 <andythenorth[d]> it's about to go dark here
16:06:57 <andythenorth[d]> so cargo classes, but a dword?
16:07:11 <andythenorth[d]> and those weird vars only get the first 16 bits?
16:07:27 <andythenorth[d]> and I port nml to use new vars?
16:08:30 <andythenorth[d]> and then there's a nibble somewhere to indicate which of the 15 competing standards the cargo belongs to? 😛
16:28:42 <peter1138> If badges were strings, how would you test for them...
16:34:34 <andythenorth[d]> we don't have string matching? 😛
16:34:56 <andythenorth[d]> do you mean in a varact2? before I make myself look daft
16:36:47 <andythenorth[d]> do I have to compose grf strings, and then see if they match? 😛
16:36:47 <peter1138> It was "enough fun" comparing a 32 bit value 😄
16:37:07 <andythenorth[d]> loop through string IDs, looking for matches 😛
16:37:19 <peter1138> Not string IDs, just strings.
16:37:27 <andythenorth[d]> are there strings though?
16:37:49 <peter1138> Generally not because ttdpatch is very bytey.
16:38:08 <peter1138> A string is just a sequence of characters terminated by a NUL.
16:38:11 <andythenorth[d]> iterate one character at a time?
16:38:28 <peter1138> It's supposed to be simpler 😄
16:39:01 <peter1138> Maybe 8 + 24 bits is "fine".
16:39:11 <andythenorth[d]> don't do anything that involves patching grfcodec significantly 😛
16:39:35 <peter1138> GRFCodec is too low level to care.
16:40:05 <peter1138> You can put a string anyway with NFO.
16:42:19 <peter1138> Badge translation table
16:43:01 <peter1138> Possible. You could then test for a badge by index.
16:43:17 <peter1138> Then the partial-matching stuff I did can't exist.
16:43:17 <andythenorth[d]> hmm cargo class translation table 😛
16:43:28 <peter1138> But maybe partial matching is a silly idea.
16:43:47 <andythenorth[d]> dunno, the modding never evolves with totally sensible ideas
16:44:05 <andythenorth[d]> partial matching, but the grf author has to precompose the substrings to match
16:44:22 <peter1138> Existing translation tables are index to 4 byte label, though.
16:44:22 <andythenorth[d]> I don't know why regex is a meme
16:44:31 <peter1138> A translation table that is index to string is... new.
16:46:40 <xarick> one last thing to solve!
16:46:40 <xarick> ```// static_assert(sizeof(TWaterRegionTraversabilityBits) * 8 == CurrentWaterRegionEdgeLength());``` I don't know what to do with this static_assert
16:46:58 <peter1138> You cannot have a static assert because it's not static.
16:47:00 <xarick> complains about constexpt
16:47:18 <ahyangyi> `CurrentWaterRegionEdgeLength` doesn't sound like very constant
16:47:53 <peter1138> Statically, the best you can hope for is that `TWaterRegionTraversabilityBits` is large enough the maximum edge length.
16:50:12 <xarick> MAX_ALLOWED_EDGE_LENGTH as a constexp?
16:51:24 <_glx_> static_assert are checked at compile time
16:53:05 <peter1138> Hmm, with string-based badges then partial matching isn't needed, you can just have a name-less badge for the partial part.
16:53:12 <kuhnovic> Just comments out that line. It makes sense as a compile time check to make sure there is enough memory for all the edge traversability bites to live in. But that's all dynamic now, so either you add a non-static assert somewhere or you just make sure you have a large enough type and ignore it
16:56:45 <andythenorth[d]> peter1138: picture? 😛
17:00:26 <andythenorth[d]> what was I doing on Monday? Adding logos to tanker wagons?
17:00:33 <andythenorth[d]> something happened about classes 😛
17:01:36 <xarick> static_assert(sizeof(TWaterRegionTraversabilityBits) * 8 == MAX_ALLOWED_WATER_REGION_EDGE_LENGTH);
17:03:08 <andythenorth[d]> what does badge matching do? Is it generally available as a var? Or limited contexts?
17:05:46 <peter1138> It's only a var, testing if a badge exists on something (usual self or parent scope stuff)
17:06:43 <andythenorth[d]> how done is it? Should I try and use it for something in a grf yet?
17:07:03 <peter1138> I appear to be having a rethink, so...
17:07:17 <peter1138> Current iteration uses 4-byte labels every where.
17:07:25 <andythenorth[d]> Horse has cases for finding passenger wagons that I think fit
17:07:26 <peter1138> (No translation table because 4 bytes isn't much)
17:08:54 <andythenorth[d]> when built, this looks up a set of IDs to figure out the formation, badge would be better
17:09:49 <johnfranklin> Why AI cannot write a proper “R”, sounds very silly
17:09:54 <peter1138> As the first byte of the label is the class, that limits the values a bit.
17:10:55 <peter1138> But as varact can't contain strings (unless I add a new op) a translation table will be needed.
17:13:07 <peter1138> Also assigning badge properties is verbose without a table, as each one duplicates it.
17:16:11 <peter1138> strings allow things like "livery/UK/British Rail/1991-1992","livery/UK/British Rail"
17:16:53 <xarick> static constexpr int or just constexpr int?
17:17:09 <peter1138> Which with labels is less clear. Hmm.
17:20:13 <peter1138> More than 255 badges used in a single newgrf?
17:22:01 <andythenorth[d]> I could imagine using more than 255
17:22:08 <andythenorth[d]> if they're all hidden metadata
17:24:43 * andythenorth[d] counting on fingers
17:26:06 <peter1138> What sort of metadata would you be doing?
17:26:22 <andythenorth[d]> mostly 'this vehicle is like other vehicles' without checking lots of IDs
17:26:35 <andythenorth[d]> ideally, across a run of vehicles, but eh
17:26:43 <andythenorth[d]> one thing at a time
17:27:23 <peter1138> With string labels you could do `metadata/FIRS/type/SOMETHING` and know that it is never going to accidentally conflict with something else.
17:27:49 <xarick> static inline const int
17:27:59 <xarick> and i have no idea what they do
17:29:06 <peter1138> Foamer-sets can have `coupler/type1` to for attachment rules or something.
17:29:29 <peter1138> Yeah, I think I've sold myself on changing this, hah.
17:29:44 <andythenorth[d]> namespacing eh
17:29:52 <andythenorth[d]> can we then namespace cargo classes? 😛
17:31:04 <peter1138> Heh, if there was a callback for "can refit to"...
17:31:14 <andythenorth[d]> do you want frosch's spec? 😛
17:31:36 <xarick> well, static inline const int it is
17:32:03 <peter1138> That 1) removes bitmasks 2) allows and/or/not/nand/xor/lol/wtf/bbq as per varact2.
17:32:54 <peter1138> Badges == Metadata.
17:33:50 <peter1138> Too busy flying around in Minecraft.
17:44:24 <kuhnovic> Hmm, interesting. I may have just found a way to make YAPF about 10% faster.
17:45:05 <LordAro> "things said just before disaster"
17:45:38 <kuhnovic> Haha there certainly are caveats 😉
17:46:59 <kuhnovic> The change essentially boils down to "if node is on closed list, return immediately" in de AddNode function.
17:47:47 <andythenorth[d]> ok so cargo classes like firs/cabbage/red 😛
17:47:50 <kuhnovic> But I need to dive deeper into this
17:47:57 <andythenorth[d]> then a predicate (varact2) for those
17:48:05 <andythenorth[d]> and we just cache them when grfs are loaded?
17:48:27 <andythenorth[d]> limited vars, like anything else in the buy menu
17:48:46 <xarick> static int _water_region_edge_length;
17:49:27 <xarick> global variable, only local to this file?
17:50:37 <xarick> im still trying to understand what I can inline
17:59:02 <kuhnovic> Don't worry too much about inlining stuff. The compiler is most likely already doing it for you, and the improvements are hardly noticeable
18:00:03 <peter1138> `static` on a function is more reasonable thatn `static inline`
18:01:48 <kuhnovic> I just love how C++ reuses keywords for different purposes, and how they often mean completely different things
18:30:05 *** gelignite has joined #openttd
19:20:08 <xarick> I'm trying a standalone branch for this 8x8 feature
19:20:56 *** gelignite has quit IRC (Quit: Stay safe!)
19:32:53 <xarick> a wild WATER_REGION_EDGE_LENGTH outside the pathfinders
19:36:17 <xarick> dang 😦 requires extra handling...
19:45:54 <xarick> does CodeFeature exist?
20:05:44 <xarick> that ship_cmd.cpp fix might be incomplete, need to verify
20:06:17 <xarick> it came up in the last minute
20:18:42 <truebrain> Oh-oh, Python 3.7 no longer works on the GitHub actions we use ....
20:18:54 <truebrain> That will be "fun" to fix 😛
20:19:21 <ahyangyi> Upgrade to 3.12, to minimize the frequency of version bumps? 😮
20:28:19 <xarick> testing the new version of #12170
20:34:19 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:46:30 <ahyangyi> Perhaps I'm too conservative
20:48:49 <xarick> some weird magic happening
20:53:48 <xarick> ah, I see what's going on
20:55:24 <xarick> it is compromised to service at the first depot that ever returned, until something bad happens
20:58:04 <xarick> nice, it is resilient enough
21:00:29 <xarick> does not switch to a new depot if built closer to the ship
21:18:20 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:28:04 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:51:00 *** ChanServ sets mode: +v tokai
21:57:43 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:30:58 *** fairyflossy has quit IRC (Quit: User went offline on Discord a while ago)
22:34:16 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:10:07 <_glx_> so using ubuntu-latest during the transition period is annoying as it can pick ubuntu-22.04 or ubunty-24.04, and 22.04 needs explicitly clang15 for our c++20 usage (clang is 14 in this image), but 24.04 doesn't have clang15 (clang is 18 then)
23:10:54 <_glx_> but manually specifying the image means we will forget to update at some point
23:11:27 <_glx_> btw emscripten workflow still uses 20.04
23:57:29 <dwfreed> _glx_: I mean, you could make the clang 15 installation conditional on the distro version, I'm sure /etc/os-release is available
23:58:18 <_glx_> we don't install them, we use what's in the image
continue to next day ⏵