IRC logs for #openttd on OFTC at 2022-12-19
⏴ go to previous day
00:06:22 *** wallabra_ has joined #openttd
00:08:49 *** sla_ro|master has quit IRC ()
00:10:36 *** wallabra has quit IRC (Ping timeout: 480 seconds)
00:10:36 *** wallabra_ is now known as wallabra
00:13:26 *** Soni has quit IRC (Ping timeout: 480 seconds)
01:15:08 <petern> Oh sleep. Maybe I should.
01:21:50 <petern> "Why are you so tired and feel like shit?"
02:03:35 *** wallabra has quit IRC (Ping timeout: 480 seconds)
02:07:04 *** wallabra has joined #openttd
02:37:53 *** Wormnest has quit IRC (Quit: Leaving)
03:51:15 *** debdog has quit IRC (Ping timeout: 480 seconds)
05:15:52 *** D-HUND is now known as debdog
05:51:24 *** _aD has quit IRC (Quit: leaving)
06:00:08 *** tokai|noir has quit IRC (Quit: c('~' )o)
07:16:08 *** sla_ro|master has joined #openttd
07:46:38 *** wallabra has quit IRC (Ping timeout: 480 seconds)
07:50:54 *** keikoz has quit IRC (Ping timeout: 480 seconds)
08:02:56 <andythenorth> today: such Horse
08:09:48 *** wallabra has joined #openttd
08:13:17 <Pruple> andythenorth: many ironies
08:18:44 <Pruple> PikkaBirdviaGitHub: my favourite is the inside curve where the left-hand pole displays correctly, and the right-hand one does not.
08:20:54 *** scrubbles has joined #openttd
08:23:51 <Pruple> doesn't have enough variants
08:24:01 <Pruple> it *is* chunky, though.
08:54:51 <andythenorth> wonder if I'll miss this magic when it's gone
09:22:12 <dP> TallTyler: yeah, that would actually be a nice way to spare the player from horrendous refitting ui
09:22:36 <andythenorth> it is jus a grf though
09:29:44 <petern> Do I now how to try and resolve that... #7675? :p
09:31:03 <petern> My words are not working today
09:31:28 <petern> Maybe I should buy a sequencer
09:31:34 <Pruple> making the bounding boxes taller on the poles might fix it 🙂
09:32:26 <petern> Hmm so linkgraph lines are 3 px wide as 1x UI scale, but there's 3 of them side by side, so 9 px wide.
09:32:37 <petern> Someone decided they needed to be scaled.
09:32:47 <petern> So at 2x UI scale they are 18 px wide.
09:34:09 <petern> Dropping the 1x size of 2px might help then it's 6px and 12px wide, which isn't so excessive.
09:34:41 <dP> stuff like #7675 desperately needs automated tests for sprite sorter
09:35:14 <dP> to make sure nothing else breaks each time there is a change
09:38:19 <dP> I already have like 100 items on todo list :p
09:38:26 *** Markk has quit IRC (Ping timeout: 480 seconds)
09:38:26 *** Markk_ is now known as Markk
09:38:30 <dP> and not enough time to even merge 13.0 to cmclient :/
09:38:46 <dP> or, well, I did merge, but half of the features broke
09:40:05 <petern> Pruple: Hmm, looks like it uses the height required under bridges all the time
09:40:50 <dP> yep, and that was beta1, without ui scaling...
09:42:11 <petern> The network command changes are invasive yes. Ah well.
09:42:15 <Pruple> petern: but it doesn't draw wires or poles at all under 1 height bridges 😮
09:42:53 <petern> It does if transparency is on, lol
09:43:32 <Pruple> it draws the wires with transparency on, yes 🙂
09:43:43 <petern> andythenorth: I got a message from my manager saying I should have stayed in bed. FFS.
09:43:55 <Pruple> but not the poles... you can put an electrified track perpendicular under the bridge and it will have no poles at all
09:44:32 <petern> The old thing where really it needs to be 2 height levels up...
09:44:43 <petern> Just as the brick viaducts illustrated.
09:44:44 <dP> petern: it's not just invasive, I had a lot of stuff built on top of it, containers, callbacks, etc
09:45:03 <petern> Callbacks are still there.
09:45:35 <dP> vanilla callbacks are hardcoded, cmcliennt can't use them for own stuff
09:45:43 <andythenorth> petern: stay in bed
09:49:45 <petern> Hmm, that elrail pylon code was last touched by me... 14 years ago.
09:50:33 *** arikover has joined #openttd
09:51:55 <reldred> there we go, your fault
10:04:55 <petern> This font ascender crap is annoying me :/
10:44:33 <petern> Where do the pylons and wire go on the right?
10:44:49 <Pruple> it's a magic thing for non-continuing electric rail
10:45:00 <Pruple> to allow for junctions between el and non el to look nice
10:45:37 <petern> I guess it checks for "does elrail continue"
10:45:50 <petern> When really it should check for "does non-elrail continue"
10:46:40 <petern> That first corner piece is elrail
10:47:00 <petern> Anyway, this is not the bug I was looking for lol
10:51:49 <petern> Pruple: removing rail needs to mark its neighbouring tiles dirty then, if it's intentional.
10:54:27 <petern> I wonder who came up with these wire bounding boxes? 😄
10:54:53 <petern> Probably trial & error and preventing flickering.
10:56:19 <petern> Does railtypes have custom signal sprites?
10:59:49 <Pruple> do you want signals in the test grf?
11:00:22 <petern> Nah... do they get varacts for things like under bridges?
11:01:02 <Pruple> no variables for rail and roadtypes because ItS tOo ExPeNsIvE
11:04:53 <andythenorth> buy a faster computer 😛
11:05:05 <petern> I'm not sure I ever tested it
11:27:20 <dP> ha, I just tried to autopilot my testing routine, build depot, build station, buy train...
11:27:27 <dP> got pretty confused when I couldn't build station
11:27:36 <dP> problems came sooner than expected xD
12:39:22 * petern breaks all offset bounding boxes :D
12:39:33 <dP> hm, I guess cmclient could hijack callback field and use it to id commands...
12:39:38 <dP> only 27 possible values though
12:41:41 <petern> That's kinda better right?
13:01:57 <dP> diagonal bounding boxes when? :p
13:14:50 <Pruple> what if you make the pole boxes even taller? what's the worst that could happen? 🤔
13:15:40 <petern> I'm perplexed why that one is so wide 🙂
13:16:12 <arikover> So I tested the engine variant groups (PR #10220), really nice. I noticed 2 small problems: 1. cargo-filtering vehicles now only works for trains (RVs, boats and planes can't be filtered by cargo) and 2. small GUI problem. Should I comment the PR or open an issue?
13:16:44 <Pruple> probably to avoid a train clipping through it at the bottom of the slope. 🙂
13:18:05 <dP> also catenary bb probably interacts witth vehicle effects in some way
13:37:11 <LordAro> arikover: comment on PR
13:45:52 <LordAro> petern: ^ that looks like one you already fixed?
13:49:40 <petern> Just needs a WIthHeight() call to limit to the top instead of the whole panel.
13:51:23 <petern> Potentially ship & aircraft too, although it might even be the same function.
14:03:06 <petern> Yeah, will fix tonight 🙂
14:18:35 <petern> Error reading configuration from file: The JSON value could not be converted to DartSassHost.OutputStyle. Path: $.CompilerSettings.Sass.OutputStyle | LineNumber: 16 | BytePositionInLine: 29.
14:19:03 <petern> When your CI fails because your tools update :/
14:19:43 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
14:19:49 *** WormnestAndroid has joined #openttd
14:19:49 *** WormnestAndroid has quit IRC (Remote host closed the connection)
14:20:42 <petern> Hmm, there is a line 16 but there isn't a byte 29.
14:21:57 <petern> > The underlying SASS compiler is changed from libsass to dart-sass. This is a necessary change, as libsass is discontinued. There are two breaking changes when working with the config json file:
14:22:00 <petern> I guess it is documented at least.
14:57:05 <petern> Something is going wonky with my VS Code recently, presumably I've enabled some extension I shouldn't've.
15:27:12 *** WormnestAndroid has joined #openttd
16:20:53 <petern> Maybe I'll try de-duping
16:21:09 <petern> (In fact it's explicitly added, so should be easy to do)
16:28:50 *** Wormnest has joined #openttd
16:55:51 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:13:49 <TallTyler> Time to fix #7575, I think (abandoned PR for industry production graph)
17:22:42 <petern> Oops, I only meant to touch one sprite offset...
17:23:55 <petern> But then I realised that how bb offsets are applied is dumb.
17:25:08 <petern> It doesn't flicker in stations, that's normal right?
17:47:22 *** gelignite has joined #openttd
17:48:34 <TallTyler> Now to see if it builds or if I somehow pushed an older version
17:48:51 <TallTyler> Updating other people's PRs is extra confusing for my rookie git knowledge
17:49:45 <TallTyler> It seems I took ownership of the commit, but there's still updating to be done so that might be up to the contributor to fix when they update it 🙂
17:49:56 <petern> Diagonals are a pain 🙂
17:51:31 <petern> Top is tweaked, bottom is vanilla.
17:52:03 <petern> Signal goes behind the bridge wall on diagonal track :/.
17:52:49 <petern> Goes it throw out wonky offsets?
17:53:05 <petern> BB for the bridge wall is right at the end of the tile
17:54:55 <MnHebi> dmu missing, unable to make comparison
17:55:10 <petern> Maybe if I pull the bridge wall in it will all magically come together?
17:55:26 <Pruple> the dmu clipping behind the foundation in the first image 🙂
17:55:51 <Pruple> definitely looks like an improvement in the poles and wires 🙂
17:56:54 <petern> That clipping happens in vanilla too
17:57:07 <Pruple> yes, I didn't think it was new 😉
17:58:11 <petern> With the changes I've made it could easily be :p
18:02:06 <petern> So currently when you set up a bounding box of 0, 0 -> 16, 16, and then apply an bb_offset of 8, 8, the bounds become 8,8 -> 16,16
18:02:29 <petern> bb_offset of -8,-8 would become -8,-8 -> 16,16
18:03:00 <petern> This is... fine but a little awkward. There are some places where the code applies the bb offset to the bb size to compenstate.
18:03:25 <petern> I'm ripping that out to 0,0 -> 16,16 with offset 8,8 becomes 8,8 -> 24,24
18:04:22 <petern> I only meant to change the pole height lol
18:05:07 <petern> I brought the walls in
18:07:41 <petern> Vehicle drives under catenary under bridge when bridge is invisible 😄
18:23:01 <andythenorth> unintended side effect: spare coaches are neatly grouped in depot by variant 😛
18:23:23 <petern> Definitely deliberate 😄
18:23:36 <petern> So, giant depots when?
18:24:53 <TallTyler> Multi-tile depots is waiting on the author
18:25:08 <petern> I haven't looked at that yet.
18:26:09 <petern> Apparently I've tested the industry production graph patch.
18:26:26 <TallTyler> I broke industry production graph patch 😦
18:26:41 <TallTyler> Stupid trying to rebase
18:26:54 <TallTyler> Maybe I can just force-push the original commit
18:27:44 <glx[d]> you can always use `git reflog` then `git reset --hard`
18:28:03 <dP> btw, is uint16 really enough for monthly production in #7575?
18:28:24 <dP> to me it seems like industry can do up to uint16 in a cycle, so 9 times that a month
18:31:33 <dP> it uses uint16 for the last month though atm so maybe not
18:32:34 <TallTyler> Never used `reflog` but it just shows me what I've done
18:32:48 <andythenorth> I will miss old magical Horse
18:32:50 <petern> You can git reset to one of the refs in the reflog.
18:32:50 <TallTyler> Everything is extra confusing because I have someone else's branch as the upstream
18:32:54 <andythenorth> but not the hidden aspects of the magic 😛
18:34:38 <Pruple> "5,000 industries sounds like a stress-test more than a typical usecase."
18:34:38 <Pruple> I just generated a 4k map with "normal" towns, "normal" industries, and no newgrfs- you know, the standard new player experience 😉
18:35:02 <petern> 0xffff + 0x1 would be 0x10000
18:35:23 <dP> petern: and 0x10000 in uin16 is 0 ;)
18:35:29 <TallTyler> Hot take: big maps can be an impediment to good features
18:35:52 <petern> I can't see the code, but int promotion is a thing.
18:36:13 <petern> TallTyler: So are offsets 😄
18:37:03 <petern> Will a 0,0 size work? Hmm
18:38:17 <dP> largest type is uint16 in that +
18:39:03 <glx[d]> anyway regression fails when loading the save, that's a good indication about where to look
18:39:16 <andythenorth> would we say these are variants of same van?
18:39:26 <andythenorth> default refits are same, generally
18:40:24 <glx[d]> should be easy to fix TallTyler
18:41:11 <glx[d]> and we use groups of 5
18:41:59 *** Smedles has quit IRC (Read error: Connection reset by peer)
18:42:13 <DorpsGek> - Update: Translations from eints (by translators)
18:42:18 <glx[d]> somehow the 3 latest increases didn't follow the rule
18:43:08 <TallTyler> I can make a cleanup PR later to fix that
18:45:59 <petern> dP: it's promoted to int within std::min()
18:46:41 <andythenorth> broke a train or two
18:47:46 *** Smedles has joined #openttd
18:48:52 <petern> Well, promoted during the addition, then std::min works on int.
18:48:55 <JGR> TallTyler: Big or small, it's player choice
18:49:37 <andythenorth> "moar is not always better"
18:49:41 <andythenorth> -> 900 trains in one grf
18:49:48 <petern> I can have 0,0 bb size, but it doesn't fix the issue 😭
18:50:01 <JGR> No matter what your playing style is, you're only going to use a subset of available features at any one time
19:03:19 <TallTyler> I'm not passing any judgement on the "right way" to play, just noticing the tradeoffs of past choices
19:03:34 <TallTyler> And maybe letting off a little steam 🙂
19:12:03 <TallTyler> Hmm, still broken, and I've just realized the title game doesn't load (it's all water)
19:22:23 <petern> Oh lol they're metro 😄
19:23:35 <petern> `DrawRailCatenaryOnTunnel()` is hilarious. It looks up its own unique set of data, then modifies that with another set of data.
19:23:41 <petern> Instead of just having the correct data in the first table.
19:24:31 <andythenorth> I always assume OpenTTD is coded to much higher standards than my grfs 😛
19:24:39 <andythenorth> but we know what assumptions make
19:25:52 <petern> It's from 15 years ago. The author if it wasn't a dev at the time.
19:26:35 <andythenorth> hmm I have made bugs
19:27:21 <andythenorth> 12.2 eh, not chunky
19:28:29 <andythenorth> half my bug pre-exists these variants
19:30:21 <petern> petern: This is unwinnable 😦
19:30:41 <petern> Is it worse than all the existing bugs...
19:31:07 <petern> Can I get away with reducing the bb of the train...
19:32:53 <JGR> The sprite sorting algorithm is fundamentally nonsensical
19:35:17 *** wallabra_ has joined #openttd
19:36:01 *** wallabra has quit IRC (Ping timeout: 480 seconds)
19:36:01 *** wallabra_ is now known as wallabra
19:39:18 <petern> Made the train bb smaller and it 'fixed' the foundation bug
19:45:01 *** wallabra has quit IRC (Ping timeout: 480 seconds)
19:46:26 <petern> Oh right, yes. Of course this clips.
19:48:30 <petern> It if's in front of a bridge it needs to be on the near side of the track.
19:48:44 <petern> Otherwise it's impossible to sort.
19:50:28 <petern> maybe we need a z-buffer 😄
19:51:53 <petern> Similar rule for tunnel heads would avoid issues too. Just the default design doesn't pose a problem.
19:54:39 <dP> z-buffer would probably solve a lot of issues
19:54:46 <dP> and may even improve performance
19:55:31 <petern> Goes very deep into the blitter though
19:57:32 <petern> ``` bool disable_elrails; ///< when true, the elrails are disabled```
20:01:19 <petern> Sprite sort but do it for every horizontal pixel.
20:01:42 <petern> (Something like Doom's renderer)
20:02:24 <petern> I mean for each horizontal coordinate.
20:02:43 <petern> Separate sort for each column
20:03:34 <petern> It was not a serious suggestion
20:04:35 <petern> Also z-buffer doesn't solve things where sprites overhang other things... like elrail pylons.
20:05:26 <dP> I does if sprites have z layer
20:10:02 <petern> Sprites having z layer themselves is... a big change 🙂
20:10:31 <petern> But er, not impossible...
20:11:19 <TallTyler> Fastest review ever? 😛
20:11:30 <TallTyler> (Because you discussed it earlier)
20:15:58 <TallTyler> ```Exception thrown at 0x00007FF657FF0C7F in openttd.exe: 0xC0000005: Access violation writing location 0x0000000000000002.```
20:16:10 <TallTyler> Interesting that I broke something so low
20:16:21 <LordAro> null pointer dereference
20:17:29 <TallTyler> I'm adding a scrollbar to the company infrastructure window, and did something wrong with `this->count = num;`
20:19:52 <petern> Oh yes, I had that patch.
20:20:58 <dP> meanwhile, it's nice to be able to place stations again xD
20:21:11 <TallTyler> Okay question time, what are the new `vsep`s for EXP_SPACING and EXP_LINESPACE? `WidgetDimensions::scaled.vsep_wide` and `...vsep_normal`, respectively?
20:21:27 <TallTyler> Or do I have that backwards?
20:22:39 <petern> SPACING... i don't see
20:22:53 <dP> I use custom station joining in cmclient that got rekt by commandcontainer disappearance
20:23:35 <TallTyler> What's LINESPACE then?
20:23:37 <petern> Yeah, there's no EXP_SPACING 🙂
20:24:08 <petern> vsep_normal for that one.
20:24:19 <TallTyler> Ha, I got it all right 🙂
20:24:23 <petern> static const uint EXP_LINESPACE = 2; ///< Amount of vertical space for a horizontal (sub-)total line.
20:24:23 <petern> static const uint EXP_BLOCKSPACE = 10; ///< Amount of vertical space between two blocks of numbers.
20:24:23 <petern> static const int EXP_INDENT = 10; ///< Amount of horizontal space for an indented line.
20:24:30 <petern> wonder where you had EXP_SPACING.
20:24:35 <petern> Maybe you changed it in the patch.
20:26:03 <petern> It's not in pre-variable scaling so I dunno.
20:26:19 <TallTyler> Doesn't matter, it doesn't exist anymore 🙂
20:26:21 <petern> Anyway, doesn't matter.
20:26:46 <petern> Oh this patch touches english.txt. hah
20:27:59 *** wallabra has joined #openttd
20:29:52 <TallTyler> Ah, found the missing code
20:30:12 <TallTyler> Chunky Bevels introduced so many merge conflicts I started over
20:30:28 <TallTyler> Copy-paste failed me yet again 😛
20:33:58 <TallTyler> petern: It's now `hsep_indent`
20:36:46 <TallTyler> I can't read the diff properly
20:36:56 <TallTyler> Too long staring at code
20:37:18 *** wallabra has quit IRC (Ping timeout: 480 seconds)
20:40:17 <TallTyler> So a null pointer dereference on the scrollbar would mean it can't find the scrollbar in memory?
20:41:35 <TallTyler> Did scrollbars change recently?
20:42:49 <petern> If you've got a window->scrbollbar thing, then you need to assign that yourself.
20:44:02 <TallTyler> Fixed it, now I'm dividing by 0 somewhere else 🙂
20:46:26 <petern> Don't know why those boxes are so tall now
20:47:15 <petern> The base set boxes that is, not the orange buttons 🙂
20:49:59 <TallTyler> Orange buttons look like an appropriate size, although I don't know of any other GUIs where we mix button colours (besides green Generate button in worldgen)
20:50:56 <petern> AI settings, Game settings 🙂
20:52:05 <petern> I guess all the buttons are the same colour.
20:55:47 <TallTyler> Not sure exactly where those numbers come from but the call comes from `virtual void OnResize() override`
20:55:50 <petern> Is your widget resizeable?
20:55:58 <TallTyler> It's supposed to be
20:56:25 <TallTyler> Game crashes before it opens 🙂
20:56:39 <JGR> The items in the company infrastructure window are not all the same effective height
20:56:44 <TallTyler> I'll comment out that line and see what happens
20:56:46 <JGR> Due to vertical padding between sections
20:57:20 <petern> You probably need need a SetFill(0, 1) somewhere
20:57:37 <petern> and/or a resize->height = 1 in UpdateWidgetSize()
20:58:06 <petern> I'm assuming it's been rewritten to draw it all in one widget.
20:58:09 <TallTyler> The widget it's looking at has `SetFill(1, 0)`
20:58:31 <petern> Quick fix, try SetFill(1, 1)
20:59:29 <petern> But not sure if that actually does it tbh
20:59:36 <TallTyler> Nope, still crashes
20:59:54 <petern> UpdateWidgetSize() and resize->height = 1 then
21:00:05 <petern> (that 1 there means 1 pixel at a time)
21:01:20 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:07:16 <TallTyler> Huh, that worked, although it definitely wasn't present before
21:07:40 <TallTyler> And the scrollbar moves fine but scroll the content
21:09:11 <TallTyler> Aha, was missing `SetResize(0, 1)` in both widgets
21:09:24 <JGR> You'll need to do the content scrolling yourself
21:22:43 <TallTyler> Project for another day 🫠
21:23:51 <JGR> You can probably save yourself some work by peeking in my branch
21:34:41 <andythenorth> such fancy mix and match with magic
21:35:10 <andythenorth> only in specific jurisdictions
21:35:14 <andythenorth> goes it variants?
21:35:24 <andythenorth> I'm up to my eyeballs in this branch now 😛
21:35:35 <petern> I need to check that bug
21:35:40 <andythenorth> I see you made some bugs
21:35:57 <petern> But I'm fiddling with vehicle reversing offsets right now.
21:36:12 <andythenorth> reverse articulated vehicles 😛
21:36:48 <petern> Let's not get carried away ;D
21:39:06 <andythenorth> virtual vehicles, instead of relying on front engine
21:39:10 <andythenorth> rest is just units
21:39:13 <andythenorth> then virtual consists
21:39:17 <andythenorth> then template replacement 😛
21:44:08 <andythenorth> hmm will I do more Horse variant stuff 😛
21:44:24 <andythenorth> yes, white pixels to fix
21:52:00 <petern> Imagine if you could get rid of half the action 1s
21:53:15 *** gelignite has quit IRC (Quit: Stay safe!)
21:53:38 <andythenorth> imagine half the action 1s
21:56:12 <petern> Weird, I'm sure I got it working better than this :/
21:57:34 *** newbthenewbd has quit IRC (Quit: User went offline on Discord a while ago)
22:02:18 <petern> Oh it's because I'm using the wrong Iron Horse version 😄
22:04:04 <petern> I don't know which is which anymore. argh.
22:04:52 <petern> Maybe it is the right version. It doesn't have variants and it messes up when I reverse.
22:04:56 <andythenorth> got another one here 😛
22:09:19 <petern> with EF_RAIL_FLIPS not set, and all the action flipping magic removed?
22:11:37 <andythenorth> oh wait, did I make one of those? 😛
22:12:09 <petern> I dunno now. Maybe I was imagining it.
22:12:23 <petern> How do I make a single shorter engine? 😄
22:12:44 <petern> I can't use the MJS 250 as that's at the back of the bounding box, but shorter engines are at the wrong.
22:12:58 <andythenorth> I'll make a Horse
22:13:11 <petern> I mean, following the MJS 250 style from the start would've been useful 😉
22:13:50 <dP> ugh, new command system is such a pain to work with
22:13:55 <Pruple> the mjs250 isn't a short vehicle, that's the point
22:13:59 <dP> I want virtual post but callback is templated :/
22:14:12 <petern> Pruple: no but it could've been
22:14:25 <andythenorth> ok so no flip flag, and remove all the special handling 😛
22:16:40 <petern> I definitely had one already because I remember that engine flipping. Hmm.
22:17:15 <andythenorth> maybe I made a quick hack dunno
22:17:33 <andythenorth> that only does engines currently
22:17:48 <andythenorth> 'untested' of course 😛
22:18:51 <andythenorth> I should do the snowplough 😛
22:19:38 <petern> Any particular engine?
22:20:27 <petern> Is it applied to all? heh
22:20:34 <andythenorth> all normal engines
22:20:43 <andythenorth> not railcar things or snowploughs
22:20:54 <andythenorth> Kelpie, or something if it's around 1980
22:22:34 <andythenorth> I can do more if needed
22:22:47 <andythenorth> Horse only has 4/8, 6/8, 8/8
22:23:35 <petern> I had a version of yours where it worked.
22:23:45 <petern> So this version does work now \o/
22:23:57 <petern> I used pikka's to test non-even flipping
22:24:02 <petern> As that doesn't support it anyway.
22:24:20 <petern> I'm going mad, I was only fiddling with this a week ago
22:25:01 <petern> Maybe I've had non-Covid Covid.
22:31:03 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:34:41 * andythenorth back to Horse variants
22:43:04 <petern> Right, depot view works properly now.
22:46:00 <dP> so client receives callback id from the server, looks it up in the table, saves the pointer in command packet, puts it into the queue, then takes from the queue, iterates the callback table to find callback id by its pointer, goes to another table of all possible callbacks to get the right function that takes the callback from the table by id so it can finally start executing command
22:46:57 <dP> I guess somewhere in that chain some template magic happens that gets actual callback function type restored but I've no idea how it works
22:50:53 <dP> oh, I see how it works, there is constexpr table that keeps the type
22:51:21 <dP> so it goes through two other tables to finally get into constexpr territory
22:51:36 <petern> template magic is often horrible 😄
22:52:01 <petern> but it makes the command system much cleaner to both provide and consume.
22:52:46 <dP> I find it anything but clean tbh
22:52:59 <dP> I'm constantly struggling to understand where the execution flow goes
22:53:19 <dP> it just accepst some junk and does magic
22:54:49 <petern> Not cleaner by itself. But sending a command and handling a command are both cleaner.
22:57:07 <dP> I don't consider it clean when I can't tell what it does without going through the guts
22:57:11 <dP> like that special treatment for first TileIndex argument, how is anyone supposed to know about this easter egg?
23:04:26 <dP> This is how I'm doing it, probably not perfect either but at least it's clear that tile is special
23:04:26 <dP> citymania::cmd::DoTownAction(t->index, HK_LADVERT)
23:04:26 <dP> .as_company(_local_company)
23:04:49 <JGR> If you can work out that both the client and server are your versions, you can signal out of band whatever you need to
23:05:21 <dP> problem is I also need some stuff to work with vanilla server / client
23:05:48 <dP> and in case of callbacks server does check them for validity so I can't just put there whatever I want
23:06:44 <dP> not that having 256 values makes it much better than 27
23:07:42 <dP> but at least I could've defined my callbacks without interfering with vanilla ones
23:14:20 <dP> dP: btw, that CmdDoTownAction doesn't even take tileindex argument and yet it's called with one in `Command<CMD_DO_TOWN_ACTION>::Post(STR_ERROR_CAN_T_DO_THIS, this->town->xy, this->window_number, this->sel_index);`
23:16:10 <dP> and it's even nice that it does. even though it does nothing in vanilla I can use that in cmclient
23:16:16 <dP> but it's anything but clean imo
23:27:04 <JGR> Callbacks are sent back to the client which sent the original command to the server anyway
23:27:27 <JGR> So you should be able to reattach the callback when the command comes back from the server
23:27:49 <dP> yeah, but it limits the value only to existing callbacks in vanilla
23:27:59 <dP> I can't just add my callback
23:28:07 <JGR> No, I mean leave the callback as 0 in the command to the server
23:28:13 <JGR> Just track it yourself on the client
23:28:33 <dP> how would I track it? command has no clear id
23:29:04 <dP> I mean I could hash the data and in fact I did it like that before but it's ugly af
23:29:32 <JGR> You can compare what you sent to the server with what comes back, and there's the my_cmd flag
23:30:33 <JGR> You're not going to have that many commands in flight at a time
23:30:45 <dP> it's not very reliable since commands can be exactly the same
23:33:46 <JGR> Presumably they'd have the same callback in that case?
23:34:55 <dP> i use lambdas for callbacks and they can capture
23:35:25 <dP> but yeah, it wasn't a big issue so far, it's just ugly
23:35:43 <dP> I also can somewhat rely on the command order
23:38:29 *** sla_ro|master has quit IRC ()
23:42:51 <JGR> Putting std::functions into a ring buffer or whatever and then dequeuing them when the command comes back seems much cleaner to me than trying to fiddle with the callback template stuff
23:44:36 <dP> i fiddle with templates for other reasons
23:44:38 <JGR> The server won't re-order or drop commands with respect to other commands from the same client, as it doesn't to the test again before queuing
23:45:09 <dP> iirc even vanilla server drops commands sometimes
23:45:46 <JGR> If you exceed the rate limit/queue length
23:46:13 <JGR> But then you'll get booted off anyway
23:46:23 <dP> also probably for some invalid commands
23:47:01 <dP> I don't remember exactly, I just remember I had issues when I expected them all to return
23:47:28 <JGR> CMD_COMPANY_CTRL has a special case
23:49:30 <petern> I'm still smashing up your offsets
23:52:13 <andythenorth> I was drawing variants
23:53:13 <andythenorth> but now I'm not 😛
23:53:43 <andythenorth> just 30 mail vans to add an extra livery to 😛
23:54:54 <petern> But only on odd-length vehicles
continue to next day ⏵