IRC logs for #openttd on OFTC at 2023-12-08
            
00:29:24 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #11561: Fix: Disable airport noise if local authority control is disabled. https://github.com/OpenTTD/OpenTTD/pull/11561#issuecomment-1846314056
01:24:29 *** misterbungus0 has joined #openttd
01:27:18 *** misterbungus has quit IRC (Ping timeout: 480 seconds)
01:27:18 *** misterbungus0 is now known as misterbungus
03:10:37 *** misterbungus has quit IRC (Ping timeout: 480 seconds)
03:42:31 *** Wormnest has quit IRC (Quit: Leaving)
04:00:17 *** debdog has joined #openttd
04:03:44 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
04:40:33 *** keikoz has joined #openttd
05:26:56 *** Flygon has joined #openttd
05:59:10 *** D-HUND has joined #openttd
06:30:08 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
06:31:52 *** Smedles has joined #openttd
07:30:00 *** tokai has joined #openttd
07:30:01 *** ChanServ sets mode: +v tokai
07:36:41 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
07:37:24 *** Wolf01 has joined #openttd
10:33:42 <xarick> KDTree for airport noise?
10:37:12 *** Compu has joined #openttd
10:41:56 <xarick> I had a weird idea... towns that are classified as Cities should have a higher noise tolerance
10:58:46 <xarick> locosage: Can you ask that user for the savegame? I've been trying to find a way to trigger that bug, but got nowhere yet.
11:12:16 <xarick> found something that looks like a bug to me, but I'm not familiar with NewGRF code... must ask
11:13:21 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_town.cpp#L49 this is a uint16
11:14:10 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/town.h#L42 this is a uint32
11:14:32 <xarick> aren't they referring to the same 'population' ?
11:15:47 <Eddi|zuHause> that's not a bug, that's just legacy behaviour.
11:16:26 <xarick> ok
11:17:23 <Eddi|zuHause> NewGRFs won't be able to distinguish sizes of really large towns. it'll be capped at 64k
11:17:54 <Eddi|zuHause> but you cannot simply extend that range without breaking old NewGRFs
11:18:22 <Eddi|zuHause> so clamping to the uint16 range is much safer
11:20:34 <Eddi|zuHause> if you have a use case for a NewGRF that needs to know about large town sizes, you can propose adding a new variable that takes a full DWORD
11:21:38 <xarick> just trying to find where the noise tolerance goes wrong...
11:22:32 <xarick> the limit is based on town population
11:22:46 <xarick> so, i thought that piece of code strange
11:22:51 <Eddi|zuHause> probably not in the newgrf code...
11:27:23 <peter1138> Most likely is AirportGetNearestTown() returning a different town for some reason.
11:28:56 <Eddi|zuHause> i haven't ever looked at that code, but maybe it broke with airport rotation?
11:31:36 <peter1138> https://github.com/OpenTTD/OpenTTD/pull/7424 < might be that.
11:33:19 <xarick> when placing a new town, it doesn't take into consideration whether there's a noisy airport around
11:33:24 <peter1138> _kd_tree is not stable, it is not impossible (although unlikely) for that function to return a different town.
11:33:57 <peter1138> Or simply that, yes. If you place a town in game, the nearest town might change.
11:34:12 <peter1138> I'd forgotten that founding towns is a thing.
11:34:37 <xarick> i tested it, and it works fine enough
11:34:47 <LordAro> i'm curious why #7424 was necessary in the first place
11:34:50 <peter1138> Did you test all possibilities.
11:35:00 *** APTX_ has joined #openttd
11:35:04 <LordAro> surely the existing calculation can't have been a bottleneck
11:35:14 <xarick> the old town that had the noise gets the limit adjusted and the newly placed town gets the new noise
11:35:37 <xarick> even when it surpasses the new town's limit, it just accepts the noise
11:36:04 <peter1138> That is handled? Surprising.
11:36:25 *** APTX has quit IRC (Ping timeout: 480 seconds)
11:36:36 <peter1138> Ah, of course, when a town is creating UpdateAirportsNoise() is called.
11:37:19 <xarick> 7424 was for.... if I recall, lowering cpu usage during AI testing placing airports
11:37:36 <xarick> testing all possible locations
11:40:42 <peter1138> This is why you should always follow the PR template, and include a motivation.
11:42:05 <xarick> there was no template in 2019
11:44:03 <peter1138> Excuses. But including a motivation was still possible.
11:46:02 <peter1138> I'm not sure why airport noise can't just use station->town.
11:46:25 <xarick> there can be an issue if the layout is very weirdly shapped
11:46:36 <peter1138> You mean large?
11:47:15 <xarick> no, i mean, not a rectangle, like a circle, since it doesn't iterate all the inner tiles, just the perimeter ones
11:47:17 <peter1138> I suppose the airport could be near a small town but the sign could be near a large town.
11:48:12 <xarick> i asked about that, and there was only the opengfx++ thing with that special corner not being part of the layout
11:48:34 <peter1138> How slow is UpdateAirportsNoise()?
11:48:51 <xarick> didn't test that
11:49:16 <peter1138> Instead of changing the noise_reached with += and -=, it could call UpdateAirportsNoise() instead.
11:50:01 <peter1138> But that seems like it might be hiding the underlying issue.
11:50:11 <peter1138> If this is even on the right track :)
11:50:35 <xarick> let me post a screenshot aobut 7424
11:50:43 <peter1138> I'm not fussed about 7424.
11:51:08 <Eddi|zuHause> station->town could be a bus stop or train station way outside the actual airport
11:51:40 <Eddi|zuHause> also, even if just placing an airport, it is highly asymmetric
11:54:07 <xarick> gonna need a savegame with thousands of airports to test UpdateAirportsNoise()
11:54:44 <xarick> I think AdmiralAI is a good candidate
11:56:17 <Eddi|zuHause> probably more helpful to build a custom AI that places and removes random airports?
11:58:09 <xarick> just wondering uint8_t GetAirportNoiseLevelForDistance, this is a uint8
11:58:38 <xarick> noise_reduction = distance / town_tolerance_distance;, this distance is uint(32)
11:58:38 <peter1138> https://www.reddit.com/r/openttd/comments/18cyt9c/noise_limit_yes/
11:58:46 <peter1138> ^ you can ask any questions of the OP there :)
11:59:02 <xarick> maybe the overflow happens during the return?
12:00:29 <xarick> 8192 / 8 =
12:01:09 <Eddi|zuHause> such a hypothesis is best tested with an assert
12:02:16 <xarick> ah, seems fine
12:02:20 <xarick> nvm
12:02:50 <xarick> as->noise_leve is a byte
12:02:56 <xarick> max value 255
12:04:02 <xarick> return 1024 > 255 ? 1 : 255 - 1024; it will return 1
12:04:57 <peter1138> step 1) before reducing t->reached_noise, assert(t->reached_noise >= noise_level);
12:05:25 <peter1138> That way you can catch when it happens.
12:05:44 <peter1138> noise_reached even :)
12:07:03 <peter1138> (Although if there are muliple airports near a town you might not catch the culprit)
12:12:42 <xarick> got an old savegame of AdmiralAI from 1.6.1, it built 1279 airports
12:14:14 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1182656383162781706/image.png?ex=65857d96&is=65730896&hm=cfee4a77b6216a40cb2dbb507016ae221f624d9a588fef2ebd647941ea1117a4&
12:14:14 <xarick> 49 ms in debug mode
12:15:52 <xarick> let me confirm airport noise is enabled
12:16:26 <xarick> yes, it is
12:16:41 <xarick> authority is Lenient
12:22:33 <xarick> Chopper has 1647 airports, but they're all heliports, small in size, less tiles to iterate over
12:22:40 <xarick> 29 ms
12:24:24 *** jinks has quit IRC (Quit: ZNC - http://znc.in)
12:24:43 *** jinks has joined #openttd
12:26:01 <xarick> I don't have a reddit account
12:29:01 <peter1138> Sensible.
12:33:47 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1182661303500800070/Bufingpool_Transport_2050-05-15.png?ex=6585822b&is=65730d2b&hm=8846548687e3790bc542e5fce8f8c90729ca5f1b992d90190eae405aec17b136&
12:33:47 <xarick> Airport name belongs to the town on the left, but the noise was added to the big town to the right :p
12:33:57 <xarick> the one at the center of the screen
12:38:28 <peter1138> Yes, that should be expected.
12:51:59 <peter1138[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1182665882053386291/GA03K1vWAAAw1xY.png?ex=6585866f&is=6573116f&hm=a0586cd40d0d8f5492f95cd527b5106d3a4165aa5397a8427e5216626b94f336&
12:51:59 <peter1138[d]> https://twitter.com/SgbAlt/status/1733102783413235973
12:52:19 <peter1138[d]> andythenorth: does it fit into your RV set?
12:53:17 <_glx_> Could go with the orange shaped mini
12:58:42 *** nielsm has joined #openttd
13:09:35 <andythenorth> yes
13:10:21 *** georgevb has joined #openttd
13:10:21 <georgevb> Some question about crash log
13:10:21 <georgevb> > "crash": {
13:10:21 <georgevb> > "reason": "Assertion failed at line 1590 of D:\\a\\OpenTTD\\OpenTTD\\src\\economy.cpp: v->cargo_cap >= v-cargo.RemainingCount()"
13:10:21 <georgevb> It would be nice to somehow identify, which vehicle caused crash (train number)
13:10:21 <georgevb> Is it possible?
13:11:02 <xarick> you have v
13:11:08 <LordAro> not really no
13:11:17 <LordAro> asserts aren't really designed to give additional information
13:11:37 <LordAro> the fact that you can get to that point suggests a bug though
13:12:20 <georgevb> The game informs that loading save with new grfs can cause crash.
13:12:53 <LordAro> well, yes, but even then...
13:12:56 <LordAro> wait hang on
13:13:04 <LordAro> is "v-cargo" accurate?
13:13:15 <LordAro> as in, "v-cargo" rather than "v->cargo" ?
13:14:17 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/economy.cpp#L1590
13:14:30 <LordAro> guess not
13:14:39 <LordAro> because that would have been very wrong :D
13:16:42 <peter1138> Presumably this is "newgrf changed" or bad callback behaviour.
13:17:01 <georgevb> It is "newgrf changed"
13:17:56 <georgevb> The problem is that there is no button "rebuild all trains that can cause crash"
13:24:14 <xarick> https://www.reddit.com/r/openttd/comments/18cyt9c/comment/kchtywq/ he replied to someone, may that someone plz ask him for the savegame 😮
13:24:56 <xarick> the mention of OpenGFX+ Airports.... seems scary
13:27:02 <peter1138> LordAro, I guess we could check that v->cargo_cap > v->cargo.RemainingCount() during AfterLoadGame(). And then either abort loading to be pedantic, or remove surplus cargo to be graceful.
13:27:29 <peter1138> I know it's "not supported" but also not hard crashing is nice.
13:27:35 <LordAro> indeed
13:27:56 <LordAro> and would allow giving a nice error message that included the vehicle number :)
13:28:05 <peter1138> There's plenty of other asserts to cause issues as well, and difficult to catch them all, but as they say, perfection is the enemy of ... something.
13:31:03 *** Farrokh[m] has quit IRC (Quit: Client limit exceeded: 20000)
13:33:55 <truebrain> pffff, hardening our saveload routines, to be more detailed in what goes wrong? pffff 😛
13:34:29 <peter1138> I'm a fan of just aborting with no extra info ;)
13:36:32 <peter1138> 8 months ago since I added my last abort-saveload change.
13:36:43 <peter1138> #10622
13:52:44 *** nielsm has quit IRC (Ping timeout: 480 seconds)
14:03:05 <andythenorth> xarick: nah it's a FIRS problem again, read the report
14:03:09 <andythenorth> FIRS now breaks airports
14:07:01 <LordAro> andythenorth: did you forget to take out your "if (airport) break_it;" statement?
14:07:09 <andythenorth> yup
14:07:59 <peter1138> There's a report?
14:10:36 <georgevb> peter1138: You mean about a crash?
14:10:49 <peter1138> No.
14:19:28 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick opened pull request #11562: Fix f92cf38: Reduce graduation of town noise tolerance distance multiplier for permissive towns https://github.com/OpenTTD/OpenTTD/pull/11562
14:23:50 <peter1138> Kinda irrelevant with #11561
14:30:58 *** Flygon has quit IRC (Remote host closed the connection)
14:31:48 <DorpsGek> [OpenTTD/OpenTTD] zephyris commented on issue #11509: [Bug]: The window restore down button does not change window size when launched maximised https://github.com/OpenTTD/OpenTTD/issues/11509
14:32:02 *** Flygon has joined #openttd
14:34:27 <peter1138> Hmm, do I fix this code or just delete it...
14:42:47 <LordAro> i vote delete it
14:44:50 <andythenorth> peter1138: There's a reddit thread, same thing?
14:46:18 <peter1138> Code that was written 4 years ago before product go-live, stores its settings in a json-serialized string, and... has never been used. Yeah. Delete :)
14:47:03 <LordAro> oh, code that was never used is my favourite
14:47:09 <LordAro> even better than code that was once used
14:50:03 <peter1138> It's "we need to offer this feature" and then... nobody taking it up.
14:50:14 <LordAro> ah yes, we're good at those too
14:50:26 <LordAro> tools are a complete mess because of it
14:50:44 <LordAro> like our licencing tool somehow pulls in our database library
14:50:49 <LordAro> it does nothing with databases
14:51:20 <andythenorth> all of our (not that many) spaghetti features fit that pattern
14:51:28 <andythenorth> - made because there was a need insisted upon
14:51:34 <peter1138> Variants eh?
14:51:35 <andythenorth> - barely or never used
14:51:42 <andythenorth> I mean at work, but ok 🙂
14:51:47 <peter1138> And that league thing.
14:51:55 <LordAro> lol
14:51:57 <peter1138> Nobody has used it. I've no idea if it works.
14:52:47 <andythenorth> at work, we got quite good at auditing the fleet (or content in the fleet) to see what's actually being used
14:52:58 <andythenorth> and sometimes we are able to delete a thing on that basis
14:54:02 <peter1138> I know this is not used because the user-interface was never finished, so requires confusing via entering json. And it could only have been me doing that as nobody else would have a clue.
14:54:13 <peter1138> er, word order.
14:55:30 <andythenorth> JSON for variants though
14:56:06 <peter1138> Pre-load audio samples into memory?
14:56:14 <andythenorth> via JSON
14:56:49 <peter1138> mp3codec?
14:57:22 <peter1138> If audio samples are preloaded then making MP3 work is a bit more feasible... Hmm.
14:57:48 <peter1138> And the patents expired now. Or as fraunhoffer tried to claim "mp3 is retired"
14:58:57 <peter1138> They said something along the lines of "You can't license it anymore", trying to scare people into moving onto one of their new products.
14:59:14 <peter1138> Reality is... there's no need to licence it anymore.
14:59:38 <peter1138> We could do the opensource thing and only support Ogg Vorbis, lol.
15:01:15 <truebrain> or just remove audio support
15:01:17 <truebrain> who uses it anyway 😛
15:06:10 <Eddi|zuHause> are you turning into andythenorth?
15:07:12 <LordAro> we can only hope
15:09:10 <andythenorth> hope for, or hope not?
15:28:21 <Eddi|zuHause> you are our last hope, obibrain?
15:48:54 <xarick> I wish I could inject a GS onto a running game
15:49:39 <xarick> it would be so useful for debugging
15:50:08 <DorpsGek> [OpenTTD/OpenTTD] hervesimard opened issue #11563: [Bug]: multplyayer desync https://github.com/OpenTTD/OpenTTD/issues/11563
15:52:23 *** Wormnest has joined #openttd
15:53:55 <LordAro> :o Arch moving off their flyspray instance
15:58:47 <andythenorth> Hell froze over?
16:16:06 <xarick> I think I found the issue
16:16:17 <xarick> (maybe)
16:18:06 <xarick> https://github.com/OpenTTD/OpenTTD/blob/3317e29847624b6f377fc4405161aed04e419f9e/src/town.h#L117-L122
16:19:01 <xarick> the returned value is transformed into a uint16, but town population can be as big as uint32 max, and town_noise_population can be as low as 100
16:19:25 <xarick> return uint32 max / 100 + 3
16:21:28 <xarick> however, the screenshot is a town of only 1500 population, there must be something else
16:27:38 <xarick> how is the noise limit in town calculated
16:30:44 <xarick> this would only affect the 2nd part in the town window, the "max"
16:30:47 <xarick> not the first
16:35:44 <xarick> Could it be RemoveAirport the culprit? The order in which it does the stuff is suspicious. Seems it can fail to remove after already being done with the nearest->noise_reached
16:35:55 <Eddi|zuHause> so you didn't find the issue. you "just" found a smelly piece of code...
16:37:14 <peter1138> I bet he still hasn't put any asserts in to trap it happening.
16:37:46 <Eddi|zuHause> well...
16:39:41 <LordAro> there's a certain neatness to just being able to look at the code and reason about it
16:39:51 <LordAro> but not when it takes you 10 times as long
16:39:54 <peter1138> There is... if you actually understand it :-)
16:43:24 <andythenorth> was it cat?
16:43:51 <truebrain> A desync in vanilla?! Those are rare 😄
16:45:18 *** HerzogDeXtEr has joined #openttd
17:05:25 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
17:11:16 <peter1138> dbg: [grf] Failed to load sound '"Unused/Nothing". Trivial empty sound file. License: Creative Commons Zero 1.0.' from opensfx-1.0.3/opensfx.cat for slot 34
17:11:27 <peter1138> A (deliberately) missing sound...
17:13:32 <Eddi|zuHause> if a sound file falls in the woods...
17:26:52 <DorpsGek> [OpenTTD/OpenTTD] merni-ns commented on pull request #11562: Fix f92cf38: Reduce graduation of town noise tolerance distance multiplier for permissive towns https://github.com/OpenTTD/OpenTTD/pull/11562#issuecomment-1847561967
17:37:38 <xarick> Persistent storage for NewGRF airports. what is this thing?
17:41:56 <peter1138> It is storage that is persistent.
17:42:05 <andythenorth> in airports
17:42:20 <LordAro> as defined by NewGRFs
17:42:54 <LordAro> good job team
17:44:57 *** gelignite has joined #openttd
17:48:22 <peter1138> Hmm.
17:48:30 <peter1138> Yes, definitely broken NewGRF sounds :D
17:49:20 <peter1138> andythenorth, any of your NewGRFs have sounds in them?
17:50:46 <xarick> if (a->targetairport == st->index && a->state != FLYING) { reduce the noise_reached of town; but then CommandCost ret = EnsureNoVehicleOnGround(tile_cur); remove airport facility if ret didn't fail }
17:51:29 <xarick> I'm unable to force EnsureNoVehicleOnGround to fail
17:51:44 <xarick> but this is one situation where it could underflow
17:51:50 <xarick> in noise_reached
17:53:12 <peter1138> I don't know what you are doing there, but that doesn't seem like a place to adjusting noise_reached.
17:55:55 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/station_cmd.cpp#L2497 ,see lines 2512, 2531 and 2542
17:56:18 <xarick> 2531 should be done after 2542
17:56:32 <xarick> but still... I am unable to force 2542 to fail
17:57:21 <xarick> can't reproduce
18:00:33 <xarick> it would have to fail the test on 2512 and ret.Failed to pass the test to have a mismatch
18:01:10 <xarick> does the check in 2512 always return the same as 2542?
18:07:01 <_zephyris> peter1138: What do you need? Generic trams has a sound... IIRC
18:07:28 <peter1138> xarick, oh, I see.
18:09:28 <peter1138> Is it possible for an aircraft to be at that airport, but with targetairport to be something else?
18:09:47 <xarick> I've been trying that
18:09:56 <xarick> and... so far haven't succeeded
18:13:14 <peter1138> Could be possible if the aircraft is taking off.
18:14:15 <peter1138> _zephyris, soemthing that uses sounds and container format 2 :)
18:14:26 <peter1138> _zephyris, and also is there a list of sounds anywhere (not in OpenTTD :))
18:16:29 <peter1138> Hmm.
18:16:47 <_zephyris> peter1138: What do you mean? https://en.m.wikipedia.org/wiki/Wikipedia:List_of_sound_files
18:16:48 <peter1138> Okay, aircraft property 12 has enough.
18:17:04 <peter1138> Errr
18:17:08 <peter1138> No.
18:17:21 <peter1138> I mean a list of TTD's sound effects (other than the list within OpenTTD's code)
18:18:31 <peter1138> Weird how there's a look up table, the sound index to play is not the same as the order in sample.cat.
18:19:11 <peter1138> And it's mostly the same, just 0 and 1 are shuffled down to 0x27/0x28
18:21:54 <peter1138> That index is why I had that error about OpenSFX.
18:22:07 <peter1138> *That lookup table
18:22:55 <xarick> try aircraft without any order, see what happens
18:25:01 <_glx_> <https://newgrf-specs.tt-wiki.net/wiki/Action11> says there are 73 sounds, but it doesn't list them
18:25:24 <truebrain> it is a secret!
18:26:04 <_glx_> <https://newgrf-specs.tt-wiki.net/wiki/NML:List_of_sound_effects> has a list
18:26:20 <xarick> are planes supposed to immediately crash when the last airport is demolished?
18:26:43 <xarick> like... immediately after i click demolish
18:27:23 <truebrain> https://github.com/OpenTTD/OpenTTD/pull/8701/files
18:27:23 <truebrain> Those old names 😄
18:27:47 <truebrain> "splat" 😄
18:28:13 <truebrain> `SND_1E_OOOOH`
18:28:23 <truebrain> why do I find them so amusing? 😄
18:28:27 <truebrain> very descriptive 😛
18:29:13 <peter1138> Yeah.
18:30:02 <peter1138> Anyway, I can't remove the look up table as that would break NewGRFs that reference the base sounds.
18:30:23 <peter1138> No big problem, I just needed to be aware that there was a lookup table at all :)
18:30:48 <peter1138> There is special code to handle a "Corrupt sound", however that sound is one of the unused slots...
18:31:04 <truebrain> not so unused after all 😄
18:31:18 <peter1138> It's unused.
18:31:37 <peter1138> It's just loaded as if it's raw PCM becuase it's not a WAV file.
18:31:43 <peter1138> And then... it's not used :)
18:31:52 <truebrain> so used a little bit? 😛
18:32:07 <peter1138> By "not used" I mean nothing tries to play it as a sound.
18:32:27 <truebrain> that makes more sense; almost sounded like a "little bit pregnant" 😛
18:35:44 <peter1138> Actually I think I'm still getting confused by this lookup table ;D
18:37:15 <peter1138> I am. It is used. Oh well.
18:37:21 <peter1138> But there's a bug.
18:38:33 <peter1138> It's named "Corrupt sound" in the Windows version of sample.cat. In the DOS sample cat, the names are different. They are all a 1 digit non-unique number.
18:38:41 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/2dcb00a79ac91520c734f4e24421566b0e1a14c1
18:38:42 <DorpsGek> - Update: Translations from eints (by translators)
18:38:48 <peter1138> So if you use the DOS sample.cat you don't get to hear the jackhammer.
18:38:54 <peter1138> Nice, justification for this patch ;-)
18:45:42 <_zephyris> Jackhammer sound? I think I've always used windows...
18:46:33 <truebrain> Makes less of a sound, a window. A jackhammer really brings it home more
19:32:48 <peter1138> Hmm.
19:44:25 <andythenorth> jackhammer falling in a forest?
19:47:31 <peter1138> Hah, I think I found my bug.
19:51:09 <peter1138> " Null byte terminating the string (not included in size) "
19:51:35 <peter1138> When reading from sample.cat the null byte IS included in the size.
19:51:42 <peter1138> When reading from NewGRF, it's not :o
19:51:58 <xarick> there is no BYTE_MAX 😦
19:52:10 <xarick> is UINT8_MAX the equivalent?
19:53:24 <peter1138> Yes.
19:54:42 <peter1138> Right, Generic Trams.
19:55:33 <andythenorth> Why Aren't Trams In The Base Game?
19:55:50 *** gebik4544 has joined #openttd
19:55:50 <gebik4544> legacy reasons
19:56:00 <peter1138> That works, but it's not container v2.
19:56:26 <gebik4544> There are still ppl using og graphics.
19:56:42 <andythenorth> eh what now?
19:56:54 <peter1138> 'has-sound-effects' is a handy tag, but... there's no 'has-container-v2' ;)
20:00:43 <peter1138> Okay, where's this class 37 :o
20:02:01 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1182774104546365573/growler_variant_2_dark_blue_white.png?ex=6585eb39&is=65737639&hm=5ba66e3bc4bcba4d4b341f528f2f92ce89b994515e3f996f1b6b11d93dd09ffb&
20:02:58 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1182774343382614026/growler_variant_3_pink_white.png?ex=6585eb72&is=65737672&hm=98824640ce770802d27ab743d45e2ded26cca27359ce9d2b8c1ddaba4e106f61&
20:03:04 <andythenorth> such variants
20:03:06 <andythenorth> terrible
20:03:43 <gebik4544> peter1138: https://en.m.wikipedia.org/wiki/British_Rail_Class_37
20:05:46 <peter1138> Okay, it's a Class 37 that's introduced in 1996.
20:26:51 <FLHerne> I suppose it's a 37/6
20:28:17 <FLHerne> regeared and some other mods for the Nightstar tunnel sleepers
20:28:28 <FLHerne> (which of course never happened)
20:29:59 <xarick> GetAirportNoiseLevelForDistance cannot overflow, just tested
20:30:12 <xarick> tested all numbers!
20:30:42 <xarick> the numbers are always between 0 and 255
20:37:02 <peter1138> Given that GetAirportNoiseLevelForDistance returns a uint8_t, that isn't surprising at all.
20:37:36 <xarick> i tested with a GS
20:37:43 <xarick> copied the same function
20:38:30 <peter1138> I mean, it's impossible for it to return anything not between 0 and 255.
20:39:35 <xarick> any noise_reduction above 255 and the function returns 1
20:39:57 <xarick> noise_reduction can go up to 512
20:40:41 <xarick> as->noise_level is a byte, so 255
20:40:44 <xarick> is max
20:42:00 <xarick> I'm assuming the maximum distance is 4096 + 4096, since it's distance manhathan, and maps can't go higher than that
20:42:55 <talltyler> gebik4544: Nope. There are no rivers in the base game, but OpenTTD provides graphics for them 😉
20:44:12 <talltyler> I suspect the reason is that without Chris Sawyer to unilaterally dictate speeds, costs, capacities, etc, we’d be stuck in an endless loop of people trying to balance vanilla trams. So instead we outsource that to GRF authors.
20:58:23 <_zephyris> There was, at the time, a fair bit of chat about distributing generic trams with the game...
21:12:43 <talltyler> I am in favor of it, FWIW
21:15:40 <xarick> has there been any towns with more than 6 553 200 population?
21:16:25 <xarick> is that amount reasonably reachable?
21:18:44 <xarick> if there is a town with more than 6553200 and town council is permissive and town_noise_population setting was changed to 100, then... MaxTownNoise overflows
21:20:58 <xarick> if town_noise_population is left to default, then the population needs to be more than 26212800, which still fits in a uint32
21:21:10 <xarick> to overflow
21:22:37 <andythenorth> talltyler: I wondered about just taking the default buses, and putting them on rails
21:22:41 <andythenorth> no balance 😛
21:24:46 <talltyler> I would probably mirror default buses, with same speed and introduction dates but twice capacity and twice purchase and running costs
21:24:55 <talltyler> Hard to argue with simplicity
21:26:59 <peter1138> Simplicity: one universal tram.
21:27:12 <peter1138> Or!
21:27:19 <peter1138> One variant group. All trams together.
21:30:51 <_zephyris> I have no idea what I picked... Maybe 50% more capacity/running cost. Ancient history
21:45:54 <peter1138> Should be easy to make a NewGRF that just uses the default bus graphics.
21:52:19 <xarick> my Git Bash doesn't want to Push
21:52:31 <xarick> failed authentication... credentials blabla
21:55:37 <xarick> Is this a bad joke? https://sfconservancy.org/news/2020/jun/23/gitbranchname/
21:57:51 <peter1138> No, that's why it's common to use 'main' instead.
22:02:04 <xarick> go woke go broke
22:02:51 <andythenorth> or as peter1138[d] said, it's common to use 'main' instead
22:07:07 <xarick> it never crossed my mind to think of master as referring to a person in a code repository context
22:07:12 <xarick> but okay..
22:07:57 <andythenorth> main is shorter, and doesn't raise the question
22:08:12 <andythenorth> so it's just better, and it autocompletes on the same 'ma' stem
22:09:03 <andythenorth> OpenTTD hasn't switched because $reasons, but lots of projects have
22:11:53 <xarick> master could even be a positive thing most of the time... oh well, ppl are weird
22:12:55 <andythenorth> the term (not in git, but in other places) is often combined with 'slave' and that is problematic in some cultures
22:13:27 <andythenorth> therefore, to avoid getting stuck debating a word for literally years, lots of projects switched
22:13:41 <andythenorth> preferring to make progress over debating semantics
22:18:52 <locosage> By the time everyone switches from master "main" can become offensive :p
22:24:13 <andythenorth> life moves on
22:27:34 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick opened pull request #11564: Fix: Prevent under/over flow when calculating town noise https://github.com/OpenTTD/OpenTTD/pull/11564
22:30:42 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #11564: Fix: Prevent under/over flow when calculating town noise https://github.com/OpenTTD/OpenTTD/pull/11564#issuecomment-1847922551
22:30:50 *** gelignite has quit IRC (Quit: Stay safe!)
22:41:08 <xarick> is it a bad PR?
22:41:19 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #11564: Fix: Prevent under/over flow when calculating town noise https://github.com/OpenTTD/OpenTTD/pull/11564#issuecomment-1847930775
22:41:52 <peter1138> I'm concerned that you are just trying random things, as you have been unable to reproduce.
22:42:49 <peter1138> And the max town noise calculation isn't particular relevant to the noise_reached stuff.
22:43:51 <peter1138> If the diagnosis of the flow is correct, the issue is that actions noise_reached is modified before all error conditions are satisfied.
22:44:35 <peter1138> s/actions/stations
22:44:43 <peter1138> eh, towns.
22:44:44 <peter1138> Words eh?
22:46:07 *** virtualrandomnumber has joined #openttd
22:46:15 <xarick> test and exec could differ, is that what you mean?
22:46:35 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #11564: Fix: Prevent under/over flow when calculating town noise https://github.com/OpenTTD/OpenTTD/pull/11564#issuecomment-1847936375
22:47:34 <talltyler> I agree with Peter. Reproducing the bug is the first step to fixing it, because how can you know if you’ve solved it unless you can test it?
22:48:20 <xarick> well, I guess I need that savegame
22:48:43 <talltyler> That could be a useful starting place
22:51:16 <peter1138> This command will first be executed without DC_EXEC, if EnsureNoVehicleOnGround fails, then the command will be aborted, before anything happens with DC_EXEC
22:51:45 <peter1138> It's then run a second time with DC_EXEC, but that shouldn't fail because it's just done a pass without DC_EXEC.
22:52:10 <xarick> what about in multiplayer?
22:52:44 <peter1138> So that is the thing, I can't remember if servers do a test run first or not.
22:53:09 <peter1138> Annoyingly I remember this came up in topic a couple of months ago, but I don't remember the answer.
22:55:33 <xarick> It's still better to have the calculation done after
22:55:37 <xarick> just to be safe
22:56:00 <peter1138> Actually I think it's better to move the EnsureNoVehicleOnGround test earlier.
22:56:38 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
22:58:27 <peter1138> (I'm just compiling, then I'll push something.)
22:58:46 <peter1138> But it still needs replication, tbh.
22:59:58 <peter1138> https://github.com/PeterN/OpenTTD/commit/df951e36f3ccfe11eabc2e68f798dd1bb8de96fd
23:01:35 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:07:56 <xarick> we got save! https://drive.google.com/file/d/1Cd6bAB0sQNDK5RgzEZW8gR9NvGnDWGgM/view
23:10:24 <xarick> oh, his airport is already removed 😐
23:20:20 <peter1138> Heh
23:20:43 <peter1138> There are two towns pretty close though...
23:28:27 <xarick> okay, something i found...
23:29:08 <xarick> rotating the airport placement gives a different town disallowing its placement
23:29:16 <xarick> that is very.... strange
23:29:23 <xarick> it's a 6 * 6 airport
23:31:42 <xarick> kdtree is buggy?
23:34:58 <peter1138> That's because it iterates the tiles in a different order.
23:40:04 <xarick> AirportGetNearestTown seems to be the problem... 😦
23:40:16 <xarick> or the iterator?
23:47:01 <Eddi|zuHause> isn
23:47:09 <Eddi|zuHause> 't that what i said in the very beginning?
23:48:01 <Eddi|zuHause> i mean, suspecting airport rotation
23:49:01 <xarick> 🙂
23:50:47 <peter1138> Okay, so an issue is that when building it uses a different way of iterating, because the airport doesn't exist -- it uses the airport spec iterator.
23:51:10 <peter1138> That iterates through the airport tile table, which could actually be in in any order.
23:51:44 <peter1138> Once built, it uses the airport iterator, which just covers the times on the map from the top corner to the bottom corner.
23:54:06 <peter1138> But then again that shouldn't matter.
23:55:16 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
23:57:13 <peter1138> station_cmd.cpp:L2330 means if two towns have the same distance it will pick one with the lowest index, so it's stable either way.
23:57:53 <xarick> AirportGetNearestTown 2324 seems to be the problem
23:58:10 <xarick> the iteration order 😦
23:59:36 <xarick> got no time now, tomorrow I'll check this better
23:59:49 <peter1138> Changing the iteration order doesn't affect which town is closer.