IRC logs for #openttd on OFTC at 2024-12-30
            
00:07:08 <_glx_> something like https://github.com/OpenTTD/OpenTTD/compare/master...glx22:OpenTTD:GSText?expand=1
00:09:11 <_glx_> had to add a static method, because API parser doesn't like friend (didn't want to touch cmake script just for that)
00:14:09 <peter1138> Yeah, something like that. I missed the compatibility script load order.
00:14:36 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
00:27:25 <_glx_> updated to work with "friend"
02:05:16 *** gelignite is now known as Guest4487
02:05:19 *** gelignite has joined #openttd
02:12:39 *** Guest4487 has quit IRC (Ping timeout: 480 seconds)
02:25:59 *** Flygon has joined #openttd
03:13:55 *** Wormnest has quit IRC (Quit: Leaving)
03:19:33 *** gnu_jj has joined #openttd
03:22:41 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:26:23 *** D-HUND has joined #openttd
03:29:53 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:36:41 *** D-HUND is now known as debdog
03:43:51 *** D-HUND has joined #openttd
04:38:16 *** gelignite has quit IRC (Quit: Stay safe!)
04:43:11 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/3a05978cc43c26d68854b4b6ffb17f369c92d747
04:43:12 <DorpsGek> - Update: Translations from eints (by translators)
05:18:17 *** keikoz has joined #openttd
06:59:12 <pickpacket> Are company numbers re-used?
07:00:33 <pickpacket> If a multiplayer game has 3 companies -- 1, 2, and 3 -- and number 2 goes bankrupt or is removed, will the next new company be number 2 or number 4?
07:06:11 *** locosage has joined #openttd
07:06:11 <locosage> Yes, they are
07:17:11 <DorpsGek> [OpenTTD/survey-web] survey-summary[bot] pushed 1 commits to main https://github.com/OpenTTD/survey-web/commit/8e32cb6f4b71d06f35ab09b2fea17ea81b53fa57
07:17:12 <DorpsGek> - Add: summary for week 52 of 2024 (by OpenTTD Survey)
07:27:05 <pickpacket> locosage: ty
07:49:06 <pickpacket> squirrel has no string split :(
07:58:06 <andythenorth> you can write one
07:58:10 <andythenorth> superlib might have one
07:59:16 <andythenorth> squirrel is lolz, it's easier to be pleasantly surprised when it *does* actually look like a modern programming language
07:59:25 <andythenorth> if you assume nothing works, that's safer 😛
08:12:30 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323202041857970248/image.png?ex=6773a76e&is=677255ee&hm=33afb141b8ad97a17e82ed1f09a4197f5cc1c946365aae6763389ba34183762c&
08:12:30 <andythenorth> pff dunno what I've done to FIRS strings here 😛
08:12:41 <andythenorth> not changed anything recently
08:14:59 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323202666431647754/image.png?ex=6773a803&is=67725683&hm=b367b0e8cdb38b7e8e98ff1e59877b6d90ed6d013812a28834782dd92a6e1fb6&
08:15:13 <andythenorth> maybe I need to get a newer OpenTTD build 😄
08:15:36 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323202820362469447/image.png?ex=6773a828&is=677256a8&hm=8f660d94a0c756a5b023b675abaead8f36e0694eaffec7f63c40d362518f1e3e&
08:21:20 <peter1138> Have I broken it?
08:21:33 <andythenorth> dunno, my build was November
08:21:59 <andythenorth> getting a new one, with some vcpkg yak shaving
08:22:21 <andythenorth> anyone ever noticed how slow the macOS build is? 😛
08:23:32 <andythenorth> it's approx 2 minutes from running cmake to final executable
08:30:34 <peter1138> Ah, no, the changes I was thinking of never got committed.
08:34:22 <peter1138> Hmm, why are GSText parameters 1-based? Is that a squirrel thing?
08:37:13 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323208261507219456/image.png?ex=6773ad39&is=67725bb9&hm=a1eaa9c3dea8735a424b7b65415e51d34fe1a8bb5a844373f37123a2505004c2&
08:37:13 <andythenorth> new OpenTTD build
08:37:16 <andythenorth> "works"
08:37:52 *** Wolf01 has joined #openttd
09:01:30 *** kuka_lie has joined #openttd
09:10:05 <andythenorth> lunch?
09:14:55 <peter1139> I'm still wondering how you managed to have a broken build.
09:30:22 <andythenorth> it was a build of a checked out PR, so I could try to replicate
09:30:33 <andythenorth> but "works now" 😛
09:31:20 <andythenorth> hmm coffee levels negative
09:33:05 <peter1138> Weird how var 42 has a byte for common cargo classes.
09:51:28 <pickpacket> is there a plan for when 15.0 will be released?
09:53:45 <wensimehrp> April the first maybe
09:54:43 <peter1139> Wondering how often we should do betas.
09:54:53 <peter1139> Nobody uses nightlies because they change too frequently.
10:01:18 <andythenorth> we should have a weekly or monthly build
10:01:35 <andythenorth> "we should" sounds like volunteering, oops
10:02:19 <andythenorth> peter1138: var 42 is entirely quirky 🙂
10:02:33 <andythenorth> it has the OR of prop 25 also
10:02:48 <andythenorth> I'd be intrigued exactly how that is used in DB Set
10:05:13 <peter1139> Well back then you could only really have one vehicle set loaded, so it was entirely controllable.
10:07:34 <andythenorth> back then it didn't take 1m 4s to compile a train grf either 🙂
10:08:16 <peter1139> “we should” — could potentially be automated if it's not too frequently.
10:09:07 <peter1139> Anyway, badges can probably replace uses of prop 25?
10:09:35 <andythenorth> indeed
10:09:43 <andythenorth> badges for Horse?
10:10:02 <peter1139> I would need to write the NML support.
10:10:08 <andythenorth> oof 10s of Horse is just the html docs
10:10:10 <peter1139> Or at least document the NFO spec.
10:12:45 *** kuka_lie has quit IRC (Quit: Lost terminal)
10:13:20 <andythenorth> hmm this thing with Horse filling so many text stack registers
10:14:25 <andythenorth> there are 10,000 instances
10:14:58 <andythenorth> think I'm going to have to adjust 😛
10:15:06 <peter1139> You should find it loads a bit quicker now.
10:15:44 <andythenorth> every single vehicle has 14 advanced varact 2
10:15:55 <andythenorth> for the name callback text register population
10:16:05 <andythenorth> 10k vehicles
10:16:12 <andythenorth> "there must be a better way"
10:16:48 <andythenorth> might try rewriting later 😛
10:17:35 <andythenorth> can badges include text? 😛
10:19:16 <peter1139> They do, but only in the extra text area.
10:19:52 <andythenorth> was consider "(small)" as a badge 😛
10:20:10 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323234169710710815/image.png?ex=6773c55a&is=677273da&hm=979b897b8e50bb427c2cd34c2008c477eae38323ae8173ff1756a1b3ad2183a7&
10:20:10 <andythenorth> ok so the player doesn't need to know about covered vs uncovered here
10:20:19 <andythenorth> that detail could be in the descriptive text if needed
10:20:31 <andythenorth> or just ignored
10:20:52 <peter1139> Maybe it could?
10:21:17 <andythenorth> if I can reduce the number of registers set per vehicle
10:21:20 <andythenorth> life will be better
10:21:36 <peter1139> Name suffix string property
10:21:44 <andythenorth> although if I make them common to one parent, I'm going to consume more varact 2 IDs
10:21:50 <andythenorth> swing, meet roundabout
10:22:08 <andythenorth> name suffix string property eh?
10:23:22 <peter1139> Well, it could just use the badge's name, but then you wouldn't get parenthesis (or they'd show in the extra text too.)
10:23:34 <peter1139> BRACKETS as we call them.
10:24:48 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1323235333349048381/image.png?ex=6773c66f&is=677274ef&hm=a9ad7626bfb276d1339a4c4275f068157c482783fdaafe8d39baf5f6b42b0168&
10:24:48 <andythenorth> my handling of the left and right sides of autoreplace
10:24:56 <andythenorth> might be confusing
10:24:58 <andythenorth> dunno
10:25:12 <andythenorth> right side works like buy menu
10:25:40 <andythenorth> left side is as used in vehicle instance description
10:26:46 <andythenorth> ok, coffee time
10:29:10 <peter1139> So if badges added a suffix, you "(Medium)" and "Ruby/Rust" could be done that way.
10:29:42 <peter1139> And the actual palette selection callback could just test for the "Ruby/Rust" badge.
10:30:08 <peter1139> The action 3 chains for all of those could then be the same action 2 id.
10:33:02 <wensimehrp> andythenorth: Can you make the train names translatable? 🫣
10:37:02 <andythenorth> peter1139: might be the way 🙂
10:41:53 <andythenorth> first maybe I can delete some of the current handling
10:42:27 <andythenorth> hmm....no I'd run out of strings
10:43:48 * peter1139 redesigns something.
10:44:40 <andythenorth> hmm how many action 4 strings do we have?
10:44:47 <andythenorth> (total IDs)
10:45:02 <andythenorth> nmlc doesn't report the limit
10:45:43 <andythenorth> the action 4 nfo docs are quite....detailed 😛
10:46:36 <andythenorth> could be a byte, could be an extended byte, could be a word 😛
10:47:37 <peter1139> Yes, whoever designed that spec was not having a good day.
10:50:50 <wensimehrp> wensimehrp: Aww
10:55:36 *** benjaminv has joined #openttd
10:57:12 <andythenorth> a 5MB reduction in .nml filesize
10:57:33 <andythenorth> just by dropping specific handling of autoreplace LHS
10:57:49 <andythenorth> 2MB nfo reduction
10:58:03 <andythenorth> 0.6MB grf reduction
10:58:27 <peter1138> What's the magic thing in Python to return the last element in an array?
10:58:37 <andythenorth> [:1] or something
10:58:41 <andythenorth> I look it up every time
10:59:00 <peter1139> Ah, [-1]
10:59:02 <andythenorth> [-1] maybe?
11:03:05 <andythenorth> maybe I was on drugs when I wrote this Horse 'universal text stack' stuff
11:03:08 <andythenorth> but I don't do drugs
11:03:16 <andythenorth> unless the drugs made me forget the drugs
11:04:06 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1323245225241612300/image.png?ex=6773cfa6&is=67727e26&hm=a3cad2141d5903a8e6c71fcfe523ed4b8f0930f34b8803f69d8e892c662468f6&
11:04:06 <peter1138> If you were using grf-py...
11:08:05 <andythenorth> ok so I'm not rewriting this Horse text stack stuff
11:08:10 <andythenorth> will await badges 🙂
11:08:18 <andythenorth> will badges be in 15? 😛
11:12:31 <peter1138> Would be nice.
11:23:39 <andythenorth> badger badger
11:32:47 <andythenorth> what do we need to do? 🙂
11:41:12 <peter1139> Hmm, this is annoying. As I'm writing the spec I'm finding limitations that I kinda glossed over before :(
11:42:29 <peter1139> Maybe a NewGRF only needs to know about 255 badges?
11:56:40 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13073: Add: NewGRF Badges feature https://github.com/OpenTTD/OpenTTD/pull/13073#issuecomment-2565387334
11:56:46 <andythenorth> "probably fine"
12:04:05 <andythenorth> how many train company badges? 😛
12:07:29 <peter1139> Adding more bits as I remember it...
12:07:34 <peter1139> How many?
12:08:30 <peter1139> Forgot to add lots of info to this. It's still missing the variable to test if a badge is present.
12:11:17 <peter1139> Anyway, the 255 limit is "probably fine" but also I'd rather not add a new feature with an annoying arbitrary limit. Especially as I already "designed" other bits to get past that same limit.
13:13:34 *** telk5093 has joined #openttd
13:13:34 <telk5093> Question for admin port for new secure login, should I append some public key onto ``ADMIN_PACKET_ADMIN_AUTH_RESPONSE`` packet?
13:25:43 <xarick> performance vs debug
13:26:03 <xarick> it's not paying off for some reason
13:26:13 <xarick> I keep getting regressive times
13:26:19 <xarick> in release
13:31:55 <_glx_> because your changes add checks for more calls ?
13:35:53 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #12878: Add: [Script] ScriptEventCompanyRename https://github.com/OpenTTD/OpenTTD/pull/12878#issuecomment-2565494228
13:38:04 <johnfranklin> https://cdn.discordapp.com/attachments/1008473233844097104/1323283972326686730/IMG_6622.png?ex=6773f3bc&is=6772a23c&hm=7ae4c72f729ba9d2ace323a7f66e8d02dcdff668019206e08d5e3e3da84f1776&
13:38:04 <johnfranklin> FirsWeird
13:43:30 <xarick> I am trying to test something:
13:44:20 <xarick> make everything behave like TileIndexDiffC, but always return invalid tile for cases that x and y go outside the map
13:44:54 <xarick> a bit similar to what I have in my branch
13:45:27 <xarick> but i wanna base the code on those operators+ magic stuff
13:45:59 <xarick> no asserts
13:46:13 <xarick> just TILE_INVALID
13:46:44 <xarick> so special #ifdef stuff either
13:47:17 <xarick> and in the end remove one of the structs, either TileIndexDiff or TileIndexDiffC
13:49:23 *** kuka_lie has joined #openttd
13:51:38 <Rubidium> telk5093: with PAKE (password authenticated key exchange) it can indeed be any (X25519) public key that the admin-client knows the private key for, i.e. you can regenerate it each time. If you want to make use of authorized keys, then you need to retain the X25519 key-pair
13:57:07 <Rubidium> telk5093: https://github.com/Xaroth/libottdadmin2/pull/17/files#diff-d0b34c75fc48a8770d2d8ac951701aeee04e0cbfd9d9f6b0dcdf90a80b0ff6c8 might help you, since it's the admin-client side implementation of the protocol
13:57:53 <telk5093> A sample codes! That would be helpful for me. Thanks
14:05:57 <xarick> is inline really necessary? 😦
14:06:13 <xarick> i change 1 little thing, boom 313 files recompiling
14:07:36 <xarick> i need a 16 core cpu then
14:10:30 <peter1138> Or an M4 mac.
14:11:40 <andythenorth> I should get one
14:21:57 <xarick> Map::WrapToMap
14:22:07 <xarick> this is the main deterrent
14:22:14 <xarick> of my approach
14:26:29 <xarick> if I understand how it works...
14:27:51 <xarick> a tile outside the map is bounced back to inside the map, kinda like a Clamp to x and y coordinates?
14:28:19 <xarick> or not
14:28:57 <xarick> x = 4096 -> x = 0
14:30:39 <xarick> and y = 1
14:44:42 <xarick> okay i'm perplexed, I don't understand what's doing
14:47:19 <kuhnovic> I don't understand what problem you are trying to fix
14:48:33 <Rubidium> kuhnovic: essentially TileAdd asserting erroneously on small maps
14:50:11 <Rubidium> kuhnovic: or alternatively: TileAdd asserting erroneously when dx is more than half the map width, e.g. trying to build a 40 wide station on a 64 wide map
14:51:32 <kuhnovic> So there is an actual problem here, even though it's very niche
14:52:04 <xarick> I am wondering what to do for a situation like this: Map::WrapToMap(tile + TileDiffXY(x, y))
14:54:38 <xarick> if tile + TileDiffXY(x, y) resolves into INVALID_TILE
14:56:54 <xarick> let me imagine a map 64*64
14:57:11 <xarick> tile = 4095, x = 1, y = 1
15:00:24 <xarick> resulted in 4095
15:00:32 <xarick> with INVALID_TILE
15:04:23 <xarick> resulted in 64 with '4095 + 65' after wrap to map
15:04:31 <xarick> completely different tiles 😦
15:06:44 <xarick> not quite the clamp I expected either
15:11:29 <xarick> it restarts from 0
15:11:34 <xarick> I see
15:15:09 <xarick> for the cases it's being used: Cargo acceptance history of nearby stations
15:15:17 <xarick> newgrf_house.cpp
15:15:55 <xarick> GetNearbyTile, newgrf_commons.cpp
15:16:33 <xarick> and SetupFarmFieldFence, industry_cmd.cpp
15:21:00 <peter1138> I think I remember a patch for that.
15:21:12 <xarick> give me
15:37:24 <andythenorth> hmm
15:56:29 <_glx_> kuhnovic: oh and it's only for debug buils, releases just do operator+ without any checks
16:00:02 <_glx_> there are 16 direct calls to TileAdd, 53 indirect via TileAddXY
16:18:06 <_glx_> 11 via TileAddByDir and 39 via TileAddByDiagDir so not that much for something doing checks only in debug builds (compared to the 170 `tile \+`)
16:21:11 <_glx_> funny I can see 37 `\+ TileOffsByDiagDir\(` (equivalent to TileAddByDiagDir without any extra validation in debug)
16:22:03 <_glx_> and 5 `\+ TileOffsByDir\(` (TileAddByDir equivalent)
16:23:15 <_glx_> 47 `\+ TileDiffXY\(`(TileAddXY)
16:23:24 <_glx_> it's so messy
16:44:57 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
16:52:04 <Rubidium> _glx_, kuhnovic: in my opinion the major question regarding TileAdd is whether we want to slow down everything to do the overflow checks correctly (on every addition), or that we just remove TileAdd/the overflow check and live with that risk. After all, given _glx_'s stats it looks like most cases do not have the overflow checks already.
16:53:18 <_glx_> and overflow check only happen in debug builds anyway
16:53:51 <_glx_> so in normal usage it's most likely never checked
16:57:17 <xarick> there's not much of a slowdown as far as I could tell, but my tests are bad
16:57:26 <xarick> not sure exactly what to test
16:57:53 <xarick> so i test generate world with large town multiplier
17:23:12 <kuhnovic> If it's a major slowdown then lets just check it using asserts. We use that strategy in many places and it seems to work well.
17:24:08 <kuhnovic> I appreciate assets a lot more since i've started working on openttd. We check and catch lots of stuff. Sure, it would be nice to have test for everything, but the truth is that we don't 😛
17:48:21 *** gelignite has joined #openttd
17:49:29 <Rubidium> the problem with doing the asserts right, is that you want dx and dy separated. However, currently it dx and dy are already collapsed into a single integer value that can be added quickly. So to not have an effect on the performance you want to pass the single integer and in debugging you want to pass two values... but then you're doing different calculations and different paths, so in debug you also
17:49:35 <Rubidium> want to do the single integer variant and check whether both calculations yield the same result
17:57:35 <xarick> TileIndex neighbour_tile = tile + *dir; this looks cursed, hope it works
18:10:35 <xarick> TileOffsByDiagDir: 131 matches
18:17:15 <DorpsGek> [OpenTTD/OpenTTD] GRATHRRAM opened issue #13206: [Bug]: Gui is Very Big when using japanese language https://github.com/OpenTTD/OpenTTD/issues/13206
18:17:16 <kuhnovic> Wouldn't it be possible to encode both x and y in a single int and use bitmasks? I haven't looked into this and I'm not close to a PC so I can't really check the code. Just firing off some random thoughts.
18:17:37 <kuhnovic> Possibly affected by red wine too
18:18:35 <Rubidium> then either you can't add them trivially to TileIndex, or you run into the problem you're trying to solve
18:18:55 <kuhnovic> Yeah that's true, hmm
18:19:23 <truebrain> change the map so it wraps around on the borders?
18:22:06 <kuhnovic> Sure, YAPF will love that 😛
18:23:00 <xarick> Tile (the non-index version), doesn't accept t + dir
18:23:04 <xarick> ;/
18:23:11 <Rubidium> though spirally connect it, so the end of "row" 1 is connected to the begin of "row 2
18:25:12 <truebrain> ofc!
18:27:46 <_glx_> isn't there a trick with freeform edges too ?
18:30:05 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on issue #13206: [Bug]: Gui is Very Big when using japanese language https://github.com/OpenTTD/OpenTTD/issues/13206
18:32:53 <_glx_> xarick: it could, with the appropriate operators
18:34:35 <xarick> `TileIndex south_neighbour = tile + 2 * south_dir;` I can't make this smart
18:35:09 <xarick> south_dir is DiagDirection, 2 is int, no TileIndexDiff at all :/
18:35:24 <_glx_> well doing math with direction is not possible
18:35:31 <_glx_> it would make no sense
18:35:50 <xarick> TileIndex south_neighbour = tile + 2 * TileOffsByDiagDir(south_dir); gonna leave it as this
18:40:39 *** virtualrandomnumber has joined #openttd
18:40:52 *** virtualrandomnumber has quit IRC ()
18:47:00 <xarick> `if (ft.tiles_skipped != 0) ft.new_tile -= TileOffsByDiagDir(ft.exitdir) * ft.tiles_skipped;`
18:47:00 <xarick> uhh.. ugly magic required here
18:47:15 *** tokai has joined #openttd
18:47:16 *** ChanServ sets mode: +v tokai
18:49:07 <xarick> actually... i can't do anything
18:49:21 <xarick> dir * int 😦
18:49:27 <xarick> skip
18:54:01 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
18:55:39 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on issue #13206: [Bug]: Gui is Very Big when using japanese language https://github.com/OpenTTD/OpenTTD/issues/13206
19:06:46 <andythenorth> well
19:06:47 <andythenorth> now what?
19:06:54 <andythenorth> I have spent the day doing house chores
19:14:25 <truebrain> come over and do mine now?
19:14:37 <truebrain> just a short flight away!
19:20:54 <DorpsGek> [OpenTTD/team] 92username opened issue #608: [pt_BR] Translator access request https://github.com/OpenTTD/team/issues/608
19:23:26 <andythenorth> I coudl get the train 😛
19:23:35 <andythenorth> dislike flying
19:25:08 <DorpsGek> [OpenTTD/OpenTTD] GRATHRRAM commented on issue #13206: [Bug]: Gui is Very Big when using japanese language https://github.com/OpenTTD/OpenTTD/issues/13206
19:57:46 <xarick> question, how do I know whether I need to add friend?
19:58:07 <xarick> friend inline TileIndex operator+(const TileIndex &tile, const TileIndexDiff &offset);
19:58:56 <xarick> friend inline TileIndex operator+(const TileIndex &tile, const Direction dir);
19:59:21 <xarick> seems to be working without even using friend
19:59:32 <xarick> why?
20:02:41 <DorpsGek> [OpenTTD/OpenTTD] WenSimEHRP commented on issue #13206: [Bug]: Gui is Very Big when using japanese language https://github.com/OpenTTD/OpenTTD/issues/13206
20:03:34 <wensimehrp> https://cdn.discordapp.com/attachments/1008473233844097104/1323380984267149312/image.png?ex=67744e15&is=6772fc95&hm=1c5035c71681528573e9723e0911a32b1270c0b6de0c1d099bba83679961f7d8&
20:03:34 <wensimehrp> oof, somebody missed `{BLACK}` somewhere...
20:06:18 <peter1138> Yeah
20:07:07 <peter1138> We could ignore the font's minimum size, but it was obviously added for a reason.
20:07:31 <peter1138> (And that font at the default size 10 is, indeed, probably too small.)
20:08:20 <wensimehrp> default CJK fonts?
20:08:58 <peter1138> Which?
20:10:33 <wensimehrp> Probably Noto Sans
20:12:24 <pickpacket> how does string comparison work in squirrel?
20:12:30 <pickpacket> I can't find any info on it
20:12:57 <peter1138> Generally you don't work with raw strings.
20:13:14 <peter1138> You work with String IDs which can be translated.
20:21:25 <_glx_> yeah comparing strings coming from the game will depend on user selected language
20:32:01 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13207: Add: Ability to toggle visibility of station signs by facility. https://github.com/OpenTTD/OpenTTD/pull/13207
20:39:29 <LordAro> ooh
20:43:12 <xarick> "friend" is unneeded, or I don't understand its purpose
20:43:50 <andythenorth> common in this channel 😄
20:44:03 <xarick> I'm testing without those, and it still calls the right functions
20:44:06 <xarick> right operators
20:44:07 <andythenorth> _snark_ andythenorth
20:44:23 <xarick> what am I missing?
20:44:56 <pickpacket> _glx_: it's strings created by the script, so that's fine
20:45:15 <pickpacket> seems to work as expected, though. My issue was something else
20:47:42 <LordAro> xarick: you're missing an understanding of when `friend` is needed
20:49:13 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
20:50:57 <pickpacket> Have you guys ever encountered that weird situation where things don't work just because your code is broken? I can't believe this is still an issue... It's almost 2025 ffs
20:51:09 <andythenorth> still happening to me
20:51:12 <andythenorth> GPT has improved it
20:51:16 <andythenorth> now it's not my code 😛
20:53:18 <johnfranklin> yes
20:54:17 <pickpacket> sometimes I don't even understand what I'm doing wrong. Why do *I* have to understand a thing to make the computer understand it?
20:54:26 <johnfranklin> there may be hard-to-find typo
20:54:49 <pickpacket> also on that note: When I try to get companyId from a bankruptcy I get "-1"
20:55:41 <pickpacket> case GSEvent.ET_COMPANY_BANKRUPT: { company_id = GSEventCompanyBankrupt.Convert(ev).GetCompanyID(); [...]
20:55:50 <pickpacket> gives me company_id = -1
20:55:57 <andythenorth> shame GPT can't write GS
20:56:14 <pickpacket> actually maybe it doesn't. Hold ya hoses
20:58:22 <pickpacket> Ah! I fail when trying to convert it to a "proper" company ID with GSCompany::ResolveCompanyID
20:58:31 <pickpacket> which makes sense, since it no longer exists
20:58:41 <andythenorth> GS is lolz
20:58:42 <pickpacket> the question is if I actually *need* to do that
20:59:40 <pickpacket> "If the company index was COMPANY_SELF it will be resolved to the index of your company" -- can this actually ever happen with a bankrupt company?
21:02:10 *** kuka_lie has quit IRC (Quit: Lost terminal)
21:09:43 <pickpacket> Given that the GS always runs as the server, is that even a "player" that can own a company?
21:11:00 <Rubidium> pickpacket: AFAIK you'll always get a "proper" company ID back, not the magic "COMPANY_SELF" as that's primarily added to the API to make it easier to request information about your own company
21:12:45 <Rubidium> so with that a bankrupt event ResolveCompanyID only checks whether the company ID is "currently" valid. Often that's not the case, unless a new company was spawned with the same ID. So resolving the company id is useless
21:13:57 <_glx_> yeah events should send the real index
21:13:58 <Rubidium> pickpacket: there is a CompanyMode in GS, which means the GS can run certain commands as if they are a specific company. I'd reckon that COMPANY_SELF resolves to the company that the GS runs as
21:15:03 <_glx_> in case a company bankrupts then another one opens in the same slot you will receive 2 events in order anyway
21:34:00 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1323403743651168319/image.png?ex=67746348&is=677311c8&hm=ab719185538ac16f06d9002c82c0ac9e4f2f12b47188f2955d7a9150106ce8e3&
21:34:00 <xarick> why is it using the wrong overload?
21:34:06 <xarick> override
21:36:01 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1323404252974153892/image.png?ex=677463c1&is=67731241&hm=0d938f361bf81b8b64d78179afa58a2fa79a19da6cdeedc5e9af731069249b6c&
21:36:01 <xarick> I have it defined
21:38:53 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1323404974482260021/image.png?ex=6774646d&is=677312ed&hm=c70b82849903cc3fb0447338e0e716d5ea7d409038513e133b99e22163ffee1b&
21:38:53 <xarick> this one here works, what's different?
21:41:53 <pickpacket> IT WORKS!
21:42:09 <pickpacket> xarick: sorry, I don't know about your thing. My GS works
21:43:03 <xarick> ~^-
21:43:35 <pickpacket> does anyone know how to do string formatting in squirrel? 😅
21:44:11 <pickpacket> The string "a\tb" prints out as "a?b" in the storybook
21:50:43 <DorpsGek> [OpenTTD/OpenTTD] bjornwarmedal commented on pull request #12878: Add: [Script] ScriptEventCompanyRename https://github.com/OpenTTD/OpenTTD/pull/12878#issuecomment-2565949152
21:56:46 <xarick> somebody explain me what am I doing wrong
21:57:12 <xarick> the wrong overload/override is picked 😦
22:00:16 <kuhnovic> Overload resolution can be a real bitch in C++. Best to google the specifications, you might find some hints.
22:01:24 <xarick> :=)
22:05:06 <xarick> probably TileIndex strongtype weird stuff
22:06:37 <kuhnovic> 9 out of 10 times you need to get the base type (int) or whatever it's called. That's my experience at least.
22:06:51 <_glx_> most probable is Axis is a int32_t
22:07:40 <xarick> enum Axis : uint8_t {
22:07:54 <_glx_> yes int32_t compatible
22:08:27 <xarick> i don't undestand. it works sometimes
22:09:52 <Rubidium> it has nothing to do with Axis, it has all to do with const(-correctness)
22:10:24 <_glx_> hmm yeah your operator signatures feels wrong
22:10:48 <Rubidium> but didn't your LLM tell you that already?
22:11:37 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1323413208911839262/image.png?ex=67746c18&is=67731a98&hm=f34165cef298c4837442f4cc591e16fae3f23fb65628ace8125beaf3ab35cc0b&
22:12:02 <xarick> it's picking the wrong operator-
22:13:47 <Rubidium> no, xarick's providing the wrong operator-
22:14:37 <_glx_> `T operator-(const T& a, const T2& b);` <-- that's what I see in cppreference
22:19:04 <xarick> nope, that didn't work either
22:19:09 * xarick glx
22:19:11 <_glx_> oh actually Compatible inside StrongType uses wrong signature in overloads
22:22:43 <_glx_> anyway int32_t version is one of the compatible, there's also int64_t
22:23:43 <_glx_> and uint32_t as basetype
22:24:15 <_glx_> so picking the correct overload is tricky
22:24:31 <peter1138> I'm not sure overloading operators for tile manipulation is a great idea.
22:24:54 <peter1138> But maybe it is.
22:25:02 <_glx_> there's already a lot of overloads for TileIndex
22:25:02 <Rubidium> it's not... you're passing const TileIndex&, guess what... non-const TileIndex& overloads are not considered
22:27:11 <xarick> it's a field TileIndex, whatever that means
22:27:38 <xarick> rs->xy (field) TileIndex
22:27:44 <Rubidium> and I agree that overloading operator-/+ for Axis is overkill and asking for problems
22:27:56 <_glx_> but I think all `friend constexpr bool operator ==(const TType &lhs, TCompatibleType rhs)` should be `friend constexpr bool operator ==(const TType &lhs, const TCompatibleType &rhs)`
22:35:26 <peter1138> Axis definitely.
22:35:42 <peter1138> DiagDir/Direction are fairly reasonable, I guess.
22:36:52 <xarick> found another
22:37:07 <xarick> TileIndex tile = v->tile + dir;
22:37:24 <xarick> it picks the strongtype compatible one
22:37:31 <xarick> that's diagdir this time
22:38:25 <xarick> so a tile that is picked via something->tile gets the wrong operator 😦
22:40:38 <Rubidium> seriously, I told you half an hour ago what the cause is and you LLM still hasn't caught on
22:41:32 <xarick> sorry, I'm not sure yet what you mean
22:44:08 <xarick> gonna try consts?
22:52:42 <xarick> nop
22:53:46 <peter1138> Did someone say there's a desync issue in master?
22:54:22 <xarick> consts make it worse, can't even build
22:54:52 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #13208: Add: [Script] Event for when a company's president name changes https://github.com/OpenTTD/OpenTTD/pull/13208
22:55:56 <_glx_> peter1138: I heard something about it yes
22:57:58 <peter1138> Hmm, but I didn't see an issue yet.
22:58:32 <_glx_> just a report here IIRC
22:58:33 <xarick> 2talltyler mentioned a desync
22:58:52 <xarick> I tried to investigate, but got nothing
22:58:57 <xarick> something about signals
22:59:16 <_glx_> no the reason is not known yet
22:59:37 <_glx_> signals were just a guess, but no proof
23:05:21 <xarick> `TileIndex tile = v->tile + (DiagDirection)(rd.x & 3);` this one works.. this is really strange
23:05:35 <xarick> there goes my something->tile theory
23:06:23 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #12878: Add: [Script] ScriptEventCompanyRename https://github.com/OpenTTD/OpenTTD/pull/12878#issuecomment-2565995225
23:07:23 <Rubidium> xarick: if something is a const pointer, then it "fails". If something is non-const, then it "works"
23:08:18 <xarick> ah!
23:08:35 <xarick> thx
23:09:56 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1323427886786674698/image.png?ex=677479c4&is=67732844&hm=7177b6455c4609ec9d21d4646df4f159fcccb13ccc3f44bbfff7b85a9a159bef&
23:09:56 <peter1138> Only an hour to get there, and it wasn't really a getting there.
23:10:15 <peter1138> And I guess the solution is perhaps stilll not known 🙂
23:11:04 <xarick> i read that but it confused me
23:11:28 <xarick> so I was testing adding const TileIndex &tile, const DiagDirections &diagdirs
23:12:46 <peter1138> Alright, so which settings are 'sandbox settings'?
23:12:55 <peter1138> "Infinite money" of course.
23:13:09 <_glx_> https://cdn.discordapp.com/attachments/1008473233844097104/1323428695527915560/image.png?ex=67747a85&is=67732905&hm=24f28b81b9a69ee4bc7655f7e9ca9fd7610d07c3fb176ef93303bc0965c7ce8b&
23:13:09 <_glx_> based on <https://en.cppreference.com/w/cpp/language/operator_arithmetic>, it would make sense to do
23:13:42 <peter1138> What does godbolt say?
23:15:02 <peter1138> Sometimes taking a reference of an integral type is sub-optimal.
23:18:31 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:23:11 <_glx_> well, Compare and Integer already use const references