IRC logs for #openttd on OFTC at 2024-11-13
β΄ go to previous day
01:35:31 <reldred> They do spawn far too quickly through
02:03:53 *** herms has quit IRC (Quit: bye)
02:31:48 *** ChanServ sets mode: +v tokai
02:38:43 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
03:03:42 *** Wormnest has quit IRC (Quit: Leaving)
03:20:55 *** Zathras has joined #openttd
03:23:50 *** godbed has quit IRC (Ping timeout: 480 seconds)
03:24:15 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:35:59 *** Zathras is now known as debdog
04:46:05 <DorpsGek> - Update: Translations from eints (by translators)
06:21:38 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:41:29 <truebrain> This time it should not have failed π
08:32:41 *** HerzogDeXtEr has joined #openttd
08:57:24 <peter1138> Hmm, okay. town cargo stats are not very interesting.
10:50:40 <truebrain> Don't know; should I be? π
10:58:30 <peter1138> I look await for a minute and all hell breaks loose.
11:29:06 <xarick> _glx_: how do you calculate how many bytes are required?
11:30:41 <peter1138> I mean, size of element * number of elements...
11:34:10 <xarick> max of 64000 towns if someone tries hard enough to create them
11:37:41 <xarick> I initially though about it being a bool
11:38:07 <xarick> but i wouldn't know how to keep track on the number of each type
11:40:54 <xarick> how often are there 240 types of industry on the game? it's usually much less
11:41:05 <xarick> need to optimize i guess
11:46:00 <andythenorth> what shall we do today pinky?
11:49:07 <merni> I burned two fingers today
11:49:13 <xarick> andythenorth: we, and by that, I mean I, need a NewGRF with 240 different types of industries
11:51:40 <andythenorth> you won't get that in a single grf
11:51:44 <andythenorth> you'll have to stack them
11:52:00 *** XYZ has quit IRC (Ping timeout: 480 seconds)
11:53:54 <xarick> oh Clang stands for C lang
11:54:07 <xarick> i thought it was about clinging
11:55:23 <LordAro> it's certainly said 'clang' rather than 'c-lang'
11:56:05 <peter1138> Allegedly. I do call it c-lang.
11:56:40 <peter1138> I also call png pee en gee, not ping.
11:57:45 <xarick> should I switch to std::vector<bool> maybe?
11:58:41 <LordAro> peter1138: well that's just obvious
11:58:49 <peter1138> I would probably try a std::vector of Industry *, then you only need to iterate the town's industries instead of all industries which are in the town.
11:59:10 <LordAro> the real question is is it sequel or s-q-l
11:59:45 <peter1138> "ping" was the official way, btw.
11:59:56 <LordAro> that's just as wrong as jif
12:00:26 <_glx_> I'd try a vector of towns in IndustrySpec
12:02:18 <peter1138> Also a possibility.
12:02:36 <peter1138> 240 vectors tops, and they default to empty when the industry is not used.
12:03:17 <peter1138> Pick your insert/remove/find strategy carefull.y
12:03:34 <peter1138> LordAro: It's not, because jif is correct.
12:04:09 <peter1138> Breaking News: OpenTTD developers shut down project due to pronunciation rift in team.
12:04:59 <xarick> isn't IndustrySpec supposed to be set in stone?
12:08:20 <peter1138> No change there really.
12:09:37 <xarick> the spec can be altered during a running game? I'm not following
12:27:48 <peter1138> Well it's not change the existing data.
12:31:01 <xarick> well, I solved one bottleneck, I expose the other
12:32:54 <truebrain> peter1138: We had a good run π
13:22:51 <peter1138> Uh huh `std::vector<std::pair<key, value>>` is probably fine.
13:30:25 <peter1138> (As long as inserts/erases are rare)
13:52:25 <xarick> i fail at interpreting this data
13:53:25 <xarick> the red is pointing to the lines after
13:53:35 <xarick> the profiler is bugged?
13:56:30 <peter1138> Optimisations can make the compiled code not necessarily line up with the source.
14:07:26 <johnfranklin> On topic, it will get dark in 2h
14:25:27 <xarick> IndustrySpec is a const
14:34:03 <andythenorth> I'm sure the originator of GIF was trolling with the official pronunciation
14:34:17 <andythenorth> "yeah, it's like in giraffe [lolz inside]"
14:43:36 <peter1138> `struct IndustrySpecCache { std::vector<lol> maybe; }`
14:43:53 <peter1138> `struct IndustrySpec { ... ; mutable IndustrySpecCache cache; }`
14:43:58 <peter1138> Something like that maybe.
14:44:15 <peter1138> Then it should not matter that it's const.
14:44:31 <peter1138> Or you can always make a non-const way to get to it.
14:45:07 <peter1138> But probably "mutable" and "cache" go some way to explaining it.
15:03:42 <kuhnovic> In Dutch we butcher "gif" even further by pronouncing the g with that guttural back-in-the-throat sound we are so often mocked for (and rightfully so)
15:04:55 <kuhnovic> It's also the Dutch word for poison. Seems appropriate.
15:09:38 <squirejames> ghhhghghghhif files
15:29:21 <andythenorth> can we discuss the pronunciation of mySQL next?
15:29:27 <andythenorth> endless entertainment
15:29:49 <andythenorth> I pronounce it "postgres", but then again, nobody knows how to say that either
15:30:40 <peter1138> That is correct. There is only one SQL database server.
15:31:11 *** XYZ_ has quit IRC (Ping timeout: 480 seconds)
15:31:21 <andythenorth> AccessDB on 365?
15:32:52 <xarick> `struct IndustrySpecCache { std::vector<std::pair<Town, Industry>> town_industry_pairs; };`
15:33:06 <xarick> I don't understand the point of this
15:34:21 <peter1138> Why are you doing it then?
15:34:33 <xarick> I don't know, you told me to
15:35:56 <peter1138> Okay, the reason for having the separate struct that is used as a member of the IndustrySpec class is it means it is clearly delineated. Everything in it is nothing to do with the data about how industries work.
15:36:01 <andythenorth> 'told' can be confusing in chat
15:36:13 <andythenorth> I used to do things because other people suggested it
15:36:29 <andythenorth> but it's ultimately voluntary
15:36:47 <peter1138> Yes, just a suggestion.
15:36:50 <andythenorth> I stopped because people kept telling me how to "fix" my python environment π
15:37:24 <peter1138> Something about venv.
15:37:36 <andythenorth> then I learnt that the problem with my python environment was listening to other people
15:38:08 <andythenorth> xarick: TL;DR if you don't know why you're doing it, first maybe stop π
15:38:31 <xarick> I wanted an alternative to 480 bytes per town
15:38:54 <peter1138> Oh, and if you're using std::vector<std::pair<>> because of something I said earlier, that was completely unrelated and was to do with something I was looking at.
15:40:22 <xarick> isn't there an IndustryCounts
15:40:48 <kuhnovic> He hasn't quite reached the "is this really worth it?"-phase just yet π
15:41:31 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
15:42:19 <xarick> wondering if i can expand on this
15:44:59 <andythenorth> should xarick see the 83MB of Iron Horse nml?
15:46:38 <andythenorth> Iron Horse compile consumes 1.1 GB of RAM just for the nmlc step
15:49:13 <xarick> Town data structure 1952 bytes, this includes my 480 stuff, right?
15:50:05 <johnfranklin> andythenorth: Isnβt it read alphabetically?
15:52:39 <andythenorth> dunno, it's English
15:52:47 <andythenorth> what are the rules even?
15:54:51 <kuhnovic> Learning English is _tough, though through_ practice you might get better
15:55:27 <talltyler> Be sure to be thorough with it though
15:55:47 <andythenorth> it's quite thought-provoking
15:56:04 <kuhnovic> 2TT might cheat and use thru π
15:56:17 <andythenorth> that's a bit rough
15:57:17 <talltyler> Iβve never seen thru used anywhere not absolutely necessary, like a road sign, e.g. βThru traffic left lane onlyβ
15:58:32 <kuhnovic> talltyler: Reminds me of the first time I saw a road sign with "Xing" on it. It took me a second to figure out what it meant.
15:59:24 <kuhnovic> Ah man, I'm getting hungry. I might start eating out of a trough.
16:00:11 <andythenorth> you could hang your trough from the bough of a tree
16:00:28 <andythenorth> "other languages are available"
16:02:08 <_glx_> talltyler: but road signs using plain text is silly
16:02:08 <mnhebi> If you try to understand English logically you will fail cause every time English encounters another language it has children with it, and randomly distributes the results in the dictionary.
16:03:11 <johnfranklin> talltyler: Drive-THRU Macdonald, for βshorter word signs more attentionβ
16:03:20 <mnhebi> its like trying to understand a 2000's chatbot that hung around in a room full of 15 years and younger, its just gibberish.
16:04:55 <andythenorth> hmm my local nmlc is still on the 309 branch π
16:05:19 <andythenorth> I think FIRS now depends on that branch, which might be difficult for other people trying to compile FIRS
16:06:25 <johnfranklin> Sometimes JPEG is read phonetically. Others are alphabetically.
16:06:58 <peter1138> I don't think alphabetically is what you mean there.
16:07:18 <peter1138> And jpeg is "jay-peg"
16:07:46 <kuhnovic> jay-peghghhghghgh in Dutch π
16:08:18 <johnfranklin> How to read newgrf?
16:08:50 <andythenorth> does anyone use nmlc besides me?
16:09:12 <johnfranklin> NewGraph? NewJiArEf?
16:09:15 <peter1138> Always "new grph" for me.
16:09:24 <andythenorth> yeah, shortened 'graph'
16:09:25 <peter1138> Like graph but without the a.
16:09:50 <andythenorth> and mySQL is myskwull
16:09:51 <johnfranklin> peter1138: This sounds like some hard Polish words
16:10:15 <peter1138> Well there is a vowel there... but it's not really an a π
16:11:32 <johnfranklin> Everyone saying Milton Keynes too βcar brainβ
16:12:09 <peter1138> Roundabouts all over the place.
16:12:18 <andythenorth> otherwise my classes PR is going to be weirdly based
16:12:25 <peter1138> It does have some hidden paths and cycle lanes, but there're not really very ... nice.
16:13:13 <johnfranklin> So only potable non-potable changes, or all classes change like in Polar Fox?
16:15:58 <andythenorth> that PR only adds potable and non-potable
16:16:21 <andythenorth> there will be a subsequent PR to add constants for other classes
16:17:40 <peter1138> "Mostly the same but reworded to satisfy the pedantics"
16:17:57 <andythenorth> pedantics / andythenorth /s
16:26:24 <xarick> `static std::vector<std::pair<TownID, uint16_t`>> counts[NUM_INDUSTRYTYPES] I'm not sure this is working
16:27:14 <xarick> im so confused, I have no idea what i want
16:28:00 <xarick> there are 240 industry types, each industry type has a vector
16:28:59 <xarick> inside each vector for an industry type, there are towns... what do I want the uint16_t for?
16:35:13 <peter1138> glx β Today at 12:00
16:35:13 <peter1138> I'd try a vector of towns in IndustrySpec
16:35:34 <peter1138> a std::vector of std::pair of TownID, uint16_t ... not a vector to Town.
16:43:55 *** XYZ has quit IRC (Ping timeout: 480 seconds)
16:44:51 <peter1138> Of course, you can do what you want π
17:30:54 <xarick> i can't do this because I'm illiterate
17:37:19 <andythenorth> not sure that's true
17:37:43 <xarick> I only get half the pair
17:42:25 <xarick> nevermind, i found the problem
17:42:44 <xarick> I did not correctly defined the pair in the declaration
18:14:14 <xarick> getting problems in the saveload INDYchuck
18:14:34 <xarick> industries have no towns defined yet?
18:18:36 <xarick> i->town is not nullptr but it's also not anything right
18:21:17 <_glx_> when loading it's the townID IIRC
18:21:36 <_glx_> and it's converted at a later stage
18:23:11 <_glx_> handled in FixPointers()
18:26:41 <xarick> I hope i can move this to there
18:28:09 *** gelignite has joined #openttd
18:35:40 <peter1138> This data does not need to be saved, surely?
18:37:32 <xarick> i'm unsure, but about 85% it doesn't
18:38:50 <xarick> `counts[type].push_back(std::make_pair(*town, 1));`
18:38:50 <xarick> this is trying to undo the town
18:41:23 <_glx_> Why not just store TownID in the vector ?
18:41:53 <xarick> i thought that wasn't wanted
18:42:21 <peter1138> If you want to store a pointer, you store town, not *town. But you can also store a TownID. It's smaller, and just needs Town::Get().
18:56:30 <xarick> std::pair<TownID, uint16_t> &pair = *it;
19:01:35 <xarick> counts[type].push_back(std::make_pair(tid, 1));
19:08:58 *** ahyangyi has joined #openttd
19:12:42 *** SigHunter has joined #openttd
19:14:12 <michi_cc[d]> try whitespace π
19:15:22 <andythenorth> nobody went for Perl?
19:20:49 <ahyangyi> wensimehrp: Does anyone use nml without any kind of preprocessor? π
19:40:19 <talltyler> ahyangyi: I do, albeit in a bunch of smaller NML files that get combined together before compiling. But thereβs no preprocessing going on, just automated copy and pasting. π
19:41:00 <ahyangyi> Ah, yes! I remember studying the code of your industry sets π
19:41:09 <peter1138> That is... basically preprocessing.
19:41:37 <talltyler> I suppose, but itβs not pnml or whatever others use
19:59:13 <andythenorth> pnml is not a thing π
20:02:30 <ahyangyi> andythenorth: "python nml"
20:02:42 <ahyangyi> Pretty sure it's a thing π
20:02:50 <andythenorth> .pnml was CPP originally
20:06:42 <ahyangyi> It still is, but you can redefine the spec π
20:12:55 <andythenorth> anyway, what shall we call this?
20:13:10 <andythenorth> the other channel is not really the place to get answers I guess
20:22:18 <andythenorth> how about just 'cargo classes for OpenTTD'?
20:22:47 <andythenorth> can't put these pages in the wiki, they have custom css
20:24:34 <xarick> can't invalidated derefece ...
20:24:39 <xarick> bah i'm about to give up
20:34:46 <andythenorth> maybe xarick can decide what to call this cargo class scheme?
20:39:54 <andythenorth> I'm so bored of it all
20:46:27 *** gelignite has quit IRC (Quit: Stay safe!)
20:56:18 <xarick> omg, i have absolutely 0 idea what I did, but now it no longer asserts
20:56:28 <xarick> all I changed was auto everything
20:58:02 <xarick> black box auto solving my issues... how shameful
20:59:16 <andythenorth> I could get GPT to name the scheme?
21:00:35 <andythenorth> GPT says "Comprehensive Cargo Class Reference for OpenTTD Modding"
21:22:34 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:25:39 *** Wolf01 has quit IRC (Ping timeout: 480 seconds)
21:33:46 <xarick> I have a feeling std::vector is bad
21:34:35 <xarick> find_if is going to be massively used
21:39:11 <talltyler> New Cargo Classes π
21:40:36 <xarick> finally get to test this...
21:40:53 <xarick> only took me the whole day to figure out how to code
21:49:09 <xarick> too good to be true, something must be wrong π
21:52:37 <xarick> yep, only selected 30 seconds
21:54:35 <xarick> not as fast as the 480 bytes version
22:28:23 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:33:13 <xarick> dang, there's a mismatch
22:36:49 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:05:46 <xarick> ``` /** Resets industry counts. */
23:05:46 <xarick> static inline void ResetIndustryCounts()
23:05:46 <xarick> std::ranges::for_each(counts, [](auto type) { type.clear(); });
23:08:03 <xarick> `static std::array<std::vector<std::pair<TownID, uint16_t>>, NUM_INDUSTRYTYPES> counts;`
23:08:59 <xarick> `auto type` gets me `std::vector<std::pair<TownID, uint16_t>>`, I wanna empty it
23:16:21 <michi_cc[d]> You want both `auto &` and a C++ tutorial.
23:17:31 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:19:34 <xarick> that was it, thanks very much
23:33:11 <xarick> slower than the 480 bytes town cache
23:34:09 <xarick> 14 seconds is measurable
23:35:38 <xarick> leaving you with my work
23:37:23 <xarick> DecIndustryTypeCount isn't tested yet, must test tomorrow
continue to next day β΅