IRC logs for #openttd on OFTC at 2025-10-17
            
00:15:36 *** davidxn has joined #openttd
00:15:36 <davidxn> Check if I'm going mad here, but can the penalty for having a station cargo rating below 128 actually increase your cargo? https://github.com/OpenTTD/OpenTTD/blob/a617d009cca418255a9682fd83c9cebc6423303e/src/station_cmd.cpp#L4069
00:15:36 <davidxn> ```if (rating <= (int)GB(r, 0, 7)) {
00:15:36 <davidxn> /* Need to have int, otherwise it will just overflow etc. */
00:15:36 <davidxn> waiting = std::max((int)waiting - (int)((GB(r, 8, 2) - 1) * num_dests), 0);
00:15:36 <davidxn> waiting_changed = true;
00:15:38 <davidxn> }```
00:15:38 <davidxn> If two bits from `GB(r, 8, 2)` = 0, waiting = `max(waiting - -1*num_dests)` and gives you (num_dests) more cargo units
00:23:33 <davidxn> Oh wait no - `waiting` is only the amount of cargo we *want* this station to have in the end, and TruncateCargo only runs if "waiting" is less than the AvailableCount... so if it goes up, nothing will happen and the cargo count isn't actually updated
00:27:21 <peter1138> 8https://github.com/OpenTTD/OpenTTD/commit/741c431caa59670bbe53740cc8a864992ce1bbd2
00:27:24 <peter1138> -8
00:28:06 <peter1138> Well, that change introduced the 'bug' by changing `x - y - 1` to `x - (y - 1)`.
00:31:40 <davidxn> Wow - well spotted 🙂 So for 12 years OpenTTD's been a tiny bit more forgiving for cargo decay!
00:32:45 <davidxn> This video I'm making just gets longer and longer - it took me ages to understand the "blame upstream stations" mechanic in the rest of this commit!
01:39:32 *** Wormnest has quit IRC (Quit: Leaving)
02:05:46 *** Compu has joined #openttd
02:08:17 <DorpsGek> [OpenTTD/OpenTTD] davidxn opened pull request #14712: Fix 741c431: Miscalculated cargo penalty for poor station rating https://github.com/OpenTTD/OpenTTD/pull/14712
02:09:35 *** Compu has quit IRC ()
02:17:08 *** gnu_jj has joined #openttd
02:20:24 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
02:38:01 <ahyangyi> off-by-two bug 😛
03:08:19 *** Zathras has joined #openttd
03:11:51 *** Zathras_11 has quit IRC (Ping timeout: 480 seconds)
03:56:06 *** saladcritter has joined #openttd
04:08:31 *** keikoz has joined #openttd
04:42:09 *** Flygon has joined #openttd
04:56:52 <rito12_51026> xarick: KeePass is a lot more than that. It has shortcuts ctrl+c for password and ctrl+b for username. Allows to easily store some notes like the email used or webpage then it is possible to enter it with one click or a shortcut. And the best part is encoding the kbdx file so you can safelly sync it within multiple devices with a thirdparty software.
06:36:06 *** Wolf01 has joined #openttd
07:24:16 *** SigHunter_ has joined #openttd
07:27:31 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
07:33:26 *** SigHunter has joined #openttd
07:34:46 *** SigHunter_ has quit IRC (Ping timeout: 480 seconds)
07:41:17 <kuhnovic> It's in the name right? It keeps your ass safe.
07:52:06 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
07:54:04 *** jinks has quit IRC (Ping timeout: 480 seconds)
07:54:29 *** SigHunter has joined #openttd
08:14:22 *** gelignite has joined #openttd
08:16:00 <xarick> hi
08:28:17 <pickpacket> kuhnovic: lol
08:33:01 *** saladcritter has quit IRC ()
08:47:52 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
08:50:26 *** Wolf01 has joined #openttd
08:59:08 <xarick> uh oh, a big windows update
08:59:21 <xarick> Windows 11, version 25H2, inb4 bricked system
08:59:32 <xarick> brb
09:01:45 *** jinks has joined #openttd
09:02:42 <xarick> that was weirdly fast
09:02:59 <LordAro> because it's not actually a big update
09:03:05 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428669637217746964/image.png?ex=68f357c8&is=68f20648&hm=cd329571c001cb5645e00cf483d8ccf367e5fc37a9626d73916d5cd80f0d13e4&
09:03:21 <LordAro> (also aiui just turning on preexisting stuff)
09:15:16 <peter1138> Forcibly enabling slop anti-features?
09:16:53 <andythenorth> apparently this stuff is coming to macOS soon
09:17:35 <andythenorth> or at least, there's some very heavy commentary in forums and tech social media that Apple is dead if it doesn't
09:18:08 <andythenorth> "yes, I'd prefer to use my computer with a dice rolling algorithm between me and my actual data"
09:18:24 <LordAro> https://support.microsoft.com/en-gb/windows/inside-this-update-93c5c27c-f96e-43c2-a08e-5812d92f220d#windowsupdate=26100 mostly
09:18:54 <LordAro> https://learn.microsoft.com/en-us/windows/whats-new/whats-new-windows-11-version-25h2 wait, this is better link
09:20:43 <ahyangyi> peter1138: Windows update also forcibly installed a patch that broke Windows update for me
09:21:11 <ahyangyi> Perhaps it's a net positive, since my Windows installation is now safe from further Windows updates
09:21:54 <LordAro> "i love having actively exploited security vulnerabilities active on my computer"
09:23:00 <peter1138> netinst.iso
09:23:48 <ahyangyi> Well, your Windows installation is either vulnerable for exploits, or vulnerable for future Windows updates
09:23:59 <ahyangyi> hard to say which is more dangerous
09:24:29 <LordAro> it's definitely the former ;)
09:24:37 <LordAro> bloody users thinking they know best
09:25:33 <ahyangyi> That's the traditional wisdom, though of which I'm losing confidence recently
09:30:17 <andythenorth> I'm quite curious if computing is about to be over
09:30:41 <ahyangyi> Halting problem finally solved?
09:31:11 <andythenorth> 🤷
09:32:58 <vondpc> ahyangyi: https://tenor.com/view/why-not-both-why-not-take-both-gif-11478682
09:33:10 <peter1138> Garbage Collection in Rust? Weird thing to add.
09:33:17 <vondpc> excuse me :Ferrisc
09:41:29 <xarick> is this readable? <https://gist.github.com/SamuXarick/ce580b384835a30da8386df79993088c>
09:41:47 <xarick> should the look up table be outside the function?
09:52:08 *** SigHunter_ has joined #openttd
09:52:12 <jfkuayue> Having no mobile phone in the year of 2025 is wild
09:54:31 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
10:06:24 <vondpc> i've done that for a short time some years ago
10:07:41 <mmtunligit> ive been living without mobile data for 7 months now but thats sort half out of necessity
10:09:58 *** gelignite has quit IRC ()
10:10:04 <xarick> <https://gist.github.com/SamuXarick/27672aae7abb46a11cb8dcf32e65e193>
10:10:04 <xarick> "Also, there is at most one corner with height difference of 2." The tests don't look like they're testing this, but due to math magic, they are...
10:10:44 <xarick> how do I prove it
10:10:48 <xarick> in english
10:11:10 <peter1138> Does any really know what time it is?
10:12:13 <peter1138> s/any/anybody/
10:12:54 <xarick> it's 11:12:52
10:14:33 <xarick> im gonna ask LLM copilot slop machine
10:16:22 <xarick> https://copilot.microsoft.com/shares/A2QJvV1r4uL4qtmLFWBJW
10:16:59 <peter1138> Shame /kick doesn't kick from Discord too.
10:33:51 <xarick> dx > 2 is redundant also
10:34:21 <xarick> and if int becomes uint8_t, dx < 0 becomes redundant also
10:42:56 <xarick> static_cast<Slope>(0xFF) is ugly
10:43:01 <xarick> what can I do
10:43:40 <rito12_51026> add SLOPE_INVALID into Slope enum
10:44:16 <xarick> the enum shouldn't have invalid entries, i think
10:46:21 <rito12_51026> the coding style file says something different
10:46:21 <rito12_51026> https://github.com/OpenTTD/OpenTTD/blob/master/CODINGSTYLE.md#enumerations--static-consts
10:52:05 <peter1138> Can of worms: layered tiles -> underground rivers
10:52:34 <peter1138> Can of worms: cliffs -> neighbouring tile height completely unrelated to current tile height.
10:53:06 <peter1138> Can of worms: quite trying to shave 3 seconds off an operation that only happens once at the start of a game.
10:53:10 <peter1138> *quit
10:56:54 <peter1138> Hmm, why do I have a docker image of OpenTTD...
11:01:31 <rito12_51026> xarick: You can omit the lookup table
11:01:31 <rito12_51026> ```cpp
11:01:31 <rito12_51026> static inline Slope HeightDifferenceToSlope(uint dn, uint dw, uint de, uint ds)
11:01:31 <rito12_51026> {
11:01:31 <rito12_51026> uint out = dw >> 1 + dw*dw*dw*dw;
11:01:32 <rito12_51026> out |= (ds >> 1 + ds*ds*ds) << 1;
11:01:32 <rito12_51026> out |= (de >> 1 + de*de) << 2;
11:01:34 <rito12_51026> out |= (dn >> 1 + dn) << 3;
11:01:34 <rito12_51026> return static_cast<Slope>(out);
11:01:36 <rito12_51026> }
11:02:44 <xarick> the lookup table was to avoid cpu cycles...
11:02:47 <xarick> but...
11:02:51 <xarick> let's try
11:03:00 <peter1138> Careful of operator precedence...
11:04:54 <peter1138> $ docker-compose up
11:04:54 <peter1138> Creating network "openttd_default" with the default driver
11:04:58 <peter1138> openttd_1 | [2025-10-17 11:02:00] dbg: [net:3] Starting dedicated server, version 20251015-master-ga949197264
11:05:02 <peter1138> Huh, it even works :o
11:05:34 <peter1138> Default config is not much help though :)
11:13:46 <xarick> slope invalid actually exists...
11:13:54 <xarick> in script_tile.hpp
11:14:39 <peter1138> Unrelated. Don't use that one.
11:17:45 *** Wolf01 is now known as Guest29230
11:17:47 *** Wolf01 has joined #openttd
11:20:34 <xarick> [2025-10-17 12:18:53] dbg: [misc:0] [MaxCount] [_GenerateWorld] 1 calls in 39040113 us [avg: 39040113.0 us]
11:20:34 <xarick> [2025-10-17 12:19:37] dbg: [misc:0] [MaxCount] [_GenerateWorld] 1 calls in 38966173 us [avg: 38966173.0 us]
11:20:34 <xarick> [2025-10-17 12:20:19] dbg: [misc:0] [MaxCount] [_GenerateWorld] 1 calls in 38629911 us [avg: 38629911.0 us]
11:20:49 <xarick> uint8_t is a bit inconsistent
11:22:13 <peter1138> How is uint8_t inconsistent?
11:23:51 *** Guest29230 has quit IRC (Ping timeout: 480 seconds)
11:24:55 <xarick> 39.0, 38.9, 38.6 secs
11:25:44 <xarick> oops, nevermind, im stupid
11:26:05 <xarick> i was using an old release version
11:30:51 <andythenorth> ok let's see if I've got it right this time
11:30:52 <andythenorth> lunch?
11:31:55 <andythenorth> peter1138 in our fork shall we just limit map size to 1024x1024?
11:32:08 <andythenorth> then rivers will be fast
11:32:32 <andythenorth> hmm maybe not if there are also underground rivers, and rivers in the sky
11:59:34 *** gelignite has joined #openttd
12:08:07 <andythenorth> sometimes I can't see things despite looking.....so is vehicle var 0x65 in the grf spec already? https://github.com/OpenTTD/OpenTTD/pull/14312
12:08:24 <andythenorth> https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Vehicles
12:08:34 <andythenorth> otherwise I will test it and add it
12:20:48 <peter1138> No it's missing, as is var 64.
12:37:24 *** gelignite is now known as Guest29236
12:37:27 *** gelignite has joined #openttd
12:42:44 <xarick> the INVALID_SLOPE is causing this thing to rebuild 300 files 🙁
12:43:59 *** Guest29236 has quit IRC (Ping timeout: 480 seconds)
12:50:06 <peter1138> https://www.tt-forums.net/viewtopic.php?t=92503&p=1276056#p1276056
12:50:11 <peter1138> This is a very hypothetical post.
12:50:27 <peter1138> > I would like to keep the Windows sounds for the others who use the shared computer while having the DOS sounds available for me.
13:19:34 <xarick> what's faster? abs or Delta?
13:20:30 <LordAro> peter1138: aren't they identical?
13:20:41 <LordAro> or am i confusing the graphics?
13:22:33 <xarick> I'm going with Delta
13:23:59 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428735293552328867/image.png?ex=68f394ee&is=68f2436e&hm=8d5ebab1c6ca680b104b80d957a6cb1433c7a5aec6bc94dc71216d8b851c0051&
13:23:59 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428735294399582228/image.png?ex=68f394ee&is=68f2436e&hm=fe56622f7fbcea650896399ef8bb84618b013cdab10dbf61a3f9efc81de3cbc1&
13:24:28 <xarick> i can keep using uint's with delta
13:24:34 <xarick> but not with abs
13:24:49 <xarick> abs(a - b) 🙁
13:25:01 <LordAro> shock.
13:40:51 <peter1138> LordAro, near enough identical.
13:44:00 <peter1138> Yes, the sample data is the same.
13:45:41 <peter1138> The only difference is the container for the Windows version contains filenames. This is also why `catcodec` is unable to decode the DOS file.
14:01:41 <xarick> what's the difference between
14:01:51 <xarick> std::tuple<int, int, int, int>{hnorth, hwest, heast, hsouth}
14:01:51 <xarick> std::tuple<int, int, int, int>(hnorth, hwest, heast, hsouth)
14:03:47 <xarick> there's also std::make_tuple(hnorth, hwest, heast, hsouth)
14:03:56 <xarick> which one has the least overhead
14:12:50 <xarick> looks like std::make_tuple was fastest
14:13:05 <xarick> std:tuple with {} slowest
14:14:04 <LordAro> i'd be amazed if there were any measurable difference
14:15:47 <locosage> step one in any performance measurement - make sure you're not measuring random noise :p
14:16:53 <LordAro> they look ever so slightly different without optimisations, but with -O2 they're all identical
14:17:03 <LordAro> https://godbolt.org/z/K741ccc4d
14:18:49 <dwfreed> make_tuple just means you don't have to worry about template types yourself
14:19:15 <dwfreed> (this could be a good or bad thing, depending)
14:57:51 <pickpacket> it used to be that dragging to place signals would space them out but also place them directly at entrances and exits to tunnels and bridges. Has that behaviour been removed in 15.0-beta3 or am I missing a setting somewhere?
15:12:13 <davidxn> pickpacket: I'm almost certain that it still works like that for me in 15.0-beta3 but I can check once I've finished being bored to death with this meeting 🙂
15:30:00 <LordAro> definitely supposed to
15:34:21 *** emperorjake has joined #openttd
15:34:21 <emperorjake> pickpacket: The setting is "when dragging, keep fixed distance between signals"
16:04:19 <peter1138> https://mastodon.ie/@johnke/115388648072324281
16:05:05 <andythenorth> https://arstechnica.com/ai/2025/10/ars-live-recap-is-the-ai-bubble-about-to-pop-ed-zitron-weighs-in/
16:05:25 <andythenorth> "$1trillion valuation of a $50bn industry"
16:05:46 <andythenorth> "remember when we thought autocomplete was worth 8% of GDP?"
16:05:55 <andythenorth> total tulip mania situation
16:06:43 <andythenorth> and https://www.theregister.com/2025/10/15/openais_chatgpt_popular_few_pay/?td=rt-3a
16:18:17 <peter1138> It's not just AI though.
16:18:27 <peter1138> Like how is a company that produces a m
16:18:28 <peter1138> p
16:18:35 <peter1138> a password manager worth... $6.8 billion.
16:23:21 <xarick> they sell passwords
16:23:37 <dwfreed> your tinfoil hat is a little too tight
16:25:38 <peter1138> Oh.
16:27:10 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1428781395228102828/image.png?ex=68f3bfde&is=68f26e5e&hm=2ffc0949a5b437cefe3fefa572e7599b30abcc6d1c89951c977a7b5c319fec91&
16:27:10 <andythenorth> it's worth $6.8bn because it's had$920m investment
16:28:47 <andythenorth> hmm
16:28:56 <andythenorth> they have 100x the ARR I have
16:29:31 <andythenorth> but maybe 2000x the valuation
16:29:37 <andythenorth> picking numbers of out of the air
16:29:51 <LordAro> moneybags andy
16:30:02 <andythenorth> yeah 34x revenue multiple, that's lol
16:30:21 <andythenorth> still, there's a lot of passwords in the world
16:31:14 <xarick> static TicToc::State GetTileSlopeGivenHeight("GetTileSlopeGivenHeight", 100000000);
16:31:17 <xarick> let's do this
16:31:49 <peter1138> Oh, right, I am not moderator of that license thread.
16:32:52 <xarick> oops that was a too big number
16:34:27 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428783230105944064/image.png?ex=68f3c193&is=68f27013&hm=32fd5c40a870e0f494bd330e5842b3d4d4741b17b0caf92a26b30ea335e1cc34&
16:35:08 <xarick> why so much variability 🙁
16:39:07 <andythenorth> peter1138: has nobody deleted it yet? 😛
16:39:13 <andythenorth> it's fuckwit bingo
16:56:57 *** gelignite has quit IRC ()
17:00:36 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #14648: Feature: Increase rail and road type limit. https://github.com/OpenTTD/OpenTTD/pull/14648
17:07:44 <locosage> iirc tictoc doesn't measure very fast functions well
17:15:48 <ahyangyi> 0.0005password
17:27:23 <_glx_> locosage: yeah it may even introduces some delay
17:31:24 <xarick> I'm going back to the 4 dimensional table
17:31:45 <xarick> it's one less operation needed
17:32:08 <xarick> no encoding
17:32:26 <xarick> it's an uglier table though
17:40:44 <xarick> aha 38.5 seconds
17:40:49 <xarick> it's faster
17:41:05 <xarick> I was getting 38.7-38.9
17:41:22 <xarick> the encoding step was bad confirmed
17:42:30 <xarick> what should be faster? the tuple with the heights or passing the heights individually
17:44:11 <xarick> it makes me re-duplicate some logic though
17:48:26 <peter1138> Nobody wants to add a lookup table to save 0.4 secounds off of 38 seconds.
17:49:25 <andythenorth> on a 4k^2 map that should not exist
17:49:48 <andythenorth> for a river generation algorithm that was only ever supposed to be "yolo, now we have rivers"
17:51:12 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428802543227633804/image.png?ex=68f3d390&is=68f28210&hm=aa2e69f4f7a15bfc1472fa06ebc02c492770ab1c4447e0bcb2f5a5f14e67ac6f&
17:51:18 <xarick> I'm back to 38.4 s
17:51:46 <xarick> removed all tuples I added
17:51:56 <xarick> re-duplicated code though 🙂
17:52:21 <xarick> it's not river gen, it's world gen now
17:52:53 <xarick> includes river gen and towns, and instrustries, tile loop etc..
17:52:58 <xarick> trees
17:54:42 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428803423070978190/image.png?ex=68f3d461&is=68f282e1&hm=5703bab369144e02370f85a04c11c668c74970c7bccabe7dc58d629a315f978d&
17:54:42 <xarick> master has these results:
18:02:04 <LordAro> TicTocSlop
18:08:27 <andythenorth> ok vehicle var 0x65 appears to work as expected
18:08:33 <andythenorth> there's an nml PR here https://github.com/OpenTTD/nml/pull/378
18:21:56 <peter1138> Well.
18:22:17 <peter1138> 43 seconds down to 38 seconds.
18:22:31 <peter1138> Definitely not worth it.
18:38:00 <andythenorth> if it was Horse compile times....I'd take the win
18:38:16 <andythenorth> how long does it take to generate a non-stupid map size? 🙂
18:42:02 <xarick> 512x512?
18:42:56 <xarick> 0.3 secs 🙁
18:46:28 <peter1138> Better spend time improving the generation.
18:52:55 <andythenorth> how do I time it on my CPU?
18:53:00 <andythenorth> can I just count?
18:54:24 <audigex> Pocket fob watch
18:54:31 <audigex> Obvs
19:06:29 *** tokai has joined #openttd
19:06:29 *** ChanServ sets mode: +v tokai
19:12:16 *** Tirili has joined #openttd
19:13:10 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
19:30:10 *** keoz has joined #openttd
19:31:35 *** keikoz has quit IRC (Ping timeout: 480 seconds)
19:41:38 *** keikoz has joined #openttd
19:43:10 *** keoz has quit IRC (Ping timeout: 480 seconds)
19:47:58 *** keoz has joined #openttd
19:50:40 *** keikoz has quit IRC (Ping timeout: 480 seconds)
20:08:18 *** keikoz has joined #openttd
20:10:59 *** keoz has quit IRC (Ping timeout: 480 seconds)
20:18:32 *** SigHunter_ has quit IRC ()
20:21:18 *** SigHunter has joined #openttd
20:23:39 *** keoz has joined #openttd
20:26:20 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:19:35 <peter1138> Well.
21:21:26 *** Flygon has quit IRC (Remote host closed the connection)
21:21:29 <andythenorth> nap though
21:32:11 <xarick> remember this? town-industry-type-counts-mixed-with-kdtree-for-industries
21:34:54 <xarick> the ultimate amalgamation of commits to improve worldgen
21:39:21 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1428859959461810296/image.png?ex=68f40909&is=68f2b789&hm=291b0645c86e8b9df7e1230a26cedf281b7572c438157deb9384be1d7d48e732&
21:39:21 <xarick> 31.1 s
21:40:27 <xarick> from 43.6 s in master
21:40:41 *** keoz has quit IRC (Ping timeout: 480 seconds)
21:40:52 <xarick> "but no one plays 4k maps"
21:42:34 <xarick> and i just confirmed passing tuples around is slower than master 🙁
21:42:59 <xarick> 45.6 s - real bad 🙁
21:45:13 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:45:24 <xarick> all resusts <https://gist.github.com/SamuXarick/d374ba727063e2c88bfa2813affeb691>
21:45:26 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #14648: Feature: Increase rail and road type limit. https://github.com/OpenTTD/OpenTTD/pull/14648
21:46:20 <xarick> deduplicate-logic-in-tile-map-accessors -> that's the tuple stuff
22:04:07 *** jinks has quit IRC (Quit: ZNC - http://znc.in)
22:04:26 *** jinks has joined #openttd
22:36:59 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
22:37:02 *** WormnestAndroid has joined #openttd
23:33:19 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
23:33:22 *** WormnestAndroid has joined #openttd
23:33:27 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
23:33:43 *** WormnestAndroid has joined #openttd