IRC logs for #openttd on OFTC at 2025-04-09
⏴ go to previous day
00:39:28 *** WormnestAndroid has quit IRC (Remote host closed the connection)
00:39:55 *** WormnestAndroid has joined #openttd
00:55:00 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
00:55:07 *** WormnestAndroid has joined #openttd
00:55:11 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
00:55:12 *** WormnestAndroid has joined #openttd
02:41:33 *** gnu_jj_ has joined #openttd
02:44:45 *** geizeskrank has quit IRC (Ping timeout: 480 seconds)
02:44:51 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
02:48:17 *** geizeskrank has joined #openttd
03:40:18 *** WormnestAndroid has quit IRC (Remote host closed the connection)
03:40:23 *** WormnestAndroid has joined #openttd
03:53:39 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
04:46:57 <DorpsGek> - Update: Translations from eints (by translators)
04:49:37 <reldred> sigh, multitile depots my beloved
05:01:50 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:05:15 <andythenorth> side quest time yet?
06:24:46 <andythenorth> back to the main quest then
09:29:47 <jfkuayue> Bike in the UK… for the first time
09:30:46 *** notluke2578 has joined #openttd
09:44:52 <jfkuayue> Lol drivers have been already taking care of overtaking me
10:41:00 <xarick> in the past I vaguely remember iterating AILists were going through repeated items if there was changes to their values
10:41:39 <xarick> or am I misremembering ?
10:54:55 <_glx_> Well changing values affects the sorting
10:58:37 <_glx_> But if you sort by item it's fine
11:01:39 <peter1138> My list changes are a bit... stifled by the modifiable iterators...
11:13:43 <kuhnovic> Does anyone want to review 13968? Not because it would make Xarick happy, but because it fixes some stuff that I never intended to break in the first place 🙂
11:57:02 <_glx_> Actually `List::Sort()` just changes the way content is iterated, internally it's always sorted ascendant by item, and also ascendant by value (there are 2 storages)
12:02:21 *** WormnestAndroid has quit IRC (Remote host closed the connection)
12:02:23 *** WormnestAndroid has joined #openttd
14:19:03 *** Wormnest has joined #openttd
14:33:20 <xarick> if the list has items where all values are 0, if i set a value to each item different that zero do I still have to have it sorted by item?
14:36:16 <peter1138> That question does not make sense.
14:46:19 <xarick> when i add a rectangle of tiles, all the items get a value of 0
14:54:09 <peter1138> While you are filling that list, I would imagine it's best to have it sorted by Item.
14:54:19 <peter1138> Then when you want to look at the values, sort by Value.
15:01:20 <xarick> the asserts at line 49 and 54 should tell me whether things go wrong
15:05:23 <peter1138> The regression tests test some specific cases, but not everything. I wonder.
15:14:00 *** Flygon has quit IRC (Read error: Connection reset by peer)
15:49:30 <_glx_> xarick: default sorter is descending by value
15:50:17 <_glx_> so line 51 will cause reordering
15:51:45 <_glx_> and can affect iteration
15:53:14 <_glx_> but in this case, assuming all values are 0 when starting you won't see it I think
15:55:28 <peter1138> Bit of a weird default sort order, but hey.
15:55:32 <_glx_> still would make more sense to use a by item sorter
15:56:07 <peter1138> I guess it makes sense for "what's the fastest engine".
15:56:15 <_glx_> I think default sorter is useful for typical get a list, valuate, iterate
15:58:46 <xarick> it's about 10 ops I save without doing Sort
16:00:24 <_glx_> in your test case default sorter should be fine, but keep in mind it's not always the case
16:26:04 *** gelignite has joined #openttd
17:13:04 *** kuka_lie has joined #openttd
17:15:59 <xarick> i should rewrite my airport searching methods 😦
17:21:11 <xarick> something eats 200 ticks here, and i can't figure out what
17:42:07 <peter1138> Hmm, the std::variant conundrum. Can't use it without the types being distinct enum or strong types. Strong types invite all the (deliberate) annoyance .base()...
17:58:16 <xarick> _glx_: can I change `heli_airports.HasItem(AIAirport.AT_HELIPORT)` to
17:58:16 <xarick> `heli_airports[AIAirport.AT_HELIPORT] != null` ?
18:30:17 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:30:20 *** WormnestAndroid has joined #openttd
18:42:42 *** ChanServ sets mode: +v tokai
18:49:44 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
19:05:42 <_glx_> xarick: You can try, but the expected result is script crash for non existing items
19:20:07 *** WormnestAndroid has quit IRC (Remote host closed the connection)
19:20:11 *** WormnestAndroid has joined #openttd
19:24:20 <frosch123> Often the class is in _type.h and the variable is in _func.h. That would end then.
19:24:20 <frosch123> Also do we want Vehicle::_pool instead of _vehicle_pool? But that makes it kind of more visible public. _vehicle_pool is more hidden private
19:27:25 <frosch123> Oh, the template magic actually does not allow Vehicle::_pool. That would be recursive.
19:28:45 <frosch123> VehiclePool::_instance would work, but kind of ugly
19:38:28 <frosch123> Hmm. I think I do not like variables as static class members, if they are primarily used outside the class
19:41:46 <xarick> how list1.KeepList(list2) works if i try to keep items that don't exist in list1?
19:47:01 <_glx_> RemoveList uses RemoveItem which does nothing if item is not found
19:52:34 <xarick> ow, it is managing 3 lists
19:54:48 <xarick> trying to come up with a more elegant solution here
19:57:36 <_glx_> _jgr_: yeah at least 3 full iterations, but doing it's easy to understand 🙂
19:58:50 <xarick> `m_airport_types.RemoveList(heli_airports)` could be `m_airport_types[AIAirport.AT_HELIPORT] = null`
20:00:10 <_glx_> yeah using RemoveList in this case is not the best idea 🙂
20:02:26 <xarick> wondering if i can get rid of those Sort
20:02:41 <xarick> instead of KeepBottom, it's KeepTop mabye?
20:04:14 <xarick> keep the most expensive, then remove from the main list
20:05:15 <_glx_> it doesn't affect the list itself
20:07:04 <_jgr_> ScriptList in general is very expensive for what it does
20:11:39 <xarick> make them multithreaded 🙂
20:12:43 <_glx_> but Sort is almost a noop, if you have 10 or 10k items it will take the same time
20:16:55 *** nielsm has quit IRC (Remote host closed the connection)
20:17:49 <peter1138> Sort is only a no-op because it's always sorting even if you don't need it.
20:21:01 <peter1138> And because it allows modification of the list while iterating it, doing something else is a pain.
20:21:53 <_jgr_> _glx_: It's actually worse than that, the reverse mapping is a std::map<SQInteger, std::set<SQInteger>>
20:23:02 <peter1138> It's a bit faster than the current way, but the sorting is still crap.
20:23:53 <peter1138> It (almost) passes the regression tests, but they don't test very much.
20:24:19 <_glx_> hehe we know authors can do unexpected things 🙂
20:24:43 <_glx_> hard to think about everything for regression tests
20:25:02 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
20:25:22 <peter1138> Having to search to find the next item/value after being invalidated is a pain.
20:27:39 <peter1138> Hmm, also seems like I've broken it again, as the regression test fails. Oh well.
20:29:17 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:49:39 *** Wormnest has quit IRC (Quit: Leaving)
20:59:54 *** kuka_lie has quit IRC (Remote host closed the connection)
21:13:51 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
21:16:13 *** WormnestAndroid has joined #openttd
21:31:37 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:41:10 <andythenorth> flash style objectCommonGameControllerSpriteList
21:44:28 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:50:21 <xarick> prev, pprev, ppprev, pppprev
21:50:33 <xarick> so that also exists in openttd code, hah
21:51:39 <_glx_> pPrev meant it's a pointer, frequent in some coding style but not ours 🙂
22:07:13 <_zephyris> Hmm, odd, github.com is stuck/very slowly "processing updates" after a PR force push... Is that normal?
22:12:49 <_zephyris> Nope, on openttd. I'll just leave it churning then 🙂
22:12:50 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
22:13:01 <xarick> 14 days wasted? it took a month and 7 days
22:13:29 <xarick> 38 days wasted it should be, unless it's doing something extra
22:13:38 *** WormnestAndroid has joined #openttd
22:13:43 *** peter1138[d] has joined #openttd
22:14:24 <xarick> I am counting days badly
22:15:07 <xarick> 40 days if lucky to get the first airport running is too much
22:15:30 <xarick> i know there's 13k towns, but still too much
22:16:56 <xarick> this should be throwing airports routes like candy
22:17:06 <xarick> it used to be much faster
22:19:26 <xarick> the reality of 10k ops and medium speed 😦
22:21:46 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
22:23:32 *** WormnestAndroid has joined #openttd
22:35:36 *** Wormnest has joined #openttd
22:49:58 *** k-man has quit IRC (Ping timeout: 480 seconds)
22:57:00 *** gelignite has quit IRC (Quit: Stay safe!)
23:02:03 *** Wormnest has quit IRC (Quit: Leaving)
23:50:26 *** Rubidium has quit IRC (Ping timeout: 480 seconds)
23:58:32 *** Rubidium has joined #openttd
continue to next day ⏵