IRC logs for #openttd on OFTC at 2024-10-25
            
01:36:30 *** tuaam has joined #openttd
01:36:30 <tuaam> drludde: very late reply but I tried a windows xp-compatible version of openttd (probably from a long time ago) on a pentium 4 with 1.5GB of ram and it worked flawlessly
01:36:30 <tuaam> Had issues running openttd on a 500mhz pIII though w/ windows 98, at that point you can just run the DOS / windows version
01:37:23 <tuaam> it does require the og graphics since the installers seem to require downloading content but this is no problem
02:10:26 *** gnu_jj_ has joined #openttd
02:13:36 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
02:53:20 *** godbed has joined #openttd
02:53:26 *** Zathras has joined #openttd
02:56:48 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:56:58 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:15:39 *** Zathras is now known as debdog
04:10:18 *** keikoz has joined #openttd
06:20:58 <kuhnovic> xarick: The ordering is not set in stone, it doesn't matter if you change it. It just shouldn't change between individual PF runs, for path repeatability reasons.
07:09:56 <andythenorth> hmm can I do `const foo = bitmask(ham, eggs);`
07:09:59 <andythenorth> let's see
07:15:48 <wensimehrp> yes
07:30:16 <andythenorth> yes
07:30:36 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1299273898101182505/image.png?ex=671c9a9c&is=671b491c&hm=4fb8519586f76f0121067debdf713f520f41e889b67e83c00ca944c4d3c550f4&
07:30:36 <andythenorth> works
08:29:33 <LordAro> \o/
08:31:01 <andythenorth> `const` is quite an interesting addition to nml
08:31:10 <peter1138> SLAAAAAAAAAAAG
08:31:16 <andythenorth> wonder how far a const can expand? πŸ˜›
08:32:47 <peter1138> LordAro: It's a bit too 927.
08:33:52 <peter1138> Damn you `dotnet build`, not removing resources that were built previously.
08:42:38 <LordAro> peter1138: ?
08:43:12 <peter1138> I'm assuming andy's playing with his custom cargo class bits.
08:49:17 <DorpsGek> [OpenTTD/OpenTTD] PeterN closed pull request #11955: Better procedural trees https://github.com/OpenTTD/OpenTTD/pull/11955
08:49:20 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #11955: Better procedural trees https://github.com/OpenTTD/OpenTTD/pull/11955#issuecomment-2437240949
08:52:02 <andythenorth> peter1138: yes
08:52:18 <andythenorth> all "seems fine"
08:52:31 <andythenorth> nothing I can do about the constants in GS, but eh
08:54:50 *** mindlesstux has quit IRC (Quit: The Lounge - https://thelounge.chat)
08:55:48 *** mindlesstux has joined #openttd
09:12:34 <karamidris> Are there any tutorials guides or courses recommended for developing patches for openttd?
09:12:34 <karamidris> I am a web developer (JS /Typescript) and have never dabbled in C++ but really love the game and would like to experiment with it.
09:19:11 <FLHerne> I don't think there's anything specific to OpenTTD, besides notes various implemention details https://github.com/OpenTTD/OpenTTD/tree/master/docs
09:19:13 <FLHerne> on
09:20:33 *** gelignite has joined #openttd
09:20:41 <FLHerne> and the generated source docs (which tbh I don't find useful compared to searching the codebase for the same comments) https://docs.openttd.org/source/
09:22:24 <FLHerne> probably best to start by finding the code for whatever you'd like to experiment with, then refer to the C++ reference docs until it makes sense to you ;-)
09:23:33 <karamidris> FLHerne: Thanks so much. Yeah that’s what I’ll likely do. Maybe look at some generic C++ OOP development guides to understand the general structure of it all too.
09:24:25 <FLHerne> the OpenTTD codebase is quite patchy in its use of OOP, and C++ features in general
09:24:49 <LordAro> OTTD doesn't use a *huge* amount of OOP, but it's definitely a good idea to know what it is :)
09:24:53 <FLHerne> originally it was all C and it's been rewritten ad-hoc over the years
09:25:18 <LordAro> https://wiki.openttd.org/en/Development/ there's a few things here too, though it's probably largely out of date
09:25:38 <LordAro> you could update it as you go, if you like ;)
09:30:09 <karamidris> Thanks all. In case yeah maybe just diving into the code and consulting docs along the way is the best bet. Excited to dive in.
09:36:42 <xarick> hi
09:37:10 <xarick> :gui_towns:
09:38:44 <peter1138> C++ isn't exactly OOP like other languages (Java) though.
09:44:48 <peter1138> Like functions outside of classes is perfectly reasonable, allowed and often encouraged.
09:46:13 <karamidris> I am a vanilla js veteran who is now maining react and typescript so I know all sides of the coin.
10:02:06 <xarick> can you make openttd main window dragging to not pause the program
10:03:01 <xarick> possibly a Windows OS issue...
10:06:47 <LordAro> sounds like a setting you've enabled somewhere
10:08:44 <xarick> https://www.reddit.com/r/gamemaker/comments/xlfqcr/is_there_any_way_to_have_a_game_not_pause/
10:08:48 <xarick> something like this
10:12:24 <peter1138> > The issue is Windows-specific behaviour - unless you run game logic and rendering on separate threads, system's dragging/resizing logic overtakes anything else and no other code executes until that's done.
10:12:37 <peter1138> Solution, don't use Windows.
10:26:16 <xarick> i forgot my password on linuxmint
10:26:28 <xarick> key ring or whatever
10:41:49 <xarick> I remembered
10:44:26 <xarick> check online content is much less laggy on ubuntu
10:44:31 <xarick> filling up the list
10:48:26 <xarick> hmm window dragging works without pausing the game on ubuntu and linuxmint
10:48:32 <xarick> why not on windows 😦
10:48:52 <peter1138> Because that's the behaviour of Windows.
10:49:13 <xarick> make windows great again
10:49:23 <peter1138> How often are you moving windows around for it to be a problem?
10:49:55 <xarick> well not too often, but... would be nice to not pause
10:54:45 <xarick> this incessant request for my password for doing anything on linux pisses me off
10:55:15 <xarick> JUST DO IT
10:56:09 <_glx_> Password is only asked for admin stuff
10:57:00 <xarick> at least on windows it only asks me for a yes or no
10:57:04 <peter1138> And initial logging in.
10:57:12 <_glx_> It's like UAC but safer
10:57:35 <peter1138> It's weird how people struggle with having a password.
10:59:06 <LordAro> xarick: what sort of things are we talking about here?
10:59:11 <LordAro> are you installing lots of stuff?
10:59:29 <xarick> key ring session or whatever, authentication admin i dunno...
10:59:45 <xarick> installing updates
10:59:45 <LordAro> no, what are you trying to do when it asks for that
10:59:54 <xarick> I started up visual studio code
11:00:19 <LordAro> i wouldn't expect vscode to be doing anything admin related, even if it's installing its own updates
11:02:50 <LordAro> there will be a way to set the auth up such that it doesn't ask after you login (NOPASSWD-alike), but i'm not going to help you work out what that is
11:07:00 <peter1138> Or just get used to it. Good practices etc.
11:08:13 <peter1138> Also there's probably a package to install that'll automatically install system updates.
11:08:22 <peter1138> If it's Debian based, something like unattended-upgrades.
11:21:46 <xarick> currently I'm testing whether AIs are building different roads
11:21:57 <xarick> with 13020
11:22:17 <xarick> they're not, they're doing the same as master
11:23:30 <xarick> good news
11:26:27 <xarick> master is fast forwarding faster
11:27:51 <xarick> could be windows messing up
11:31:11 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1299334438785908807/image.png?ex=671cd2fe&is=671b817e&hm=8d23728efee02681be78b937264b9d2f5a73da3a48819a35fc0a0329bf0ec86e&
11:31:11 <xarick> same finances for 1950, aka same roads
11:58:51 *** nielsm has joined #openttd
12:21:56 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:39:58 *** nielsm has quit IRC (Ping timeout: 480 seconds)
12:58:17 <xarick> is this true? https://www.youtube.com/watch?v=L5Ec5jrpLVk or just one of those click bait videos...
13:02:17 <LordAro> it can be both
13:03:09 <LordAro> https://www.theregister.com/2024/10/23/linus_torvalds_affirms_expulsion_of/
13:05:27 <_glx_> <https://arstechnica.com/information-technology/2024/10/russian-coders-removed-from-linux-maintainers-list-due-to-sanction-concerns/>
13:11:03 *** urdh has quit IRC (Read error: Connection reset by peer)
13:11:21 *** urdh has joined #openttd
13:18:38 <xarick> 100% racist
13:19:09 <xarick> sad news
13:20:54 <xarick> why is this even political...
13:21:01 <xarick> oh well
13:21:08 <LordAro> such a cute world view
13:41:52 *** toktik is now known as Guest7423
13:41:56 *** toktik has joined #openttd
13:48:14 *** Guest7423 has quit IRC (Ping timeout: 480 seconds)
13:54:08 <peter1138> Not ractist, not personal, just legal advice.
14:05:40 <andythenorth> it's just basic compliance
14:20:35 <peter1138> lzma eh?
14:20:54 <Rubidium> xarick: I reckon it's the lesser of two evils
14:23:46 <xarick> hi Rubidium, how's 13020 going?
14:25:34 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13020: Codechange: replace magic numbers with enumeration https://github.com/OpenTTD/OpenTTD/pull/13020#pullrequestreview-2395466904
14:29:18 *** gelignite has quit IRC (Quit: Stay safe!)
14:46:51 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411
14:49:16 *** HerzogDeXtEr has joined #openttd
14:57:22 <xarick> I'm at 18 pull requests
15:01:53 <xarick> <https://github.com/OpenTTD/OpenTTD/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved>
15:04:39 <Rubidium> congratulations ;)
15:06:03 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #12836: Fix #12831: Delay vehicle cache initialisation to after map upgrades in load https://github.com/OpenTTD/OpenTTD/pull/12836
15:06:06 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #12831: [Crash]: Systematic crashes while loading a save https://github.com/OpenTTD/OpenTTD/issues/12831
15:06:43 <Rubidium> peter has 32 ;)
15:09:24 <xarick> I don't like 12269, but was told to make it 😦
15:19:12 *** HerzogDeXtEr1 has joined #openttd
15:25:49 *** HerzogDeXtEr has quit IRC (Ping timeout: 480 seconds)
15:54:58 <peter1138> I should probably trim some down.
16:01:55 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #13020: Codechange: replace magic numbers with enumeration https://github.com/OpenTTD/OpenTTD/pull/13020#pullrequestreview-2395750222
16:04:09 <peter1138> I've got an enum change to do as well.
16:06:42 <talltyler> Some of your PRs are already approved, and just need to be merged! πŸ˜‰
16:06:49 <talltyler> The lowest of the fruit
16:07:02 <kuhnovic> Could you have another look at the yapf-renaming PR as well? I don't mean to nag, if you don't have time then let's merge it as it is.
16:16:56 <peter1138> Well.
16:16:57 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13005: Codechange: Use standard code-style for YAPF. https://github.com/OpenTTD/OpenTTD/pull/13005
16:17:09 <peter1138> I didn't get around to the pNode stuff yet.
16:17:40 <peter1138> Probably not too hard to f2-refactor those though.
16:17:59 <peter1138> talltyler: They probably need rebasing...
16:20:10 *** Wolf01 has joined #openttd
16:37:16 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #13020: Codechange: replace magic numbers with enumeration https://github.com/OpenTTD/OpenTTD/pull/13020
16:37:32 <DorpsGek> [OpenTTD/OpenTTD] github-advanced-security[bot] commented on pull request #13005: Codechange: Use standard code-style for YAPF. https://github.com/OpenTTD/OpenTTD/pull/13005#pullrequestreview-2395835615
16:37:41 <peter1138> Un oh.
16:38:27 <_glx_> not a new alert I think
16:38:34 <_glx_> just retriggered
16:43:25 <_glx_> hmm weird, it seems it never detected it before
16:48:55 <peter1138> `VehicleType` shoud be changed at some point, as it's actually a template parameter and nothing to do with `enum VehicleType`
16:53:09 <xarick> a happy merge!
17:05:32 <xarick> my job is complete!
17:06:30 <xarick> Rubidium will be proud! <https://github.com/OpenTTD/OpenTTD/compare/master...SamuXarick:OpenTTD:TileAddXY-and-TileAdd>
17:06:40 <kuhnovic> That codeQL thing doesn't make sense
17:08:39 <xarick> now we can enjoy asserts on tile add operations
17:09:17 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic approved pull request #13005: Codechange: Use standard code-style for YAPF. https://github.com/OpenTTD/OpenTTD/pull/13005#pullrequestreview-2395908318
17:13:43 <peter1138> It does make sense, but whether it's a problem is another matter.
17:13:51 <peter1138> It's one of those "as long as your careful" situations.
17:14:41 <peter1138> *you're
17:23:17 <xarick> my stuff doesn't detect TileIndex++
17:23:24 <xarick> or TileIndex + TileIndex
17:24:01 <xarick> those won't go through the assert test
17:24:09 <xarick> 😦
17:27:48 <xarick> ive been wondering if it wouldn't be better to have x and y embeded in TileIndex mega structure
17:45:05 <peter1138> kuhnovic: It's warning about the possibility of something like
17:45:05 <peter1138> ```c++
17:45:05 <peter1138> CFollowTrackRail ft(v);
17:45:05 <peter1138> delete v;
17:50:51 <kuhnovic> Anywhere where there's pointer you have the ability to call delete om them. That doesn't mean that you should πŸ˜›
17:53:00 <kuhnovic> Oh wait, I misinterpreted your example. I guess that's a possibility, but it feels a little far-fetched to me.
17:54:40 <peter1138> No, the point is that there's no way in ft to guarantee that v is still valid.
17:54:45 <peter1138> That's why there's a warning.
17:55:13 <peter1138> Passing a pointer is fine. Passing a pointer for it to be stored will produce that warning.
17:55:18 <kuhnovic> In general we pass around pointers where references would have often been more appropriate. Leftovers from the C days I guess.
17:55:31 *** gelignite has joined #openttd
17:56:15 <_jgr_> Unfortunately a reference doesn't guarantee that the thing referenced will have sufficient lifetime either
17:56:43 <peter1138> Yes, reference has the same problem.
17:57:29 <peter1138> C++ would say you pass a copy, or use a smart pointer πŸ™‚
17:57:30 <_jgr_> It's not really solvable without going all the way to rust-style lifetime management
17:58:40 <peter1138> Of course, even if we passed the vehicle index and used Vehicle::Get(index), it's still theoretically possible for the vehicle to be removed from the pool and the index to become invalid. And that won't even be warned against.
17:59:10 <kuhnovic> That would only be a problem if things were running concurrently
17:59:56 <peter1138> Not really, from CodeQL's point of view it's equaly as theoretically likely.
18:00:12 <peter1138> So we just ignore it πŸ™‚
18:01:30 <kuhnovic> But *v isn't really a local variable anyway right? It's pointing to a vehicle that's in a pool, in heap memory...
18:01:42 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13005: Codechange: Use standard code-style for YAPF. https://github.com/OpenTTD/OpenTTD/pull/13005
18:01:58 <peter1138> But it *could* be heap memory.
18:02:01 <peter1138> Er
18:02:08 <peter1138> You know what I meant to write πŸ˜„
18:04:04 <kuhnovic> Haha
18:04:26 <kuhnovic> But yeah it could be ... Context context context
18:04:56 <kuhnovic> So if we ignore it, merge the damn thing! πŸ˜‰
18:07:55 <peter1138> Too late.
18:19:49 <kuhnovic> Hehe
18:20:50 <johnfranklin> https://cdn.discordapp.com/attachments/1008473233844097104/1299437530441056327/IMG_5507.jpg?ex=671d3301&is=671be181&hm=35254b3a7b46065d5e4f4726a1cb14158dd6d97ca7249143bcedfe27e485b315&
18:43:02 <xarick> oh noes! more conflits
19:03:44 <xarick> Is this acceptable? `this->dest_tiles = dest_tiles;`
19:04:07 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12206: Fix #12193: Don't use the entire docking area when computing closest station tile https://github.com/OpenTTD/OpenTTD/pull/12206
19:04:49 <xarick> waiting for github-advanced-security[bot] (via GitHub) to say no
19:05:10 <peter1138> Is it in a constructor?
19:05:46 <xarick> It's here <https://github.com/OpenTTD/OpenTTD/pull/12206/files#diff-65e2e70333e566c0aad5d808d54588a570ec421491d51bd1635c4f1cffeeda4bR47>
19:06:02 <xarick> no idea if it's a constructor
19:09:41 <xarick> oops, forgot a "this->"
19:11:43 <xarick> gonna wait for security bot first
19:23:11 *** Wormnest has joined #openttd
19:25:13 <xarick> I'm renaming anyway
19:27:36 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12206: Fix #12193: Don't use the entire docking area when computing closest station tile https://github.com/OpenTTD/OpenTTD/pull/12206
19:39:00 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed pull request #13017: Codechange: use functions described in documentation, instead of related other functions https://github.com/OpenTTD/OpenTTD/pull/13017
19:39:50 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12156: Fix #11862: Ships leaving docks could be momentarily lost https://github.com/OpenTTD/OpenTTD/pull/12156
19:46:55 *** gelignite has quit IRC (Read error: Connection reset by peer)
19:47:22 *** gelignite has joined #openttd
20:28:10 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #12996: Codefix: document TileIndexDiff behaviour and enforce offset limits https://github.com/OpenTTD/OpenTTD/pull/12996
20:40:46 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #12996: Codechange: use different structure for TileIndexDiff in debug https://github.com/OpenTTD/OpenTTD/pull/12996
20:51:54 <xarick> rubidium, how can you dismantle an offset into x and y values
20:52:17 <xarick> it was ambiguous and now you're doing it?
21:10:46 <xarick> weird magic code
21:10:58 <xarick> i feel like a novice
21:15:12 <peter1138> Any objection to me simplifying GetWaterTileType?
21:16:46 <xarick> πŸ™‚
21:17:23 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:19:24 <xarick> do it
21:21:22 <xarick> is it gonna change Bit field layout
21:23:59 <Rubidium> xarick: didn't I document that?
21:24:56 <xarick> there are some places that do tile++ and tile--
21:25:11 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13030: Codechange: Simplify storage of WaterTileType in map. https://github.com/OpenTTD/OpenTTD/pull/13030
21:26:13 <xarick> i found one such case
21:29:20 <xarick> maybe it's handled in the magic code, gonna test
21:31:16 *** Beer has joined #openttd
21:35:48 *** Wormnest has quit IRC (Quit: Leaving)
21:36:14 <xarick> nope, it's handled by strongtype ++
21:36:19 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:37:55 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/landscape.cpp#L895
21:38:13 <xarick> and line 922 with --
21:38:31 *** Beer has quit IRC (Quit: Leaving)
21:42:04 <_glx_> -- uses =-
21:44:13 <xarick> oh, I see where it could be useful..
21:44:19 <xarick> `for (TileIndex tile = 0; tile < Map::Size(); tile++) {`
21:44:55 <xarick> if this is now going into the assert for boundary check, it's bad
21:45:12 <Rubidium> it's not as there's no TileIndexDiff involved there
21:46:14 <peter1138> xarick: This could possible be `for (auto tile : Map::Iterate()) {` these days?
21:49:18 <_glx_> indeed
21:49:47 <_glx_> and internally it's uses TileIndex++ (StrongType)
21:51:45 *** tokai has joined #openttd
21:51:46 *** ChanServ sets mode: +v tokai
21:51:49 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13030: Codechange: Simplify storage of WaterTileType in map. https://github.com/OpenTTD/OpenTTD/pull/13030#pullrequestreview-2396567368
21:53:32 <_glx_> looks like we have 14 for-loops not using Map::Iterate
21:54:45 <Rubidium> I count 21
21:55:27 <_glx_> oh but Map::Iterate works with Tiles
21:55:57 <Rubidium> grep -R 'for' src | grep '++' | grep TileIndex | grep '= 0' | grep Size
21:58:38 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
21:59:07 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #13030: Codechange: Simplify storage of WaterTileType in map. https://github.com/OpenTTD/OpenTTD/pull/13030#issuecomment-2438938678
22:16:35 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #13030: Codechange: Simplify storage of WaterTileType in map. https://github.com/OpenTTD/OpenTTD/pull/13030#issuecomment-2438955505
22:16:52 *** gelignite has quit IRC (Quit: Stay safe!)
22:29:47 <peter1138> Hmm, landscape.html has a non-bit-stuffed interpretation of MP_WATER m5.
22:29:56 <peter1138> Listing it as byte values for ... everything.
22:53:06 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13030: Codechange: Simplify storage of WaterTileType in map. https://github.com/OpenTTD/OpenTTD/pull/13030
22:56:50 <peter1138> I wonder what WaterTileTypes 4-15 could be... πŸ™‚
22:57:35 <peter1138> Could make it 2 bits.
23:08:47 *** HerzogDeXtEr1 has quit IRC (Read error: Connection reset by peer)