IRC logs for #openttd on OFTC at 2024-10-25
β΄ go to previous day
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: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
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);`
08:31:01 <andythenorth> `const` is quite an interesting addition to nml
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:43:12 <peter1138> I'm assuming andy's playing with his custom cargo class bits.
08:52:18 <andythenorth> all "seems fine"
08:52:31 <andythenorth> nothing I can do about the constants in GS, but eh
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:20:33 *** gelignite has joined #openttd
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: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: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: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:44:26 <xarick> check online content is much less laggy on ubuntu
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: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 <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:22:17 <xarick> they're not, they're doing the same as master
11:26:27 <xarick> master is fast forwarding faster
11:27:51 <xarick> could be windows messing up
11:31:11 <xarick> same finances for 1950, aka same roads
12:21:56 *** Flygon has quit IRC (Read error: Connection reset by peer)
12:39:58 *** nielsm has quit IRC (Ping timeout: 480 seconds)
13:11:03 *** urdh has quit IRC (Read error: Connection reset by peer)
13:20:54 <xarick> why is this even political...
13:21:08 <LordAro> such a cute world view
13:41:52 *** toktik is now known as Guest7423
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:54 <Rubidium> xarick: I reckon it's the lesser of two evils
14:23:46 <xarick> hi Rubidium, how's 13020 going?
14:29:18 *** gelignite has quit IRC (Quit: Stay safe!)
14:49:16 *** HerzogDeXtEr has joined #openttd
14:57:22 <xarick> I'm at 18 pull requests
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: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: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:38:27 <_glx_> not a new alert I think
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`
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: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: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: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> CFollowTrackRail ft(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:58 <peter1138> But it *could* be heap memory.
18:02:08 <peter1138> You know what I meant to write π
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:43:02 <xarick> oh noes! more conflits
19:03:44 <xarick> Is this acceptable? `this->dest_tiles = dest_tiles;`
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: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:46:55 *** gelignite has quit IRC (Read error: Connection reset by peer)
19:47:22 *** gelignite has joined #openttd
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:15:12 <peter1138> Any objection to me simplifying GetWaterTileType?
21:17:23 *** keikoz has quit IRC (Ping timeout: 480 seconds)
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:29:20 <xarick> maybe it's handled in the magic code, gonna test
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:38:31 *** Beer has quit IRC (Quit: Leaving)
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:47 <_glx_> and internally it's uses TileIndex++ (StrongType)
21:51:46 *** ChanServ sets mode: +v tokai
21:53:32 <_glx_> looks like we have 14 for-loops not using Map::Iterate
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)
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: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)
continue to next day β΅