IRC logs for #openttd on OFTC at 2024-10-27
β΄ go to previous day
00:00:39 <_glx_> it's harder to enter SCC stuff manually
00:01:41 <_glx_> and bananas texts or server names are manually written
00:06:40 <peter1138> Sorry for always using 10 digits now. 7 has too many collisions these days.
00:51:13 *** mindlesstux is now known as Guest7550
00:51:13 *** Guest7550 has quit IRC (Read error: Connection reset by peer)
00:51:14 *** mindlesstux has joined #openttd
02:27:09 *** gelignite is now known as Guest7563
02:27:12 *** gelignite has joined #openttd
02:34:33 *** Guest7563 has quit IRC (Ping timeout: 480 seconds)
02:46:35 *** gelignite has quit IRC (Quit: Stay safe!)
03:44:58 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:46:35 *** Artea has quit IRC (Remote host closed the connection)
04:00:02 *** D-HUND is now known as debdog
04:06:09 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:47:34 <DorpsGek> - Update: Translations from eints (by translators)
08:36:47 <andythenorth> If lunch is coffee, then yes
08:52:04 <johnfranklin> instant noodles with smoked salmon, that sounds strange
08:52:33 *** SigHunter has joined #openttd
08:55:20 <wensimehrp> π they are food
08:57:12 *** SigHunter has joined #openttd
08:59:45 <Rubidium> johnfranklin: I'd say "vegan turkey stuffing" is stranger ;)
09:04:27 <johnfranklin> It seems that scotrail is still operating ic125
09:16:18 <peter1138> Maybe doing utf-8 decoding and ignoring only control codes at the start is better.
09:38:00 *** debdog has quit IRC (Quit: Initiating getting-the-hell-out-of-here maneuver!)
09:46:24 *** gelignite has joined #openttd
10:12:03 <peter1138> std::variant<pr13034, pr13035>
10:45:31 <LordAro> #13035 seems reasonable though
10:46:14 <LordAro> wonder if it might be worth changing 'Garbage' to something more descriptive, since it implies actual invalid characters, not just "we don't sort on these"
11:21:12 *** HerzogDeXtEr has joined #openttd
11:27:02 <wensimehrp> Ah It's an abbreviation
11:28:33 <merni> wensimehrp: I wouldn't really say so. More like a technical term
11:28:59 <merni> Though I guess calling it an abbreviation also makes sense
11:29:26 <wensimehrp> merni: That's what the dictionary said
11:42:42 <peter1138> LordAro: Not sure. We do sort on them, just not if they are at the beginning of the string.
11:44:05 <peter1138> And I rather solve the issue I created instead of come up with new terms π
12:18:10 *** ketsuban has joined #openttd
12:18:10 <ketsuban> This is where I get bitten by not having a complete development environment and find out I need to include an extra #include or something. π
12:18:46 *** ketsuban is now known as Guest7620
12:18:47 *** Guest7620 is now known as ketsuban[d]
12:21:16 <xarick> I'm trying to decipher TryBuildLightHouse mystic code
12:21:42 <xarick> I suspect there is a off by one issue there but i can't prove it
12:28:23 <peter1138> There can't be an off-by-one issue in that line.
12:29:23 *** gelignite has quit IRC (Ping timeout: 480 seconds)
12:35:14 *** gelignite has joined #openttd
12:56:30 <johnfranklin> This is an extra-long weekend.
12:56:58 <johnfranklin> But there is a extra-short weekend in March.
13:16:34 <Rubidium> xarick: there are many off-by-somewhat "issues" in that function, though the question is whether it really matters that much in the context of everything else
13:26:53 *** aperezdc has quit IRC (Ping timeout: 480 seconds)
14:03:01 <peter1138> Hmm, I can do some timing.
14:09:20 <xarick> i just bruteforced building light houses in every map size combination possible and every random number combination
14:10:38 <peter1138> Is it because it's not broken?
14:12:45 *** Wolf01 is now known as Guest7628
14:13:48 <xarick> i must have screwed up somehow
14:16:38 <andythenorth> Who watches the watchmen?
14:17:43 *** Guest7628 has quit IRC (Ping timeout: 480 seconds)
14:18:34 <xarick> alright, i'm gonna delete the lighthouse then
14:20:41 <xarick> IsTunnelInWayDir and CmdBuildTunnel
14:20:49 <xarick> how to reproduce these
14:27:00 *** Flygon has quit IRC (Read error: Connection reset by peer)
14:30:21 <xarick> i must be confused with the old TileAdd doing incorrect asserts...
14:35:30 *** Artea has quit IRC (Remote host closed the connection)
14:44:00 <xarick> `std::tie(end_tileh, end_z) = GetTileSlopeZ(end_tile);`
14:51:52 <LordAro> what do you think it does?
14:52:05 <LordAro> or, have you tried asking anyone other than us?
15:01:47 <xarick> i thought std::tie was for another purpose
15:14:29 <xarick> tunnel_in_way_dir is weird
15:18:59 *** aperezdc has joined #openttd
15:21:23 <xarick> depending on the position I am in the map
15:21:31 <xarick> it searchs either left or right
15:21:58 <xarick> is this an optimization attempt?
15:24:23 <peter1138> When checking if a tunnel is in the way, you only need to check one side of the tunnel about to be built.
15:25:30 <peter1138> That code chooses which side based on position to reduce the potential number of tiles to check.
15:25:43 <peter1138> So it is an optimization.
15:26:31 <peter1138> With larger maps it's still going to check a lot of tiles, but it prefers to check the shorter side.
15:27:53 <xarick> I can't seem to get the assert triggering
15:30:38 <peter1138> Asserts only trigger when the code is wrong.
15:32:53 <xarick> height of a tile is always the minimum of the 4 corners.
15:33:14 <xarick> this is impossible to assert
15:33:19 <andythenorth> Clocks changed, lunch confusion
15:34:11 <xarick> if the start_z is 0, freeform_edges is off, the edge is water and cannot start a tunnel through the edge
15:35:26 <xarick> if (start_z == end_z) break; prevents ever going through the edge
15:35:40 <xarick> so why did it assert on my code? π¦
15:38:09 <andythenorth> Itβs common that testing code has as many errors as the code itβs nominally testing
15:40:16 <xarick> is there a difference between GetTileSlopeZ and GetTileZ?
15:40:30 <LordAro> have you tried reading?
15:40:34 <peter1138> Person writing unit tests shouldn't be the same person writing code being unit tested.
15:43:48 <xarick> nop, seems to produce the same height
15:43:59 <LordAro> in all circumstances?
15:44:20 <LordAro> also, that's not an answer to "have you tried reading [the documentation]?"
15:45:51 <xarick> > * @return Minimum height of the tile
15:45:51 <xarick> > int GetTileZ(TileIndex tile)
15:46:16 <LordAro> stop echoing everything here
15:49:49 <peter1138> So now #13034 is only necessary if we'd like to ignore control codes in the middle of strings as well.
15:55:12 <Rubidium> xarick: GetTileSlopeZ and GetTileZ are the same. Just like ordering a sandwich with soda and a sandwich [without soda] will cause you to end up with the same sandwich. Though if you don't want a soda, why would you order it?
15:57:44 <andythenorth> Ok lunch is happening, important news
15:58:42 <Rubidium> though having said that, GetTileSlopeZ suffers from one of the two hard problems of software development
17:50:14 <LordAro> `UserError("Uhm, would you be so kind not to load a NewGRF that changes the type of the map generator sprites?");` lol
17:56:18 <peter1138> At some point using exceptions instead of crashing hard would be better...
18:03:43 <peter1138> Great thing about IRC is you can't see all the stuff in other channels.
18:06:55 <andythenorth> peter1138: I muted most of discord channelsβ¦
18:12:08 *** belajalilija has joined #openttd
18:12:08 <belajalilija> I muted them all
18:12:16 <belajalilija> Idk how to hide them
18:20:32 <peter1138> Oof, it conflicts π
18:31:48 <xarick> const auto or const TileIndex
18:41:16 <xarick> `for (const auto t : Map::Iterate()) {` or `for (auto t : Map::Iterate()) {`
18:42:30 <LordAro> xarick: what do you think the difference is and when one would be appropriate over the other?
18:43:37 <xarick> some of the afterload conversion doesn't work with const
18:43:55 <LordAro> why do you think that is?
18:44:25 <xarick> it's still changing bits on the t structure
18:52:11 <LordAro> you can't modify a const reference
18:53:13 <LordAro> you might be able to modify (the contents of) pointers within it though
18:59:07 <_glx_> usually t is just a Tile here
19:03:06 <_glx_> not sure interchanging TileIndex with Tile works very well
19:04:52 <peter1138> Yes, Tile is different from TileIndex. I don't know if Map::Iterate() is appropriate for all uses. (Maybe it is)
19:06:10 <_glx_> oh there's an automatic TileIndex to Tile conversion
19:08:26 <_glx_> ok it works because `debug_inline Tile(TileIndex tile) : tile(tile) {}` and `debug_inline constexpr operator TileIndex() const { return tile; }`
19:08:48 <peter1138> Working != best practice π
19:09:08 <peter1138> (Not to say it's not, though)
19:19:18 <peter1138> Heh, remember the pain of rebasing savegame changes before the magic numbers were turned into an enum...?
19:39:00 <peter1138> I can see some improvements but, uh...
19:56:22 <xarick> I think I found a bug in the Diagonal area iterator
19:58:11 <xarick> or maybe it's fine bcause it's a while loop...
20:11:52 <_glx_> looks like it's equivalent to `this->tile != INVALID_TILE && ...`
20:18:54 <xarick> i can't make tile 65535 reachable with terraforming diagonal
20:19:41 <xarick> can't find a way to get this->tile to == 65535
20:20:22 <xarick> there's a row and column of void tiles there, I see
20:21:29 <xarick> what else uses diagonal iterator in the game?
20:25:05 <peter1138> Clearing land ctrl pressed. Placing trees with ctrl pressed.
20:25:25 <peter1138> Terraforming land with ctrl pressed.
20:27:34 <_glx_> in this loop condition I don't think > or >= would make a difference
20:31:37 <peter1138> It's better to focus on actual bugs rather than thinking everything is buggy and needs fixing.
20:35:40 <_glx_> it should exit the loop
20:37:03 <xarick> looks fine, I don't know what I should be looking for
20:37:36 <xarick> how would i make it 65536 perhaps?
20:37:59 <_glx_> you can't get 65536 as x and y are bound checked
20:38:18 <_glx_> and this->tile will be INVALID_TILE in this case
20:39:10 <_glx_> `this->tile = x >= Map::SizeX() || y >= Map::SizeY() ? INVALID_TILE : TileXY(x, y);` handles it
20:43:11 <xarick> hmm okay, thx for looking at it
20:43:56 <xarick> maybe this->tile == INVALID_TILE?
20:44:27 <_glx_> that's what it actually does yes, but there's no bug
20:44:37 <xarick> > >Map::Size() triggered my alarm
20:44:55 <xarick> because everywhere else I look, it's always >= Map::Size()
20:50:03 <xarick> waypoint_sl.cpp has a whole map tile++ that I'm trying to convert to Map::Iterate(), but it's a special kind
21:05:08 <xarick> is there a version 16 savegame somewhere so i can test this?
21:05:19 <xarick> moving waypoints to base station
21:11:41 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:20:18 <xarick> forgot what was the site with all openttd versions
21:35:15 <xarick> cannot open file sample.cat
21:36:09 <_glx_> you need original TTD files before 1.0 IIRC
21:45:53 <xarick> oh, this only catches invalid waypoints
21:47:35 <xarick> how to make it invalid
21:51:56 *** ChanServ sets mode: +v tokai
21:58:56 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:04:01 *** gelignite has quit IRC (Quit: Stay safe!)
22:20:12 <xarick> all this because of Map::Iterate() π
22:21:52 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:28:03 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:22:17 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day β΅