IRC logs for #openttd on OFTC at 2024-11-19
β΄ go to previous day
02:09:08 *** Wormnest_ has joined #openttd
02:09:08 *** Wormnest has quit IRC (Read error: Connection reset by peer)
02:32:01 *** ChanServ sets mode: +v tokai
02:35:54 *** Wormnest_ has quit IRC (Quit: Leaving)
02:38:59 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
03:17:20 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:28:56 *** D-HUND is now known as debdog
06:13:40 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:58:22 <Rubidium> poor MacOS being thrown under the bus
07:58:57 <peter1138> Oh god, it's snowing.
08:09:34 *** SigHunter has joined #openttd
08:15:15 *** gelignite has joined #openttd
08:30:36 <peter1138> Does it matter? No one will understand it.
08:32:25 *** SigHunter has joined #openttd
08:41:21 <peter1138> They're all in the GRFs.
08:41:54 <peter1138> So what you are saying is build a list of labels and their classes into OpenTTD and override whatever the author says...
08:42:33 <peter1138> And do the same for railtype classes which don't even exist.
08:42:58 <peter1138> grfcodec -d is not the easiest way of setting cargo classes.
09:03:38 <peter1138> 13090 is going to cause your act2ids to be consumed even faster right?
09:04:05 <LordAro> there seems to be someone missing from the bridge
09:04:15 <LordAro> or else peter is talking to himself
09:04:34 <peter1138> Yes, andy said a rude unicode character.
09:04:42 <pickpacket> peter1138: we had some snow a couple of days ago. Still on the ground
09:05:48 <pickpacket> When I'm trying out my GS, is it possible to reload it without closing the game?
09:10:37 <Rubidium> I don't think that's possible yet. Or maybe rescan_game + reload (if you mean restarting the application by "closing the game")
09:19:06 <peter1138> 16 bit act2ids when?
09:19:36 <peter1138> For badges I use a 16 bit translation table, not that's really needed but I define more than 255 badges...
09:50:02 <exceptik> I thought `this` doesn't work in static context since there is no object to associate π€
09:50:56 *** mindlesstux has joined #openttd
10:12:57 <Rubidium> exceptik: this in static context does indeed not work, but consider a static data member called m; That can be accessed by this->m from non-static context
10:16:54 <exceptik> I'm just used to use `ClassName::member` π€·
10:17:07 *** gelignite has quit IRC (Quit: Stay safe!)
10:18:21 <Rubidium> that is the way we prefer it to be for static class members, just like we would like this-> to be used for instance members
10:25:54 <peter1138> Yeah, it's annoying that `this->` DOES work for static members from inside.
10:29:22 <xarick> am I doing something bad?
10:30:18 <xarick> what name would "level + 1" have if it was defined as a variable?
10:30:50 <xarick> it's in kdtree context
10:31:25 <kuhnovic> Did I already mention that I don't like the `this->` thing π ?
10:33:45 <xarick> I'm going with "descent_level"
10:40:30 <xarick> what's different between static const and static constexpr
10:50:09 <xarick> static const size_t MIN_REBALANCE_THRESHOLD = 8; made it recompile 158 files
10:56:33 <xarick> peter told me to make PR's
11:08:22 <peter1138> Yes, I'm regretting that.
11:08:31 <peter1138> Make PRs if you know what you are doing, perhaps.
11:09:23 <xarick> I won't do for those cases where I'm uncertain
11:09:46 <xarick> the std::move fiasco, don't know how much implications it has
11:10:34 <peter1138> In fact we should probably go private and develop everything behind closed doors :p
11:29:33 <xarick> is that better? the INVALID_NODE doesn't have it
11:40:48 <xarick> Make member functions const for const-correctness
11:40:48 <xarick> Sometimes Copilot is too obvious
11:41:17 <xarick> would that fly as a commit message?
11:48:11 <xarick> Copilot is looking at your Pull Request template
11:48:58 <yiffgirl> don't you have a brain of your own
11:50:04 <xarick> my brain is made of water
11:56:45 <xarick> jesus, it answered all of the "Limitations" part
12:17:23 <xarick> there's some more consts mixed with references
12:21:29 <xarick> also renaming the "e" for "element" and making the name consistent across the other parts that also refer to "element"
12:21:55 <xarick> I've seen it named "v", "a", "b"
12:31:56 <xarick> @tparam T Type stored in the tree, should be cheap to copy.
12:33:07 <xarick> viewport_kdtree.h doesn't look cheap to me
12:40:08 *** gelignite has joined #openttd
12:45:25 <talltyler> But can it run ~~Doom~ Conway's Game of Life?
12:53:51 <peter1138> Ah yes, can't view videos inside Discord because the ads are not blocked.
12:55:42 <peter1138> His voice is weird...
12:57:26 <peter1138> Also he misnames the game. Pfft.
13:03:29 <xarick> what is he doing? he can copy paste rails?
13:04:32 *** sam_chug has joined #openttd
13:04:32 <sam_chug> i can't do anything about my weird voice π
13:05:36 <sam_chug> i get that a lot, its ok haha
13:06:11 <locosage> sam_chug: hi, next time you have issues with cmclient just dm me ;)
13:17:53 <peter1138> This is the only legit use for block signals as 'logic'
13:19:04 <peter1138> "vanilla transport tycoon also has a hard cap of 5000 trains"
13:19:30 <peter1138> Mmm, I think actual Transport Tycoon is a lot lower than that.
13:20:25 *** gelignite has quit IRC (Quit: Stay safe!)
13:31:22 <sam_chug> yeaaaah true, but to be fair "open transport tycoon deluxe" or "openttd" dont roll off the toungue the same way "transport tycoon" does
13:32:24 <peter1138> The first one isn't the game's name anyway.
13:34:04 <xarick> why do station, town, sign always have the same value?
13:34:14 <xarick> if one is 5, the others are also 5
13:34:16 <peter1138> It's the same location.
13:34:59 <_glx_> maybe it could be a variant instead
13:35:55 <peter1138> Not super useful, all the types are uint16_t.
13:37:17 <peter1138> Plus all the overhead of checking the variant contents.
13:37:32 <_glx_> anyway all IDs are in the same location, and to know which one it really is there's the type field right above
13:38:13 <xarick> isn't this a thing that could be passed as reference instead of copy?
13:38:30 <xarick> ViewportSignKdtreeItem
13:39:29 <_glx_> most things can be passed as reference, depending on context
13:40:41 <xarick> e is a ViewportSIgnKdtreeItem in this case
13:40:41 <_glx_> push_back will make a copy anyway
13:44:44 <xarick> maybe copilot is misleading me
14:31:32 <xarick> I'm trying to invent a IsAnyContainedExcept for kdtree
14:50:20 <xarick> oh, I actually need a FindNearest except
15:43:15 *** herringland has joined #openttd
15:43:15 <herringland> I have a question about Bananas. Iβm interested in pushing content to Bananas with a GitHub (or similar) build pipeline, but Iβm finding the existing tooling doesnβt have the features I need.
15:43:15 <herringland> I took a look at the bananas-frontend-cli, which is very nearly what I need, however Iβm finding the authentication component a bit of a hassle. To get an authentication token for Bananas, you need to log in with GitHub in your browser, and allow permissions to Bananas for verifying your account. Doing this once wouldnβt be an issue, however the bananas authentication token only seems to be valid
15:43:15 <herringland> for 14 hours. Iβd prefer my build pipeline to publish to bananas automatically, without the need for manual web authentication.
15:43:15 <herringland> Is there a way to get a longer lived token to bananas, or a way to authenticate your GitHub that doesnβt involve logging in with a browser? TIA!
16:30:48 <xarick> how do I return the invalid sentinel value of a type?
16:31:46 <xarick> I need a T::ReturnInvalidSentinel()
16:31:58 <xarick> T could be many things
16:32:14 <xarick> IndustryID, TownID, StationID
16:37:32 <xarick> well currently yes... but
16:38:27 <xarick> viewport item thingy doesn't have
16:39:07 <_glx_> I mean IndustryID:: is like uint16_t::
16:40:20 <_glx_> usually if there's an invalid value it's specified as a template param
16:41:32 <peter1138> Oops, I did a bad commit :S
16:45:15 <peter1138> All my OpenTTD commits are good. Honest π
17:22:44 <johnfranklin> (Blame Long Vehicles v4)
17:35:44 <LordAro> i'd imagine it has no idea what 'T' is
17:40:22 <_glx_> no it knows what 'T' is and it's clearly not interchangeable with 'int'
17:40:54 <_glx_> the proper way would be an extra template arg
17:45:16 <xarick> copilot is telling me std::optional<T> element = std::nullopt
17:47:09 <xarick> yes, I dunno, still testing
17:48:18 <_glx_> else you would not need a default value
17:54:26 <peter1138> Don't worry, I'm not doing ALL of them...
18:03:39 <peter1138> herringland: Not sure about banana token life. Maybe truebrain knows.
18:09:18 <herringland> peter1138: cheers, wasnβt sure if I should ping them or not
18:09:34 <xarick> ``` const auto iid = _industry_type_kdtrees[type].FindNearestExcept(TileX(tile), TileY(tile), current->index);
18:09:34 <xarick> if (iid.has_value()) best_dist = DistanceManhattan(tile, Industry::Get(iid.value())->location.tile);```
18:09:52 <peter1138> Oh well, I probably shouldn't either, but at least that means you don't get the wrath π
18:14:32 <peter1138> truebrain: Well, I guess I could...
18:15:13 <truebrain> herringland: Access Tokens are retrieved from GitHub, so their lifetime is defined by GitHub. But as it goes with Access Tokens, you want them to be short-lived. So that is expected, and also not something you would like to change
18:16:33 <truebrain> If you want an app that survives longer, you need to do the handshaking with GitHub, and use one of their machine-to-machine flows
18:17:19 <truebrain> I once made a begin with that, but all content creators at that time made very clear to have zero interest in that, so .. with no users, no effort was added π
18:17:46 <_glx_> bananas permissions is only done once I think
18:18:08 <truebrain> I am unsure how permissions are related to this question?
18:18:58 <_glx_> but you have to log in to get the token, which seems to be expected
18:21:10 <truebrain> I still don't know what you are trying to say, sorry π
18:21:49 <_glx_> it should be possible to use a long term access token you can generate in github interface and put in secrets
18:21:50 <truebrain> herringland: anyway, part of the problem is that the only machine-to-machine flow GitHub supports, is done by creating your own GitHub App, which seems a bit far-fetched from the average use-case
18:22:01 <truebrain> so maybe we should look into supporting login-flows by just a PAT
18:22:11 <truebrain> as in the end, BaNaNaS doesn't actually care how you authenticated
18:25:19 *** gelignite has joined #openttd
18:28:24 *** asasnat has joined #openttd
18:28:24 <asasnat> note to self: do NOT parallel build OpenTTD on Linux
18:28:50 <asasnat> (my system froze when I did that)
18:29:09 <herringland> truebrain: Thanks for reply, the bearer token time limit makes sense. The PAT route sounds like what Iβm looking for.
18:29:13 <_glx_> you forgot to limit the parallisation
18:29:29 <truebrain> herringland: yeah, that needs altering of the bananas-api
18:29:37 <asasnat> _glx_: no idea what that is so I'll just serial build (is that the corret term?)
18:30:19 <truebrain> basically all API endpoints should just accept a Bearer token, instead of depend on a session
18:30:26 <truebrain> but this API was written from way before that was acceptable π
18:30:29 <_glx_> don't use `-j` without any number
18:31:59 <herringland> truebrain: Do you accept PRs? Iβm a Python developer/devops person by day, I could probably take a look at this.
18:32:15 <_glx_> PRs always welcome π
18:32:16 <truebrain> I do think it might require a bit more fundamental rewrite of the API
18:32:28 <truebrain> it has been months, no, years since I last actually looked at the API
18:33:39 <truebrain> ah, no, I am wrongt
18:33:43 <truebrain> the API already uses Bearer
18:33:52 <truebrain> it was just from before it was normal that frontends talked to the API directly
18:33:56 <truebrain> so it is now routed via a backend
18:34:11 <truebrain> which means the API only wants to see a valid JWT token
18:34:31 <truebrain> so I guess it means the backend of the frontend (ghehe) only needs another login URL where you can offer it a token directly
18:35:13 <truebrain> ah, yes, I didn't write that backend
18:35:15 <truebrain> now I remember π
18:36:12 <truebrain> I guess it would be reasonable if there was another URL where you can offer the JWT directly
18:36:29 <truebrain> now I come to think of it
18:36:34 <truebrain> you are skipping the frontend completely
18:36:40 <truebrain> so you should just be able to talk to the API via a valid JWT
18:36:59 <truebrain> so none of what I said in the last 30 minutes is anywhere near relevant
18:37:11 <truebrain> and the answer is just: make a call the API yourself, and use a PAT token as Bearer token
18:37:15 <truebrain> that should "just work" π
18:37:37 <truebrain> I might be wrong, as that sounds too simple π
18:38:24 <truebrain> ah, indeed. Okay, next mindfuck. Does it show I wrote this software years ago? π
18:38:29 <truebrain> Sorry about the long blabla
18:38:47 <truebrain> but the API acts like its own OAuth provider, so we do need an extra step
18:39:18 <truebrain> and we do expire our own API tokens too
18:39:38 <truebrain> so I was very wrong π Lovely!
18:39:49 <herringland> truebrain: Yeah, this is what I was running into!
18:39:58 <truebrain> Both the GitHub's access token expires
18:40:03 <truebrain> but we expire our API tokens too
18:40:29 <herringland> no worries about forgetting the old software haha, Iβm basically in the same boat here, trying to make automatic releases so I donβt forget how to do all this
18:40:57 <peter1138> I did happen to wonder about doing automatic releases from github just today.
18:41:17 <peter1138> But I don't have any workflows yet to even get to the point of discovering that login is a problem π
18:41:30 <truebrain> This for example is where normally the OAuth code (of the API) is changed for a Bearer token
18:42:04 <truebrain> I think we did it this way, as back then, it wasn't absolutely a given that GitHub was to stay
18:42:09 <truebrain> so the API supports multiple backends
18:42:32 <truebrain> so it implements its own OAuth handling, but doesn't give things like persistent tokens, or JKS, or any of that stuff
18:45:21 <_glx_> peter1138: if you release via github to github it should not be too hard to do using github API
18:45:29 <truebrain> function doesn't exist yet), and a valid Bearer token can be returned to the application, which can be used for the next 14h to do API calls
18:45:40 <truebrain> the 14h isn't an issue then too, as your automation shouldn't take that long π
18:45:51 <truebrain> and this way we have a clean way to revalidate every 14h that a PAT is still valid
18:46:19 <truebrain> does that make sense? Anyway, a PR would be much and highly appreciated. Just know it is a bit of an old codebase, so there are some odd thing sin there. But the only changes you need should be in the bananas-api repo
18:50:07 <herringland> truebrain: Yeah, that makes sense! Iβll spin up a development environment tonight to start working on this π
18:50:34 <herringland> Thanks for your explanations!
18:50:44 <truebrain> any questions, let me know!
18:50:48 <truebrain> here to help, just limited in time π
18:55:22 *** Flygon has quit IRC (Read error: Connection reset by peer)
19:00:44 *** jfinance has joined #openttd
19:00:44 <jfinance> Hidden secrets of the digital market that top traders donβt want you to know! Iβm looking to help just five individuals who are serious about earning over $100K weekly in the digital market. Remember, Iβll require just 15% of your profits once you start seeing earnings. Note: Iβm only looking for five serious and truly interested individuals!, drop a message letβs get stated by asking (HOW)
19:40:19 <LordAro> you guys have been slacking
20:07:57 *** HerzogDeXtEr has joined #openttd
20:32:20 <peter1138> This'll make everything unhappy π
20:35:18 <peter1138> Maybe it still compiles
20:35:40 <xarick> oh, you merged 2 kdtree changes :p
20:39:28 <peter1138> I guess NETWORK_COMPANY_NAME_LENGTH is not actually necessary since it was removed from the server info side? Was I imagining that it has company names at some point.
20:45:51 <xarick> i changed the line above only
20:48:48 <_glx_> actually NETWORK_COMPANY_NAME_LENGTH should have been removed since 12.0
20:52:51 <peter1138> MAX_LENGTH_PRESIDENT_NAME_CHARS and MAX_LENGTH_COMPANY_NAME_CHARS are looking a bit arbitrary as well, to be honest.
20:55:06 <_glx_> but they are used for command level checks
20:55:23 <peter1138> I don't mean they're wrong. Just... arbitrary π
20:56:27 <_glx_> remnants from fixed size arrays, now they mostly prevent weird GUI resizing I guess
20:56:57 <kuhnovic> Just got a divide by zero exception starting openttd...
20:57:54 <peter1138> Who would write such code.
20:59:05 <peter1138> Sorry I broked it π¦
20:59:13 <peter1138> And it's been 2 MONTHS?!
21:00:14 <kuhnovic> Everone loves larger towns
21:00:38 <peter1138> The second one is safe.
21:01:37 <xarick> I'm bad at splitting commits
21:02:05 <_glx_> as good as reviewers π
21:06:25 <xarick> does Codefeature exist?
21:06:44 <kuhnovic> If you are in the C++ committee, then yes
21:11:37 <exceptik> i wouldn't be surprized if one of them is here
21:14:25 <peter1138> Still, Rust would protect against that.
21:14:50 <peter1138> (I have no idea what it would do)
21:16:44 <LordAro> panic, unless you used checked_div or similar
21:19:27 <peter1138> Hmm, I think I can't std::visit for a std::variant that needs to be accessed by index.
21:21:42 *** gelignite has quit IRC (Quit: Stay safe!)
21:24:36 <kuhnovic> I channel my inner Xarick to find this obscure bug
21:24:58 <peter1138> That's in the wrong section, you should've opened a PR...
21:29:50 <kuhnovic> `20>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9531,5): warning C5105: macro expansion producing 'defined' has undefined behavior` how ironic
21:37:11 <xarick> crap, I need a FindContainedExcept
21:37:32 <xarick> not a IsAnyContainedExcept
21:47:16 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
21:56:01 <xarick> `_industry_type_kdtrees[ind_index].FindContainedExcept(0, 0, Map::SizeX(), Map::SizeY(), current->index, [¤t, &layout_filter, &town_filter, &closest_dist, &count](IndustryID iid) {`
21:58:09 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:59:06 <xarick> I don't expect much gains, but let's test
22:00:51 <kuhnovic> Oh don't you love it when you fix one bug, but reintroduce an old one
22:05:23 <xarick> I suspect 13105 is... ship trying to go to the tile with the sign which has no water
22:12:05 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:12:43 <kuhnovic> I completely forgot about that one!
22:17:18 <kuhnovic> It doesn't fix it, but might still be related
22:19:43 <kuhnovic> 13105 is one of those lovely cases where the high level path is found, but a low level path can't be found because the ship needs to reverse. 12333 is another one of those, and I haven't yet found a good solution for these two.
22:19:56 <kuhnovic> To be honest I haven't tried too hard
23:42:06 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day β΅