IRC logs for #openttd on OFTC at 2023-05-03
⏴ go to previous day
02:03:13 *** herms has quit IRC (Quit: bye)
02:13:15 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:41:19 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
02:41:48 *** WormnestAndroid has joined #openttd
02:45:50 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
02:46:22 *** WormnestAndroid has joined #openttd
06:26:28 *** D-HUND is now known as debdog
07:02:35 <pickpacket> andythenorth: it was, yesterday
07:04:19 <petern> It was if you were eating lunch.
07:04:44 <petern> But don't confuse that with dinner, tea or supper.
07:05:06 <pickpacket> I think it's about time for second breakfast
07:05:38 <petern> That makes me think though... I nearly always have cold food at lunch and hot food in the evening. Even though I work from home and easily mix it around.
07:48:13 <andythenorth> sometimes I mix it around
07:48:29 <andythenorth> big meal before bed is supposed to be ... not great for the body
09:29:07 <andythenorth> wonder if we should bake in to the buy menu support for all the badge / flag stuff authors like
09:29:17 <andythenorth> then I could use it for dice and a colour chart
09:29:30 <andythenorth> or it could just be done with spritestack, but eh
09:29:43 <andythenorth> if it's separate we might be able to control the layout of it better
09:30:43 <pickpacket> andythenorth: whaaaa...? I have absolutely no idea what you're talking about
09:42:46 <EmperorJake> MopRV uses sprite stack for the buy menu icons. Possibly others too
09:43:42 <EmperorJake> pickpacket: Stuff like this
09:45:31 <EmperorJake> andythenorth: I like this idea, but I know someone who wouldn't...
09:52:48 *** WormnestAndroid has quit IRC (Remote host closed the connection)
09:52:50 *** WormnestAndroid has joined #openttd
10:02:29 <andythenorth> if we split it off, we could
10:02:29 <andythenorth> - make it optional
10:02:29 <andythenorth> - handle relayouting it for different window sizes if needed
10:02:29 <andythenorth> - handle RTL / LTR reading
10:06:30 <petern> Hmm, not lunch time yet.
10:32:30 <petern> Kinda like a 1D finish line camera but quite...
10:37:08 <pickpacket> petern, andythenorth: I've had lunch
10:38:19 <pickpacket> EmperorJake: ugh... those do *not* look good, imho
10:38:52 <petern> If it was a game feature to separate them, then you'd be able to turn them off.
11:10:04 <andythenorth> some people really love them
11:10:10 <andythenorth> I'm potato / potato
11:10:13 <andythenorth> but Horse has dice
11:26:44 <EmperorJake> Well nothing's gonna stop me from putting them in all of my GRFs ever
11:37:42 <pickpacket> I want to play, not work.
12:23:55 <petern> EmperorJake: But a better way would be nice, right?
12:25:02 <EmperorJake> If there was a better way, I would definitely make use of it
13:20:13 <petern> Thanks, I couldn't find it quickly, pelya's old repo kept coming up.
13:27:42 <FLHerne> UKRS2 has them optional, iirc
13:27:49 <FLHerne> personally I don't like them much
14:31:22 <andythenorth> wonder if we should bake in colour randomising options for grf vehicles
14:31:34 <andythenorth> obvs. grfs can do it for themselves but eh
14:32:24 <andythenorth> nah...just let grf authors sort it out I think
14:36:28 <petern> That would work for rgb-cc
14:51:28 <andythenorth> recolour / remap sprites work very well
14:51:30 <andythenorth> but they're a faff
14:52:21 <andythenorth> lot of varaction 2 for something that could just be 'pick a random colour [any | optional list of ranges]'
14:53:04 <andythenorth> it would only affect CC1 and CC2, not the whole palette
14:53:21 <JGR> Randomly picking a recolour sprite to use could equally just be 1 varaction2
14:53:54 <andythenorth> not if you're using nml procedures to 'optimise' how many varact 2s you're using 😛
14:57:18 <JGR> The templating that you're doing is a bit opaque, but using procedures should not make anything worse than it would be without them
14:57:34 <glx[d]> one procedure is a varact2
14:58:45 <petern> Yeah, you don't need a procedure, just return the random colour map chain when it's a colour map callback.
14:59:15 <andythenorth> oh there was some advanced varact 2 that can chain results?
14:59:30 <petern> All varact 2s are chains...
14:59:31 <andythenorth> and I have no idea what nmlc does, but I assume it consumes a lot of varact2
15:00:07 <andythenorth> maybe nml uses that for all the [] operations
15:00:18 <andythenorth> I didn't read the .nfo output so eh
15:00:45 <andythenorth> anyway such random
15:00:56 <petern> That's pretty much a standard varact2, the "advanced" bit is that you don't have to use those operators if you don't need them.
15:01:34 <andythenorth> don't rain on my parade, I felt very 'advanced' when I used them in HEQS 😛
15:01:45 <andythenorth> now I just worry about what magic nmlc is doing 😛
15:02:06 <petern> And if you don't ever need them to rerandomize then you don't even need a 'fake' randomact2 in the graphics chain.
15:03:39 <andythenorth> I wonder how much filesize I save if I nerf this randomisation
15:04:46 <JGR> Even looking at the NML file after the templating is done would give a rough idea of how much duplication/overhead there is
15:05:56 <andythenorth> well it's a procedure 😛
15:06:01 <andythenorth> so it's hopefully once
15:06:14 <andythenorth> I might nerf it and see
15:06:34 <FLHerne> NML is an extremely stupid compiler tbh
15:07:44 <glx[d]> a procedure is not duplicated, unless the template outputs it multiple time
15:08:52 <JGR> The varaction2 format is pretty rubbish, which somewhat forces very inefficient code generation
15:09:43 <JGR> However NML is egregiously bad at optimising fairly obvious things
15:10:10 <glx[d]> at least now it optimise out trivial varact2
15:11:08 <JGR> I'm doing some optimisations at GRF load time to get rid of various NMLisms
15:13:33 <petern> Can we bake those into NML?
15:14:11 <petern> Or just make NML less dumb 😄
15:14:22 <petern> I suppose nobody said NML is an optimizing compiler.
15:14:56 <glx[d]> I tried to remove duplicates on nml side, very slow for too little gain
15:14:59 <JGR> The bitstream format and action 6 make a lot of things difficult
15:20:17 <petern> If it's possible in OpenTTD, then it must be possible in NML. Hmm.
15:21:09 <JGR> In my case, I am cheating because I do the optimisation after action6s have run, and I have more operators, etc for internal use
15:23:48 <petern> After action6 is quite a cheat, yes.
15:24:05 <petern> TBH I didn't realise that action6 was used enough to warrant being an issue.
15:30:23 <andythenorth> does 'if' in nml use action 6?
15:30:28 <andythenorth> or one of the others I can never remember
15:30:37 <andythenorth> 6, 9, D I never remember
15:31:40 <petern> glx found it does silly things even if it could just be act7/9
15:32:09 <JGR> NML is quite restrictive about what it allows to be put in an if block
15:32:37 <JGR> Action 6 is used a lot for referencing GRF parameters
15:32:50 <glx[d]> yeah if does weird actionD stuff before the actual action7/9
15:39:41 <glx[d]> like ```1 * 9 07 9D 04 \7= 01 00 00 00 01``` in original openttd.grf nfo vs ```1 * 5 0D 7F \D= 9D 00
15:39:41 <glx[d]> 2 * 9 09 7F 04 \7! 00 00 00 00 01``` in the nml version
16:27:29 *** HerzogDeXtEr has joined #openttd
16:29:13 <andythenorth> Horse with and without colour mapping callback handling
16:29:37 <andythenorth> difference of 1.9 MB for nml also
16:31:42 <petern> That seems excessive for what it is.
16:35:57 <andythenorth> there's some stupidity in there to handle random
16:36:53 <petern> Do you use the same random bits for all random recolouring?
16:39:08 <andythenorth> yes, the random choice is in a procedure
16:39:25 <andythenorth> but there's also the 'random vehicle' thing which has to handle recolouring
16:39:41 <andythenorth> it branches to the action 2 chain for another [vehicle from list]
16:40:20 <petern> Why is it a procedure? Can't it just end with the result?
16:40:35 <andythenorth> procedure just saves action 2s overall
16:40:46 <andythenorth> it's one per grf, not one per vehicle for about 1000 vehicles
16:41:14 <andythenorth> most of Horse is procedures, it's one reason the compile time is no longer 1m 20s
16:41:16 <petern> You can reuse action 2 chains between vehicles.
16:41:22 <petern> That's what a procedure is...
16:41:46 <andythenorth> it's the same thing
16:42:06 <petern> Just a chain that returns. But I don't know why you'd want to return in random colour map callback chain.
16:42:22 <petern> Procedure does more work, and uses more entries.
16:42:25 <glx[d]> oh I see why nmlc outputs some weird actD
16:42:42 <andythenorth> procedure means I can pass params to it then store them
16:43:01 <andythenorth> it's just easier nml to write
16:43:13 <petern> Vehicles don't have persistent storage, hmm.
16:43:24 <andythenorth> if they did, someone would abuse it
16:43:37 <JGR> Is this switch_colour_mapping/switch_colour_mapping_purchase you're referring to?
16:44:38 <andythenorth> it's possibly slightly mad
16:44:51 <andythenorth> it started out simple
16:45:11 <andythenorth> then it got complicated handling the old Horse 'change livery on company colour combo' method
16:45:17 <andythenorth> and then I refactored it for variants
16:45:27 <andythenorth> so it's one thing plastered over another
16:46:04 <andythenorth> 1.3 MB of grf just for recolouring seems a lot
16:46:39 <petern> Yeah I think you're not actually reusing it in the resulting code, even if you're reusing your "template"
16:47:14 <andythenorth> reusing the which what?
16:47:44 <andythenorth> frosch: once had a graphviz of call stacks from popular graphs
16:49:36 <petern> andythenorth: As in, I'm not sure it is ending up as one-per-grf.
16:50:21 <andythenorth> there are some intermediary switches
16:50:44 <andythenorth> yeah, there are also multiple vehicle types with different recolour chains
16:51:17 <andythenorth> how big is a grf supposed to be anyway?
16:51:27 <petern> A random colour chain should only be a couple of dozen bytes per vehicle though, and that's without reusing it.
16:52:11 <JGR> It does seem to be in the GRF only once
16:57:01 <JGR> switch_colour_mapping is sprite 5100, from line 206
16:57:49 <JGR> This does seem to be directly referenced by the other wagons
17:00:13 *** nebulabc has quit IRC (Quit: must've rage quit ¯\_(ツ)_/¯)
17:02:15 <andythenorth> there are 2 switches per vehicle that are chained through
17:02:24 <andythenorth> removing those cuts 0.8 MB from the grf
17:03:04 <andythenorth> there are at a guess, 1500 vehicles that use them
17:03:12 * andythenorth didn't actually count
17:03:40 <andythenorth> I think they can be dropped
17:04:51 *** gelignite has joined #openttd
17:06:27 <andythenorth> but they save nothing 😛
17:06:40 <andythenorth> nmlc was already optimising them out because they were returning constants
17:12:32 *** nebulabc has joined #openttd
17:12:42 *** nebulabc_ has joined #openttd
17:15:10 <andythenorth> it does quite a lot 🙂
17:15:21 <andythenorth> file sizes got smaller
17:17:07 <glx[d]> yeah switches returning constants was the first thing I noticed in andy's stuff, and that was easy to optimise
17:17:26 <glx[d]> same with switches with only one choice
17:18:12 *** nebulabc has joined #openttd
17:19:03 *** nebulabc has joined #openttd
17:26:33 <andythenorth> I could probably decrease filesize a lot by moving cargo sprites to layers
17:26:51 <andythenorth> instead of composed into the vehicle spritesheets at compile time
17:27:12 <andythenorth> but then I can't just open the spritesheet to check cargo placement, I have to create a full test game
17:31:57 <andythenorth> so...action 0 prop, 2 lists of recolours (1cc, 2cc), game randomly chooses when vehicle is built? 😛
17:35:13 <petern> It's nice to tidy up things if it's wasted/wrong but otherwise doesn't matter
17:36:14 <frosch> andythenorth: there is a youtube recording of that
17:36:22 <JGR> There have been various conversations about CDN costs and the like
17:36:33 <JGR> GRFs getting ever larger and larger cannot help with that
17:37:40 <andythenorth> Iron Horse 2 size
17:38:05 <andythenorth> so ~2 MB in 4 years
18:17:36 <andythenorth> maybe there's a better way to show that this vehicle randomises
18:17:44 <andythenorth> the sprite is too wide IMO 😛
18:18:04 <andythenorth> also I can't rely on text, because the buy menu tends to clip it
18:20:15 <andythenorth> does the small font work in buy menu?
18:24:19 *** Wormnest has joined #openttd
18:34:51 <andythenorth> presumably we don't want to increase the row height in train menu?
18:38:44 <Brickblock1> You can but it does look weird if you combine different sets
18:39:17 <andythenorth> this is with 24px
18:39:19 <andythenorth> ignore the white
18:39:56 <andythenorth> it's not efficient on space, but it's more comfortable to read
18:40:57 <DorpsGek> - Update: Translations from eints (by translators)
18:45:33 <andythenorth> could do more like?
18:45:46 <andythenorth> nope silly photoshop 🙂 That's just dice
18:56:15 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
19:41:24 *** axet has quit IRC (Quit: Leaving.)
19:44:13 *** gelignite has quit IRC (Quit: Stay safe!)
19:46:49 *** Wormnest has joined #openttd
20:14:15 *** kstar892[m] has quit IRC (Quit: Client limit exceeded: 20000)
20:33:44 <andythenorth> such dice via spritelayer
20:41:16 <andythenorth> `${'dice' if unit_variant.uses_random_livery else 'no_dice'}`
20:44:16 <andythenorth> dice are now only shown when needed 😛
20:44:28 <andythenorth> goes it animated dice?
20:53:00 <andythenorth> wonder if the dice should be same colour as the +/- icon
20:55:06 <andythenorth> guess I should sort the pink pixels out
21:14:29 <Eddi|zuHause> something doesn't look right with the dice...
21:14:46 <Eddi|zuHause> could you put the dice next to the wagon instead of on top?
21:16:52 <Eddi|zuHause> ah you did that already
21:20:07 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:20:32 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:23:39 <andythenorth> these are more like your + / - colour
21:23:50 <andythenorth> are you going to svg those and change the colour though? 😛
21:24:08 <andythenorth> if you could do that just after I release this Horse...
21:24:16 <andythenorth> maybe 10 mins after
21:24:35 <andythenorth> it's an idea yes
21:24:48 <andythenorth> animated palette cycle to show random options
21:28:20 <andythenorth> I could recolour the dice
21:28:38 <andythenorth> I saw some fancy gaming dice at the weekend, with different colours on the faces
21:36:40 <andythenorth> really should animate on click or something
21:46:13 <petern> NewIcons, act 3/2/1 chain, highlight context, animation frames...
21:46:49 <andythenorth> hover state on mouseover 😛
21:46:54 <andythenorth> not for tablets though
21:47:05 <andythenorth> how about this, but in svg?
21:48:52 <petern> For fonts I did one giant SVG file
21:50:11 <petern> But uh, then I found the SVG library I picked is a bit dead and unmaintained.
21:56:17 <petern> Let's use some obsolete vector format
21:58:15 <glx[d]> of wmf is older than flash
21:58:35 <glx[d]> I have a CD with plenty of wmf
21:58:53 <andythenorth> hmm we probably can't make the buy menu wider by default, yes/no?
21:59:33 <andythenorth> I should be using that ctrl-click square thing that never persists across game restarts
21:59:58 <glx[d]> ctrl-click should persist
22:00:09 <JGR> Most of the player base are likely not using vehicle GRFs with long names or fancy icons
22:00:17 <andythenorth> probably doesn't persist because I crash the client or something
22:00:27 <andythenorth> most of my games end in 'crashed openttd again'
22:00:37 <andythenorth> or ctrl-c and make
22:00:38 <glx[d]> yeah windows.cfg is written on close
22:00:39 <petern> Fancy icons are quite common, and quite ugly
22:00:53 <andythenorth> most of the player base are using zbase
22:01:13 <petern> 32bpp so it must be better
22:01:20 <andythenorth> it's more modern
22:01:24 <andythenorth> more like proper games
22:01:43 <andythenorth> it's just like Train Fever or something
22:01:56 <andythenorth> I believe Zeph might be improving it 🙂
22:02:07 <andythenorth> by making OpenGFX with more zoom levels
22:02:50 <andythenorth> hmmm.....grf property to set UI window width? 😛
22:02:51 *** ChanServ sets mode: +v tokai
22:03:00 <andythenorth> "that won't end badly"
22:03:11 <glx[d]> we know how it will end
22:03:39 <andythenorth> looks like the original width is scaled to the Manley-Morel DMU
22:04:43 <andythenorth> this does not go well with ship grf 😛
22:05:18 <glx[d]> now imagine autoreplace window
22:05:54 <glx[d]> with both right and left panel sized for full string width
22:08:14 <petern> We can probably auto size it a bit better.
22:08:35 <petern> Not sure if the space for variants added or ate into it.
22:09:05 <andythenorth> 1728 x 1117 seems like a weird screen resolution
22:09:39 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:10:10 <petern> Cheap icon animation: number of "rotations" in act1 is the number of animation frames.
22:10:33 <andythenorth> and a frame step counter as a property?
22:10:40 <andythenorth> the full animation callback is a bit wtf
22:10:58 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
22:11:40 <petern> No, base sprite + global ticker counter % number of rotations
22:12:44 <petern> I have such bad ideas at 11pm after rides
22:13:01 <andythenorth> it can animate the available train colours 😛
22:13:13 <andythenorth> ...or we can make Doom guy face
22:13:19 <andythenorth> then we've finished OpenTTD
22:14:04 <andythenorth> wonder if I can make easter object where doom guy face appears when the correct set of objects is placed
22:16:05 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:21:08 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
22:21:47 *** WormnestAndroid has joined #openttd
22:30:32 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:44:31 *** Wormnest has joined #openttd
23:09:52 *** WormnestAndroid has quit IRC (Remote host closed the connection)
23:10:03 *** WormnestAndroid has joined #openttd
23:31:43 *** SicIuvatIreSubUmbras has joined #openttd
23:31:43 <SicIuvatIreSubUmbras> o/ on the topic of cdn costs, I was wondering if alternative compression formats for newgrfs could help here - from some very rudimentary testing, the brotli-compressed version of Horse 2.64 (which I had on hand) is ~2.1MiB whereas `gzip -9` yields a ~4.2MiB archive, so there could be some noticeable savings. Although the downside is, this would probably require storing two versions of each grf unless cloudfront can be
23:37:14 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
continue to next day ⏵