IRC logs for #openttd on OFTC at 2024-11-12
โด go to previous day
02:31:47 *** tokai|noir has joined #openttd
02:31:47 *** ChanServ sets mode: +v tokai|noir
02:38:49 *** tokai has quit IRC (Ping timeout: 480 seconds)
03:25:09 *** debdog has quit IRC (Ping timeout: 480 seconds)
06:10:46 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:47:25 <truebrain> For once it failed for good reason, as it wanted to overwrite files
07:47:35 *** Guest9135 is now known as TinoDidriksen
08:06:29 *** Extrems` has joined #openttd
08:07:40 *** Extrems has quit IRC (Ping timeout: 480 seconds)
08:07:40 *** Extrems` is now known as Extrems
08:22:55 *** Smedles has joined #openttd
09:11:22 *** mindlesstux has joined #openttd
09:15:48 <peter1138> The old "there were no commits" bug.
09:15:57 <peter1138> That must mean OpenTTD is dead.
09:17:07 <andythenorth> has reddit connected the infra outage with the recent IP rights licensing change to a game from 1994, yet?
09:17:23 <andythenorth> I'm sure it will
09:19:39 <xarick> could i make some lambda functions static or is that a bad idea?
09:22:49 <kuhnovic> Should be ok as long as it's a stateless lambda
09:23:38 <peter1138> Ooh, weird bug, I toggled the Unicode font in Minecraft, and now Distant Horizons renders in front of the world...
09:24:13 <peter1138> Built-in x-ray ๐
09:28:13 <peter1138> Of course in Minecraft it switches from one bitmap font to another.
09:28:55 <wensimehrp> minecraft simply uses unifont
09:33:32 <xarick> I don't know whether my lambdas are stateless
09:34:29 <andythenorth> what does GPT say?
09:38:47 <xarick> gonna ask Copilot, lol
09:39:24 <johnfranklin> I remember using x-ray (stones = transparent to find mines) and kicked in multiplayer
09:39:53 <peter1138> If your lambda is capturing any variables, it cannot be static.
09:40:13 <peter1138> If it can be static, you might as well just use a regular non-member function.
09:40:44 <peter1138> wensimehrp: Exactly.
09:41:00 <peter1138> Although there is a toggle for Japanese variants.
09:41:33 <peter1138> But unifont only works well with very limited font sizes.
09:42:26 <peter1138> Multiples of 16 pixels.
09:43:52 <xarick> ``` auto is_conflicting = [&](IndustryID iid) {
09:43:52 <xarick> const Industry *i = Industry::Get(iid);
09:43:52 <xarick> int dist = DistanceMax(tile, i->location.tile);
09:43:52 <xarick> if (dist > dmax) return false;
09:43:52 <xarick> return std::ranges::any_of(indspec->conflicting, [&](IndustryType conflicting) {
09:43:54 <xarick> return i->type == conflicting;
09:44:15 <wensimehrp> peter1138: and players encounter the same glyph problem... minor though
09:44:37 <_jgr_> `[&]` is a strong hint that your lambda is not stateless
09:45:25 <xarick> what if i make it [tile, indspec]
09:45:53 <_jgr_> No, if you want a stateless lambda, use `[]` so that you don't capture anything
09:46:24 <xarick> okay, thanks, i can't do static
09:49:19 <peter1138> It's clear and sharp but definitely has a different feel...
09:53:09 <wensimehrp> It's more designed for basic displaying rather than achieving an art style.
09:54:12 <wensimehrp> While *many* people's got hidpi displays nowadays...
09:56:41 <xarick> any newgrf that can trigger GetClosestIndustry but not during generation?
10:03:53 <kuhnovic> Maybe the Found Industry dropdown menu option? I think it's called that way at least. That allows you to create a new industry mid-game, I'd assume it does checks.
10:12:30 <peter1138> Okay, OpenTTD Sans here twice is probably a bug.
10:14:40 <peter1138> Looks more recognisable ๐
10:14:50 <peter1138> Also "OpenTTD.Classic"
10:17:08 <Emru> Hey, I'm trying to package openttd dedicated server. I've builded it with 'OPTION_DEDICATED=true', but 'openttd -D' fails with missing graphics set. Do I need those for dedicated server? Or am I missing some option?
10:22:50 <peter1138> Hmm, my Steam version picks a different Serif-style font.
10:23:20 <peter1138> Ah, Noto Serif instead of Noto Sans. I wonder why.
10:39:24 <xarick> still didn't get any non 65535 IndustryID in GetClosestIndustry
10:39:44 <xarick> i must be picking the wrong grfs
10:41:03 <xarick> i wanted to test the performance of tree.Remove(current->index);
11:00:29 <xarick> Improved Town Industries is the new king of slow industry generation!
11:03:06 <xarick> holy smokes, why so slow
11:05:06 *** HerzogDeXtEr has joined #openttd
11:09:44 <peter1138> Well, it's improved.
11:10:12 <peter1138> Not sure if it's possible to add a filter to kdtree searches.
11:17:43 <peter1138> Over 10 minutes to generate?
11:23:44 <peter1138> Winner winner chicken dinner
11:28:24 <xarick> and GetCountAndDistanceOfClosestInstance
11:31:57 <xarick> wondering if it can receive kdtree treatment
11:34:18 <xarick> GetClosestDistance above only got 0,01% ๐
11:41:03 <peter1138> Towns have a stations_near, and Stations have an industries_near.
11:41:22 <peter1138> Would Towns having an industries_near help in some cases?
11:41:51 <peter1138> There's a town filter there, but it might not be in use there.
12:22:41 <xarick> it's faster, but still slow
12:25:36 <xarick> not sure it's doing the same thing
12:28:35 <xarick> that assert there is just so I can find any newgrf that isn't 65535
12:36:03 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:36:12 <peter1138> Making a copy of the kdtree every time probably isn't the best idea.
12:58:09 <xarick> i only need a copy if current->index is value
12:58:27 <xarick> but have yet to find any such newgrf
13:05:09 <xarick> actually, in this case, since it's iterating over all the industries, I guess it's faster to exclude itself in the condition
13:05:29 <xarick> avoids a remove and a kdtree copy indeed
13:08:54 <xarick> ind_index < NUM_INDUSTRYTYPES I dont need this either, it's already been checked above
13:10:22 *** throwawayaccount[m] has quit IRC (Quit: Bridge terminating on SIGTERM)
13:10:22 *** soylent_cow[m] has quit IRC (Quit: Bridge terminating on SIGTERM)
13:10:32 <xarick> the name "ind_index" is a bit misleading, it's an IndustryType
13:14:21 <kuhnovic> Have you reached the "this ain't worth it"-stage already Xarick ๐ ?
13:17:51 <xarick> it's against the rules...
13:18:08 <xarick> i get sidetracked easily
13:26:46 <peter1138> xarick: Yes but you're making a copy every time.
13:27:13 <peter1138> (Or were, at least)
13:28:32 <xarick> trying to avoid a copy if not needed
13:28:39 <xarick> but im bad at pointers
13:28:46 <xarick> references and whatnot
13:28:58 <peter1138> Yes, definitely bad.
13:29:04 <peter1138> free_copy goes out of scope
13:31:10 <andythenorth> peter1138: I had chicken lunch
13:35:17 <peter1138> `*tree = tree_copy` actually replaces the real kdtree.
13:40:49 <kuhnovic> assert(false); probably doesn't do much good either ๐
13:41:11 <kuhnovic> Unless you're trying to check if asserts are disabled.
13:41:53 *** stenyg has quit IRC (Quit: User went offline on Discord a while ago)
13:46:31 <xarick> i really need to test this
13:46:51 <xarick> there are asserts inside the kdtree code that can trigger
13:47:03 <xarick> if i pass invalid elements
13:51:15 <xarick> peter1138: hmm so i don't know how to do it
13:53:43 <_glx_> BTW using Industry::GetIfValid() here is not really needed, there are only 2 options during variable resolution, index is valid, or it's INVALID_INDUSTRY
13:56:38 <_glx_> especially when one of the parameter of the function is an Industry*
13:59:26 <peter1138> Yeah, that's a bit silly too ๐
14:00:01 <peter1138> Okay, so are there any CJK-covering fonts that could possibly be bundled?
14:01:33 <peter1138> And is there any point?
14:02:24 <peter1138> Currently the UX can vary wildly depending on OS and even installation method.
14:04:00 <peter1138> With my side-by-side font cache work, it kinda makes sense to always load a wide-coverage unicode font as a fallback.
14:06:36 <peter1138> Hmm, although that can have implications for line-height.
14:08:38 <xarick> I wanted to avoid code repetition
14:09:42 <xarick> and I wanted to avoid a copy
14:11:16 <peter1138> Use a separate function that accepts a reference to the kdtree.
14:11:32 <peter1138> Then you don't need to duplicate.
14:14:37 <andythenorth> hmm can I claim my prize?
14:21:31 <xarick> forgive me, my brain got stuck
14:21:45 <xarick> I don't know how to do this
15:06:54 <xarick> this function is really tricky
15:07:16 <xarick> without knowing for sure what kind of parameters it can be fed with, I can't deduce anything
15:07:42 <xarick> GetClosestIndustry(TileIndex tile, IndustryType type, const Industry *current)
15:07:59 <xarick> the type could be different than current->type
15:08:23 <xarick> current->index could be invalid, or it could be valid
15:09:18 <xarick> not sure how Kdtree works if I call a Remove on an index that doesn't exist
15:13:22 *** talltyler has joined #openttd
15:13:22 <talltyler> (I assume you have tested, of course ๐ )
15:17:25 <xarick> still looking for a newgrf that calls GetClosestIndustry with a valid industry index
15:21:40 <andythenorth> xarick: doesn't FIRS do that?
15:22:02 <xarick> it does, but it's still not yet on the map
15:22:37 <xarick> or I didn't try hard enough
15:30:27 <xarick> dang, i dodged a bullet
15:31:03 <_glx_> valid industry index means the industry exists already, and I don't see how knowing the closest industry would matter for an existing industry
15:31:55 <_glx_> for me major usage of var64 is during construction
15:34:39 <xarick> the industry could be motivated if it knows there's another nearby or something lol
15:34:50 <xarick> and then produces more cargo
16:17:25 <peter1138> Use could simply use the existing method if the industry already exists.
16:17:59 <peter1138> That you can't find anything requiring it once built suggests that is not a path needs attention.
16:21:33 <andythenorth> we must optimise!
16:21:37 <andythenorth> even for the unused!
16:21:41 <andythenorth> because it might
16:47:57 <peter1138> I optimised badges.
16:48:22 <peter1138> I wonder what cunning tricks will be used.
16:48:32 <peter1138> Probably none, it's a pointless unwanted feature.
17:38:23 *** D-HUND is now known as debdog
17:42:08 <xarick> ECS Animal Farm triggered something
17:44:25 <wensimehrp> peter1138: Noto Sans CJK or Source Han Sans would've been perfect if their glyphs were smaller ๐คช
17:44:25 <wensimehrp> Least for me, no matter what font size I use, the interface looks discord.
17:44:25 <wensimehrp> There's a reason why I use ChillRoundF and ChillRoundM.
17:44:37 *** gelignite has joined #openttd
17:45:16 <xarick> Change industry production at the source of this call
17:45:54 <xarick> and ... the Animal Farm calls GetClosestIndustry of the same type
17:46:03 <peter1138> ChillRoundF is a bit wide for latin at least.
17:46:05 <xarick> finally got to test this
17:49:51 <wensimehrp> It's extra wide for Cyrillic
17:50:42 <wensimehrp> But a fact is players who actually use the font... Uses CJK languages
17:54:53 <peter1138> Hmm, what's the difference between F and M.
17:57:28 <wensimehrp> F is based on Kosugi Maru and it's derivatives
17:57:28 <wensimehrp> M is based on Zen Maru Gothic
17:57:31 <peter1138> Yes that doesn't really mean anything to me.
17:57:58 <wensimehrp> M is rounder to be short
17:58:06 <peter1138> Ah, sounds like it's basically a different font, then.
17:59:12 <peter1138> Better than unifont.
18:08:05 <peter1138> With this branch I can use the sprite font for latin, and ChillRound for CJK.
18:08:21 <johnfranklin> OpenTTD Sans + ChillRound?
18:08:46 <peter1138> The screenshot is OpenTTD Sans + ChillRoundF, yes.
18:12:58 <xarick> static std::vector<IndustryID> list_of_industries_of_the_same_type;
18:13:14 <xarick> gonna ask copilot for a shorter name
18:13:40 <wensimehrp> Openttd Sans seems bolded
18:14:27 <wensimehrp> ๐ Bold Chinese Characters are Very Hardยฎ to read
18:17:06 <wensimehrp> In fact traditional writings don't use bold to emphasize anything. Maybe because they realized that thick characters impacts readability
18:20:23 <peter1138> Ah, Korean glyphs. Hmm.
18:23:30 <peter1138> Problem is I still need to configure it for special non-latin fonts otherwise mine'll fall back to e.g. "Noto Sans CJK SC, Black"
18:24:07 <peter1138> Specific, not special.
18:25:07 <peter1138> Probably the search for "boldest" font is not wise.
18:38:35 <peter1138> I was trying to work out what causes this weird alignment.
18:38:53 <peter1138> Well, this would certainly do it.
18:58:00 <xarick> it's faster, but it's still slow
18:58:00 <xarick> [GenerateIndustries] 209596736 us
19:00:12 <xarick> goes through 3 kdtree implementations
19:00:58 <xarick> and it's still slow because 2 of them... still iterate over a list of industries, they just happen to be of the same type
19:01:22 <xarick> oh, 4 fronts, i have it in 4 places now
19:08:47 <peter1138> ChillRoundF is nice because the default size is the same line height as OpenTTD Sans.
19:08:58 <peter1138> Other fonts, not so 'lucky'
19:09:47 <peter1138> Chinese-exclusive though.
19:15:10 <peter1138> Ah it does have some JP glyphs but not all that OpenTTD uses.
19:41:31 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
19:58:44 <xarick> found some missing "this->" in industry.h
20:11:18 <johnfranklin> peter1138: In Chinese (CJK?) texts, it is normal to have a 2-character indent at the beginning of a paragraph.
20:12:21 <peter1138> Sure, I just had to check there was no bug as it's not present anywhere else.
20:16:58 <xarick> disaster_vehicle.cpp iterate over some industries of certain type/behaviour
20:17:09 <xarick> not sure it's worth it to kdtree
20:24:17 <xarick> what's different between any_of, find_if
20:24:41 <LordAro> well one returns a value
20:24:56 <LordAro> i imagine one is implemented in terms of the other
20:27:41 <LordAro> `any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return !std::none_of(__first, __last, __pred); }` ah, close
20:28:00 <LordAro> `none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return __last == _GLIBCXX_STD_A::find_if(__first, __last, __pred); }`
20:28:18 <_glx_> any_of and none_of are just bool
20:39:18 <xarick> how worthy it is to have kdtrees already built just for satisfying some function conditions
20:40:05 <_glx_> you can fill the trees when industries are built
20:41:28 <xarick> what does the survey say about multiple_industry_per_town
20:41:42 <xarick> what % of users have it disabled?
20:42:27 <xarick> where do I find these surveys? in openttd.org?
20:43:51 <peter1138> game.settings.economy.multiple_industry_per_town
20:43:57 <peter1138> Huh, that does not cut & paste well ๐ฆ
20:44:41 <_glx_> Q3 for 14 is 80/20 false/true
20:44:50 *** gelignite has quit IRC (Read error: Connection reset by peer)
20:45:03 *** gelignite has joined #openttd
20:48:42 <xarick> that's still a considerable number of falses
20:49:18 <xarick> maybe another sub kdtree for types
20:50:42 <xarick> or, have it in Town structure
20:50:56 <xarick> counts for industry types
20:57:18 <peter1138> It's worth adding things if it affects gameplay performance. Less so if it's just world gen.
20:58:52 *** Wormnest has joined #openttd
21:12:58 <xarick> if ((*t)->industry_type_counts[type] != 0) {
21:33:09 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:43:25 <kuhnovic> lordaro4353: could you have another look at #12992 ? Should be good to go now
21:46:57 *** gelignite has quit IRC (Quit: Stay safe!)
22:12:31 <xarick> RebuildTownIndustryCounts
22:16:44 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:22:33 *** squirejames has joined #openttd
22:22:33 <squirejames> xarick: All Cargo Classes are equal but some Cargo Classes are more equal than others?
22:23:40 <xarick> is that operator <=> gonna work on that array?
22:25:10 <xarick> if (old_town_caches[i] != t->cache) {
22:25:19 <xarick> let's provoke a desync
22:30:47 <xarick> I forgot how to test the desync...
22:35:08 <xarick> why isn't it printing the debug message?
22:35:24 <xarick> i got debuglevel desync=9
22:35:48 <LordAro> some of that stuff has to be compiled with desync debugging turned on
22:35:58 <LordAro> i can't remember off hand how to do that, it's in the docs somewhere
22:38:36 <xarick> oh, it prints a text file isn't it? not in the console
22:39:46 <xarick> my forced desync works
23:08:39 <xarick> my message is so off...
23:13:23 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:21:34 <_glx_> so 480 bytes of cache per town
23:35:55 <peter1138> If industries were spawning every tick it might be worth it.
continue to next day โต