IRC logs for #openttd on OFTC at 2024-10-18
⏴ go to previous day
02:49:57 *** gnu_jj_ has joined #openttd
02:53:19 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:04:26 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:47:17 <DorpsGek> - Update: Translations from eints (by translators)
05:12:26 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:29:32 <andythenorth[d]> [making cargo class docs]
06:30:01 <andythenorth[d]> who's responsible for providing fallbacks?
06:30:26 <andythenorth[d]> should cargo authors set classes so that there are always fallbacks to piece goods, bulk, liquid?
06:30:56 <andythenorth[d]> or should vehicle authors always provide some vehicles that support all the classes?
08:15:58 *** SigHunter has joined #openttd
08:34:37 *** mindlesstux has joined #openttd
08:54:16 *** dwfreed_ has joined #openttd
08:58:25 *** dwfreed_ has quit IRC (Remote host closed the connection)
08:58:26 *** dwfreed has joined #openttd
08:59:07 <andythenorth[d]> think it's cargos
08:59:32 <andythenorth[d]> what if FIRS had a parameter "set all non-pax, non-mail cargos to include CC_PIECE_GOODS"
08:59:44 <andythenorth[d]> [what if OpenTTD had a setting for that?] 😮
09:08:32 *** akimoto has joined #openttd
09:30:25 <andythenorth[d]> I did have an idea about detecting any cargos that don't have a suitable vehicle, then just forcing something to refit them
09:30:44 <andythenorth[d]> but it's much more complicated and would be more pitchforks (planes carrying coal)
09:46:38 <xarick> I have another one of those weird ideas
09:47:00 <xarick> get rid of TileIndexDiff and only use TileIndexDiffC
09:55:34 <NGC3982> no config file bundled in openttd-14.1-linux-generic-amd64$?
10:00:23 <NGC3982> its created when the program runs
10:00:46 <NGC3982> it doesnt seem to be created in linux automatically when i run the program headless
10:01:29 <LordAro> it'll use the default config file locations
10:13:20 <NGC3982> oh, the site isnt updated
10:13:21 <NGC3982> timekeeping_units = 1
10:13:22 <NGC3982> minutes_per_calendar_year = 0
10:19:10 <xarick> I haven't come accross any assert yet, that's quite remarkable
10:19:27 <xarick> that doesn't mean things are working correctly
10:20:53 <NGC3982> also, how is server_name set? it's not part of the new config and the site hyperlink is broken
10:38:04 *** akimoto has quit IRC (Remote host closed the connection)
10:46:29 *** D-HUND is now known as debdog
10:49:28 <xarick> 116 matches for TileOffsByDiagDir 😦
11:01:34 <peter1138> NGC3982: "Archive" in the URL 🙂
11:02:22 <peter1138> `server_name` is set in private.cfg now.
11:29:25 <xarick> it's my first time doing an operator
11:30:04 <xarick> ```struct TileIndexDiffC {
11:30:04 <xarick> int16_t x; ///< The x value of the coordinate
11:30:04 <xarick> int16_t y; ///< The y value of the coordinate
11:30:04 <xarick> TileIndexDiffC operator - () { return TileIndexDiffC{ static_cast<int16_t>(-x), static_cast<int16_t>(-y) }; };
11:31:42 <xarick> TileIndexDiffC delta = TileIndexDiffCByDiagDir(AxisToDiagDir(axis));
11:31:42 <xarick> TileIndex start = AddTileIndexDiffC(start, -delta) AddTileIndexDiffC(start, -delta)```
11:31:45 <peter1138> There's a pattern that should be followed when implementing these operators.
11:32:11 <peter1138> e.g. `operator-` should usually be defined in terms of `operator-=`
11:32:36 <peter1138> So it may be better to have explicit functions (like how TileAdd is) instead.
11:44:03 <NGC3982> peter1138: if it's in private.cfg, how is it references while running openttd as a dedicated server?
11:44:44 <peter1138> private.cfg still exists.
11:45:38 <peter1138> When using `-c` just use different config directories instead of one.
11:45:56 <NGC3982> oh, so it picks up private.cfg in the config directory
11:46:09 <NGC3982> i noticed that it was created there when i tried running with the separate cfg file
12:03:45 <peter1138> Is tile 0 always MP_VOID?
12:05:01 <xarick> freeform_edges off makes it a water tile
12:29:24 <xarick> i want -delta to be {x=0 y=1}, how hard can it be?
12:31:23 <xarick> oh, it's right on the other side... weird
12:32:28 <peter1138> Were you looking at the value before it had been executed?
12:32:52 *** argoneus has quit IRC (Read error: No route to host)
12:32:54 *** argoneus7 has joined #openttd
12:35:39 <xarick> AddTileIndexDiffC(start, -delta)
12:36:06 <xarick> how do I know what it does?
12:39:20 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:40:15 <xarick> inline constexpr TileIndexDiffC operator - ()
12:44:01 <xarick> operator- still displays it returning garbage, but AddTileIndexDiffC displays it correctly after
12:50:38 <xarick> it is turning the original delta into a different thing, that's not what I want
12:51:40 <peter1138> Yeah, if you implement operators incorrectly...
12:52:04 <_glx_> `T T::operator-() const;` that's the expected signature
12:52:25 <_glx_> you are not supposed to modify `this`
12:57:29 <kuhnovic> Question about code style. Do we allow function parameters to shadow member names, and rely on this-> to solve that? `this->tile_index = tile_index;` for example.
12:57:51 <peter1138> Ideally it shouldn't.
12:58:13 <_glx_> that's why we "force" `this->`
12:58:32 <_glx_> but usually it's for constructors only
12:58:49 <_glx_> other functions tries to not do it
12:59:03 <peter1138> If you can avoid it, do so. Like `tile_index` can just be `tile`
13:00:17 <xarick> @glx TileIndexDiffC is a struct, not a class
13:00:49 <_glx_> struct and class are similar, the only difference is default visibility
13:01:47 <xarick> which one is it? what the heck is T
13:02:23 <_glx_> "The keywords class and struct are identical except for the default member access and the default base class access."
13:02:58 <_glx_> T is TileIndexDiffC in your case
13:04:32 <xarick> i tried replacing a with this, doesn't work
13:04:44 <kuhnovic> peter1138: The reason I'm asking is that I want to fix the codestyle in all of YAPF. There's a lot of renaming and adding `this->`, I don't really want to nitpick each parameter name 😛
13:04:57 <peter1138> kuhnovic: I have patches for that already.
13:07:02 <peter1138> I only did it this week.
13:08:01 <peter1138> And without `m_` everywhere it becomes much easier to read, IMHO.
13:08:03 <kuhnovic> I'm glad I mentioned it before I went all the way haha
13:08:18 <peter1138> I did already say I was doing it, soryr.
13:08:43 <kuhnovic> I did see that but I only half registered it I guess
13:09:03 <peter1138> Anyway, if you fancy reviewing that PR... 🙂
13:09:11 <kuhnovic> ... not really ... 😛
13:09:28 <peter1138> Removal of `m_` is also what motivated me to remove `CCountedPtr`
13:10:12 <kuhnovic> One thing leads to another, suddenly everything is modern C++ and half of the codebase is removed
13:10:25 <kuhnovic> Did you do this by hand or did you use some tooling?
13:10:32 <peter1138> Using `m_` doesn't make sense when those members are accessable outside the class directly.
13:10:50 <peter1138> It's mostly automatic refactoring, and some manual replacements where that missed things.
13:11:28 <peter1138> The second commit that adds includes helped, as that reinforces the
13:11:58 <peter1138> the links between types and also means that you actually get feedback on what is right/wrong.
13:12:04 <kuhnovic> It was quite easy for me to do the renaming automatically, but the this-> was something I couldn't get automated
13:12:53 <peter1138> That's why I did `this->` first. I could ensure that anything that started with `m_` by itself would have `this->` added.
13:13:06 <peter1138> If I renamed first, then that's not so easy to see.
13:13:30 <peter1138> And indeed there might be that tile_index naming clash there I guess 🙂
13:14:07 <kuhnovic> Ah yeah that's smart
13:15:17 <kuhnovic> One thing at a time, this is already a huge improvement. Some variable names could also use a bit of a refresh I guess. I don't see the need to abbreviate things like "trackdir" to "td" for example. But that's definitely outside the scope of this PR.
13:20:06 <peter1138> Seeing `ft.m_new_tile` used in places just reinforced my view that m_ is the wrong thing there.
13:20:38 <peter1138> There are some bits that are still matching our convention. e.g. template parameter naming.
13:20:46 <peter1138> And using `typedef` still instead `using`
13:22:54 <peter1138> Hmm, not sure why I renamed 'm_arr' to 'items' and then went with "data" int he debug output... heh
13:24:40 <kuhnovic> Again, one thing at a time, this is already a huge change and I bet I'm going to see "this->" when I close my eyes tonight 😛
13:41:38 <kuhnovic> Small stuff. Let's do a few more improvement iterations 🙂
13:45:24 <kuhnovic> YAPF should be happy, it's getting a full body make-over!
14:33:56 <xarick> I was going the removal direction
14:34:27 <xarick> removing TileIndexDiff
14:34:38 <LordAro> just make everything an int
14:34:38 <xarick> convert everything to TileIndexDiffC
14:34:46 <LordAro> it's all it is underneath anyway
14:35:30 <peter1138> But we all know maps when 4 million tiles are too small...
14:36:17 <peter1138> But we all know maps with only 4 million tiles in one direction are too small...
14:38:17 <Rubidium> up to 2 billion we'll go ;)
14:49:08 <xarick> `assert(!IsDriveThroughRoadStopContinuation(rs->xy, AddTileIndexDiffC(rs->xy, -TileIndexDiffCByDiagDir(AxisToDiagDir(DiagDirToAxis(GetRoadStopDir(rs->xy)))))));`
14:57:25 <xarick> woah, script_road is complicated
14:58:44 <Borg> okey :) BSPI v3.00 release.. I made a post on thread.. now lets wait for bug reports ;)
15:01:31 <xarick> NormaliseTileOffset in script_road.cpp... how to deal with it?
15:02:51 <LordAro> i wouldn't call ')))))))' particularly smart
15:30:29 *** Wormnest has joined #openttd
15:58:21 *** gelignite has joined #openttd
16:04:50 *** HerzogDeXtEr has joined #openttd
16:53:28 <andythenorth[d]> peter1138: too small for lunch?
16:55:51 *** gelignite has quit IRC (Quit: Stay safe!)
16:56:58 <xarick> I just realised most of my AddTileIndexDiffC should have been AddTileIndexDiffCWrap
17:07:09 <andythenorth[d]> did I even lunch?
17:13:01 <peter1138> Okay, so TileIndex 0 could be sea.
17:27:22 <johnfranklin> Fish and chips today
17:30:13 <xarick> replacing all TileOffsByDiagDir to TileIndexDiffCByDiagDir
17:30:50 <xarick> script_road.cpp is a mess, I can't change that
17:39:11 <xarick> > /* Here's one of the main headaches. GetTileSlope does not correct for possibly
17:39:11 <xarick> > * existing foundataions, so we do have to do that manually later on.*/
18:20:39 <NGC3982> where did lan_internet and server_advertise move?
18:44:03 <peter1138> server_game_type = public
18:57:28 <xarick> trying to understand if it can ever assert with my changes
18:57:42 <xarick> but it seems already resilient enough
20:00:59 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
20:37:22 *** Wormnest has joined #openttd
20:40:21 <ian01223> hmm... I just noticed that on the English (UK) language, all the tooltips for tickboxes say "Check this box..."
20:41:01 <ian01223> this seems like a great argument waiting to happen
20:42:14 <ian01223> well, I guess checkbox has pretty much become part of british english by this point, but not the verb check for this purpose
20:42:48 <ian01223> the things you notice when writing wiki articles...
20:44:44 <xarick> I finally got asserts!
20:45:31 <_jgr_> That text has been there for over 20 years, I expect any such argument would have happened by now
20:47:44 <Rubidium> I hope those tooltips don't tick someone off ;)
20:48:56 <xarick> woah, I was doing that
20:49:52 <ian01223> I'd be surprised if it didn't
20:50:26 <xarick> I was instead doing a massive 50++ file changes at once
20:50:42 <ian01223> so, 51 file changes?
20:51:17 <xarick> I get some ortogonal iterator asserts :p
20:51:50 <ian01223> _jgr_: but I think I'll let someone else check the IRC logs for when it did last happen
21:12:59 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:15:56 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:26:33 *** Borg has quit IRC (Quit: leaving)
21:37:40 *** Wormnest has joined #openttd
21:47:44 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:51:35 *** ChanServ sets mode: +v tokai
21:58:29 *** Tirili has quit IRC (Quit: Leaving)
21:58:33 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:21:20 <xarick> actually fine in openttd
22:22:08 <xarick> tile = AddTileIndexDiffCWrap(tile, delta);
22:32:36 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day ⏵