IRC logs for #openttd on OFTC at 2023-12-09
⏴ go to previous day
00:12:28 <xarick> how many tiles are in a 6 * 6 perimeter?
00:12:55 <xarick> somehow it only iterated 16
00:13:35 <xarick> oh, 6 + 5 + 5 + 4 my bad
00:19:50 <talltyler> Regardless of what you find though, you need to be able to compare before and after your change to know if it fixes the problem.
00:21:32 <talltyler> You should start by trying to reproduce the problem, testing your hypotheses by building airports and founding towns or rotating airports or whatever you want, instead of hypothesizing and then changing code — without any ability to test if your hypothesis even fixes the bug.
00:22:48 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
00:24:16 <talltyler> Come up with consistent, reproducible steps, like a savegame with “place airport here” or “place town here” signs or whatever causes the bug. You want to avoid any ambiguity in reproducing the bug. Then we can actually have a productive conversation about why those steps cause the bug, and how to fix it.
00:24:29 <talltyler> Anything else is just wasting your own time. 🙂
00:27:57 <peter1138> Yes, the iterator is wrong.
00:28:46 <peter1138> Or rather the perimeter is wrong.
00:28:55 <peter1138> It assumes the first tile is the top corner.
00:29:20 <peter1138> But with an airport spec iterator, it could may not be.
00:30:11 <LordAro> it may could well have had hasn't not been
00:33:58 <talltyler> LordAro: I had to read that three times to make sure it was nonsense and I wasn’t just missing something 😛
00:34:48 <talltyler> I lived for a few years in the southern US where they used some creative grammar, like “y’all might could do X” to suggest a course of action 🤔
00:45:54 <peter1138> Hmm, maybe I should keep the asserts.
00:52:58 <peter1138> Yeah, let's do it :D
00:57:55 <peter1138> Anyway, airport noise with permissive local authority still needs to be fixed, but that probably isn't the cause.
01:32:50 *** HerzogDeXtEr1 has joined #openttd
01:37:36 *** HerzogDeXtEr has quit IRC (Ping timeout: 480 seconds)
02:20:57 <Rubidium> has anybody considered that changing the NewGRF that provides the airports can also cause underflows in the reached noise values?
02:25:08 <peter1138> In general that fall under "don't change NewGRFs" right?
02:26:57 <Rubidium> a NewGRF can define the noise level. If you have a savegame with such an airport, and then change the NewGRF to tweak the noise level... problems. So someone might be chasing someone messing with NewGRFs as if it's a bug in OpenTTD. Ah well... get the savegame and you'll probably know
02:29:20 <peter1138> Noise levels are recalculated on load.
02:29:34 <peter1138> So the only issue is that you might end up with noise level greater than permitted.
03:00:08 *** herms has quit IRC (Quit: bye)
03:05:41 *** FLHerne has quit IRC (Ping timeout: 480 seconds)
03:38:53 *** Wormnest has quit IRC (Quit: Leaving)
03:42:23 *** FLHerne has joined #openttd
03:59:25 *** Zathras has joined #openttd
04:02:46 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
04:02:46 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:09:57 *** gretel[m] has quit IRC (Quit: Client limit exceeded: 20000)
06:43:39 <andythenorth> Rubidium: OP on reddit mentions FIRS crashing aa the cause of their issue…
07:30:23 *** tokai|noir has joined #openttd
07:30:23 *** ChanServ sets mode: +v tokai|noir
07:37:01 *** tokai has quit IRC (Ping timeout: 480 seconds)
08:14:10 *** gelignite has joined #openttd
08:38:36 <peter1138> Interest, non-DC_EXEC flags is called twice.
08:52:17 <merni> Could someone maybe merge OpenMSX PR #33 :)
09:16:23 *** Zathras is now known as debdog
09:27:59 <peter1138> Wow, this old cold uses std::ptr_fun
09:36:05 <peter1138> And also libgdk, which seems to have disappeared.
09:36:18 <peter1138> Maybe I should start from scratch :)
09:39:18 <LordAro> talltyler: my initial sentence accidentally made sense, so i had to add a few more words
09:46:39 <peter1138> Yay, I got it to compile :D
09:46:44 <peter1138> But only by removing all the GUI code.
10:03:59 <truebrain> tnx for the comment fix peter1138 🙂 A tile that is an origin tile that is the top-left, was not really a helpful collection of words 😄
10:05:38 <truebrain> and you can't merge OpenMSX PRs? That is fixable ...
10:12:44 <truebrain> isn't it amazing?! 😛
10:16:17 <xarick> oh, thx for fixing my bug 😐
10:36:15 <peter1138> Heh, that desync savegame uses point-to-point lines :o
10:43:38 <peter1138> Last commands were CmdLevelLand, though. Hmm.
10:43:53 <truebrain> I hope that was not the one causing the desync 😄
10:43:53 <peter1138> How do you parse a desync debug command file?
10:44:16 <peter1138> cmd: 000ad467; 2a; 00; 00000065; 00000e66; 035d3f; 3F5D03003F5D03000001 (CmdLevelLand)
10:44:40 <truebrain> owh, with the new command parsing, that is an interesting question 😄
10:46:00 <peter1138> tile 00035d3f, start_tile 00035d3f. diagonal 00, level mode 01
10:46:00 <truebrain> if I would to guess, `3F5D0300` is tile, `3F5D0300` is start_tile, `00` is diagonal and `01` is LevelMode .. but I am guessssiiinnnnggggg 😄
10:46:12 <xarick> why isn't VCPKG_TARGET_TRIPLET automatically set to x64-windows-static when opening a project?
10:46:30 <truebrain> guess if we both say so, it is less guessing 😄
10:47:04 <peter1138> So that's a single-tile lower.
10:47:27 <peter1138> Such inefficient packets :D
10:47:34 <truebrain> the order of the tile-ids is a bit odd btw .. the debug statement suggests `035d3f` is the tile_index 😛
10:48:04 <truebrain> so I guess there is some LE/BE going on with the parameters 🙂
10:48:41 <peter1138> Sure, the byte packaing is LE, the tile in the debug output is already converted.
10:48:49 <truebrain> anyway, please remember that we don't desync check every command; we only do it once in a while. So it can happen earlier.
10:53:33 <xarick> how do I cherry pick a commit from a branch of another repository to mine?
10:54:22 <truebrain> so weird, you typed that in the wrong window
10:55:44 <xarick> google search doesn't work correctly here 😦
10:56:10 <truebrain> really weird, like Discord is not a place to search for things .. such odd ...
10:56:38 <xarick> 06b8be046c47&psq=how+do+I+cherry+pick+a+commit+from+a+branch+of+another+repository+to+mine%3f&u=a1aHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvNDE0MTMzNTcvY2hlcnJ5LXBpY2stY29tbWl0LWZyb20tYS1kaWZmZXJlbnQtcmVwbw&ntb=1
10:56:59 <truebrain> this is not your help channel for your average question you can search for yourself
11:00:41 <xarick> there's a reason I don't like google, they're so high up their horse
11:01:05 <truebrain> so pick any other search engine; but using us as search engine is just rude
11:36:49 <truebrain> Or flac, for "those people"
11:36:57 <truebrain> Stop doing this 😛 😄
11:37:28 <peter1138> My music collection is flac.
11:37:58 <peter1138> (I once ripped everything as ogg vorbis, but it turned out the encoder at the time did a terrible job.
11:38:24 <truebrain> I once had all my music in flac too
11:38:34 <truebrain> Now I don't own my own music anymore 😦
11:39:47 <peter1138> Hmm, forgot to add the padding at the end for the "resampler".
11:40:05 <peter1138> Maybe I shouldn't remove soxr, but... memory usage eh?
11:47:37 <peter1138> Let's robustize this.
11:51:45 <locosage> I may have command data parser for new format but can only check in the evening
11:52:43 <locosage> I definitely have some code that unpacks it into c structs
11:52:55 <locosage> Don't remember if I even finished python parts
11:53:41 <xarick> I don't understand remotes...
12:27:19 <xarick> I can't get the list of branches
12:28:00 <peter1138> git fetch github-desktop-PeterN
12:32:44 <peter1138> Hmm, maybe I should steal OpenTTD's GUI system ;D
12:44:37 <peter1138> Okay, how do I test with an mp3... haha
12:59:32 <andythenorth> truebrain: Does Ludde rent you your music?
13:00:40 <peter1138> -rw-r--r-- 1 petern petern 1245728 Dec 9 13:00 opensfx.cat
13:00:40 <peter1138> -rw-r--r-- 1 petern petern 13196496 Oct 31 2021 opensfx.cat.bak
13:04:18 <peter1138> I removed all the validation, so now it will let me shove any old file into the sample.cat ;D
13:05:49 *** gelignite has quit IRC (Quit: Stay safe!)
13:12:58 <xarick> peter1138: Nice, that worked, but visual studio should have an option to do that
13:13:35 <peter1138> It probably does, but I don't use it so I can't tell you how.
13:13:58 <_glx_> Git is a command line tool, it's impossible to get all possible features in gui
13:22:41 <peter1138> Hmm. My FindLibMad.cmake is not working :o
13:25:49 <peter1138> But it doesn't actually link with it.
13:28:30 <peter1138> Odd. It's basically the same as my JACK one which works.
13:28:41 <peter1138> Such magical things.
13:36:24 <peter1138> Case sensitive of course.
13:45:21 <xarick> peter1138: I used cherry-pick on your commit, fixed the conflicts, but it didn't inherit the author 😦
13:50:47 *** virtualrandomnumber has joined #openttd
13:51:27 *** virtualrandomnumber has quit IRC ()
13:52:46 <peter1138> The change is spurious, it's always called without DC_EXEC first.
13:57:16 <andythenorth> one day someone will add an n-track building tool 😛
13:58:28 <andythenorth> also mixing railtypes on a diagonal tile 😛
13:58:45 <andythenorth> someone is about to suggest I switch to JGRPP? 🙂
14:01:14 <andythenorth> ah I forgot something in my Horse set design 😛
14:01:29 <andythenorth> only the engine is evaluated for railtype compatibility
14:01:41 <andythenorth> "this is awkward"
14:02:17 <andythenorth> those pax coaches are not compatible with this railtype 😛
14:09:38 <emperorjake> That's fine, they just won't be able to use the max speed of the engine
14:11:21 <andythenorth> means you get 120 mph trains on a 200 mph railroad 😛
14:11:27 <andythenorth> where you don't want them
14:11:41 <andythenorth> railtype min speed property? 😛
14:11:54 <andythenorth> not actually joking
14:12:32 <peter1138> Pathfinder penalty?
14:13:57 <andythenorth> above my pay grade 🙂
14:14:27 <andythenorth> the railtype wagons thing can lead to odd results when depots have mixed track types
14:14:40 <andythenorth> it's totally possible to have narrow gauge wagons on standard RAIL for example
14:15:07 <_glx_> xarick: it's not a cherry-pick if you modify the commit to include your local changes 🙂
14:15:37 <peter1138> If the wagon is incompatible then you can't buy it in the depot to be able to attach it.
14:16:51 <_glx_> you should not be able to get standard and narrow in the same depot
14:16:56 <emperorjake> but someone can always make a railtype where they are compatible
14:17:14 <emperorjake> with a dual gauge depot you can attach narrow gauge wagons to a standard gauge engine
14:17:32 <peter1138> Yes but if they are then compatible... they are compatible.
14:18:13 <emperorjake> but then the engine can still travel on standard gauge tracks while pulling the narrow gauge wagons
14:18:18 <emperorjake> It's a feature, not a bug
14:19:39 <_glx_> and narrow gauge wagons runs on standard sleepers ?
14:20:35 <emperorjake> It's a way to simulate re-gauging
14:24:34 <andythenorth> I am correct that we don't evaluate railtypes for wagons? I haven't checked src, but behaviour suggests this
14:25:11 <_glx_> compatibility is checked when buying I think
14:25:47 <andythenorth> it's definitely checked for buy list
14:26:24 <peter1138> You can manually do a callback I think.
14:26:54 <_glx_> when running I think the engine is checked (at least for power and also compatibility), but the consist compatibility is assumed
14:26:56 <andythenorth> ok so for entering a tile, it's only the lead engine that's evaluated
14:27:06 <peter1138> With CBID_TRAIN_ALLOW_WAGON_ATTACH return 0x402 and it'll say "incomaptible rail type"
14:27:16 <peter1138> Yes, once on the map that is necessary.
14:27:28 <andythenorth> performance issues?
14:27:43 <peter1138> case 0x400: // allow if railtypes match (always the case for OpenTTD)
14:28:13 <peter1138> So 12 years ago it was known and left as a feature that railtypes are not checked when attaching parts.
14:28:24 <peter1138> But you can override it with the callback.
14:28:48 <peter1138> andythenorth, no, disconnecting train issues, or at least, train stuck unable to move.
14:28:51 <andythenorth> new feature, incompatible railtypes?
14:29:43 <_glx_> train stuck can still happen IIRC
14:30:22 <peter1138> Why am I so slow? :(
14:30:43 <peter1138> If this was Unity I would have just connected a couple of boxes together and made it all work by now.
14:30:46 <andythenorth> why am I so hungry?
14:30:58 <peter1138> Because you saw my lunch.
14:31:30 <peter1138> Anyway, the MP3 sample.cat is loaded, but I'm failing at the buffers :D
14:31:33 <andythenorth> I have not had lunch
14:32:54 <andythenorth> if I have lunch, will I be less complaining about railtypes? 😛
14:33:15 <peter1138> Are you complaining?
14:33:35 <andythenorth> in my head at least
14:34:33 <andythenorth> maybe a sandwich
14:38:38 <andythenorth> maybe 2 small sandwiches
14:52:41 <xarick> noise_reached may overflow yet
14:53:17 <xarick> if someone manages to place a tremendous amount of airports in a town
14:56:44 <peter1138> Finally. MP3 sample.cat ;D
14:57:01 <andythenorth> ```Note that the compatibility is only evaluated for the lead engine of a consist. This means that trains will run on incompatible rail types if they are in a consist where the lead engine is compatible with the rail type. This applies to both engines and wagons.```
14:57:07 <peter1138> 1.2MB instead of 13MB
14:57:13 <andythenorth> I've added this to grf spec, does the wording make sense?
14:57:31 <peter1138> 64kbps because it's mono
14:59:52 <xarick> the original sounds are already low quality, doing another lossless compression on them would make it worse, right?
15:00:36 <peter1138> It's not "another" lossy compression.
15:00:49 <_glx_> original are not compressed at all
15:02:56 <peter1138> And this doesn't affect the original sounds.
15:04:06 <xarick> is there a lossless PCM thingy? 😐
15:05:07 <peter1138> That's... the default.
15:08:13 <xarick> compressed, i guess the aim is to have it compressed but still lossless?
15:08:30 <peter1138> What are you talking about?
15:08:48 <xarick> okay, I don't know what's the goal then
15:08:50 <peter1138> OpenTTD supports raw samples, and PCM wave files.
15:08:59 <peter1138> I've just been playing with adding support for MP3 as well.
15:09:11 <peter1138> That does not remove the current support.
15:11:39 <xarick> was searching on the web for something like APNG but for audio
15:16:00 <xarick> using zlib to compress the audio, make it streamable
15:16:11 <xarick> something of that nature
15:16:43 <peter1138> Are you trying to think of a way of doing lossless audio without using an existing lossless audio codec?
15:16:47 <peter1138> Pretty sure that's a dumb idea.
15:17:24 <peter1138> flac generally gets files down to about half their uncompressed size.
15:18:12 <peter1138> Interesting ordering...
15:18:34 <andythenorth> I'll update nml wiki also for railtypes
15:18:56 <alfagamma7> What format does the base sounds set use
15:19:21 <peter1138> Mostly wave files, there's one raw pcm.
15:19:38 <andythenorth> ach railtype vs rail type again 😦
15:19:42 <andythenorth> rail type in the spec
15:19:45 <andythenorth> but railtype in nml
15:19:51 <andythenorth> except when it's track_type
15:20:09 <peter1138> The original base sounds wave files are all mono 8-bit 11kHz.
15:20:24 <peter1138> OpenGFX uses mono 16-bit 44.1kHz
15:20:44 <andythenorth> ach the compatibility note I added is confusing 🙂
15:20:49 <andythenorth> it's only about routing, not building
15:21:13 <andythenorth> ```Note that when routing trains, the compatibility is only evaluated for the lead engine of a consist. This means that trains will run on incompatible rail types if they are in a consist where the lead engine is compatible with the rail type. This applies to both engines and wagons.
15:21:43 <andythenorth> I wonder why we don't just show all wagons in all depots, irrespective of rail type?
15:21:53 <peter1138> If you do that, how are we supposed to change it later and claim is was undefined behaviour?
15:22:06 <andythenorth> but the spec was wrong
15:22:38 <andythenorth> we're unlikely to change it, because it's going to cause stuck trains?
15:22:43 <andythenorth> and users will bring pitchforks
15:23:00 <peter1138> Because depots have railtypes and you can't buy a wagon with an incompatible railtype.
15:23:10 <andythenorth> but that seems odd
15:23:24 <andythenorth> compatibility doesn't mean anything for wagons
15:23:39 <peter1138> You can't buy a wagon in an incompatible depot.
15:23:56 <peter1138> You can't buy an engine in an incompatible depot.
15:24:10 <andythenorth> that makes sense
15:24:12 <peter1138> Why? Becuase that's basically the point of compatible railtypes.
15:24:38 <peter1138> The side effect of dual-compatible depots was probably not even considered.
15:25:05 <peter1138> The fact that railtype is "not checked" when a train is on the map, is because at that point the code assumes it was all checked in the depot.
15:25:50 <xarick> noise_reached overflowing is difficult to mess with
15:25:55 <peter1138> Therefore, you can "fix" this by making it not possible to attach a wagon to an engine with an incompatible railtype.
15:26:13 <peter1138> However, given there's specifically a callback result for handling this precise case... I don't see the point :)
15:27:46 <xarick> if I clamp it to the max of uint16, then on RemoveAirport, i just can't subtract from that
15:27:53 <andythenorth> nah I miss something 🙂
15:28:09 <andythenorth> I think I'm probably trying a BAD FEATURE?
15:28:19 <talltyler> I think the specialized railtype is the footgun here
15:28:39 <andythenorth> well it's the idea of speed separation I think
15:28:44 <andythenorth> no matter how people try to do it
15:28:55 <talltyler> Yes, you were trying to do pathfinder stuff with railtype
15:29:07 <andythenorth> this is what programmable signals are for?
15:29:08 <talltyler> Programmable signals is how I’d solve it in JGRPP
15:29:47 <talltyler> Just have a signal at the start of the fast line with a “if max speed < 186 then deny”
15:30:11 <andythenorth> did we find a way yet to make grfs JGRPP only?
15:30:19 <andythenorth> there might be a feature detection system?
15:31:08 *** virtualrandomnumber has joined #openttd
15:31:19 <merni> MP3 music for openttd 😍
15:31:38 <talltyler> Programmable signals are something I would seriously consider trying to get into vanilla someday, obviously just the basics and with some gates to avoid players finding them too easily. They can be their own footgun quite easily.
15:31:41 <andythenorth> I still miss why compatibility is evaluated for wagons
15:31:43 <locosage> andythenorth: Yeah, multi track tool is on my endless todo list xd
15:32:10 *** Wormnest has joined #openttd
15:32:14 <alfagamma7> Because OTTD plays mono?
15:32:15 <peter1138> Because sound effects and music are totally different systems.
15:32:48 <merni> Oh for sounds and not music
15:33:42 <merni> but would it be very hard to add support for music as well if all the work in building in MP3 playing for sound (in all OS etc) is already done :p
15:35:16 <andythenorth> this wagon list is misleading
15:35:33 <andythenorth> ALL the Horse wagons are compatible with this railtype
15:36:11 <andythenorth> it's inconvenient to only show the ones that have compatibility set
15:36:50 <andythenorth> (BAD FEATURE problems)
15:37:08 <andythenorth> "just don't add BAD FEATURES" might apply here
15:39:39 <peter1138> merni, it's completely different.
15:40:05 <peter1138> And there is literally no point because the original music is MIDI.
15:41:10 <merni> I mean the original graphics are 8bpp 1x zoom and yet we have other options?
15:41:30 <peter1138> That isn't really comparable.
15:43:39 <_glx_> original music is basically raw partitions 🙂
15:44:28 <peter1138> It's sheet music :D
15:44:55 <_glx_> the orchestra is inside the player
15:45:43 <peter1138[d]> It's inside the little box next to my PC 🙂
15:46:10 <_glx_> and it can be very different from system to system
16:05:34 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
16:08:39 <andythenorth> coaches aren't available on this railtype
16:09:31 <talltyler> Why don’t we just fix routing? Wagons cannot use railtypes they are incompatible with?
16:09:54 <talltyler> Pitchforks hasn’t stopped us before 😛
16:09:56 <andythenorth> we need an acronym for BFDDI
16:10:27 <peter1138> I don't know why that's considered "routing"
16:10:31 <talltyler> Saveload could be handled by teleporting problematic trains to depots, we did it with multi-tile level crossings and nobody complained
16:10:35 <peter1138> That's attaching wagons in the depot.
16:10:56 <andythenorth> I 've routed the train into the depot
16:10:59 <andythenorth> and tried to clone it
16:12:07 <talltyler> Routing because dual-gauge track can handle both narrow and standard gauge trains, but a train with both types shouldn’t be able to travel onto either narrow or standard gauge-only track
16:12:28 <andythenorth> slightly different case here
16:12:36 <peter1138> Okay, to me routing means finding a route... pathfinding.
16:12:48 <talltyler> And freight cars can be coupled to a fast loco, but not travel on fast track
16:12:54 <peter1138> But the issue here is clearly "can you attach a wagon of the wrong type in a depot"
16:12:57 <andythenorth> is 'traverse tile' a better issue?
16:13:15 <talltyler> “Wrong” seems to be made-up with railtypes
16:13:20 <andythenorth> the issue here is NewGRF author BAD FEATURES
16:13:41 <talltyler> What is the railtype of the Badger?
16:13:52 <andythenorth> probably the LGV type
16:14:02 <andythenorth> I never remember how compatibility works
16:14:05 <talltyler> (I have no idea how railtypes or railtype tables work, it sounds frustrating and stupid)
16:14:23 <andythenorth> the idea is that railtype authors can redefine the trains
16:14:35 <peter1138> There's stuff in the callback specifically to handle this.
16:14:52 <andythenorth> I think we're at cross purposes 🙂
16:15:00 <andythenorth> how will the callback handle that?
16:15:09 <andythenorth> the passenger coaches are not available on this railtype
16:15:27 <andythenorth> I built them on another railtype which isn't compatible
16:15:30 <andythenorth> then sent them to this depot
16:16:44 <andythenorth> the engine uses some label we'll call FAST
16:16:50 <andythenorth> which is compatible with ELRL and RAIL
16:17:00 <andythenorth> and that is the BAD FEATURE
16:17:49 <andythenorth> railtypes shouldn't really be mixed in this way
16:18:49 <peter1138> Oh I guess .base() is not standard, or is newer than C++17
16:18:55 <andythenorth> what if I convert the FAST trains to maglev? 😛
16:19:05 <andythenorth> then they're obviously not going to run on ELRL or RAIL
16:23:29 <xarick> Is this gonna do what I think it's gonna do?
16:23:29 <xarick> `assert(IsInsideBS(nearest->noise_reached + nearest->noise_reached, std::numeric_limits<decltype(nearest->noise_reached)>::min(), std::numeric_limits<decltype(nearest->noise_reached)>::max()));`
16:23:54 <peter1138> What do you think it's going to do?
16:24:21 <xarick> can the added noise fit inside the type of variable of noise_reached ?
16:25:02 <xarick> assert(IsInsideBS(nearest->noise_reached + newnoise_level, std::numeric_limits<decltype(nearest->noise_reached)>::min(), std::numeric_limits<decltype(nearest->noise_reached)>::max()));
16:25:32 <peter1138> IsInsideBS is wrong for min/max.
16:26:27 <peter1138> IsInsideMM exists for that -- but that also exclues max.
16:27:10 <peter1138> Why do you think noise_reached can get near UINT16_MAX?
16:27:59 <xarick> probably if someone tries enough to make such a giant town with tons of airports 😮
16:38:34 <peter1138> Also the game hung for a long time doing that generaion.
16:39:53 <peter1138> It's trying to add 30,000 buildings in one go.
16:40:58 <peter1138[d]> Yeah, it's kinda exponential or at least non-linear.
16:41:22 <_glx_> thinking about overflows is nice, but also consider the probability to encounter them before trying to prevent/fix
16:41:30 <peter1138> That was 1 press of expand town :D
16:42:09 <peter1138> Anyway, it's uint16_t because uint8_t wouldn't be enough, but uint16_t is plenty.
16:42:21 <_glx_> and worse case if there's an overflow here is allowing more noisy stuff
16:43:22 <peter1138> Population is going up by itself :D
16:45:25 <peter1138> Noise limit is now 3772. Given the density and radius of the town, placing 1 intercontinental airport raises the noise by 17 (max is 25 for that airport)
16:45:32 <xarick> it needs to be higher than 6 553 200
16:45:34 <andythenorth> _glx_: or a FIRS error? 😛
16:45:43 <peter1138> So shall I place 220 airports?
16:45:51 <andythenorth> write a GS to do it
16:46:06 <_glx_> if you place an airport you'll remove some houses
16:46:07 <andythenorth> you ran out of town radius?
16:46:34 <peter1138> Probably need about 4000 airports
16:47:43 <xarick> needs a NewGRF to set airport noise to some big value, 255 is max i guess
16:48:40 <_glx_> airport specs are quite limited so nobody use them
16:49:05 <_glx_> just using the rotation stuff
16:49:24 <_glx_> but layouts can't really change
16:49:54 <xarick> make that 1 * 1 helipad have a 255 noise
16:52:11 <xarick> ok gonna make a GS massing helipads
16:53:42 <andythenorth> Goes It Throw Out BAD FEATURE?
16:53:46 <andythenorth> hmm we can't mix the memes?
16:54:42 <xarick> the GS will need to provide the money
16:55:29 <merni> ...why are you doing this anyway?
16:55:44 <merni> to prove that it's theoretically possible to cause an overflow?
16:56:43 <_glx_> but airport noise don't add to max_noise directly
16:57:09 <_glx_> and the comparison usually is done on ints (auto conversion)
16:58:21 <peter1138> Spam a town with 1x1 255-noise heliports, profit?
17:01:25 <peter1138> Oh I need to rebase to make the CI happy.
17:02:16 <peter1138> Probably should've done a local PR, sorry :)
17:03:00 <_glx_> like in ` if ((nearest->noise_reached + newnoise_level) > nearest->MaxTownNoise()) {` the first addition promotes everything to int so everything is safe
17:05:07 <_glx_> well uint as newnoise_level is uint, but still it's promoted to 32bit
17:08:18 <_glx_> anyway the ClampTo in MaxTownNoise won't prevent anything as the overflow is more likely to happen when updating noise_reach than when calculating MaxTownNoise
17:09:47 <_glx_> but the result is tested to not be higher than MaxTownNoise before the real update can happen
17:11:52 <_glx_> so really the only possible way to get an underflow/overflow of noise_reached is changing newgrf in a running game
17:12:49 <talltyler> Which we don’t support
17:13:54 <_glx_> (UpdateAirportsNoise() and RemoveAirport() are the only things not checking for over/under, but that's where the check should happen if really needed
17:14:18 <_glx_> all other locations seem safe in the current code
17:20:29 <_glx_> RemoveAirport() assumes no overflow occured when adding the airport (and that's a valid assumption as CmdBuildAirport() doesn't allow increase of noise_reached if the new value would be higher than MaxTownNoise())
17:21:16 <xarick> you can create new towns
17:21:18 <_glx_> and UpdateAirportsNoise() assumes the same
17:23:24 <_glx_> noise is transfered from original town to new town if it's closer to airport ?
17:23:58 <xarick> it reruns UpdateAirportsNoise
17:24:17 <xarick> the new town can get a result higher than it's max
17:24:17 <_glx_> then the only "issue" could be noise_reached being above MaxTownNoise()
17:24:43 <_glx_> you are just not allowed to build more airports
17:28:00 <_glx_> you can't prevent noise_reached going above MaxTownNoise() in that case, unless you remove the airport
17:36:17 <andythenorth> list of incompatible vehicles for a railtype?
17:40:22 <xarick> is there a way to reset the value of a setting to its default in the console?
17:48:36 <xarick> I wonder if this will work
17:48:36 <xarick> `GSGameSettings.GetValue("town_noise_population[" + GSGameSettings.GetValue("town_council_tolerance") + "]"))`
17:50:18 <andythenorth> eh I think cb36 can change vehicle speed when railtype changes
17:50:22 <andythenorth> Horse seems to do that
17:52:19 <andythenorth> oh 0 mph evaluates funny 😄
17:54:07 <andythenorth> this is too silly as a solution 🙂
17:54:21 <andythenorth> coaches set speed to 1 mph when on high speed rail
17:54:35 <andythenorth> the engine shows permanent sparks, which is nice
17:56:05 <peter1138> Okay, that's ... surprisingly working :D
17:57:43 <peter1138> I implemented mmap support in OpenTTD (for Linux of course)
17:57:58 <peter1138> This has almost no benefit ;)
18:02:09 <peter1138> Not sure if I can easily abstract ReadBlock() to avoid copies though.
18:03:19 <peter1138> Well, that was frivolous. I could've done good things today but instead I wasted it all on two stupid things.
18:23:21 *** gelignite has joined #openttd
18:25:27 <xarick> GSTown.ExpandTown(town, 0xFFFFFFFF)
18:25:43 <xarick> and... openttd locked up
18:26:35 <andythenorth> no you are ahead, I only did one stupid thing
18:31:49 <peter1138> Hmm, cancelling downloads doesn't cancel them. I thought we fixed that ;D
18:52:04 <xarick> the houses need to finish construction?
18:54:33 <peter1138> "Doctor, it hurts when I do this"
19:02:25 <xarick> GetTownRoadGridElement is heavy
19:02:59 <xarick> or is it GrowTownWithExtraHouse?
19:03:11 <xarick> this cpu profiler isn't too smart
19:08:36 <locosage> Towns grow fast enough, just don't make it grow shitton of houses at once
19:08:48 <peter1138> 4 billion houses is quite a lot.
19:08:58 <peter1138> It was slow enough with 10000
20:03:58 <xarick> is it possible for a GS or AI to know it's using too much cpu time?
20:06:05 <andythenorth> I mean...you could count how often it gets suspended
20:06:10 <andythenorth> by storing timestamps
20:06:18 <andythenorth> but it will not be very precise measure
20:07:01 <andythenorth> and there is a fundamental problem, that you can't make your timestamp code run until all the other opcodes are finished 😛
20:07:49 <andythenorth> if you slice up jobs into batches, and write your own dispatcher for them in the main loop, you could approximately maintain some control over it
20:08:16 <andythenorth> but if you get an unanticipated runaway condition, there's no interrupt that I'm aware of that will let your main loop resume control, it's all single-threaded stuff
20:11:29 <xarick> I see GSDate.GetSystemTime()
20:12:11 <andythenorth> yeah, as I remember, it's not super useful, it's not very fine grained
20:12:43 <andythenorth> oh it's seconds, probably fine for your case
20:12:50 <andythenorth> not fine for performance timing purposes
20:15:52 <xarick> how many ticks in a day? still 74?
20:19:26 <debdog> for me, one per year is enough
21:38:39 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:42:12 <xarick> guarded by IsValidTile
21:45:55 <xarick> GetTileIndex is smarter
21:55:36 <andythenorth> kilroy was here?
22:01:18 <locosage> the heck is that gamma
22:01:53 <xarick> it's the windows screenshot tool, it captures it like that 😦
22:03:11 <peter1138> I'm going to have to Decino this level, I've run out of ammo :o
22:04:40 <andythenorth> peter1138: no chainsaw?
22:05:03 <peter1138> Yes, but beserk is better.
22:06:03 <xarick> this one is captured using the in-game screenshot
22:06:35 <peter1138> Yes, because it's not an OpenTTD bug.
22:07:26 <_glx_> see openttd knows the colours, hence in-game screenshot being fine
22:07:42 <andythenorth> can't be bothered to find the charger
22:07:57 <andythenorth> oh it's right here
22:08:01 <peter1138> andythenorth, how are you doing to stay upa all night drawing pixels?
22:08:22 <andythenorth> A) I'm not B) see above
22:08:25 <_glx_> andythenorth: thanks for the reminder, last time I checked my phone was at 15%
22:08:34 <locosage> andythenorth: how many horse compiles is that? xD
22:08:45 <andythenorth> each compile is about 1% of battery
22:09:29 <xarick> so, to whom I complain about these colours?
22:10:10 <_glx_> if you can try with an nvidia card that would give a hint
22:10:28 <xarick> I don't have a Nvidia GPU 😦
22:11:06 <_glx_> but HDR is a pain, even on playstation, usually it must be disabled when streaming else the colours are wrong
22:11:57 <_glx_> it's most likely an OS issue
22:12:26 <_glx_> or the tools not supporting HDR properly, or a mix
22:15:27 <_glx_> but it's never the program used to draw on screen
22:16:21 <_glx_> because as you could see, in-game screenshot is fine, and it's exactly the same as what openttd draws on screen
22:17:53 <peter1138> No, Sigil II is released soon.
22:17:55 <_glx_> so either bug inside windows API, or GPU driver, or ..., the list can be long, but it's never the program
22:18:32 <xarick> I wanted to benefit from this monitor 😦
22:18:45 <andythenorth> IsCompatibleRail perhaps?
22:19:27 <_glx_> the monitor itself is fine, I guess you get nice pictures on it
22:20:52 <_glx_> the screenshot tools on the other hand might use the wrong API, or the OS return the image at the wrong time in the chain
22:21:38 *** Wormnest has joined #openttd
22:21:40 <peter1138> Did someone say cache the minimum of compatible railtypes?
22:22:06 <_glx_> the issue is between program plotting pixels on the screen and the monitor, but program and monitor are fine
22:22:35 <_glx_> I mentionned the idea of compatibility per consist yes
22:23:17 <_glx_> intersection of individual compatibilies of vehicles in consist
22:23:44 *** Smedles has quit IRC (Read error: Connection reset by peer)
22:26:06 <_glx_> would change ` return HasBit(GetRailTypeInfo(enginetype)->compatible_railtypes, tiletype);` into ` return HasBit(v->cached.compatible_railtypes, tiletype);` or something like that
22:26:34 <_glx_> (that's `IsCompatibleRail()`)
22:27:18 *** Smedles has joined #openttd
22:27:51 <_glx_> maybe not the right function to touch, but it's an idea
22:28:09 <xarick> dang it, river generation stall is so annoying
22:28:41 <xarick> it's rare, but when it happens... bam... 5 minutes lost
22:32:33 <_glx_> oh but there's already a v->compatible_railtype, but it's filled with powered_railtypes
22:33:33 <peter1138> F2 can make quick work of disambiguating that.
22:34:32 <_glx_> then yapf caches it and may add compatible_railtypes to it
22:57:04 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:58:40 *** nielsm has quit IRC (Ping timeout: 480 seconds)
23:05:10 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:10:50 *** gelignite has quit IRC (Quit: Stay safe!)
23:17:55 <andythenorth> diagonal roads eh 😛
23:18:35 *** NGC3982 has quit IRC (Quit: brb)
23:41:44 <Flygon> Diagonal roads would massively sate the aesthetic part fo me hahaha
23:46:51 <peter1138> I have no idea how the map array would have to look for that to work.
23:48:19 <peter1138> Job done, we can go home.
23:49:12 <emperorjake> There is an experimental patch that changes the road vehicle movement code so that diagonal roads actually work, no changes to the map array needed
23:49:38 <emperorjake> the wall they ran into was with articulated vehicles disconnecting or something
23:50:46 <Flygon> The difficulty is having those diagonals work nicely with the cliffs :P
23:50:53 <Flygon> I can see how articulated is a pain.
23:58:25 *** Flygon has quit IRC (Read error: Connection reset by peer)
continue to next day ⏵