IRC logs for #openttd on OFTC at 2024-11-08
            
01:58:30 <DorpsGek> [OpenTTD/OpenTTD] PikkaBird commented on issue #12986: [Bug]: Setting house property 16 to > 0 prevents callback 1B from running at the start of the game. https://github.com/OpenTTD/OpenTTD/issues/12986
03:26:39 *** D-HUND has joined #openttd
03:30:08 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:45:22 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/80f628063a5f97888117e016fea8faf0cb74d4d8
04:45:23 <DorpsGek> - Update: Translations from eints (by translators)
05:06:00 *** keikoz has joined #openttd
05:41:16 <DorpsGek> [OpenTTD/OpenTTD] Release workflow was not successful https://github.com/OpenTTD/OpenTTD/actions/runs/11736479510
06:11:01 *** keikoz has quit IRC (Ping timeout: 480 seconds)
07:03:42 <andythenorth> peter1138: BeOS is a blast from the past
07:03:51 <andythenorth> was going to replace Mac OS
07:12:01 *** Flygon has quit IRC (Read error: Connection reset by peer)
07:20:16 <DorpsGek> [OpenTTD/OpenTTD] andythenorth commented on discussion #12975: Defining bits 13 and 14 of cargo class as "potable / food / clean" and "non-potable / non-food / dirty", respectively. https://github.com/OpenTTD/OpenTTD/discussions/12975
07:32:00 <DorpsGek> [OpenTTD/OpenTTD] felixprigge commented on pull request #12683: Fix: Timetable precision https://github.com/OpenTTD/OpenTTD/pull/12683#issuecomment-2463954361
07:45:17 <truebrain> It seems orudge needs to press some button again on the Apple Portal 🙂
08:04:41 <peter1138> Hmm. of course, callback 1B involves random, so fixing 12986 changes all the towns.
08:09:43 <peter1138> (Does it matter...)
08:09:46 <truebrain> it is amazing to me how often Apple needs to know we still agree on their terms
08:09:57 <truebrain> like a goldfish that forgot who signed it after 3 months
08:10:02 <truebrain> "Who are you again?!"
08:10:16 <truebrain> I just think they are looking for some love, and this is their attempt to get that
08:10:36 <truebrain> Maybe someone should just drop by their office and give them a few hugs; maybe that is enough to last a year
08:30:48 *** HerzogDeXtEr has joined #openttd
09:15:56 <peter1138> I just broke the rules and did a Friday release.
09:16:03 <peter1138> It is, at least, still morning.
09:21:04 *** mindlesstux has quit IRC (Quit: The Lounge - https://thelounge.chat)
09:22:07 *** mindlesstux has joined #openttd
09:32:03 *** alfagamma0007 has quit IRC (Quit: User went offline on Discord a while ago)
09:38:46 <dwfreed> peter1138: this means that friday afternoon will be spent reverting the release
09:38:57 <dwfreed> which is at least an improvement over friday night
09:40:34 <andythenorth> or Saturday morning
09:45:19 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304381227788402749/image.png?ex=672f2f2e&is=672dddae&hm=8885011885c447df9c293c5ee7698a5797d46a8503069e8058d2be68197a1fb5&
09:45:27 <xarick> fake news
09:46:24 <xarick> https://en.cppreference.com/w/cpp/header/inplace_vector
09:51:31 <DorpsGek> [OpenTTD/team] Dotoshny opened issue #598: [ru_RU] Translator access request https://github.com/OpenTTD/team/issues/598
09:51:51 <truebrain> and orudge gave Apple a big hug, so let's rerun the nightly 🙂
09:57:32 <_jgr_> xarick: Unless you have a time machine, C++26 isn't here yet
10:00:53 <peter1138> dwfreed: Exactly!
10:07:35 <peter1138> ``` const HouseSpec *spec = HouseSpec::Get(HousePickerCallbacks::sel_type);
10:07:35 <peter1138> Command<CMD_PLACE_HOUSE>::Post(STR_ERROR_CAN_T_BUILD_HOUSE, CcPlaySound_CONSTRUCTION_OTHER, tile, spec->Index());
10:07:45 <xarick> forward_list has no size 😦
10:08:40 <peter1138> Does this need to use `HouseSpec::Get`? I think it can just pass `HousePickerCallbacks::sel_type` to the command.
10:12:29 <_jgr_> Index does the inverse of Get here, so passing sel_type directly should be fine
10:12:37 <andythenorth> classes for cargo classes eh?
10:12:39 <andythenorth> wot larks
10:12:50 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1304388155239038997/image.png?ex=672f35a2&is=672de422&hm=9010cb3e7f9f94b7e701eb90c178cda88a75e42e0a46a718c07e9779567b3705&
10:14:18 <DorpsGek> [OpenTTD/OpenTTD] telk5093 commented on discussion #13065: Neutral Stations https://github.com/OpenTTD/OpenTTD/discussions/13065
10:16:17 <andythenorth> Yair strange rail stations
10:16:31 <andythenorth> Hmmm….station objects? 😛
10:17:08 <andythenorth> So the stations are player owned, and tiles remain with each company. But cargo is pooled
10:17:43 <andythenorth> And that’s done via a neutral staton tile, non-routable
10:35:39 <peter1138> What happens if companies transfer cargo via neutral stations at the moment?
10:46:31 <peter1138> Ooof, save/restore random seeds.
10:49:07 <peter1138> Oh, even that does not work. Hmm.
10:51:26 <xarick> CC_WEIRD ?
10:55:25 <xarick> forward_list is slow 😦
10:56:47 <xarick> and i needed 2 pointers and a counter
10:56:50 <xarick> ugly
10:57:44 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304399454694281246/image.png?ex=672f4028&is=672deea8&hm=65d00b033b800f3210f24a7b82491016590bc6324206d55aee3dcbd8fcce7121&
10:57:44 <xarick> 2 minutes
10:59:36 <xarick> i want a backwards list
11:03:59 <peter1138> That's called `std::list`
11:04:31 <peter1138> `std::forward_list` is a singly-linked list. `std::list` is a doubly-linked list.
11:06:36 <exceptik> xarick: why? when you insert an item the function returns a valid iterator to the inserted item, you can just increment that
11:07:36 <LordAro> https://en.wikipedia.org/wiki/List_of_data_structures
11:17:23 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on issue #12986: [Bug]: Setting house property 16 to > 0 prevents callback 1B from running at the start of the game. https://github.com/OpenTTD/OpenTTD/issues/12986
11:41:15 <xarick> testing std::vector<bool>
11:44:14 <DorpsGek> [OpenTTD/OpenTTD] PikkaBird commented on issue #12986: [Bug]: Setting house property 16 to > 0 prevents callback 1B from running at the start of the game. https://github.com/OpenTTD/OpenTTD/issues/12986
11:55:54 <xarick> it's slow
12:00:09 <exceptik> research what each container is better and worse in, compare it to your needs in the algorithm, select the best one, don't just randomly poke each of them
12:00:09 <exceptik> there is always a tradeoff, no container is perfect 🤷
12:01:04 <andythenorth> hmm
12:08:56 <kuhnovic> That will not stop Xarick from trying random stuff
12:13:38 <xarick> hehe you know me
12:17:50 <xarick> the 2 container approach seems to be faster
12:18:18 <xarick> a single container still not yielding good results for me
12:40:38 <talltyler> peter1138: It works like a normal station and sets up CargoDist links if enabled, but only the last company gets paid.
12:41:04 <peter1138> As I thought 🙂
12:42:01 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #13066: Codefix: Silence clang-cl warnings https://github.com/OpenTTD/OpenTTD/pull/13066#pullrequestreview-2423707152
12:42:03 <talltyler> I made a Trade Center grf that is basically a free, player-built oil rig with a dummy industry that does nothing but build the special neutral station tile. 🙂
12:42:42 <peter1138> IOTC as well.
12:43:38 <talltyler> That’s an actual industry, more like a FIRS port industry
12:44:09 <peter1138> Ah yes.
12:45:14 <peter1138> Bah, I wish C++ had C#-style interfaces.
13:04:41 <LordAro> concepts?
13:08:43 *** nielsm has joined #openttd
13:28:57 <peter1138> Nah, the other thing it allows -- hiding implementation details.
13:42:16 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #13066: Codefix: Silence clang-cl warnings https://github.com/OpenTTD/OpenTTD/pull/13066
14:57:52 <andythenorth> did we merge all the class stuff yet
14:58:13 <andythenorth> I am hoping to finish my docs this weekend, ship new FIRS and Horse, and then stop thinking about it
14:58:30 <andythenorth> at least until someone finds the changes I intend to make to the wiki, and turns up with a flaming torch 😛
15:20:08 <peter1138> Badge column layout, openttd.cfg or favs.cfg?
15:30:44 <_glx_> windows.cfg ?
15:32:10 <talltyler> andythenorth: New FIRS 4 or 5?
15:32:41 <andythenorth> both
15:32:46 <andythenorth> I backported
15:32:48 <talltyler> Might be good to do the 5 split here, so anyone who complains can be told to stick with 4 🙂
15:33:13 <andythenorth> the thing is that this is, largely, an improvement, in my testing
15:33:53 <andythenorth> the flaming torch is because....well there's always one
15:34:12 <andythenorth> and I'm redefining the interpretations of about half the classes
15:34:39 <andythenorth> they're somewhat "wrong" anyway, due to the results of a wiki edit back-and-forth
15:42:33 *** Flygon has joined #openttd
16:08:03 *** keikoz has joined #openttd
16:44:27 *** TinoDidriksen has quit IRC (Read error: Connection reset by peer)
16:44:29 *** TinoDid|znc has joined #openttd
16:48:15 *** Wormnest has joined #openttd
16:49:16 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12683: Fix: Timetable precision https://github.com/OpenTTD/OpenTTD/pull/12683#issuecomment-2465258769
17:03:01 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304491379346505788/image.png?ex=672f95c5&is=672e4445&hm=8f46f419fda1ba72d93fb275d896859b809855de6a818dd72e7fc1d5f728496e&
17:04:58 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304491868767387768/image.png?ex=672f9639&is=672e44b9&hm=312ea96a7aa596a013e97083bf5e269ba290f92f9204404da1f767255d1f40f0&
17:05:07 <xarick> I can't do anything
17:06:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304492262121668628/image.png?ex=672f9697&is=672e4517&hm=b1e9b3f64bcc97fda913d50703c3050495b9d725299cb20450aefbf35106b717&
17:07:43 <peter1138> It's a good job your environment is telling you that.
17:13:35 <exceptik> my invalidated iterators just continue doing something unexpected 😆
17:16:27 *** Artea has quit IRC ()
17:16:59 <xarick> okay std::list works... but i feel like i'm working backwards
17:21:17 <DorpsGek> [OpenTTD/OpenTTD] WenSimEHRP commented on discussion #13065: Neutral Stations https://github.com/OpenTTD/OpenTTD/discussions/13065
17:24:20 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304496744750518333/image.png?ex=672f9ac4&is=672e4944&hm=f21e5f1b311619aad96c105146208dc7d5ed793536649c665888c553d3c6dfc0&
17:24:20 <xarick> slightly different messages but the meaning is the same
17:25:21 *** Wolf01 has joined #openttd
17:26:08 <_glx_> maybe you should read "Iterator invalidation" section in each container documentation
17:29:33 <xarick> only std::list lets me do it
17:34:22 <_glx_> reading the doc would help you to understand why
17:43:05 <xarick> why is invalidated iterator? I'm adding it to the end
17:43:12 <xarick> I know what im doing
17:43:25 <LordAro> 🤔
17:44:36 <xarick> I mean I am keeping track of it
17:44:43 <xarick> as I insert items
17:45:18 <LordAro> it's not something you can "keep track of" - you need to recreate it
17:45:36 <LordAro> (unlike std::list, which doesn't have iteration invalidation)
17:45:40 <LordAro> iterator*
17:58:20 <xarick> here's what I'm trying to do
17:58:35 <xarick> there is a uint count I wanna eliminate
17:58:57 <xarick> i can just use marks.size() to get the same result as the manual count++
17:59:48 <xarick> currently I'm forced to use count to switch to the next item in the container
18:00:03 <xarick> tile = container[count]
18:00:52 <xarick> i am trying to use an iterator to switch to the next item so that I can finally get rid of count
18:01:15 <xarick> but it complains that I'm adding items
18:01:21 <xarick> and iterator can't be used
18:01:56 <xarick> only std::list works, but it's utterly abysmally slow
18:07:01 <exceptik> xarick: the insert function returns valid iterator
18:07:26 <exceptik> like yes, when you insert to an iterator X, the X gets invalidated
18:38:35 <_glx_> iterators are like pointers into memory, if memory moves it invalidates the think pointing to it
18:39:50 <peter1138> Oof, this config stuff is being a pain to design 😦
18:40:50 <_glx_> each container type have a specific use, they are not directly interchangeable
18:42:49 <_glx_> you need to design around the container, you usually can't switch container type for a given algorithm
18:48:42 <peter1138> And also, if your container is telling you that the iterator is invalid, it's probably in a debug mode. Which might be why your std::set is slow in the first place...
19:02:32 <xarick> I'm kinda satisfied with this... it's reproduceable in different OS'es and is fast enough for me. <https://gist.github.com/SamuXarick/e6cbac284add628b12269de0543c57da>
19:03:42 <xarick> i renamed `count` to `i`... it's still there, disguised
19:03:48 <xarick> but less obvious
19:31:26 <peter1138> Yup, definitely looks disgusting.
19:32:03 <exceptik> your first problem is that you are constantly pushing into vector without giving it the size needed first
19:32:03 <exceptik> vectors need to reallocate if they have not enough space and also relocate if they don't have enough continuous space to fit everything
19:32:03 <exceptik> so there is a lot of allocs reallocs and frees there
19:37:47 *** TinoDid|znc is now known as TinoDidriksen
19:54:09 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304534444719472640/image.png?ex=672fbde0&is=672e6c60&hm=95aa6267c177e072a55fc62ef53ef4d9f6c4144c1311b45fb6b87aca27cd8b3f&
19:54:18 <xarick> 11 secs
19:54:51 <xarick> same map gen in 3 compilers
19:55:07 <xarick> 9 secs on linux, because linux
19:58:42 <xarick> gonna investigate the reallocate thing
20:01:05 <andythenorth> naptime?
20:21:45 <xarick> having fun with containers
21:12:34 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304554181318676570/image.png?ex=672fd042&is=672e7ec2&hm=10b5e88de1390be7158fbe8dcaa2e9bc6baa626b90ea0fbd8dd8cf05273542e6&
21:12:34 <xarick> is it capacity what I should be looking for?
21:14:21 <xarick> how much should I queue.reserve()
21:16:55 <_glx_> depends
21:23:31 <xarick> how do i make this "smart" at reserving?
21:24:17 *** Compu has joined #openttd
21:25:46 *** Compu has quit IRC ()
21:34:31 <peter1138> Okay, this design smells 😦
21:34:45 <peter1138> I have 4 representations of things :/
21:35:32 <xarick> ```size_t _highest_capacity_registered = 0;
21:35:32 <xarick> static std::tuple<bool, bool> FlowRiver
21:35:32 <xarick> {
21:35:32 <xarick> std::vector<TileIndex> queue = { begin };
21:35:32 <xarick> queue.reserve(_highest_capacity_registered);
21:35:34 <xarick> for (// Do queue.push_back stuff);
21:35:34 <xarick> _highest_capacity_registered = queue.capacity();
21:35:36 <xarick> }```
21:35:40 <xarick> pseudo code
21:37:29 <xarick> is this "smart"?
21:38:02 <_glx_> most likely wasting memory for average use
21:38:48 <xarick> oh, it's not smart enough, I forgot something
21:38:54 <xarick> `if (_highest_capacity_registered < queue.capacity()) _highest_capacity_registered = queue.capacity();`
21:40:23 <peter1138> Basically, just accept that large maps take time to process :p
21:43:44 <andythenorth> peter1138: thing, thething, Thing, ThInG?
21:46:14 <xarick> it's at most 24 reserves
21:46:46 <xarick> erm... reallocations or whatever
21:48:40 *** yeshomo has joined #openttd
21:48:58 *** yeshomo has quit IRC ()
21:51:25 <xarick> okay, I counted, 6 times
21:51:47 <peter1138> 1) list of badge classes, 2) list of badge classes for the current feature, sorted by column and display order, 3) user configuration of badge classes, 4) drop down list showing config.
21:51:52 <peter1138> So, yeah. Wrong design.
21:52:45 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:53:39 <peter1138> Memory is cheap.
21:53:48 <peter1138> Rivers are only created on map generation.
21:54:10 <peter1138> If rivers were generated during the game and it was being slow, then it would be worth spending time optimising it.
21:54:16 <peter1138> But they're not. So it's not.
21:57:04 <andythenorth> not when FIRS is sooooo slow
21:57:13 <andythenorth> did I redo the animated tiles yet?
21:57:47 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1304565560172089394/imagem.png?ex=672fdadb&is=672e895b&hm=ea717db3a8f9da3935b48284487c091e5fe7308057cc6d0f1924dd860fe89aba&
21:57:47 <xarick> wow linux
21:57:54 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:57:54 <xarick> under 9 seconds
21:59:20 <xarick> need to figure a way to not use a global variable for this
21:59:29 <xarick> just for fun
21:59:33 <peter1138> Make your vector static.
21:59:58 <peter1138> Then it will reuse the allocation between goes.
22:00:14 <peter1138> Just make sure you call .clear()
22:00:42 <peter1138> It will reallocate on the first go but after that it will already have the allocation ready to use.
22:00:43 <andythenorth> pff might have to do naptimr
22:01:05 <xarick> how heavy is .clear()
22:01:07 <xarick> hmm lets try
22:02:19 <peter1138> I'm pretty sure you will no notice any difference in these allocation strategies. The river generation algorithm swamps the memory allocation time.
22:05:35 *** D-HUND is now known as debdog
22:06:11 <xarick> earlier today i put a counter on how many times those DiagDir loops were called, it's a staggering 113 million times
22:06:43 <xarick> computers are fast!
22:13:22 <xarick> yeah... .clear() eats 1 second
22:23:21 <peter1138> If it's a vector, it does not.
22:24:18 <xarick> okay I lie, it's about 0.2
22:24:22 <xarick> still cool
22:24:37 <_glx_> clear() is instant for a vector I think
22:27:27 *** Wormnest has joined #openttd
22:36:04 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:36:28 <xarick> vcpkg is always updating
22:36:33 <xarick> so annoying
22:36:56 <xarick> or cmake
22:46:32 <_glx_> vcpkg updates only if you you touch its repo
22:52:40 <xarick> static vectors all accross openttd
23:00:47 <johnfranklin> Why is my refrigerated milk become yogurt one day before the “best before” limit…
23:01:34 <xarick> faulty refrigerator
23:02:04 <xarick> is the door sealing fine
23:02:12 <johnfranklin> I guess once it opened, the limit will come earlier?
23:02:29 <_glx_> yeah the limit is for non open
23:02:34 <johnfranklin> Oh…
23:02:49 <_glx_> usually it's about 3 days once open
23:03:38 <johnfranklin> I would rather no longer buy the 2L one, although it is cheaper per unit
23:04:21 <_glx_> 2L is familly size
23:06:18 <johnfranklin> I was overestimating my milk intake and its endurance of freshness
23:06:30 <xarick> > [2024-11-08 23:04:56] dbg: [misc:0] [CreateRivers] 9977013 us [avg: 9977013.0 us]
23:06:30 <xarick> > [2024-11-08 23:05:23] dbg: [misc:0] [CreateRivers] 9928439 us [avg: 9928439.0 us]
23:06:30 <xarick> > [2024-11-08 23:05:47] dbg: [misc:0] [CreateRivers] 9838254 us [avg: 9838254.0 us]
23:06:38 <xarick> finally under 10 seconds on MSVC
23:06:49 <xarick> static is great
23:09:12 <xarick> > [2024-11-08 23:07:22] dbg: [misc:0] [CreateRivers] 11408553 us [avg: 11408553.0 us]
23:09:12 <xarick> > [2024-11-08 23:07:49] dbg: [misc:0] [CreateRivers] 10861254 us [avg: 10861254.0 us]
23:09:12 <xarick> > [2024-11-08 23:08:13] dbg: [misc:0] [CreateRivers] 10893364 us [avg: 10893364.0 us]
23:09:12 <xarick> Clang doing the usual 10 seconds with static
23:16:35 <xarick> > [2024-11-08 23:14:59] dbg: [misc:0] [CreateRivers] 7959749 us [avg: 7959749.0 us]
23:16:35 <xarick> > [2024-11-08 23:15:20] dbg: [misc:0] [CreateRivers] 7915190 us [avg: 7915190.0 us]
23:16:35 <xarick> > [2024-11-08 23:15:42] dbg: [misc:0] [CreateRivers] 8016253 us [avg: 8016253.0 us]
23:16:35 <xarick> there's something just special on linux
23:16:41 <xarick> under 8 secds
23:18:26 <xarick> alright, enough for today, good night
23:27:20 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:33:08 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)