IRC logs for #openttd on OFTC at 2024-10-09
            
02:03:59 *** herms61 has quit IRC (Quit: bye)
02:05:01 *** herms61 has joined #openttd
02:14:11 *** Wormnest has quit IRC (Quit: Leaving)
02:14:15 *** D-HUND has joined #openttd
02:17:39 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:48:37 *** debdog has joined #openttd
03:00:19 *** gnu_jj has joined #openttd
03:03:29 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:08:29 *** keikoz has joined #openttd
04:19:18 <ahyangyi> I think the same applies to all building-types: house, object, station, etc
04:19:37 <ahyangyi> The NewGRF has to ensure that the preview sprites are sorted in the right order
04:22:04 <wensimehrp> _pruple: Yep you'll have to manually sort them
04:52:48 <_pruple> hmm... I guess that's doable
05:15:33 *** keikoz has quit IRC (Ping timeout: 480 seconds)
05:44:54 <andythenorth[d]> pff sleeping, over-rated eh
06:00:19 <LordAro> afirm
06:03:36 <andythenorth[d]> pff thought of an option B, less change to existing bits
06:03:37 <andythenorth[d]> https://gist.githubusercontent.com/andythenorth/8cd5169ec955955d942c0ae163fb596d/raw/4d9ac6c5a84b9b8172167d21ad753596db5bb8be/gistfile1.txt
06:03:57 <andythenorth[d]> any of this, I'll put a FIRS parameter in to switch to old classes
06:25:19 *** Ox7C5 has left #openttd
07:04:47 *** keikoz has joined #openttd
08:06:28 <peter1138> Hmm, that is a limitation I wasn't really aware of. Makes sense that it's the same forr other types because it's the same drawing function.
08:07:04 <pickpacket> Hey, andythenorth[d] : https://lounge.warmedal.se/uploads/d7b1aecc250c89e6/image.png
08:08:36 <andythenorth[d]> lol
08:09:04 <andythenorth[d]> the canvas in 4o is such a good idea, but so slow and buggy
08:10:30 <andythenorth[d]> hmm
08:10:44 <andythenorth[d]> so where are specific classes baked into current OpenTTD?
08:11:00 <andythenorth[d]> I've found cargotype.h
08:22:15 <andythenorth[d]> do I read correctly? Base game vehicles have a cargotype, which determines label, classes etc? e.g. CT_LIVESTOCK
08:23:04 <andythenorth[d]> hmm ConDumpCargoTypes was unexpected
08:25:26 <peter1138> It is only 4 years old.
08:25:38 <peter1138> Eh, nearly.
08:27:45 <peter1138> Base vehicles have a bit of magic to support different cargo label depending on the climate.
08:27:53 <andythenorth[d]> I saw mixed
08:28:11 <peter1138> Base cargo types have cargo classes assigned.
08:29:00 <andythenorth[d]> in cargo_const.h?
08:29:11 <andythenorth[d]> oh dear GS has specific constants for specific classes
08:29:18 <andythenorth[d]> and presumably AI
08:29:54 <peter1138> And then there's a mapping from climate + cargo label to cargo classes to apply refits to default vehicles.
08:30:22 <peter1138> (Or rather, to vehicles that don't set cargo properties)
08:30:45 <andythenorth[d]> so many problems with my current plan 🙂
08:31:12 <andythenorth[d]> interesting that the classes listed don't conform to the spec
08:31:13 <peter1138> The defaults even use excludes which are apparently forbidden...
08:32:25 <andythenorth[d]> where are the excludes (which file)?
08:37:40 <andythenorth[d]> wondering if `_standard_cargo_mask` makes cargo class bit 15 non-repurposeable
08:38:53 <andythenorth[d]> `if (cargo->classes & CC_SPECIAL) break;`
08:54:03 <peter1138> Handling of CC_SPECIAL is not particularly consistent anyway.
08:54:53 <peter1138> But anything with it is excluded from many UI places.
08:58:06 <andythenorth[d]> I'm searching the others to see which are depended on
08:58:12 *** mindlesstux has quit IRC (Quit: The Lounge - https://thelounge.chat)
08:59:27 *** mindlesstux has joined #openttd
09:00:07 <peter1138> Changing the meanings of existing cargo classes is not a good idea really.
09:00:30 <andythenorth[d]> no
09:00:40 <andythenorth[d]> the stupid ones are more debatable
09:00:59 <andythenorth[d]> hmm `CalculateRefitMasks`
09:01:15 <andythenorth[d]> specifically `DefaultRefitMasks`, my brain says no
09:02:36 <peter1138> frosch wrote that code, so it's bound to be well thought out and correct. (This is not sarcasm)
09:03:33 <andythenorth[d]> I *think* that if I was prepared to take on the pitchforks, and change the apparently-facts-but-are-they really rules
09:03:50 <andythenorth[d]> the existing classes and 2 spare bits would do everything needed
09:04:11 <andythenorth[d]> and it could be done 2 ways, either with or without NOT AND exclusions
09:04:33 <andythenorth[d]> dunno if that's worth the candle
09:04:43 <peter1138> Remember that 2C/2D exist for specific scenarios, classes are for generalising.
09:05:39 <andythenorth[d]> so apart from pitchfork factor, the major flaw in my plan is that default vehicles don't support all the classes I would want to declare as 'base'
09:05:46 <andythenorth[d]> which is a problem for fallback 😛
09:05:57 <andythenorth[d]> like...really kills it dead
09:06:20 <andythenorth[d]> I can put a parameter in FIRS to deal with that, but it's a kludge
09:06:40 <peter1138> This is why excludes.
09:06:47 <andythenorth[d]> I know 🙂
09:06:56 <andythenorth[d]> I just suspect that if we decompiled all the grfs on bananas
09:06:59 <andythenorth[d]> we'd find nobody does that
09:07:50 <andythenorth[d]> `GPT can you decompile everything on bananas`
09:07:59 <andythenorth[d]> `analysing` -> crashes browser tab
09:08:17 <andythenorth[d]> currently, our AI overlords are limited by the rate at which they crash Chrome tabs
09:08:49 <ahyangyi> andythenorth[d]: Use Firefox
09:09:16 <ahyangyi> That'll make GPT unable to crash Chrome tabs 😛
09:09:24 <merni> Firefox'd probably crash even earlier
09:09:29 <ahyangyi> True
09:09:36 <ahyangyi> but then they are crashing Firefox tabs instead
09:09:40 <merni> I say that as a long-time firefox user :logo_Blauwnet:
09:10:51 <andythenorth[d]> I can probably address the 'no refits on default vehicles' by always including one of the supported classes
09:11:10 <andythenorth[d]> (in cargo action 0 prop 0x16)
09:11:14 *** tokai|noir has joined #openttd
09:11:14 *** ChanServ sets mode: +v tokai|noir
09:11:41 <andythenorth[d]> pff, kind of makes CC_GAS pointless
09:12:59 <andythenorth[d]> ah, no, wouldn't have to be CC_LIQUID and CC_GAS
09:13:02 <andythenorth[d]> could be piece
09:13:06 <andythenorth[d]> almost everything can be piece
09:14:42 <merni> Water can be piece
09:14:45 <merni> Just put it in bottles
09:14:49 <andythenorth[d]> yes
09:15:03 <andythenorth[d]> vehicles have long been a problem for this
09:15:08 <andythenorth[d]> and livestock bothers people
09:15:34 <andythenorth[d]> almost all other cargos can be packaged in sacks, boxes, crates, bales, barrels, jars, or palettised
09:15:41 <merni> andythenorth[d]: Vehicles are inherently piece, no?
09:15:44 <andythenorth[d]> no
09:15:53 <andythenorth[d]> they're a non-standard breakbulk cargo
09:15:59 <merni> Do you transport vehicles in one gloopy mass :p
09:16:39 <andythenorth[d]> lol 🙂
09:16:47 <andythenorth[d]> they tend to fall outwith piece handling as they can rolle
09:16:54 <andythenorth[d]> and generally don't stack well
09:17:21 <merni> Who needs vehicles when you have trains and trams anyway
09:18:08 *** tokai has quit IRC (Ping timeout: 480 seconds)
09:18:08 <andythenorth[d]> hmm which base vehicles actually refit piece?
09:19:58 <andythenorth[d]> goods vans
09:20:00 <andythenorth[d]> fine
09:27:38 <xarick> hi
09:30:05 <andythenorth[d]> _pruple: is it any way necessary for livestock to set piece? 😛
09:31:02 <andythenorth[d]> /me tests
09:31:12 <_pruple> no, not at all
09:31:26 <andythenorth[d]> I haven't followed all the way through src
09:31:35 <andythenorth[d]> but I think the livestock van has LVST somehow somewhere
09:33:39 <andythenorth[d]> ah, no livestock van in tropic
09:34:05 <andythenorth[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1293506767715569747/image.png?ex=67079f8d&is=67064e0d&hm=29ff8105e99554ede36d7f15716736b8c5936876ca24e387966337df061aa07e&
09:34:05 <andythenorth[d]> unexpected 😛
09:35:26 <andythenorth[d]> are livestock express? 😛
09:35:36 <andythenorth[d]> seems express was always a silly cargo
09:36:42 <andythenorth[d]> `Josef Drexler> Refrigerated Goods is a good idea. I "invented" Express Freight with the Transrapid in mind, so it would include the types of freight you could imagine being transported by the Transrapid.`
09:40:53 <andythenorth[d]> we've all done it 😛
09:43:09 *** emperorjake has joined #openttd
09:43:09 <emperorjake> There are definitely places where people take their livestock on the passenger train to bring them to market
09:47:54 <andythenorth[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1293510241090015252/image.png?ex=6707a2c9&is=67065149&hm=054d18cda732362570a52cb8b6c7c19f1c0d5d38a2f0a99020a51e5bb8ddff75&
09:47:54 <andythenorth[d]> if this list also included a set of covered bulk cargos, would we mind?
09:48:14 <andythenorth[d]> sand, carbon black, quicklime, cement, potash, phosphate, soda ash
09:48:23 <andythenorth[d]> oh, some of those are there anyway
09:48:44 <peter1138> You can also exclude by label...
09:49:00 <andythenorth[d]> GPT tells me that 😛
09:49:42 <andythenorth[d]> I should have screenshotted the default goods van
09:50:16 <andythenorth[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1293510838182875166/image.png?ex=6707a358&is=670651d8&hm=04b6eb0509ee95a07a6106e150adc22e37c40d34f23bc10d9b3b31f11f0dd965&
09:50:16 <andythenorth[d]> there, that's my actual question 😄
09:51:42 <andythenorth[d]> pretty much everything can be piece
09:51:58 <peter1138> Basically we should never have gone above say 16 cargo types.
09:52:14 <peter1138> Refittable: Yes.
09:52:42 <andythenorth[d]> if pretty much everything can be piece
09:52:55 <andythenorth[d]> then most of the crappy 'modifier' classes, which ~nobody uses
09:53:00 <andythenorth[d]> can be changed
09:54:57 <_pruple> peter1138: who's "we"?
09:55:09 <peter1138> OpenTTD 🙂
09:55:51 <_pruple> the conversation of the last few days has certainly inspired me to nuke everything non-Sunshine from my CTT. 0x12 cargos, much more managable. 🙂
09:56:46 <_pruple> and fortunately, I have rather less than 997 wagons to reconfigure...
09:57:12 <peter1138> Any actual objects to CC_CLEAN/CC_DIRTY?
09:57:56 <peter1138> I'm not sure if andy objects or not.
10:00:16 <andythenorth[d]> I won't use them
10:00:33 <andythenorth[d]> as the current spec stands
10:00:50 <andythenorth[d]> (all classes spec, not clean vs dirty)
10:02:21 <_pruple> 🤷 and I'm going to use them regardless, they'll be sunshine spec even if they're unofficial.
10:04:01 <emperorjake> I'm not opposed to those new cargo classes, seems like they could make covered hoppers work better
10:04:33 <andythenorth[d]> there are no covered hoppers without labels 😛
10:04:36 <andythenorth[d]> can't be done
10:04:42 <andythenorth[d]> in the current spec
10:05:01 <peter1138> What I'm reading is "cargo classes can't perfectly match things so I'm going to throw it all away"
10:08:37 <reldred> baby out with the bathwater
10:18:20 <peter1138> Why do scrollbars have to fade away these days?
10:18:51 <reldred> because very little good has come from technology in the last twenty years
10:20:27 <ahyangyi> peter1138: Touchscreen logic, I guess
10:22:40 <peter1138> VS Code should never need that.
10:28:49 <LordAro> peter1138: chrome does though
10:34:34 <xarick> std::unique_ptr vs std::make_unique
10:36:19 <xarick> for the heck of me, i can't do this 🙂
10:37:05 <peter1138> There's no vs.
10:37:18 <peter1138> The first one is the type. The second one makes the first one.
10:42:46 <LordAro> for the heck of you indeed
10:44:41 <xarick> <https://gist.github.com/SamuXarick/1348a566b8f631f9182ae72cf3866b67>
10:45:18 <xarick> line 1, line 10 and line 25. Compiling then errors at line 25
10:45:36 <xarick> any ideas why I am dumb?
10:49:49 <xarick> function does not take 2 arguments?
10:49:56 <xarick> but then it doesn't take 1 either
10:51:10 <LordAro> use a vector
10:51:27 <peter1138> You are creating a unique_ptr to hold a unique_ptr? Seems illogical.
10:51:43 <LordAro> also that
10:57:13 <xarick> holy crap, that was it?
10:57:20 <xarick> line 1 was the problem
11:00:17 <xarick> nop, i think i failed yet
11:01:20 <peter1138> No doubt not THE problem, but one.
11:02:35 <xarick> .fill doesn't exist
11:02:55 <peter1138> std::fill(begin, end, value);
11:03:15 <peter1138> Because it's a unique_ptr[], you will need to provide the begin and end as well.
11:03:30 <peter1138> .fill only exists on std::array.
11:09:30 <xarick> begin and end doesn't exist 😛
11:11:02 <ahyangyi> pointers are iterators
11:11:21 <LordAro> std::begin & std::end exist though
11:11:50 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293531366876516394/image.png?ex=6707b676&is=670664f6&hm=229c93abb5b732fcce07f5ca1b8cf649b191488b97d44f2a6854278cc42beab0&
11:12:45 <xarick> it's telling me again that it's a std::unique_ptr for some reason
11:13:49 <LordAro> what were you expecting it to be/
11:13:51 <LordAro> ?
11:14:00 <_jgr_> You need to use `->begin()` here
11:15:35 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293532310238527549/image.png?ex=6707b757&is=670665d7&hm=45b846722e743e6754f83ace1659c213eb439ac5c7578e70a22ad4d94ea0a2e2&
11:15:35 <xarick> still not working 😦
11:15:53 <peter1138> Not with a unique_ptr<T[]>
11:16:30 <ahyangyi> `.get()` and `.get()+N` I guess
11:16:32 <LordAro> that error message isn't very useful, i'll give you
11:17:30 <peter1138> Using a unique_ptr array when you don't know what you're doing is, well...
11:17:37 <peter1138> There's a few foot-guns
11:18:12 <_jgr_> Ah, TWaterRegionPatchLabelArray has been changed...
11:18:22 <ahyangyi> Yeah, in 99% of the time `vector` does the same and better
11:19:02 <xarick> it built! something
11:19:09 <xarick> `std::fill(this->data.tile_patch_labels.get(), this->data.tile_patch_labels.get() + GetWaterRegionNumberOfTiles(), INVALID_WATER_REGION_PATCH);`
11:19:52 <peter1138> _jgr_: He's making the water region size variable. Nobody knows why.
11:20:20 <peter1138> (One size per game, at least, I hope...)
11:20:39 <_jgr_> I can see the logic in making it variable at compile time for benchmarking purposes
11:21:27 <xarick> alright, one more problem to solve and I think I'm done here
11:21:27 <peter1138> Yeah. it is by changing some defines 🙂
11:23:57 <kuhnovic> He wants to tell me I'm wrong for settling on 16x16 regions and 4 region lookahead
11:24:57 <xarick> yes! I am experimenting swaping between 8x8 with 6 lookaheads to 16x16 with 4 lookaheads
11:25:27 <xarick> swap on the fly
11:25:52 <kuhnovic> I agree with you that 8x8 or even 4x4 regions lead to very nice PF results. Until you run a 4K map that is.
11:26:46 <kuhnovic> Luckily you of all people know what it's like to run a 4K 70K ship map, so you'll quickly find out how much worse the performance of the PF gets when you do that 😛
11:28:45 <kuhnovic> And increasing the region lookahead beyond 4 doesn't improve path quality a whole lot, but the LL PF has to explore a LOT more nodes and becomes quite a bit slower.
11:29:14 *** leadnaut has joined #openttd
11:29:14 <leadnaut> how are you deciding when to swap? like swap to the smaller regions when you approach the destination?
11:29:40 <peter1138> No, it's not possible to be dynamic like that.
11:29:45 <leadnaut> fair okay
11:30:25 <peter1138> The only reason to make it dynamic is to test performance differences without recompiling, and... you are not then comparing the same thing.
11:30:41 <xarick> i am attempting to make it re-AllocateWaterRegions
11:31:26 <xarick> just need to be careful and not trigger an infinite loop
11:31:39 <xarick> re-re-re-re-Allocate
11:45:51 <peter1138> It's 1 o'clock and time for lunch, bom de bom de bom.
11:47:11 <LordAro> so it is
11:48:27 <andythenorth[d]> lunch?
11:51:57 <andythenorth[d]> I'll decide unilaterally eh
11:51:59 <andythenorth[d]> fishfingers
11:52:11 <andythenorth[d]> and brocolli?
11:52:43 <LordAro> no
11:53:01 <andythenorth[d]> AND NOT brocolli?
11:53:19 * andythenorth[d] is a bad person
11:56:08 <andythenorth[d]> fishfingers || brocolli || carrots
11:56:28 <andythenorth[d]> can't ||, discord makes it spoiler
11:56:28 <LordAro> kids refusing to eat their fruit & veg, huh?
11:56:39 <andythenorth[d]> brocoli is new to me
11:56:49 <andythenorth[d]> not eaten before 2023
11:57:02 <andythenorth[d]> brocolli denial
11:57:46 <LordAro> :o
11:59:11 <peter1138> Errr
12:03:21 <andythenorth[d]> well
12:07:28 <andythenorth[d]> fishfingers cooking
12:07:42 <andythenorth[d]> let's see what CC_REFRIGERATED is actually used for in base game
12:07:43 <peter1138> Fishfinger sandwiches?
12:07:54 <andythenorth[d]> fishfingers and healthy veg
12:09:01 <peter1138> Oh, no, not me, I'm a man of repute!
12:09:31 <andythenorth[d]> are fishfingers CC_REFRIGERATED?
12:16:52 <andythenorth[d]> ach I so nearly have a plan that doesn't involve changing much except some spec words
12:17:04 <andythenorth[d]> shame I'm not more clever
12:35:01 <andythenorth[d]> I can also report that the LLMs are not more clever
12:46:28 <peter1138> <https://www.reddit.com/r/cpp/comments/1fyce2n/named_loops_voted_into_c2y/>
12:46:29 <peter1138> Hmm
12:50:57 <truebrain> the "I don't like this syntax, so here is my even shittier suggestion" comments are most fun to read 🙂
12:51:19 <_jgr_> Seems like a good change to me
12:52:41 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:53:05 <peter1138> Macro-obsessives.
13:01:10 <kuhnovic> Has a bit of a goto-ish vibe
13:24:35 <peter1138> There's usually the option of breaking things up into smaller functions.
13:25:00 <peter1138> Or a bit of RAII if you're worried about the purity of 'Resource'.
13:26:18 <LordAro> or ranges
13:26:32 <LordAro> which is probably covered by both of those
13:58:41 <peter1138> Hmm.
13:59:23 <andythenorth[d]> what's CC_REFRIGERATED for? Not a trick question, and I know how to google 😛 i.e. what cargos should it be set for? 🙂
14:04:38 <talltyler> Cargos that need cooling provided by the wagon: meat, produce, dairy, etc.
14:04:38 <talltyler> Gases which are cold due to pressure do not qualify, since the wagon does not provide active cooling
14:05:02 <talltyler> In my opinion, anyway 🙂
14:05:10 <andythenorth[d]> so beer?
14:05:32 <peter1138> Beer doesn't _need_ cooling.
14:05:49 <peter1138> (Only shitty lager, tbh)
14:06:05 <_pruple> and even that, not during transport 🙂
14:06:27 <peter1138> What if you're drinking it while transporting it?
14:06:33 <andythenorth[d]> `mb> That sounds fine. You could, of course, classify "Mail" under "Express Freight," but that would probably go against the spirit of TTD. :) And "RefrigeratedGoods" could be its own category (Food, Beer, Fish, ...), or you could rename "Express Freight," because what else would that be? Just Valuables? If it's only "Goods," it would be hard to distinguish, as containers, for example, wouldn't be
14:06:33 <andythenorth[d]> Express Freight, but rather slow freight. Hmm.`
14:06:39 <andythenorth[d]> origin of refrigerated
14:06:47 <andythenorth[d]> could have just been 'food_grade'
14:08:16 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1293575766851850321/image.png?ex=6707dfd0&is=67068e50&hm=5afad9683bd4f52c08531c322a3f9ae87a8b154d3f70151668e67542e0110d8a&
14:08:16 <peter1138> That tracks.
14:08:56 <peter1138> (Although of course a cargo set from 2005 isn't going to work well with anything)
14:10:40 <andythenorth[d]> I've broken something 😛
14:10:49 <andythenorth[d]> base vehicles aren't refitting food
14:11:57 <peter1138> It's not impossible that I've broken something...
14:12:03 <_pruple> I think it might be the base vehicles are wonky
14:12:23 <_pruple> I just checked, and with sunshine industries the only vehicle that can refit food is the oil tanker, which can't be right...
14:12:32 <peter1138> Ah, no, newcargo.grf doesn't even set classes 😄
14:12:49 <peter1138> Too early even for that.
14:13:36 <andythenorth[d]> quirky, removing CC_REFRIGERATED causes food to become non-refittale with base vehicles
14:13:52 <andythenorth[d]> even though CC_EXPRESS is also set, and supported for other cargos
14:14:16 <andythenorth[d]> I'd need to remove and re-add to verify
14:14:17 <peter1138> Oh right, there's a NewGRF to add labels/classes to newcargo.grf
14:14:53 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1293577433450025031/image.png?ex=6707e15d&is=67068fdd&hm=1bc7ff7530908adaddb67af2d1725515d59536fd802bfa65d5d6e9d0772add13&
14:14:53 <peter1138> Magic.
14:14:56 <andythenorth[d]> anyway, I'm sure I'll find reasons this doesn't work
14:15:20 <andythenorth[d]> but CC_REFRIGERATED -> CC_FOOD_GRADE, send pitchforks
14:15:45 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1293577648756232284/image.png?ex=6707e190&is=67069010&hm=6357c0d3379ab8f52c3afa9f0b0d40d08dad2e02a7a5185a21cbdfdc8d1b0eea&
14:15:45 <peter1138> Ish?
14:15:45 <andythenorth[d]> refrigeration or not is a detail, and 'food van' or 'food hopper' or 'food tank' is a class
14:16:13 <peter1138> I think those classes need tweaking for beer 😄
14:16:52 <andythenorth[d]> what's the key, I haven't got dumpinfo open 😛
14:17:20 <_pruple> wonky minimum refittability of default vehicles?
14:17:28 <peter1138> express, piece, liquid.
14:17:46 <andythenorth[d]> so was refrigerated not set?
14:18:11 <peter1138> This is an unreleased test GRF I made while doing the default refit mask stuff, not available to anyone else 😉
14:18:20 <peter1138> Nobody actually cares about newcargo.grf
14:19:22 <_pruple> I don't care about newcargo.grf, but my FOOD is express, piece, liquid, refrigerated, covered, and the only default temperate rail wagon that can carry it is the oil tanker.
14:19:44 <_pruple> fortunately, I don't care much about the default vehicles either, I suppose... 🤷
14:19:46 *** nielsm has joined #openttd
14:21:15 <andythenorth[d]> hmm, can I set bits directly in nmlc cargo_classes? 😛
14:21:20 <andythenorth[d]> or do I have to use the constants
14:21:58 <peter1138> Yeah, the default stuff will exclude due to CC_LIQUID.
14:23:12 <peter1138> Maybe the default refit stuff needs to be looked at too.
14:23:54 <peter1138> default goods wagon excludes liquid.
14:24:14 <andythenorth[d]> "I have a proposal (nearly)"
14:25:25 <peter1138> (Or rather, default-anything-that-defaults-to-'GOOD')
14:25:55 <_pruple> the spec does suggest that liquid, bulk, and piece may be combined "to simulate multiple modes of transport", and should never be excluded...
14:26:16 <andythenorth[d]> extend to "nothing should ever be excluded" 😛
14:26:20 <andythenorth[d]> it's just not necessary
14:26:36 <andythenorth[d]> exclusion was one person's effort in TTDP to deal with not having anything like labels, in 2005
14:26:39 <andythenorth[d]> 19 years ago
14:26:42 <_pruple> exclusion should certainly be done sparingly
14:27:08 <andythenorth[d]> people make honest mistakes, we don't have to keep pretending they got it right
14:27:56 <_glx_> at least default vehicles can transport unknown cargo, even if it's not the best vehicle type
14:28:24 <andythenorth[d]> I've done the digging, and to abuse a quote "there is no fence" https://en.wikipedia.org/wiki/Wikipedia_talk:Chesterton%27s_fence
14:29:42 <xarick> my .reset isn't working
14:29:56 <xarick> this->data.tile_patch_labels.reset();
14:30:26 <_glx_> it doesn't delete the object pointed ?
14:30:45 <kuhnovic> I'm pretty sure it's working, and that you don't understand what reset does.
14:32:05 <xarick> it crahses openttd
14:32:50 <_glx_> https://en.cppreference.com/w/cpp/memory/unique_ptr/reset
14:33:09 <andythenorth[d]> we have this list, which I've been rude about, but right now it's quite useful https://newgrf-specs.tt-wiki.net/wiki/CargoTypes#Cargo_Labels
14:33:24 <andythenorth[d]> how many of those would *not* be valid for Piece Goods?
14:33:56 <_glx_> of course crash may happen if the code doesn't expect nullptr
14:34:27 <andythenorth[d]> (not valid with piece goods to ensure compatibility)
14:34:39 <_glx_> like anytime you work with pointers, you need to be careful
14:36:05 <andythenorth[d]> ok, not piece goods: pax, livestock, electricity, regearing
14:36:17 <andythenorth[d]> tourists
14:37:01 <xarick> ah, i think i fixed it, it was something stupid of me
14:37:07 <xarick> wrong size of array
14:39:23 <xarick> there are 3 allocation calls when starting openttd
14:39:27 <xarick> weird
14:41:49 <xarick> the first one is because _water_region_edge_length is not initialised, is 0, and it checks with the pathfinder settings which are also not initialized
14:42:45 <xarick> _water_region_edge_length becomes 16
14:44:05 <xarick> the second one it loads the main menu save game, it initialises, but the pathfinder settings are still not defined
14:44:18 <xarick> _water_region_edge_length still 16
14:44:57 <xarick> 3rd call, it's still loading the main menu... again=
14:45:23 <xarick> pathfinder values are now valid
14:45:32 <xarick> _water_region_edge_length becomes 8
14:46:03 <xarick> well, it's not an infinite loop!
14:47:07 <_pruple> https://cdn.discordapp.com/attachments/1008473233844097104/1293585541903945871/Unnamed_1st_Jan_19505.png?ex=6707e8ea&is=6706976a&hm=31a64e213a3f1a4e7599505efb55610edf3fa2684ca4501e45bd958f16121c5c&
14:47:07 <_pruple> refitting using classes (and only classes) seems to work pretty well for me
14:49:02 <xarick> let's try the on-the-fly reallocation
14:49:08 <xarick> moment of truth
14:51:35 <xarick> it works!
14:53:47 <xarick> I can't watch the contents of the array though
14:53:53 <xarick> lame
14:56:18 <xarick> bad performance though
14:56:38 <xarick> either 16 or 8
14:57:28 <xarick> something's failing, ships lost
14:58:25 <kuhnovic> Are you resetting the vector that keeps track of whether the regions are invalidated?
14:59:00 <kuhnovic> And by resetting I mean filling it with "false" to indicate they are all invalid after a change in region size
15:00:57 <andythenorth[d]> _pruple: Try a mineral covhop for sand and not coal 😛
15:02:08 <_pruple> andythenorth[d]: Why?
15:02:56 <andythenorth[d]> “Why not?”
15:11:12 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293591603226738839/image.png?ex=6707ee8f&is=67069d0f&hm=93dbf5289b852dc8261371ea8bbf0301e3f4d65a2686b6f23171a9332bcdea23&
15:11:12 <xarick> something feels off here
15:11:20 <xarick> where is my array
15:18:56 <andythenorth[d]> in another world, there'd be a class that can be set in train prop 0x28
15:19:09 <andythenorth[d]> 'any cargo that is not refittable elsewhere'
15:19:23 <andythenorth[d]> I guess it doesn't work across vehicle intro dates
15:20:57 *** HerzogDeXtEr has joined #openttd
15:21:51 <andythenorth[d]> hmm autogenerated ctt with all possible 4 char labels? 😛
15:22:02 <andythenorth[d]> might exceed the property size
15:35:34 <peter1138> xarick: It's a pointer...
15:38:08 <peter1138> Hmm, what's special about Blitter_32bppSSE4_Anim that it needs a cast?
15:38:08 <peter1138> ```c++
15:38:08 <peter1138> Blitter *CreateInstance() override { return static_cast<Blitter_32bppSSE2_Anim *>(new Blitter_32bppSSE4_Anim()); }
15:41:28 <andythenorth[d]> oh 2011 cargo classes wiki edit war 😛
15:41:30 <andythenorth[d]> I see
15:42:35 <andythenorth[d]> was trying to find origins of oversized and hazardous
15:42:42 <andythenorth[d]> they predate the wiki move
15:42:50 <andythenorth[d]> diffs not in history
15:45:20 <peter1138> <https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem>
15:48:11 <andythenorth[d]> diamonds are CC_ARMOURED
15:52:33 <andythenorth[d]> pff all I can find in forums is that `oversized` offended everybody, grf devs and openttd devs
15:52:36 <xarick> my array is a char?
15:52:43 <andythenorth[d]> and nobody references who added it or why
15:53:15 <andythenorth[d]> at some point it was also 'overweight' but that was arbitrarily removed from the spec
15:54:00 <andythenorth[d]> did I do it?
15:56:19 <andythenorth[d]> yeah the spec got quite adjusted, this one is closer to what some people originally intended http://www.ttdpatch.de/grfspecs/nfogrfTechRef.html
15:57:28 <peter1138> Wiki or not?
15:57:35 <andythenorth[d]> indeed
15:58:04 <andythenorth[d]> the history of edit wars has not aided cargo classes
15:58:52 <peter1138> I was wondering what to do about badges...
15:59:09 <andythenorth[d]> ship them
15:59:13 <andythenorth[d]> with bells on
15:59:31 <peter1138> Given there is limited spaces (`2^8` classes and `2^24` badges in each class)
16:00:44 <peter1138> Unless I forgo the normal convention and just use std::string everywhere...
16:01:01 <andythenorth[d]> wonder if nml will take a raw bitmask in the form `bitmask(0, 3, 10)` or if it wants `bitmask(0x00, 0x03, 0x0A)`
16:01:06 <peter1138> (Would be pretty hard to do varact2 tests though.)
16:01:29 <peter1138> forego, even.
16:01:34 <andythenorth[d]> fourgo
16:01:40 <andythenorth[d]> fourgon
16:02:40 <andythenorth[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1293604556458168371/1280px-Fourgon_OCEM_39820_Thiviers_juillet_2015.png?ex=6707faa0&is=6706a920&hm=d587e60a470786a87d2911e6dfc27b0ddce7318f2f54434f94399737d2251f43&
16:02:40 <andythenorth[d]> CC_PIECE_GOODS, CC_EXPRESS
16:02:46 <andythenorth[d]> I'll gt my coat
16:03:23 <andythenorth[d]> that's a terrifying potential number of badges
16:03:36 <andythenorth[d]> even if I autogenerate them
16:05:00 <peter1138> Yes, but people will want to use ascii letters/numbers, bringing it down to 36 and 36^3.
16:05:19 <andythenorth[d]> ah yes
16:05:44 <andythenorth[d]> ℹ️ 🇷 0️⃣ 🇳 🐴
16:05:56 <andythenorth[d]> only that's extended unicode or something
16:06:32 <_glx_> andythenorth[d]: both are the same thing
16:06:51 <andythenorth[d]> I could just yolo class changes, except for NMLC
16:07:19 <andythenorth[d]> define my own 'standard' 😛
16:10:43 <andythenorth[d]> _glx_: thanks 🙂
16:11:35 <_glx_> hexadecimal or decimal are a human thing, software doesn't care
16:12:26 <_glx_> you can even write `bitmask(0x00, 0x03, 10)`
16:20:44 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293609103893069955/image.png?ex=6707fedc&is=6706ad5c&hm=d678c2a4fd8f424a49da041f60003f13eb0ed84e644cd8f44058373b8896c0ea&
16:20:44 <xarick> is it working?
16:33:17 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293612262249992253/image.png?ex=670801cd&is=6706b04d&hm=5e03fcb3ce341e7b312264928246e3479f3bd07bd6353d8c6fb7fa3166925896&
16:33:17 <xarick> yeah, it works imo
16:33:45 <xarick> but something is broken at some point
16:34:54 <peter1138> If you make regions 1x1 does that improve it?
16:37:38 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293613357605322752/image.png?ex=670802d2&is=6706b152&hm=fc03399d31e672f4018094c261d3bd9ab93118fec22535c91007f4775899cb1e&
16:37:38 <xarick> and now the ship is lost for ... reasons I don't know yet
16:43:25 <peter1138> Definitely working.
16:45:02 <xarick> ah, I think i got it
16:45:10 <xarick> it's "number_of_water_regions_lookahead + 1"
16:45:20 <xarick> the pesky +1 was missing
16:46:50 <xarick> yep, that was it, problem solved
16:52:00 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293616970524131381/image.png?ex=67080630&is=6706b4b0&hm=87f9a759fe66be4cf36a978f2099bc9ef03d45095a50400a7f4fdafc6b8ba801&
16:52:00 <xarick> it werked
16:52:40 *** Artea has quit IRC ()
16:52:40 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293617137482727536/image.png?ex=67080657&is=6706b4d7&hm=4507b12a3a01740e107d2cadd2a3486ce1537f0f3ef46118083b451606dd63aa&
16:52:46 <xarick> alright, enough screenshots
16:56:09 <kuhnovic> xarick: Before you start doing any performance comparison and jump to conclusions: BUILD THE THING IN RELEASE
17:05:22 *** debdog has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
17:09:09 <peter1138> 😄
17:11:19 *** debdog has joined #openttd
17:11:57 *** debdog has quit IRC ()
17:23:45 <xarick> PrintDebugInfo needs fixing
17:25:03 <xarick> std::array<int, 16> traversability_NW{0}; dang.... arrays again
17:27:00 <xarick> cannot call non constexpr blabla
17:29:04 *** gelignite has joined #openttd
17:40:23 <kuhnovic> Or you just comment out that part. The labeling process works the same regardless of what the region size is.
17:41:49 <kuhnovic> So not much need to inspect the regions. _And it won't work in release anyway... _
17:49:51 <xarick> it's writing many zeros
17:55:20 <xarick> " +{:->{}}+" morse code
18:20:37 *** Wolf01 has joined #openttd
18:31:48 *** D-HUND is now known as debdog
18:47:15 <andythenorth[d]> imagine
18:47:24 <andythenorth[d]> if base vehicles were less climate limited
18:47:29 <andythenorth[d]> oh wait, ogfx + trains 😛
18:48:14 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293646221340053504/image.png?ex=6708216d&is=6706cfed&hm=de3e4662fa1bdefd456012268c918c589d84890161f7201a4677af9cc06664e8&
18:48:14 <xarick> those 1's are misplaced
18:49:26 <andythenorth[d]> I see nothing here that would prevent me redefining what CC_REFRIGERATED might mean? https://github.com/OpenTTD/OpenTTD/blob/master/src/table/cargo_const.h#L52
18:49:38 <andythenorth[d]> I'm only interested in default base game, not what grfs I might 'break'
18:49:52 <peter1138> Uh oh. <https://www.reddit.com/r/openttd/comments/1fzynof/what_going_wrong_here/>
18:50:06 <andythenorth[d]> I like that
19:10:57 <xarick> fmt::join doesn't like my idea of std::unique_ptr<int[]> traversability_NW = std::make_unique<int[]>(CurrentWaterRegionEdgeLength());
19:16:41 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293653383374180522/image.png?ex=67082819&is=6706d699&hm=69e98eb63261d2f4306a52fe2ef105fc6ac5dcad97c7c4ae9455b33ab17352c4&
19:16:41 <xarick> I can't english this
19:19:38 <xarick> 'fmt::v10::join': no matching overloaded function found
19:30:28 <DorpsGek> [OpenTTD/OpenTTD] JGRennison opened pull request #12985: Codefix: Incorrect documentation comments in StringBuilder https://github.com/OpenTTD/OpenTTD/pull/12985
19:31:41 <andythenorth[d]> so cargo badges when?
19:31:47 <andythenorth[d]> and vehicles have badges
19:31:50 <andythenorth[d]> and cargos have badges
19:31:58 <andythenorth[d]> and if the badges match...the vehicle can carry the cargo
19:32:05 <andythenorth[d]> "so simples"
19:33:13 <dwfreed> xarick: pretty sure you need to deref the unique_ptr
19:33:15 <peter1138> Heh, left-overs from C-style strings...
19:33:25 <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #12985: Codefix: Incorrect documentation comments in StringBuilder https://github.com/OpenTTD/OpenTTD/pull/12985#pullrequestreview-2358149759
19:39:19 *** test123_ has joined #openttd
19:40:44 *** test123_ has quit IRC (Remote host closed the connection)
19:53:09 *** gelignite has quit IRC (Quit: Stay safe!)
20:03:13 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:09:37 <xarick> trying to learn what std::visit works
20:09:38 <andythenorth[d]> CC_CAT
20:09:41 <andythenorth[d]> for cats
20:10:10 <_glx_> std::join works with arrays
20:10:27 <_glx_> or containers
20:10:50 <_glx_> unique_ptr is neither
20:11:58 <_glx_> maybe try with traversability_NW.get()
20:12:42 <_glx_> but I'm not sure C-style array will work
20:13:27 <_glx_> using a vector would have been way easier
20:13:32 <andythenorth[d]> ok so...I have pissed around fitting classes into the available 11 bits, mostly trying to preserve the meaning of classes that are actually used
20:13:36 <andythenorth[d]> but it's a bit weird
20:13:52 <andythenorth[d]> it's better than the current classes, but it's weird
20:14:30 <xarick> i need rbegin
20:17:30 <xarick> oh, it can use rbegin
20:17:41 <xarick> well, i need... something, forgot what
20:20:19 <_glx_> usually when you want an array with dynamic size, it's simpler to switch to vector
20:21:14 <andythenorth[d]> so can I just have my own cargo class namespace? 😛
20:24:43 <_jgr_> _glx_: Allowing each water region to have its own separate size field seems like it'd open up a whole new exciting set of bugs 😛
20:26:59 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293671075611279391/image.png?ex=67083893&is=6706e713&hm=7b176c3bc662e20df91fa684e2f8de4625332b5c45e1cedd4b0b022ba85241e1&
20:26:59 <xarick> almost
20:27:18 <xarick> that 1 0 0 0 0 0 0 0 should be 0 0 0 0 0 0 0 1
20:28:14 <xarick> fmt::join doesn't do it on reverse?
20:35:57 <xarick> std::reverse exists
20:38:38 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293674007144693820/image.png?ex=67083b4e&is=6706e9ce&hm=7022c0281ff238153a7fc4fa97239f68b28142b952332adcdd5b8e52537cb838&
20:38:39 <xarick> success!!
20:41:36 <xarick> ``` std::vector<int> traversability_NW(CurrentWaterRegionEdgeLength(), 0);
20:41:36 <xarick> for (auto bitIndex : SetBitIterator(this->data.edge_traversability_bits[DIAGDIR_NW])) traversability_NW[bitIndex] = 1;
20:41:36 <xarick> std::reverse(traversability_NW.begin(), traversability_NW.end());
20:41:36 <xarick> Debug(map, 9, " {:{}}", fmt::join(traversability_NW, " "), max_element_width);
20:41:36 <xarick> no more angry fmt
20:48:10 <andythenorth[d]> have you tried Copilot? 😛
20:49:01 <xarick> yes, it kinda points me to the right way
20:49:24 <xarick> but still fails to provide good code
20:50:26 <xarick> CalculateWaterRegionPatchHash, wondering if it needs fixing...
21:01:35 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1293679779349925908/image.png?ex=670840ae&is=6706ef2e&hm=a4a52af0818548fee351e735e46d8c8e16e5dd8e42186b5e9869a7e608f383d8&
21:03:09 <xarick> GetWaterRegionIndex returned 262143
21:03:45 <xarick> 1 | 262143 << 8 = ?
21:05:24 <xarick> ‡ CalculateWaterRegionPatchHash returned 67108609 int
21:05:42 <xarick> fits in an int
21:07:14 <xarick> wondering if I change that << 8
21:07:48 *** Flygon has joined #openttd
21:11:57 <andythenorth[d]> pff 11 bits, I would like more
21:12:01 <andythenorth[d]> pls send me bits
21:12:04 <andythenorth[d]> 1 at a time
21:13:12 <xarick> `return water_region_patch.label | GetWaterRegionIndex(water_region_patch) << FindFirstBit<uint8_t>(CurrentWaterRegionNumberOfTiles());`
21:13:19 <xarick> much prettier 🙂
21:18:27 <xarick> ‡ CalculateWaterRegionPatchHash returned 16777153 int
21:19:03 <xarick> it made a << 6
21:22:10 <xarick> back to the original 256 number of tiles, we get
21:22:23 <xarick> + water_region_patch {x=255 y=255 label=1 '\x1' } const WaterRegionPatchDesc &
21:22:49 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:23:02 <xarick> oh crap, can't use uint8_t, needs to be larger
21:23:43 <andythenorth[d]> send me your extra bits that don't fit, I can use them
21:26:41 <xarick> ‡ CalculateWaterRegionPatchHash returned 16776961 int
21:26:54 <xarick> very interesting
21:28:26 <xarick> almost feels like something is not right
21:32:54 <xarick> nop, seems correct
21:32:59 <xarick> verified
21:33:09 <xarick> well, I'm off to bed, good night
21:39:27 <andythenorth[d]> naptime
21:57:59 <andythenorth[d]> hmm. think I've done a thing
22:04:04 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:32:25 <andythenorth[d]> cargo class redefinitions
22:32:25 <andythenorth[d]> - keeping all the ones required by OpenTTD dependencies
22:32:25 <andythenorth[d]> - keeping the commonly used ones
22:32:25 <andythenorth[d]> - redefining or replacing the uncommon or almost-never-used ones
22:32:25 <andythenorth[d]> - rewrite the "rules" in the "spec" which isn't what it was supposed to be, had some edit wars, and diverges between nfo and nml versions
22:32:27 <andythenorth[d]> Pitchfork count: 5
22:32:27 <andythenorth[d]> Flaming torch count: 1
22:32:29 <andythenorth[d]> Extra bits required: none
22:32:29 <andythenorth[d]> Difficulties: nmlc constants patch, which might be controversial
22:32:31 <andythenorth[d]> Regrets: some predicted
22:33:32 <andythenorth[d]> Nap: wanted
22:33:57 <reldred> I just got up and I want a nap
23:32:32 *** D-HUND has joined #openttd
23:35:41 <peter1138> I decided it was an idea to watch Threads.
23:36:06 <_pruple> such ideas
23:46:51 <reldred> I need to start planning re_fabs3
23:47:28 <reldred> I can't believe this project has going onto it's third iteration before even being publicly released 💀
23:47:50 <reldred> i need to do a better job of planning out ID usage and class ID's