IRC logs for #openttd on OFTC at 2025-01-20
⏴ go to previous day
00:00:25 <goddess_ishtar> for extra certainty
01:23:43 <goddess_ishtar> wait, once the PR is merged, I can safely delete my side of things and not lose anything, right?
01:56:36 <_glx_> you can click on delete button in your PR yes
02:08:28 *** Ttech has quit IRC (Quit: Este é o fim.)
03:06:01 *** Wormnest has quit IRC (Quit: Leaving)
03:29:46 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:51:19 *** gnu_jj_ has joined #openttd
03:54:31 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:42:37 <DorpsGek> - Update: Translations from eints (by translators)
06:00:03 *** keikoz has quit IRC (Ping timeout: 480 seconds)
07:13:01 *** D-HUND is now known as debdog
07:15:23 <DorpsGek> - Add: summary for week 03 of 2025 (by OpenTTD Survey)
08:07:31 <andythenorth> if starting today, would we try buy menu grouping based on badges?
08:07:36 <andythenorth> [specific badges]
09:19:57 <peter1138> andythenorth, probably not.
09:34:20 *** gelignite has joined #openttd
09:53:30 <andythenorth> peter1138: yeah probably not
09:53:49 <andythenorth> I have badges being applied that 1:1 map with variant groups
09:54:06 <andythenorth> but not every variant group requires a badge
09:59:41 <pickpacket> what's a "badge" in OpenTTD?
10:02:16 *** brickblock19280 has joined #openttd
10:02:16 <brickblock19280> An icon applied to a vehicle or similar
10:13:55 <peter1138> Not bad for a completely new feature.
10:14:37 <peter1138> I'm sure at least half of that is documentation ;-)
10:14:52 <andythenorth> did we merge it yet?
10:15:16 <peter1138> No there are still issues to address.
10:15:26 <andythenorth> the Horse changes are pretty extensive
10:15:32 <peter1138> Like the first crashing bug you found.
10:16:20 <xarick> but I was told to keep them
10:16:51 <xarick> i can't have visual studio step in the macro while debugging
10:19:08 *** gelignite has quit IRC (Quit: Stay safe!)
10:21:38 <peter1138> The reason you were asked to keep them was to keep the scope smaller.
10:21:53 <peter1138> Replacing macros with functions is not just a code-style change.
10:22:21 <andythenorth> peter1138: remember how we used to have nightlies?
10:22:43 <peter1138> Because we didn't have branches.
10:23:10 <peter1138> Also very few people use nightlies, because the sort of player that would just uses JGRPP.
10:24:06 <xarick> no idea what a scope is
10:25:56 <peter1138> In terms of scope-of-change, it's when you are doing one thing (fixing code style) but end up doing lots of things (fixing code style, refactoring code, fixing bugs, code changes)
10:29:40 <andythenorth> this will only add confusion here, but I sometimes use 'zero visible diff' to judge size of scope
10:29:52 <xarick> _height_map can store negative heights? tgp is more confusing than i thought
10:29:53 <andythenorth> but that depends on having integration tests / other tests further up the stack
10:30:22 <andythenorth> if a codechange has no observable behaviour when the test suite is run, then that's easier to merge
10:30:40 <andythenorth> doesn't mean it's a small scope necessarily, but it means the scope is understood and controlled
10:31:45 <ahyangyi> And that also requires the integration tests have high code coverage
10:32:16 <andythenorth> if they don't, it requires that engineers approving the change have a comprehensive understanding of system behaviour
10:32:23 <andythenorth> and can predict it by reasoning
10:32:29 <andythenorth> or that the risk tolerance is high
10:34:41 <ahyangyi> Are there open source projects with extensive integration tests? :S
10:38:31 <LordAro> the answer when it comes to "who does testing well" is always sqlite
10:40:09 <ahyangyi> (I edited the question to "open source game projects" on the Discord side)
10:40:33 <LordAro> well in which case you can probably just s/open source //
10:40:52 <ahyangyi> Otherwise I would also look at GCC, perhaps not as extensive as the (in)famous sqlite test suite, but as far as I remember it's also a big one.
10:42:16 <ahyangyi> And I also write unit tests for my station newgrf, because some of the bigger switches do need safeguards. I have no idea how to write integration tests though 😛
10:44:54 <andythenorth> I mostly rely on docs though
10:45:14 <andythenorth> a big reason for the FIRS docs compile was that it provides an automated test
10:45:47 <andythenorth> there's no red-green, but it's easy to eyeball the results, or diff
10:47:02 <ahyangyi> andythenorth: The same, though I just followed your model 😛
10:48:11 <ahyangyi> Though I also did the same in a previous project, so perhaps I just like docs.
11:01:19 <xarick> gotta smooth those slopes three times
11:02:19 <xarick> anyway, 1 second for a 4k map, this is fine
11:05:57 <xarick> heightmapcurves is kinda expensive, that's the one that deals with Variety distribution
11:10:51 <xarick> with variety set to none: [GenerateTerrainPerlin] 486356 us [avg: 486356.0 us]
11:24:06 <ahyangyi> The algorithm just needs 2x computation with variety I guess?
11:24:40 <ahyangyi> I don't know what the algorithm is, but if you ask me to design one I might multiply one perlin noise to another, ending up with a similar time complexity.
11:29:14 <peter1138> Variety is shit. When I rewrite it it will probably be slower though.
11:29:42 <peter1138> Combining different perlin noise produces better maps, but still not great.
11:30:26 <andythenorth> should I benchmark TGP on my new laptop?
11:30:40 <andythenorth> can we target high end hardware only?
11:30:54 <andythenorth> offload TGP to the GPU?
11:31:04 <andythenorth> slightly serious, "it's just height maps"
11:37:33 <peter1138> Offload TGP to the bin.
11:37:51 <peter1138> Download your heightmap generator from bananas?
11:37:57 <peter1138> "But I want to play with the default AI!"
11:38:33 <andythenorth> we have original terrain gen still 😛
11:38:33 <peter1138> The original generator created predefined noise patterns using special sprites.
11:40:25 <andythenorth> Iron Horse uses predefined 'random consist' patterns 😛
11:40:29 <andythenorth> sometimes it's better
11:45:01 <xarick> > The seed is an int32_t
11:45:12 <xarick> i thought it was uint32_t
11:46:42 <xarick> > or click "Random" for a new random seed
11:47:47 <ahyangyi> peter1138: I prefer slower but higher quality (or just more interesting in general) generators.
11:48:40 <xarick> max height isn't 15...
11:48:56 <ahyangyi> BTW, the arid/wet split in tropical does not have to correlate with height?
11:49:11 <ahyangyi> unlike the snow/nosnow split is just thresholding the height
11:51:00 <_glx_> Int or uint doesn't matter for seed, it's used as a bitfield
11:51:18 <_glx_> As long it's 32 bits it's fine
11:51:50 <andythenorth> sometimes I think we should just generate 256 heightmaps and bundle them 😛
11:52:05 <andythenorth> we could blend and tile larger maps
11:52:45 <andythenorth> 'variety' could be achieved by bundling heightmaps at 64x64 and 256x256
11:53:09 <andythenorth> then making some 'tiles' out of 16 smaller tiles, and some out of 1 large tile
11:53:18 <peter1138> ahyangyi, but also people want a real-time preview in the world-gen window.
11:54:00 <peter1138> Variety is flawed because it ends up mostly removing hills and mountains.
11:54:01 <_zephyris> How long does the perlin take to generate?
11:54:10 <peter1138> For TGP barely any time at all.
11:54:28 <peter1138> For a normal perlin noise generator, also not much time unless you are doing 4kx4k.
11:54:41 <peter1138> Mainly it "adds up" if you want to overlay multiple maps to do interesting things.
11:54:48 <andythenorth> and cheap isn't really good
11:54:54 <peter1138> My branch (not on github) uses multiple perlin layers and multithreads the perlin generation.
11:55:11 <ahyangyi> peter1138: I think it's a side effect of specifying max height?
11:55:12 <peter1138> With multithreading it was just about as fast as TGP.
11:55:22 <_zephyris> Does it do coordinate warping? ie. sampling for one perlin offset based on another?
11:55:33 <_zephyris> Any chance of a voronoi too?
11:55:36 <peter1138> TGP no. In theory my branch could.
11:56:03 <peter1138> Voronoi is something I wanted to look into but all the algorithms explained it in a way that assumed you knew what it was talking about :p
11:56:17 <_zephyris> A lot can be done with perlin-warped voronoi multiplied by another perlin.
11:56:57 <peter1138> I had convolutions and guassian blurs and things.
11:56:59 <ahyangyi> BTW, is the current way of assign each tile to a town basically a voronoi?
11:57:05 <ahyangyi> just not used in map generation
11:59:58 <peter1138> I guess it is, but it's not a general voronoi algorithm.
12:00:10 <peter1138> It uses the kdtree to get the closest town from a tile.
12:00:23 <_zephyris> Though the best way would probably be a water flow/erosion model, and generate rivers with the heightmap
12:00:39 <_zephyris> (if you haven't already found that poking around!)
12:01:39 <andythenorth> now considering writing a height map stitcher
12:01:46 <andythenorth> that treats the map like Lego baseplates
12:02:04 <ahyangyi> I wouldn't say the best, since realism isn't the only valid goal, but it would be a vast improvement in terms of river generation.
12:02:43 <peter1138> Right, mountainous with rivers can look nice but you need plateaus and plains to make placing roads and rails not so tedious.
12:02:56 <andythenorth> remember how exciting that extruded ABS was? 😛
12:03:05 <peter1138> They don't make them like that any more :(
12:03:17 <ahyangyi> The current algorithm was especially bad at placing river in plateaus though
12:03:38 <andythenorth> but Lego baseplates aren't just 32x32, they come in other sizes, and can be tesselated
12:03:50 <peter1138> Current river generation is completely separate from heightmap generation.
12:04:31 <peter1138> When it comes to placing roads and rails, rivers are annoying.
12:04:36 <ahyangyi> And for plains, it's often a large area with zero slope, leaving little information for the river placement.
12:05:36 <peter1138> If you do river generation before the map is normalised to the tile grid (x, y and z) then there is hidden information that could help.
12:05:56 <ahyangyi> There are also imported heightmaps
12:05:58 <peter1138> That huge flat plain actually bumps that are smoothed out when converted to tiles.
12:06:21 <andythenorth> ahyangyi: that's what I had in mind approx
12:06:34 <ahyangyi> Yeah, I just happen to like this board game 😛
12:06:38 <andythenorth> simple google search turned up quite a lot of tile based terrain generators
12:06:38 <peter1138> Hmm, how does perlin warping perlin work...
12:07:08 <peter1138> You want to adjust the perlin position a bit.
12:07:12 <ahyangyi> Interprete perlin A as offests, then read the value from perlin B
12:07:16 <peter1138> "how much and what direction"
12:07:37 <xarick> > max_coast_Smooth_depth
12:07:37 <xarick> any special reason Smooth is capital?
12:07:47 <xarick> > /** Start at given point, move in given direction, find and Smooth coast in that direction */
12:07:53 <xarick> even the comment has it
12:08:07 <peter1138> > Note how we use two 1-dimensional fBM calls to emulate a 2-dimensional fBM, which is what we need in order to displace a point in 2 dimensions.
12:08:10 <ahyangyi> could it be a case-insensitive find-and-replace?
12:09:20 <peter1138> Okay, my commits for my heightmap(generation) branch was "Meh", "Codechange: Use threads for perlin generation." and "lol wip"
12:10:55 <LordAro> xarick: i suspect git-blame will tell you
12:11:14 <LordAro> and yeah, probably an over enthusiastic find and replace at some point in the past
12:14:51 *** gelignite has joined #openttd
12:15:03 <peter1138> It's from January 2024. Rebase?
12:17:53 <xarick> someone really liked to capitalise Smooth
12:21:15 <xarick> i don't know how many changes can I do in a single PR
12:22:27 <LordAro> corners seem to be missing
12:22:52 <peter1138> That's known as "cropping"
12:22:59 <peter1138> My screen isn't big enough.
12:24:11 <ahyangyi> feature request: octagonal maps 😛
12:24:46 <LordAro> in theory that would just require adding void tiles in a load of places
12:25:18 <peter1138> This generation is just throwing fixed random numbers around to see what happens.
12:29:20 <peter1138> Hmm, okay, this looks like it is generation 2 perlin heightmaps, and used a 3rd perlin map to lerp between the first two.
12:29:59 <xarick> * vs x ... should they match?
12:30:02 <peter1138> base 1 is folded, and base 2 is scaled by power.
12:30:40 <ahyangyi> peter1138: BTW, I don't think 8 bit depth is good enough to figure out the rivers, even before the normalisation
12:30:41 <peter1138> (Folding is some weird way of creating ridges)
12:30:47 <ahyangyi> But do we support 16 bit heightmaps?
12:30:58 <ahyangyi> I think PNG has that?
12:31:11 <peter1138> My heightmap work uses floats.
12:31:36 <ahyangyi> We all use floats internally, but I don't think there's a popular image format that does that.
12:32:40 <peter1138> PNG supports 16-bit, but by the time we create rivers it's all lost anyway.
12:33:17 <peter1138> Okay, the power function was used to create the flattish terrain.
12:33:36 <andythenorth> pff searching "tabletop terrain modules" 🙂
12:34:30 <LordAro> xarick: since you're changing it anyway, yes
12:34:54 <kuhnovic> Looks like Carcassonne
12:35:11 <ahyangyi> I have the same thought 😛
12:35:24 <ahyangyi> (but was looking for a bigger image)
12:35:41 <peter1138> Hmm, smallmap contours doesn't really show much.
12:35:48 <kuhnovic> Somebody bought all the expansion packs 😛
12:36:00 <LordAro> pfft, one or two maybe
12:36:07 <ahyangyi> They only used River 1 and not River 2 though.
12:37:14 <peter1138> The screenshot will have a resolution of 65,409 x 32,959 pixels.
12:37:16 <peter1138> Maybe I won't do that.
12:37:35 <peter1138> Is that 4X zoom or something...
12:39:10 <peter1138> Lerping between a smooth map and a rough map is basically variety distribution.
12:39:39 <peter1138> (Except variety distribution has a few scalings it uses)
12:39:57 <peter1138> Actually, not, it's completely different, but is sort of the effect I wanted.
12:41:04 <peter1138> Hmm, warping. I should try implementing that.
12:41:31 <peter1138> I guess it needs to be a modification to the perlin generator rather than something that works on two perlin maps.
12:43:40 <peter1138> Hmm, river networks.
12:52:35 <peter1138> Oh right I was using TGP-style perlin here.
12:52:52 *** kuka_lie has joined #openttd
12:53:55 *** gelignite has quit IRC (Quit: Stay safe!)
12:57:16 <andythenorth> kuhnovic: Idea somewaht inspired by that yes
12:59:39 *** reldred has joined #openttd
12:59:39 <reldred> andythenorth: Huh, I’m doing something similar to that arm
13:00:38 <reldred> But in 110x110mm tiles because apparently I hate myself. Eh. I’ll probably start doing some larger 220mm to cover wider areas.
13:00:41 <LordAro> reldred: looks like you're building it on top of old computer parts
13:00:54 <LordAro> it's the right shade of beige
13:01:11 <reldred> Heh, it’s grey PLA but eh
13:01:19 <peter1138> Actually 3½" by scale.
13:29:14 <peter1138[d]> Ridges but not good terrain...
13:29:23 <peter1138[d]> (My folding was on the wrong side,)
13:29:43 <LordAro> idk, looks quite nice
13:30:47 <LordAro> not necessarily that good for gameplay though
13:31:04 <ahyangyi> Max height is still adjustable so I'm not worried
13:33:11 <peter1138> Nah, this is all too kludgy.
13:33:33 *** SigHunter has joined #openttd
13:34:31 <peter1138> I did find the bug that caused the last edge to all be zeros though.
13:43:11 <xarick> bad commit messages... i just fail
13:47:54 <xarick> I feel I'm being too pedantic
13:54:07 <johnfranklin> reldred: The first glance was a big cake 😂
14:29:26 *** cloudysdev has joined #openttd
14:32:07 <xarick> i think, not sure, i found a bug in "coast softening formula"
14:36:57 <xarick> `h = static_cast<Height>(std::min<uint>(h, h_prev + (4 + depth))); // coast softening formula`
14:36:57 <xarick> Height can be negative apparently, so, using std::min<uint> is suspicious
14:45:50 <andythenorth> seeing how far GPT can get with tile based heightmap tesselator
14:52:23 <_glx_> xarick: a negative value is just a very high unsigned value
14:53:06 <xarick> `h = std::min<Height>(h, h_prev + (4 + depth)); // coast softening formula` - this seems correct and less ugly
15:03:34 <_glx_> I think the `std::min<uint>` version favorises positive height values (any negative value is bigger than positive), you version will prefer any negative value
15:09:12 <_glx_> for example: with `h = -1`, `h_prev = 0` and `depth >= -4` (I don't know the exact range, it's just to explain how it works), the new `h` will be `4 + depth` for old way, but `-1` with your version
15:10:05 <xarick> I think heights at this point are already at least equal to 0
15:10:25 <xarick> there was water level adjustment before this
15:12:00 <_glx_> anyway signed/unsigned for heights is a mess all over the source
15:12:57 <xarick> if (h < 0) h = I2H(0);
15:13:12 <xarick> no negative heights when that code is run
15:19:48 <xarick> shouldn't this depth be transformed with a int to height?
15:20:12 <xarick> or am I misunderstanding this
15:20:20 <LordAro> i'm not sure anyone fully understands it
15:20:21 *** Markk has quit IRC (Ping timeout: 480 seconds)
15:20:31 <LordAro> i'd leave it alone unless there's actually an issue with it
15:20:46 <LordAro> (that you find *before* looking at the code)
15:22:03 <xarick> im curious, gonna check how much it breaks
15:22:09 <xarick> h = std::min<Height>(h, h_prev + (4 + I2H(depth))); // coast softening formula
15:32:49 <LordAro> now the question is, which is better? :p
15:36:14 *** maxtaktik has joined #openttd
15:36:14 <maxtaktik> xarick: Hm... maybe just calculate like avg height from mainland and simply decrease randomly each block by one?
15:38:23 <maxtaktik> _glx_: I mean, if height can't be 0 (which is kinda obvious for mainland) and if he solely works on mainland I think that unsigned int would be better
15:39:54 <xarick> if I understand this softening formula
15:40:12 <xarick> depth is the number of tiles from the border to inside
15:40:21 <xarick> in a perpendicular manner
15:40:37 <peter1138> Alternatively, unsigned integers are dangerous.
15:41:12 <maxtaktik> xarick: What do you refer by "border" and "inside"? Coast and mainland?
15:41:27 <xarick> tgp Height only really raises terrain in openttd's height every 16
15:41:54 <maxtaktik> xarick: Every 16 what? Blocks?
15:42:18 <xarick> border, map border, the black, distance from back to inside the map
15:43:06 <maxtaktik> xarick: Hm... so u do calculations from borders to center?
15:43:29 <xarick> the maximum depth it goes is 35 tiles
15:43:50 <peter1138> This is like two LLMs conversing with each other.
15:44:38 <maxtaktik> xarick: Ok, but you also need to consider the fact that sometimes coastline may be higher than mainland (although it is rare to see)
15:47:46 <LordAro> peter1138: good, innit?
15:48:29 <xarick> disabling SmoothCoasts, let's see how it looks like
15:48:37 <_zephyris> Were heightmaps updated to read river data too? Or am I hallucinating?
15:49:53 <xarick> okay, I2H is a bad idea
15:52:32 <maxtaktik> xarick: U got high elevations?
15:52:58 <xarick> it was having pratically no effect in smoothing
15:53:27 *** Wormnest has joined #openttd
15:54:54 <maxtaktik> xarick: Bruh, happens
15:58:39 <ahyangyi> _zephyris: No, though I wish that could happen
16:01:11 <LordAro> _zephyris: #10409 is probably what you're thinking of
16:03:27 <ahyangyi> Oh, I missed it, nice!
16:07:24 <xarick> enum class Borders are basically DiagDirections bitmask
16:12:25 <xarick> is this worthy of a PR?
16:27:18 <_zephyris> There is fun to be had, but oh so many parameters
16:34:33 <goddess_ishtar> this push-pull discussion stuff is looking really cool
16:39:06 <talltyler> Just needs the actual code written for it 😛
16:42:19 <_zephyris> Lots of good discussion, but still a bit of disconnect between eye-candy and gameplay
16:42:36 <goddess_ishtar> it would necessitate removing the requirement that a locomotive must lead the train, right?
16:42:45 <talltyler> I'll be honest, none of the discussion has really changed my implementation plans 🙂
16:43:24 <goddess_ishtar> goddess_ishtar: that's going to be a lot of work
16:44:19 <talltyler> Yes and no, most of the work I suspect will be migrating everything to consists so the leading engine is less important
16:49:22 <peter1138> How many moons on a stick?
16:50:02 <peter1138> I had a patch one that lets you put the engine in the middle of a train...
16:50:06 <goddess_ishtar> _zephyris: how so? I feel the settings you suggested work well
16:50:25 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
16:50:43 <peter1138> Whenever I looked it reversing engines I get sidetracked by the major flaw in vehicle movement.
16:51:46 <_zephyris> My suggestions were purely gameplay focused, there's another option which is allowing train reversal but with the visual effect of flipping the orientation of each articulated vehicle/consist within the train.
16:53:27 <_zephyris> But, add that option in, and I think it does cover everything!
16:53:37 <goddess_ishtar> so there's really three things we need to handle, then
16:54:46 <peter1138> To be honest, you're all discussing restrictions. None of all that matters without the "basic" functionality of a consist being able to run in either direction.
16:55:06 <talltyler> Peter, what is "the" major flat in vehicle movement? Just the inability to back up?
16:55:13 <goddess_ishtar> whether or not trains are allowed to magically flip, whether trains are allowed to travel without a leading driving cab or engine, and how fast a train going in reverse should be allowed to go
16:55:37 <goddess_ishtar> peter1138: well, everyone is in agreement that functionality is desirable
16:56:06 <goddess_ishtar> the restrictions are the only part which is actually being argued
16:56:08 <peter1138> If only that's what it took.
16:56:42 <goddess_ishtar> fine, I'll implement it myself then :p
16:57:06 <peter1138> talltyler, vehicles only exist at the centre of the vehicle. The front and rear positon of a single vehicle is not tracked, only derived from its left.
16:57:53 <peter1138> See you definitely interact with 40+ men here. This one is fucking senile too.
16:58:13 <talltyler> Right, but I guess I'm missing why going forwards is easier than backwards
17:00:11 <_glx_> because it's easy to know head and you can iteratively go to next element from head
17:02:11 <andythenorth> peter1138: we should allow arbitrary movement
17:02:12 <peter1138> talltyler, oh this doesn't really affect that, it's just a general flaw.
17:02:19 <andythenorth> then we could have more interesting crashes
17:02:29 <andythenorth> including z axis
17:02:44 <peter1138> Especially when you mix vehicle parts of different lengths.
17:02:58 <andythenorth> how do I get the 40+ badge? 😛
17:05:05 <talltyler> Push-pull seems like a "clean up a lot of tech debt" project, not unlike last year's timekeeping project 🙂
17:05:43 <talltyler> That only got done because TB quit his job to rewrite the timer system 😄
17:06:03 <talltyler> Anyone won the lottery lately to pay for a repeat? 😛
17:06:33 <talltyler> I hope nobody is expecting this for 15.0, maybe 16.0 if we get inspired
17:07:19 <andythenorth> ship Consist as a no-op in 16.0
17:07:23 <andythenorth> then expand on top
17:07:39 <andythenorth> (substitute version numbers as needed)
17:07:58 <talltyler> That is more realistic, yes 🙂
17:07:58 <andythenorth> if Consist is good enough, it will be flexible to other things in future, like template replacement
17:08:14 <peter1138> I wouldn't worry about it. JGRPP probbaly already has it all.
17:08:26 <andythenorth> pay JGR your 10p fine 🙂
17:08:39 <andythenorth> every time we're snarky we should send JGR beer
17:08:42 <talltyler> Nope, push-pull is only possible by GRF authors pulling their hair out
17:08:43 <peter1138> I don't believe this magical "Consist" will somehow fix everything.
17:08:44 <andythenorth> that would be more like £10 😐
17:09:03 <andythenorth> it will fix the issue of 'people trying to fit it in the current spec'
17:09:19 <andythenorth> that is my only expectation there
17:09:22 <peter1138> (I don't play it, so far all I know it might.)
17:09:49 <peter1138> Although I guess obviously it doesn't because otherwise there'd be no discussion.
17:09:57 <andythenorth> "you can't have reversing because everything has to be on the lead engine for [reasons]"
17:10:11 <andythenorth> "ok, but if I add some magic woo properties to grf spec, can I then have reversing?"
17:10:47 <maxtaktik> Bruh, what kind of alghorithm is that?
17:10:49 <peter1138> You can't have reversing because some of the devs are too busy doing code changes that you'll never see any visible difference with.
17:11:21 <andythenorth> "you can't have reversing because everything has to be on the lead engine"
17:11:24 <peter1138> Oh dear, we've got a "Bruh"-guy in here.
17:11:35 <andythenorth> "but if I just type 'reversing' a lot, it will work, right?"
17:11:48 <talltyler> "why would the devs change the command system from forbidden magic to readable functions, destroyed my patchpack"
17:11:53 <andythenorth> I've really tried to stop them redpilling
17:11:54 <peter1138> You can't have reversing because it will break one of the 7 different bit flags that NewGRFs rely on"
17:12:01 <andythenorth> bruh is 100% redpill, yes?
17:12:07 <talltyler> (not a dig at JGR, just a complaint I saw somewhere else)
17:12:14 <_glx_> lead engine needs to be in front, if you reverse it's not in front
17:12:26 <andythenorth> just wish really hard
17:12:35 <andythenorth> and put #reversing in your insta post
17:12:47 <maxtaktik> talltyler: I thought they pull out hand
17:12:53 <talltyler> Behold the magic bullet of Consist to take away lead engine magic, I'm sure it'll solve everything cleanly 😛
17:12:55 <andythenorth> manifesting actually has scientific evidence, but eh
17:13:15 <xarick> `Height h00 = _height_map.Height(x, y + 0 * step);` I know it's for readability, but... doesn't it cost performance? `0 * step` ?
17:13:33 <andythenorth> if we have Consist, can we have it for RVs too? 😛
17:13:37 <andythenorth> oops, escalations
17:13:40 <_glx_> it's a noop, compiler is smart
17:13:43 <peter1138> For parity, do road vehicles have Consists too?
17:13:52 <andythenorth> send that man a cookie
17:13:57 <_jgr_> talltyler: The actual templating stuff to make the nice outer interfaces possible is seriously arcane magic levels of C++ 😛
17:13:57 <maxtaktik> Bros are discussing some lead engine with such seriousness like they are building some sort of nuclear plant. That's crazy
17:14:23 <peter1138> Just a bit of custom serialisation.
17:14:26 <andythenorth> maxtaktik: are you in the right place? Or are you looking for Toilet Tower Defense?
17:15:20 <_glx_> _jgr_: and we used to complain about YAPF 😉
17:15:29 <maxtaktik> andythenorth: I am in right place that is for sure. Why such question? U have something against me or what?
17:15:46 <andythenorth> you just seem to be out of context
17:15:54 <peter1138> I tend to think you are not in the right place.
17:16:54 <peter1138> "Developers talking about the internal limitations of a game" -> "Bruh"
17:17:44 <LordAro> peter1138: what up bro
17:18:19 <peter1138> You know, I can leave both Discord AND IRC...
17:18:48 <LordAro> so tempting to leave the same comment on one of your PRs...
17:18:48 <maxtaktik> andythenorth: So what is the context? Give me some picture, because all what I see right now is looking like some person wanted to do something using "magic wand" and I just don't get it
17:19:26 <andythenorth> the context is the channel
17:19:33 <andythenorth> I'm not sure what picture can be given
17:19:42 <andythenorth> either you're in the context or not 🙂
17:20:05 <LordAro> maxtaktik: we have about 15 years of meta in here, it takes a while to get up to speed
17:20:10 <andythenorth> hi and welcome etc though 🙂
17:21:05 <maxtaktik> andythenorth: I don't get what is wrong with that lead engine and what's wrong with will of "magically" have it reverse
17:21:56 <maxtaktik> LordAro: Okay, get the newbie of programming into tho. I just want to see what is floating up. Additional mind is better
17:22:04 <maxtaktik> andythenorth: Thanks bro
17:26:08 <maxtaktik> andythenorth: Oh, now I get the thing. Reverse train with 2 locos on different sides rather than magic teleport.
17:26:33 <maxtaktik> I'm kinda in favor of it, I've also seen "magic" train teleport tbh
17:28:35 <maxtaktik> But with current system I think the prob easiest solution is to make the children of main loco called reversed loco and make some conditions and assign to reversed loco negative train speed
17:30:16 <andythenorth> 'just -ve velocity" is an interesting alternative approach
17:31:13 <LordAro> sounds at best like a massive hack
17:34:47 <maxtaktik> andythenorth: However, however, depends what side reverse loco faces. So I just thought about new idea. How about sort of conditional switch where based on direction of the path train would go to the destination best loco will be determined as main one (however it may need some hard logic there especially when new roads are added)
17:36:44 <maxtaktik> maxtaktik: However some neural network integration may even help with that
17:37:20 <peter1138> Truely has no idea.
17:37:52 <LordAro> yeah i got nothing there
17:39:26 <maxtaktik> andythenorth: What?
17:40:06 <xarick> i changed float to double, i barely notice the differences, but they're there
17:42:32 <andythenorth> my GPT generated heightmap wasn't the best
17:42:48 <talltyler> Badges will probably happen before push-pull, yes 😄
17:43:07 <LordAro> andythenorth: neat, lol
17:43:28 <ahyangyi> andythenorth: Probably more playable than those heightmaps I uploaded
17:43:34 <andythenorth> revisiting my objections on colours.... "Colour Mix: brown, grey and current company colour" seems maybe ok
17:43:57 <andythenorth> partly it's just a capitalisation issue
17:44:17 <andythenorth> I don't know whether to capitalise "Current Company Colour"
17:44:28 <andythenorth> the purchase menu is inconsistent on caps, but eh
17:44:41 <talltyler> Although I do worry that you’re counting on badges as a silver bullet for every Horse and OpenTTD design issue related to vehicle purchasing 🙂
17:44:55 <andythenorth> they are quite all-purpose
17:45:11 <andythenorth> they solve lots of problems immediately
17:45:23 <talltyler> OpenTTD is pretty sparse with capitalization, usually it’s just the first word unless it’s a proper noun
17:45:41 <andythenorth> cargos are Capitalised, as Proper Nouns
17:45:46 <andythenorth> and Company Colours are Capitalised
17:46:06 <andythenorth> but it's quite variable
17:46:25 <andythenorth> "goods" is "Goods" in lists, but not in sentences
17:47:06 <maxtaktik> xarick: Float to double is actually big change
17:47:11 <talltyler> We are consistently inconsistent, you know that 😛
17:47:23 <andythenorth> people are, consistently
17:48:02 <talltyler> Cargo capitalization is one of the more egregious ones, I think
17:48:46 <xarick> but PI is a double in openttd
17:48:46 <talltyler> Also, I think your “complementary company colour” is close enough to the actual company colour that you might not need to write it. I just assume the paint has faded. 🙂
17:48:56 <maxtaktik> andythenorth: Color mixing by words is actually crazy. I would actually prefer some embedded RGB or CMYK color picker lol
17:49:14 <maxtaktik> xarick: But shouldn't PI be a float?
17:50:32 <maxtaktik> andythenorth: I would actually opt for capitalizing first word here only
17:50:35 <goddess_ishtar> andythenorth: can we merge template replacement into trunk if we move to Consist
17:50:36 <andythenorth> talltyler: I was hoping you'd say that
17:50:53 <goddess_ishtar> I'd spend the entire time trying to clean up the tech debt just for that lmao
17:51:12 <andythenorth> peter1138[d]: badges as purchase menu strings - was that a thing you suggested once?
17:52:09 <_jgr_> goddess_ishtar: You don't need any fancy consist stuff for template replacement, the templates are not moving after all...
17:52:28 <peter1138> So 1) It's a possibility, 2) It would ignore the name callback.
17:53:50 <goddess_ishtar> _jgr_: well yeah but we're at it anyway, right?
17:54:30 <peter1138> It's entirely unrelated.
17:55:49 <andythenorth> I was trying to frame my comment on Consist quite carefully, if we add pile-it-on-crap to grf spec related to reversing (or to orders), the harder it becomes to do other things like templates
17:56:03 <andythenorth> but one thing doesn't make the other happen
17:56:42 <peter1138> It's funny how it means all sorts of different things to different people.
17:56:50 <andythenorth> working code tends to win
17:56:59 <andythenorth> especially if it has tests 😛
17:57:19 <andythenorth> "it would ignore the name callback" 🙂
17:57:37 <andythenorth> but my oh-so-lovely variant 'headers' 😛
17:58:07 <andythenorth> vehicle badges for different levels of the purchase tree? 😛
17:58:16 <maxtaktik> andythenorth: But the fact that working AND understandable AND modifiable code is actually rare
18:00:57 <andythenorth> that will change, LLMs will do it
18:01:45 <andythenorth> hmm, badges, but it's a list of lists? 😛
18:01:53 <andythenorth> each list maps to a variant level
18:03:10 <peter1138> Step one would've been "don't do silly things with names in the first place" but whatever.
18:03:15 <maxtaktik> andythenorth: What if we have list of queues? List of arrays? List of vectors? What if at the end of grand-grand-grand...grand-grand list we meet an object that is list?
18:03:23 <peter1138> Hmm, MTB... or not...
18:05:42 <andythenorth> I had same thought about 'go swimming in heated pool'
18:05:45 <andythenorth> but involves outside
18:06:21 <andythenorth> peter1138: there's a step zero I think
18:07:34 <peter1138> Heated pool is a different prospect than going in the hills and getting muddy and cold. Hmm.
18:07:36 <andythenorth> even on 1x UI, I can't fit all the variant group in
18:07:44 <maxtaktik> Oh yeah **proceeds to name lists a, b, c, d... **
18:08:00 <peter1138> Yeah, that's actually 2x.
18:08:12 <andythenorth> no that's just my screenshot tool 😛
18:08:23 <maxtaktik> andythenorth: "How many aggregate hoppers do you see?" "Yes"
18:08:35 <Rubidium> peter1138: though... when I'm in the heated pool I get cold after a while, but when I'm on my bike in the cold I get warm after a while
18:08:51 <peter1138> Hmm. reasonable point.
18:08:53 <andythenorth> ^ what Rubidium said
18:09:05 <LordAro> he's got a point you know
18:10:31 <Rubidium> but... maybe you'll get a "I did a bike ride"-badge today? Or would it be easier to get the "I did merge badges"-badge?
18:12:16 <andythenorth> ok here's an idea
18:13:27 <andythenorth> there are 49 variants of Aggregate Hopper, which are essentially just 4 variants with deterministic recolours
18:13:47 <andythenorth> how about I do the recolour on subtype callback?
18:14:12 <_glx_> someone gave a hammer to andy, and he used it everywhere 🙂
18:14:15 <andythenorth> trying to find a way to reduce to 1 level of variant nesting
18:14:37 <andythenorth> deleting vehicles would be a solution
18:15:38 <_jgr_> Do users actually use all these variants?
18:16:12 <_jgr_> Is it just a case of pick the first one in the list and then that's that?
18:16:13 <LordAro> _jgr_: since when has that ever been relevant?
18:39:16 <xarick> Amplitude should be int64_t
18:39:53 <xarick> or keep the macro as suggested 🙂
18:41:17 <peter1138> Or you could understand what the code is doing.
18:44:59 <xarick> desired_water_tiles overflows
18:45:10 <andythenorth> peter1138[d]: "badge strings ignore the name callback" or "the name callback is disabled"?
18:45:15 <xarick> if I keep Amplitude as int
18:45:31 <xarick> and the A2I as a function
18:48:02 *** tokai|noir has joined #openttd
18:48:02 *** ChanServ sets mode: +v tokai|noir
18:49:56 <Rubidium> why can't A2I be both int64_t or int32_t or whatever integer type it needs to?
18:53:53 <xarick> the macro option is smarter
18:54:27 *** Flygon has quit IRC (Remote host closed the connection)
18:54:51 *** tokai has quit IRC (Ping timeout: 480 seconds)
18:55:11 <xarick> in other words... it's fine the way it is, don't get confused
18:55:22 <xarick> I'm just messing around
18:56:17 <xarick> I was trying to make the code look decent without casts around
18:56:27 <xarick> `int64_t desired_water_tiles = A2I(water_percent * _height_map.size_x * _height_map.size_y);`
18:57:41 <Rubidium> just cast water_percent to int64_t and be done with it
18:57:45 <xarick> instead of this abhorrention:
18:57:45 <xarick> `int64_t desired_water_tiles = A2I((static_cast<int64_t>(water_percent)) * static_cast<int64_t>(_height_map.size_x * _height_map.size_y));`
18:59:01 <Rubidium> xarick: the second cast isn't needed, the first cast is needed and making A2I int64_t won't remove the need for the cast. Actually some compilers will start complaining that you're multiplying numbers before expanding the size of their type
18:59:49 <Rubidium> without the casts the multiplications will keep using int32_t and overflow, so you must explicitly tell it to use int64_t
19:00:50 <Rubidium> and those macros can be trivially rewritten as functions with C++; you only need to change the line of the macro for that, nothing else in the code needs to be changed.
19:02:39 <peter1138> Function names need changing but I didn't for brevity.
19:02:51 <goddess_ishtar> andythenorth: >LLM
19:02:51 <goddess_ishtar> >understandable and extensible
19:03:39 <andythenorth> well it's extensible due to the LLM
19:03:47 <andythenorth> you just type what you want extended
19:03:51 <andythenorth> and then magically, it does it
19:04:01 <peter1138> I guess the issue is that Height and Amplitude are defined as limited types, but the macros ignore that.
19:04:34 <goddess_ishtar> yeah, but you're reducing the number of people who actually understand the code from 1 to 0
19:04:51 <goddess_ishtar> it's like copying from stackoverflow all over again
19:05:02 <andythenorth> there's an entire PR / code review culture
19:05:15 <andythenorth> nothing there says "only the author can understand the code"
19:05:25 <goddess_ishtar> I'm talking about intent
19:05:26 <Rubidium> peter1138: yes, there's at least one place where amplitude is multiplied by the map size which would overflow in Amplitude-land
19:05:52 <andythenorth> when I javascript running in the browser, I don't worry about how the OS memory management code works
19:05:57 <goddess_ishtar> anyone can understand code in a vacuum, but only the author can really tell you *why* it's laid out that way
19:06:25 <andythenorth> most engineers are just stuck writing react for instagram embeds anyway
19:06:35 <peter1138> That use of A2I seems bogus to me.
19:06:43 <andythenorth> or yet another iOS 'account settings' page
19:07:13 <goddess_ishtar> goddess_ishtar: well, "understand" in the sense that you can comprehend *what* it's doing if you look at it for long enough
19:07:44 <andythenorth> I'm not negating the skill or discipline of engineering 🙂
19:08:00 <andythenorth> I'm just dubious that it applies to a lot of the code that gets put in prod
19:08:23 <peter1138> /** Fixed point array for amplitudes (and percent values) */
19:08:28 <peter1138> Why "and percent values"
19:08:28 <andythenorth> "WordPress powers around 43.6% of websites on the internet"
19:08:43 <peter1138> const Amplitude water_percent = sea_level_setting != (int)CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY ? _water_percent[sea_level_setting] : _settings_game.game_creation.custom_sea_level * 1024 / 100;
19:08:55 <andythenorth> how many image gallery sliders need to be written by engineers on $100k USD?
19:09:02 <peter1138> 1024 is the factor, that happens to be AMPLITUDE_DECIMAL_BITS
19:09:11 <peter1138> But actually it's just a coincidence.
19:09:21 <peter1138> (I mean, it's a deliberate choice, but...)
19:09:41 <andythenorth> oof Horse badges is now all sidequest
19:09:54 <andythenorth> 'add badges' -> redesign the grf
19:11:26 <Rubidium> though... peter, please don't side-quest into unrelated territories ;)
19:12:29 <andythenorth> to use badges in purchase texts, I need to eliminate variants
19:12:50 *** kuka_lie has quit IRC (Remote host closed the connection)
19:12:59 <andythenorth> 'variant headers' (silly idea) depend on name callback
19:13:16 <peter1138> There is currently no support for putting the badge name into the engine name anyway.
19:13:21 <andythenorth> sorry, accuracy, I need to eliminate *deeply nested variants*
19:13:34 <andythenorth> to which the solution is deleting a lot of vehicles
19:13:56 <peter1138> Players can do that by... not expanding the list.
19:14:09 <andythenorth> did we never like n-level variants anyway?
19:15:55 <peter1138> IMHO your use is fine imho. The header stuff was not really intentional though.
19:16:22 <LordAro> is it really a new feature if it doesn't make andy reset the progress of one or more of his grfs to 0?
19:19:32 <goddess_ishtar> ohno, just had a horrible idea
19:19:49 <goddess_ishtar> badges can be used to set company-wide liveries
19:20:13 <peter1138> Players don't get to set badges.
19:20:26 <goddess_ishtar> since that UI currently relies on the MU flag on the vehicle, I think
19:20:39 <goddess_ishtar> it's weird and feels arbitrary
19:21:11 <goddess_ishtar> goddess_ishtar: (for trains, anyway)
19:21:27 <goddess_ishtar> I wish I was at my computer so I could show the screenshot of the menu I mean
19:21:30 <peter1138> Oh you mean extending the company livery system from arbitrary classes and groups, to that + badges.
19:22:23 <peter1138> Those arbitrary classes come from the original TTDPatch implementation.
19:22:43 <goddess_ishtar> so, lots of tech debt?
19:23:40 *** gelignite has joined #openttd
19:24:30 <michi_cc> There's no tech dept, just a dept of laziness (why design something new if you can just copy TTDP) 🙂
19:25:17 <goddess_ishtar> surely that's a credit of laziness?
19:26:11 <peter1138> That's back when most players were still use TTDPatch, so we figured that if TTDPatch decided to use those categories, why not borrow it and give a similar choice.
19:26:59 <peter1138> And I still think they are fairly reasonable, but definitely arbitrary.
19:27:22 <peter1138> Barring the "what is and what isn't an MU" etc..
19:27:44 <peter1138> My search is failing to come up with the screenshots of TTDPatch's window.
19:28:49 <peter1138> And technical debt: pre-signals.
19:29:07 <goddess_ishtar> peter1138: yeah they work well enough, but it'd be nice to be able to extend them
19:29:50 <peter1138> And then someone comes along and wants them per-group.
19:32:04 <goddess_ishtar> you can already set liveries per group lmao
19:32:55 <goddess_ishtar> yeah, but you can just set unique liveries on every subgroup
19:33:58 <xarick> peter1138[d]: A2I is no longer used now
19:37:15 <peter1138> We copied it but actually worse.
19:38:17 <goddess_ishtar> huh, surprised 2cc is that old
19:39:12 <peter1138> This installation has NewGRFs from 2003. It's wil.d
19:40:23 <peter1138> Maybe we should steal the look of the tabs.
19:44:44 <xarick> what about A2I, it's only use was there
19:52:43 <andythenorth> namespace for badges that are set by OpenTTD GUIs
19:52:54 <andythenorth> hmm, but badges are not per vehicle instance?
19:53:48 <goddess_ishtar> isn't the whole point of badges that they're shared between GRFs?
19:55:53 <xarick> why isn't my suggestion coloured
20:04:34 <andythenorth> right what was I doing?
20:04:40 <andythenorth> other than side quests on side quests?
20:07:09 <peter1138> No offence but that's my thing :/
20:08:17 *** belajalilija has joined #openttd
20:08:17 <belajalilija> That’s all of our thing
20:15:39 <andythenorth> I have fewer branches than peter1138[d]
20:25:33 *** Tirili has quit IRC (Ping timeout: 480 seconds)
20:31:59 <peter1138> Better badge configuration UI.
20:32:36 <peter1138> Better badge filtering?
20:34:00 <peter1138> Badge config is only on the engine purchase list right now, but batches exist elsewhere.
20:49:29 <xarick> I wonder if that last `xr` is a typo or if it's really intended to be that
20:49:54 <andythenorth> so to use badges in procedure params, `badgetype(cabbage/foo)`?
21:14:10 *** gelignite has quit IRC (Quit: Stay safe!)
21:16:22 <peter1138> Hmm, did anyone weigh on using enums...
21:22:12 <xarick> HeightMapMakeHistogram is witch coding
21:22:33 <xarick> `hist[h]++`, but h = -16
21:25:00 <Rubidium> xarick: we're not your LLM
21:28:46 <xarick> i found a bug with 13346, I believe
21:29:45 <kuhnovic> Xarick turned into a Dalek
21:31:14 <andythenorth> lol trying to refactor my loop unrolls
21:31:21 <andythenorth> 3 of them, 256 loops each
21:31:40 <andythenorth> they broke, so reading the nml is huge 😛
21:33:42 <_glx_> maxtaktik: emojis are supported, they are unicode characters
21:34:07 <andythenorth> should the bitmask for 0x61 check of 0x7A be 0x00000001?
21:34:24 <_glx_> but default font won't have them probably
21:34:31 <peter1138> xarick, probably the A2H change.
21:34:44 <peter1138> THat's could lose resolution.
21:34:54 <peter1138> That could lose resolution.
21:49:57 <peter1138> And that weird dropdown thing.
21:51:55 <xarick> i changed some floats to doubles
21:52:13 <peter1138> Hm, I broked something :(
21:53:25 <xarick> cus everything else uses doubles
21:53:40 <xarick> then there's a mix of int, double and float multiplications
21:54:25 <xarick> that assert there hasn't yet triggered
21:55:49 <andythenorth> wonder if anything churns register 0x1E
21:56:11 <andythenorth> getting unexpected results from trying to check badges using var 0x61
21:57:08 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:58:38 <peter1138> Okay, fixed. badges.grf had the strings marked generic when they're not.
22:03:31 <peter1138> Hmm, move badge configuration to Game Options?
22:03:57 <andythenorth> where is it now? 😛
22:04:27 <xarick> i failed at understanding the lose resolution part
22:06:26 <andythenorth> maybe xarick is the one to expand newgrf debug window contents?
22:06:35 <andythenorth> e.g. badgers on train vehicles
22:07:00 <peter1138> I mean it could be done.
22:07:11 <peter1138> Although all features have badges so...
22:08:35 <peter1138> Badges do not have badges.
22:08:43 <xarick> I know little about NewGRF
22:08:59 <peter1138> I guess I could see about adding badge labels to it.
22:09:14 <andythenorth> I considered trying 😛
22:09:27 <xarick> static inline bool AllocHeightMap(), but always returns false
22:09:27 <andythenorth> could get my openttd commits into double digits
22:13:04 <peter1138> andythenorth, the badge configuration is the stupid "B" button the build vehicle window.
22:13:10 <peter1138> It's a place holder.
22:13:23 <andythenorth> I have not clicked it
22:13:31 <andythenorth> well...not more than once
22:13:32 <peter1138> Like "Badge config" would be way too long.
22:13:44 <peter1138> The last push I made fixed that issue :)
22:13:44 <andythenorth> ok badges is working as a way of handling fancy multiple unit sprites
22:14:04 <andythenorth> these all use a common badge to pick sprites
22:14:15 <peter1138> Also yes, the mask is 0x00000001.
22:14:31 <andythenorth> previously it was checking 16 possible IDs for every vehicle
22:14:36 <andythenorth> now it's just one badge
22:14:50 <andythenorth> still 128 vehicles forwards and backwards, but eh 😛
22:14:54 <peter1138> Doesn't NML use non-DWord varactions though? If it was a byte varaction the mask would be 0x01.
22:15:18 <peter1138> I looked at one switch which was several screens long.
22:15:23 <andythenorth> 16 is max number of params to a procedure
22:15:38 <andythenorth> checks 128 vehicles forward and backward
22:15:51 <andythenorth> ID of each vehicle is compared to 16 possible IDs
22:16:13 <andythenorth> definitely efficient now 😛
22:16:31 <peter1138> I mean, testing for badges isn't completely efficient, but... better than that.
22:16:57 <andythenorth> I guess I could limit it to 64 vehicles in each direction
22:17:39 <andythenorth> maybe OpenTTD could do it 😛
22:17:45 <peter1138> The badge list property is stupidly overkill, taking a word as the number of entries.
22:18:13 <peter1138> What happened to the "clone engine" action anyway...
22:18:35 <andythenorth> I calculate 3 'vars': `position_in_badge_chain`, `position_in_badge_chain_from_end`, `num_vehs_in_badge_chain`
22:18:44 <xarick> but functions are CamelCase!
22:19:05 <andythenorth> because it's varact 2, I assume it's not cached at all
22:19:31 <andythenorth> 256 checks, for every vehicle with this behaviour in the consist
22:19:36 <andythenorth> every time graphics are drawn
22:20:10 <peter1138> Did we fix it so that it only gets evaluated if the vehicle is actually on screen?
22:20:34 <peter1138> What would persistent storage do?
22:21:11 <peter1138> Persistent storage was only only the lead engine.
22:21:22 <andythenorth> keep the same loop unroll, but cache it
22:21:39 <andythenorth> yeah it was probably workable, but I'd have done something horrible to make it work
22:21:49 <peter1138> So I wonder if a different approach of a much smaller persistent storage per vehicle would be better.
22:22:05 <andythenorth> and there were questions about access, these sprites change on load/unload
22:22:37 <peter1138> Effectively a persistent storage of 1 element.
22:23:12 <andythenorth> the braking people will need vars like `position_in_badge_chain` 😛
22:23:17 <peter1138> Does the result of the 256 checks change depending on load/unload?
22:23:29 <andythenorth> only on rearranging the consist
22:23:38 <peter1138> Okay so sprites changing on load/unload is not relevant.
22:23:40 <andythenorth> brake type people will also `num_vehs_in_badge_chain`
22:23:59 <peter1138> A var 60 equivalent but for a badge, yes?
22:23:59 <andythenorth> calculation of realistic brake force
22:24:44 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:25:11 <peter1138> Ooh, the cursed Game Options window.
22:25:34 <peter1138> Now, I had an idea about window colours.
22:25:40 <andythenorth> oh it's vars 0x40 also, maybe 0x41
22:26:02 <andythenorth> hmm maybe not, the docs of those confuse me
22:26:25 <peter1138> Get length of same consecutive wagons?
22:26:46 <peter1138> So the issue there is that variable is cached, because it's expensive.
22:26:53 <peter1138> But for badges, it would need a parameter.
22:27:14 <peter1138> So if you need to cache that, you need to cache with the parameter in mind.
22:27:51 <andythenorth> ok, so the cache could grow to [num badges]?
22:28:15 <andythenorth> suddenly my solution looks less bad 😛
22:28:34 <andythenorth> loop unroll vs. RAM use
22:28:41 <peter1138> var 0x60 is not cached, so...
22:28:46 <andythenorth> does everyone now have 36GB?
22:31:22 <Rubidium> nope, don't even have half of that
22:31:44 <andythenorth> it's probably overkill right now
22:32:02 <andythenorth> we could cache everyone's train vars in my spare RAM?
22:34:30 <peter1138> Oh, does var 0x60 count from the current vehicle?
22:35:42 <peter1138> Oh I guess parent vs self scope.
22:36:39 <peter1138> if (parameter >= std::size(object->ro.grffile->badge_list)) return UINT_MAX;
22:36:53 <peter1138> Hmm, is this going to use the correct badge translation table?
22:37:10 <peter1138> Dunno if that is affected by scope.
22:38:51 <peter1138> I'll assume it does otherwise cargo table lookups wouldn't work either.
22:40:27 <andythenorth> "probably fine"?
22:41:56 <peter1138> Okay, variable done. Probably works. Do you need it?
22:42:16 <peter1138> And is 1 location of persistent storage enough for vehicles or oddly restrictive?
22:45:40 <andythenorth> probably oddly restrictive?
22:45:50 <andythenorth> what's the bloat?
22:46:30 <andythenorth> I have to sleep, gummy eyes 😛
22:46:54 <wensimehrp> andythenorth: I've never seen anyone having 36g ram.
22:46:54 <wensimehrp> It's a weird number.
22:46:55 <peter1138> Standard persistent storage is 256 entries. 256 32-bit values is 1KiB.
22:47:17 <andythenorth> ok so everyone uses TL 7, with 8/8 vehicles
22:47:34 <peter1138> 14 vehicles per consist?
22:47:45 <peter1138> So 14KiB per train.
22:47:45 <andythenorth> and everyone makes at least 5000 trains per game
22:47:56 <peter1138> That bit isn't true :)
22:48:28 <peter1138> Now, I do have a patch to reduce it.
22:48:40 <andythenorth> so maybe 8MB in a 'typical' game?
22:48:56 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
22:48:59 <peter1138> But if 1 entry is enough, that would be "more efficient"
22:49:15 <peter1138> Of course, You'd need to bit-stuff it yourself.
22:49:29 <peter1138> Instead of just storing "1" in location 0 and "5" in location 1.
22:49:47 <xarick> I am removing static_casts wherever I can
22:50:06 <andythenorth> nah, my eyes have fallen down my face
22:50:43 <andythenorth> one of the Horse main badge quests mostly works
22:50:46 <andythenorth> do I get a badge?
22:51:39 <andythenorth> so tomorrow is another day
22:51:46 <andythenorth> hmm instead of listing colour names
22:51:57 <andythenorth> I could just draw 8px badges, one for each colour
22:52:15 <andythenorth> just square colour chips
22:52:51 <andythenorth> then the name callback handling is significantly reduced
22:53:13 <andythenorth> name callback handling is ~20% of Horse code currently
22:55:39 <talltyler> I like the color chip idea a lot, acrually
22:57:12 <andythenorth> It will work with company colour perfectly
22:57:43 <peter1138> I've got a company colour square already.
22:59:04 <talltyler> Does badges come with common sprites like color chips, smoke/diesel/sparks, maybe flags, that all GRFs can share? Or do they need to be added by the GRFs themselves?
22:59:50 <talltyler> I saw you finding them for your test grf, not sure where they’ll be actually distributed
23:00:37 <peter1138> I've not put colours there yet, though.
23:00:53 <peter1138> In terms of distribution, I'm not sure.
23:00:59 <talltyler> Heheh, the turbine is fun
23:01:05 <peter1138> I draw that myself, lol
23:01:42 <peter1138> Because the idea is to standardise on badges, the OpenTTD release cycle is probably too long to bundle it in.
23:02:04 <peter1138> So maybe bananas distribution is better.
23:02:34 <peter1138> I should add the colour "chips"
23:02:47 <peter1138> I did get side-tracked with coloured dice.
23:03:23 <andythenorth> Horse has custom recolours
23:03:31 <talltyler> We should name the colours after OpenTTD references: BaNaNaS Yellow, FIRS Green, etc. 😛
23:03:37 <andythenorth> Recolour sprites supported for badges?
23:06:32 <peter1138> No, only company colour or not. The game will pick an appropriate remap depending on 2cc-ness.
23:07:21 <peter1138> Okay, looks like the NewGRF debug window doesn't let you distinguish between road or tram types.
23:08:10 <peter1138> Oh, whoops. I used the badge string name. I should perhaps use the badge label.
23:09:16 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:11:55 <peter1138> Also you can't debug the railtype of a station tile.
23:14:09 <peter1138> Some tweaks if andythenorth (who is asleep) wants to play.
23:14:31 <peter1138> Okay, so should we allow custom remaps. If so, how...
23:15:22 <peter1138> How are custom palettes usually assigned with NML.
23:15:37 <peter1138> We're looking at a bit of GRM right?
23:16:40 <peter1138> 256 byte property? haha
23:18:39 <peter1138> param[3] = reserve_sprites[3];
23:19:16 <_glx_> you can use a named param too
23:19:37 <peter1138> 020_recolour.nml doesn't make a lot of sense.
23:20:00 <peter1138> I think it's reserving and creating 3 palettes, but not actually using them anywhere.
23:20:01 <_glx_> it's a regression test so doing weird stuff is common
23:21:15 <peter1138> Let's use iron-moose for reference...
23:21:23 <peter1138> custom_wagon_recolour_sprites = reserve_sprites(16 * 2 * 39);
23:21:24 <peter1138> replace(custom_wagon_recolour_sprites) {
23:21:41 <peter1138> 1: return custom_wagon_recolour_sprites + 416 + company_colour2;
23:28:15 <peter1138> I don't think there's any existing property that will take a colour remap.
23:32:15 <xarick> tried to remove as many static_casts as possible
23:32:42 <xarick> now trying to beat CodeQL
23:39:52 *** Wormnest has joined #openttd
23:40:32 <michi_cc> I think it would be actually fine to supply a default list of badges in openttd.grf. Can the icon of a badge be defined separately? If yes, the icon could live in ottd_extra so other basesets can provide their own.
23:41:28 <peter1138> I don't think it needs to be baseset-specific graphics.
23:42:52 <goddess_ishtar> oh wow, the `mode` badges are a great idea
23:43:26 <peter1138> I suspect 'role' is a better term now, but...
23:43:50 <goddess_ishtar> yeah I'd use "role"
23:44:08 <michi_cc> Also fine. Include a default list into openttd.grf that is always there. We could also ship an extra badge GRF via bananas, but right now there isn't anything that would make this a better user experience than each NewGRF doing their own.
23:44:08 <goddess_ishtar> it's not like anything depends on this yet, you can break continuity :p
23:44:54 <peter1138> Anyway, this is why I've been asking for a nice SVG version of the steam and diesel smoke ;-)
23:45:10 <peter1138> I managed to svg-ise the electric spark because it's just geometry.
23:47:56 <peter1138> Also "role/express_passenger" and "role/express_freight" might be better represented by ["role/express", "role/passenger"] and ["role/express", "role/freight"
23:48:16 <goddess_ishtar> that's probably more robust
23:48:18 <peter1138> Authors are free to include their own joker roles.
23:49:45 <goddess_ishtar> (also I'm just excited that I can eventually sort by Horse role, since you can filter by badges)
23:49:49 <peter1138> Hmm, that docs page should include a link to the repo.
23:50:01 <goddess_ishtar> I had to look for it myself
23:57:27 <peter1138> Ok, my docs workflow still works.
23:59:11 <peter1138> A lot of NewGRFS use a metro-style symbol in place of the steam/dielse/electric symbols.
23:59:17 <peter1138> Which is slightly odd.
continue to next day ⏵