IRC logs for #openttd on OFTC at 2025-01-19
โด go to previous day
00:10:36 <xarick> okay bed time, got no time
00:19:59 *** gelignite has quit IRC (Quit: Stay safe!)
00:26:53 <_glx_> xarick: if you think about what void tiles are (all around the map) the answer is 1 void can have max 2 void neighbours
03:12:39 *** Wormnest has quit IRC (Quit: Leaving)
03:31:05 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:55:46 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:16:26 <goddess_ishtar> amending and force-pushing to a pull request is safe, right?
04:17:21 <goddess_ishtar> oh wait, I should have used rebase and squash, shouldn't I
04:41:13 <DorpsGek> - Update: Translations from eints (by translators)
08:21:08 <andythenorth> ok badges working in Ibex
08:21:17 <andythenorth> as extra text info
08:21:30 <andythenorth> not sure why Horse isn't showing them, might be localised issue
08:38:43 <andythenorth> ok Iron Horse is mangling the badge string
08:39:04 <andythenorth> it's using a vehicle name string for both badge strings
08:39:39 <andythenorth> Iron Ibex does not
08:39:58 <andythenorth> if I add Ibex *after* Horse in the grf list, then the string works
08:40:17 <andythenorth> if I move Horse after Ibex, then the badge strings are wrong in both grfs
08:49:50 <truebrain> Always finding ways to break things ๐
08:49:57 <truebrain> (which is a good thing btw ๐ )
09:23:45 <goddess_ishtar> it's always time for coffee
09:24:00 <goddess_ishtar> tea is also good, dare I say, better
10:00:37 <peter1138> 8Badfes are unique by label. the last name set replaces earlier names.
10:02:11 <peter1138> Sounds like theres a festure mixup in your IH strings.
10:02:52 <andythenorth> or nmlc is writing over some
10:04:06 <andythenorth> hmm how do I define which feature a string is for?
10:04:16 <andythenorth> the .lng file does not declare that
10:05:23 <andythenorth> action 4 has a feature byte
10:05:37 <andythenorth> is nml doing something magical?
10:07:14 <goddess_ishtar> nielsmhviaGitHub: oh wow, that is... certainly a bug report
10:11:29 <peter1138> Github seems a bit slow.
10:17:47 <merni> That's 2 bug reports about the same thing so far
10:19:37 <peter1138> andythenorth, NML is not magic, it's just dumb.
10:20:31 <peter1138> When it sees the name property it creates the action 0 for it, and also prepares the action 4, and (logically) uses the same feature as the property.
10:20:59 <peter1138> Yes, it's a dup issue.
10:21:18 <andythenorth> I should branch Horse eh
10:22:58 <peter1138> git switch -c badges
10:26:04 <merni> peter1138: Yeah, my point was more that obviously this behaviour is something people are noticing and is at least somewhat unintuitive
10:26:53 <andythenorth> ok what are all the things for Horse Badger?
10:27:07 <peter1138> nielsm's suggestion of a new button is most sensible.
10:27:10 <andythenorth> power source, vehicle role, randomisation
10:28:34 <peter1138> And all the hidden things you want to avoid having a list of 256 different engines.
10:28:39 <merni> peter1138: Would that help? The way I read it that would *spawn* the town without roads, but upon expanding it again it would still build more
10:31:06 <peter1138> merni, get your VS Code out then.
10:31:31 <merni> If I had the time to do that I'd have the time to address Tyler's feedback on my existing PR :p
10:31:55 <merni> Hopefully in two weeks.
10:31:58 <peter1138> Disconnect from Discord. :p
10:32:13 <merni> Nah discord is just a distraction
10:32:28 <merni> It isn't something that needs my full time attention, unlike openttd programming :p
10:33:31 <peter1138> Right, magical drop down items. Let's see.
10:34:56 <bohaska> nielsmhviaGitHub: changing the code to match the docs...
10:36:04 <goddess_ishtar> merni: yeah this is the way I would do it
10:39:48 <_zephyris> Woop, people agree with me, fuzzy warm feelings ๐
10:40:12 <_zephyris> I'd like to think I'm good at taking a step back and seeing the bigger picture problem
10:41:02 <peter1138> I wondered if you happened to be reusing the same string id :D
10:41:13 <andythenorth> I'd have to edit the nfo to test
10:41:30 <andythenorth> identical code produces 2 grfs
10:41:46 <peter1138> Push your branch to github so I can pull it and take a look?
10:41:57 <andythenorth> the only difference in the non-working version is the number of vehicles and strings
10:41:57 <peter1138> (See, always branch)
10:43:21 <andythenorth> is 'tilt bonus' a badge?
10:43:42 <peter1138> So it's cabbage/foobar that are not working?
10:43:43 <andythenorth> it's already just an action 0 prop, but I'm trying to avoid using extra text info callback ๐
10:43:55 <andythenorth> it works in Ibex
10:44:00 <andythenorth> it does not work in Horse
10:46:27 <peter1138> I like that you forgot how string files are formatted and put the : in the wrong place :-)
10:47:16 <peter1138> Compiling now, in about 10 minutes I will inspect the NFO.
10:49:12 <andythenorth> I have 90MB of nfo here
10:49:25 <peter1138> I wonder if other people do that. I've seen other NewGRFs with spaces in weird places...
10:50:00 <andythenorth> {BLACK}Probably {YELLOW}Maybe
10:51:33 <xarick> new FindSpring algorithm, I finally have results
10:52:33 <xarick> I am not impressed ๐ฆ
10:52:42 <peter1138> Parsing ... 136.2 s
10:52:42 <peter1138> Preprocessing ... 37.6 s
10:52:42 <peter1138> Generating actions ... 3.5 s
10:52:50 <peter1138> Assigning Action2 registers ... 129.9 s
10:53:05 <merni> Have you somehow piped your console output to IRC :p
10:53:35 <andythenorth> I should do that with mine
10:53:40 <peter1138> Why is a 7 year old processor so slow...
10:53:57 <andythenorth> we'd see how often I accidentally up-enter on `git reset --hard`
10:54:12 <andythenorth> this could all be badges....
10:55:18 <peter1138> Your makefile breaks with -j :(
10:55:44 <andythenorth> oh there's a couple of edge cases where it does
10:55:48 <peter1138> It produced the nml files, iron-horse.nfo, iron-ibex.nfo, and stopped. Nothing else created.
10:56:18 <andythenorth> 'run it again' ๐
10:56:23 <andythenorth> one-person project eg ๐
10:56:43 <andythenorth> is it failing on Iron Moose missing a string?
10:57:44 <peter1138> I ran make again and it completed. So there is something not right in the chain.
10:57:50 <peter1138> I didn't see an error but maybe there was.
10:58:12 <peter1138> Oh! Yes, it was. I see the error when I ran it again.
11:00:19 <andythenorth> I've force pushed, that string should be fine now
11:02:31 <peter1138> Okay, it's a bug in my understand of how OpenTTD treats strings :D
11:04:36 <peter1138> They are not separated interally by feature.
11:05:11 <peter1138> I think also that engine IDs > 53248 will have similar issues.
11:05:35 <peter1138> (They'll conflict with D000+ strings)
11:12:04 <peter1138> Engines of different types don't conflict because it uses the mapped engine id, not the action 0 id.
11:12:35 <peter1138> So you'd need to actually have 53,248 engines before it starts to conflict.
11:12:43 <andythenorth> "who would do such a thing"
11:13:33 <peter1138> That's in total, not per-GRF, so it's easier than you might think.
11:14:41 *** peter1138[d] has joined #openttd
11:15:18 <peter1138> Now, does this separation break anything?
11:18:50 <xarick> comparing it to PR version
11:21:57 <xarick> i have a hard time to make a judgment
11:31:20 <xarick> code complexity explosion for a tiny benefit
11:31:37 <xarick> or even losing at times
11:34:10 <peter1138> Hmm, maybe that's not the best way after all :p
11:35:11 <johnfranklin> Peter is using ChillRoundF? ๐ฎ
11:44:39 <peter1138> Ah, probably is. Checking one 32-bit value is better than checking one 16-bit value and one 8-bit value.
11:47:09 <andythenorth> I could drop all my python attrs
11:47:17 <andythenorth> and just set badge strings
11:47:26 <andythenorth> no, that would be silly ๐
11:48:34 <peter1138> Well, congratulations on finding a huge flaw in your first use ;D
11:53:07 <andythenorth> "it's what I do" ๐
11:53:34 <andythenorth> probably the main reason I don't use JGRPP is I instantly break everything
11:58:05 *** D-HUND is now known as debdog
12:13:11 <peter1138> I did something drastic.
12:13:22 <peter1138> I close a whole browser window with a load of unknown tabs.
12:13:38 <peter1138> (I shall now proceed to open more)
12:21:22 <andythenorth> I have tabs open sometimes
12:26:17 <peter1138> Just imagine all the extra features you could target if you did use JGRPP.
12:28:50 <andythenorth> like trains > 7 tiles?
12:30:26 <peter1138> Well, it's more difficult to mess up than cargo class bitmasks, right?
12:36:25 <peter1138> It automatically does the mapping from label to translation table index.
12:37:03 <peter1138> Oh, and automatically does it as a 32-bit parameter. So it's fairly complex under the hood.
12:39:10 <peter1138> Hmm, maybe it doesn't, I might've forgotten about that.
12:43:37 <peter1138> In the regression test, the switch is before the badgetable. In theory that shouldn't work :D
12:45:54 <peter1138> Okay, it's use a byte parameter.
12:49:14 <peter1138> Testing with a longer translation table, let's see.
12:50:07 <peter1138> Is there a standard way to split an array into chunks...?
12:55:30 <peter1138> Magical. NML automatically uses a byte parameter if it can, otherwise it stores a dword in a register.
12:58:41 <_glx_> I see Andy found weird bug when testing, as always ๐
12:59:36 <peter1138> andythenorth, ^ now supports more enough badgetable entries to satisfy iron-horse...
13:00:28 <andythenorth> hmm I never figured out how to update a local fetch of a PR
13:00:33 <andythenorth> the GPT suggestions just don't work
13:09:31 <xarick> stupid background tasks ruining my benchmarks
13:10:09 <peter1138> Anyway, "git fetch upstream pull/359/head:pr359" should update it.
13:10:20 <peter1138> -f if it's been force-pushed.
13:24:34 *** gelignite has joined #openttd
13:41:21 <stenyg> Hi im trying for a custom game to prepare a new button in mission orders, could someone guide me how to add a mission button that adds a conditional to first with 100% from start and set the current selected to No_Unloading or FullLoad?
13:55:29 <peter1138> Anyone know what any of that is about?
13:57:57 <Rubidium> it's about adding some conditional feature to the vehicle's orders, but beyond that I've got no real clue
13:59:36 <andythenorth> it's not an LLM?
14:00:38 <stenyg> il try to reformulate it, just need pointers the order_gui wasnt easy to get into ๐
14:05:47 <stenyg> what i would like to try is to add a button so when u click on it it will add go from
14:06:06 <stenyg> and put it under the "goto menu"
14:06:56 *** akimoto has joined #openttd
14:37:20 <peter1138> Also NUM_BADGES_PER_GRF is bogus, it was part of an earlier scheme that use station-type way of assigning class names.
14:39:52 *** akimoto has quit IRC (Remote host closed the connection)
14:42:18 <xarick> woah, that was a bad error
14:42:41 <_glx_> not an issue actually ๐
14:44:39 <peter1138> Hmm. What's the difference between a CursorID and a SpriteID?
14:44:51 <andythenorth> I need to check badges on neighbouring vehicles
14:45:00 <peter1138> They're both just sprite numbers as far as I can tell.
14:47:56 <xarick> gah, I still fail at commiting comits
14:48:15 *** kuka_lie has joined #openttd
14:48:18 <andythenorth> ah 0x7A needs a parameter
14:48:30 <Rubidium> peter1138: CursorID has a few flags to denote some animated cursors that aren't actual direct sprites
14:48:52 <peter1138> Ah, so it's the flags on top. Gotcha.
14:49:59 <Rubidium> so... when it has a flag it does not have a sprite number at all, when the flag's not set it's actually a sprite number
14:50:25 <Rubidium> get rid of animated cursors and they're all sprites ;)
14:52:22 <andythenorth> can't remember how to parameterise the var for 0x61
14:52:39 <andythenorth> `[STORE_TEMP(-1, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]` is the code I have checking IDs, but needs to use 0x7A
14:55:27 <peter1138> Rubidium, so almost like a std::variant, but encoded in a single value...
14:56:03 <peter1138> I believe there are special variants that can do that, using unused space rather than allocating (and re-aligning)
14:56:25 <andythenorth> _glx_: need to give it a badge as the param ๐
14:57:46 <_glx_> The 60+x parameter specifies the variable to access and temporary register 10E is passed as the new 60+x parameter.
14:58:24 <_glx_> so variable number replaces 0xC6, and you put the param in 0x10E
14:59:46 <peter1138> Why do you need to parameterise this?
15:00:16 <peter1138> Are you testing for a different badge based on some other condition?
15:04:01 <andythenorth> I need to test neighbouring vehicle
15:06:28 <andythenorth> presence of badge(s)
15:06:33 <peter1138> If it's one particular badge, then use has_badge().
15:07:01 <andythenorth> what do I miss in the syntax?
15:07:21 <_glx_> isn't has_badge() only for SELF or PARENT ?
15:07:25 <peter1138> I don't know, is the example in 042_badges.nml not enough?
15:09:01 <peter1138> Ah you need the magical relative scope which only exists for random switches.
15:09:26 <xarick> `CalculateCoverageLine` has this weird pointless variable
15:09:26 <xarick> ``` const DiagDirection neighbour_dir[] = {
15:09:29 <_glx_> but using that in normal switches ๐
15:12:14 <peter1138> Is it `[STORE_TEMP(badgetype("blah"), 0x10E), STORE_TEMP(-1, 0x10F), var[0x61, 0, 0x00000001, 0x7A]]`?
15:12:20 <peter1138> Then the result is 1 or 0.
15:12:41 <peter1138> Untested of course.
15:13:44 <peter1138> I stil wonder if relative scope for varaction 2 would make sense, but I think someone said no. Maybe it was some other restriction.
15:14:31 <_glx_> peter1138: untested but looks correct
15:15:25 <peter1138> I could make a helper function... has_badge("blah", 0)
15:15:34 <peter1138> has_badge("blah", -1)
15:15:53 <peter1138> Would hide all the STORE_TEMP.
15:16:16 <_glx_> I think only Andy does relative access
15:16:21 <peter1138> On the other hand, if you need to test multiple vehicles in the chain, that's less efficient as it will needless set 0x10E every time.
15:19:37 <peter1138> There's also no "count number of vehicles in the chain with this badge"
15:20:26 <peter1138> Something equivalent to 0x60 I guess.
15:20:57 <peter1138> Not sure if that's needed.
15:21:49 <peter1138> I guess has_badge() by itself is usually pointless, testing your own badges is not very useful.
15:22:06 <peter1138> It just happens to work for the wagon attach callback.
15:22:23 <peter1138> parent/self I guess.
15:23:31 <andythenorth> I need to re-read my own code
15:23:45 <andythenorth> but I think I test 128 vehicles forwards and backwards, checking IDs
15:24:03 <andythenorth> I'm looking for an unbroken chain
15:24:38 <peter1138> Looking for ways to slow the game down :D
15:24:41 <_glx_> yeah it's done with 128 switches
15:26:15 <andythenorth> it's only called for every vehicle in the chain
15:26:19 <andythenorth> on every graphics draw
15:27:04 <peter1138> "Have some persistent storage" "What's the point?"
15:30:34 <andythenorth> we had a PR for persistent storage?
15:33:17 <andythenorth> seems I did something with it
15:35:19 <peter1138> Yes, the argument was "when should persistent storage be writable?"
15:51:34 <peter1138> (I was trying to differentiate Sprite 0 and INVALID_SPRITE...
16:08:29 <andythenorth> well hidden badges working
16:17:03 *** nielsm has quit IRC (Remote host closed the connection)
16:19:54 <peter1138> Hmm, why should clicking on toolbars not take focus (away from windows with an editbox)
16:22:19 <peter1138> This introduced that.
16:22:48 <peter1138> So if you have a window with an editbox open, and then click on th toolbar, the editbox window still has focus.
16:24:43 <andythenorth> I don't like requesting specialise vars for grf, they're usually weird
16:25:02 <andythenorth> but this loop unroll I use to find unbroken chains of similar-but-different vehicles
16:25:06 <andythenorth> is not efficient ๐
16:25:48 *** Wormnest has joined #openttd
16:35:42 <xarick> I'm making histograms multithreaded
16:36:31 <xarick> wish i could template this
16:37:33 <xarick> [GetHistograms multithreaded] 15591 us
16:37:46 <xarick> i forgot to get the result for single threaded
16:41:51 *** gelignite has quit IRC (Quit: Stay safe!)
16:44:34 <talltyler> Interesting, if you remove a house set from a game, the fallback houses don't know how big they are and can be demolished one tile at a time...
16:44:45 <talltyler> Probably not a bug, this is why the warning exists ๐
16:47:30 <truebrain> It can even crash your game
16:48:01 <truebrain> We fixed so many games because of that over the years .. don't remove house GRFs, it rarely ends well ๐
16:50:14 <peter1138> Aren't you meant to to use a fallback house of the same size?
16:50:42 <talltyler> I am playing with my family, one of them is the server host ๐
16:51:07 <talltyler> (I am shocked that I managed to get them hooked on OpenTTD)
16:51:19 <talltyler> I don't even know which house set was removed
16:51:20 <peter1138> Like, if you make a house that is 2x2, then it should use the appropriate parts of a default 2x2 house as the fallback IDs.
16:51:28 <peter1138> Not sure if that's the case or whatever.
16:53:37 <peter1138> Hmm, seems weird to me that if you have a query window open (e.g. rename vehicle), click on the toolbar and open a dropdown menu, keeping it open, if you type, the query window still recieves the characters.
16:56:06 <peter1138> Hmm, okay, I guess it's focus-stealing prevention.
16:57:26 <peter1138> Focus switching happens deep within the window opening->initialisation path, so there's no way to tell if it's opening from manual interation or automatically.
17:00:55 <xarick> > [GetHistograms multithreaded] 23040 us [avg: 23040.0 us]
17:00:55 <xarick> > [GetHistograms singlethreaded] 0 us [avg: 0.0 us]
17:05:40 <xarick> is cpu cache doing something?
17:14:03 <kuhnovic> peter1138: I still really like that one!
17:15:05 <peter1138> Well I finally decided to fix the niggling issue, and without a workaround.
17:15:59 <peter1138> But focus-stealing preventation is usually full of gotchas.
17:16:09 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:18:34 <andythenorth> ok so the strings are just indexes into the BTT?
17:24:26 <peter1138> Use `badgetype("badge")` to get the number.
17:25:25 <andythenorth> curious where I can just use strings
17:25:34 <andythenorth> presumably procedure params are fine
17:26:17 <peter1138> Only in the badgetable list, the badges list, and in the badgetype() built-in function.
17:26:48 <peter1138> You should not ever use the index directly, same as you don't normally use the cargotable index.
17:26:50 <kuhnovic> peter1138: What's that issue? It's not entirely clear to me from the commit message, and I can't find it in the comments either
17:27:32 <peter1138> The dropdown menu did not close if you clicked on the same button again.
17:27:39 <peter1138> This seems like a simple thing, but...
17:28:14 <peter1138> But actually, the dropdown menu did not close if you clicked on ANY button in the toolbar.
17:28:37 <peter1138> So the first commit of that PR is now a change that makes dropdown menus ignore focus stealing protection.
17:29:13 <peter1138> With focus stealing protection removed, the dropdown gains and loses focus normally, even though the toolbar itself doesn't get focused.
17:29:30 <peter1138> And with that, the dropdowns now close properly without needing hacks in the toolbar window.
17:30:40 <peter1138> It's not listed as a "fix" in any of the commit messages, because the "bug" was never introduced in the first place.
17:39:23 <xarick> Oh, that issue uint vs int again ๐
17:39:59 <LordAro> uint foo = *(int *)bar makes no sense to me
17:40:07 <LordAro> which i think RB brought up already
17:40:23 <LordAro> this seems to be the case with many of your PRs - there are outstanding comments that have not been addressed
17:40:33 <LordAro> i've looked through a few of them
17:41:20 <xarick> I don't know what to do
17:42:35 <LordAro> `for (uint i = apc->terminals[0]; i > 0; i--) num += apc->terminals[i];` this is a really weird line of code
17:42:42 <LordAro> (it was there already, don't worry)
17:44:28 <andythenorth> hmm do badges transcend grfs?
17:47:00 <xarick> ``` uint height_lake = *static_cast<int *>(user_data);
17:47:00 <xarick> if (!IsValidTile(tile) || TileHeight(tile) != height_lake || !IsTileFlat(tile)) return false;```
17:47:00 <xarick> ``` int height_lake = *static_cast<int *>(user_data);
17:47:00 <xarick> if (!IsValidTile(tile) || static_cast<int>(TileHeight(tile)) != height_lake || !IsTileFlat(tile)) return false;```
17:49:46 <LordAro> ok, look at it this way - height_begin (in FlowRiver) is a uint. You're passing it into MakeLake via its pointer. The type of this variable has not changed
17:50:03 <LordAro> so why is it suddenly becoming an int?
17:50:35 <LordAro> that's the case in master
17:51:35 <xarick> wait, no, im so confused
17:51:38 <xarick> int height_begin = TileHeight(begin);
17:51:39 <LordAro> in your branch, for some reason you've made height_being into an int - please explain why, when TileHeight returns a uint
17:52:43 <xarick> I need it to be int to compare it with IsTileFlat's int
17:53:22 <xarick> IsTileFlat(lake_centre, &height_lake) &&
17:53:22 <xarick> height_lake == height_begin &&
17:53:43 <kuhnovic> peter1138: Will this affect any other windows? You could argue that the odd window is the toolbar window, so it would make sense to have any hacks there instead of the general window class
17:53:45 <LordAro> i think IsTileFlat suffers from the same problem - int* in, assigns to a uint
17:54:44 <kuhnovic> (I know very little about the window system, so if you say this is the best solution then I believe you)
17:55:49 <peter1138> An alternative is to allow the toolbar to be focused.
17:56:18 <peter1138> Currently if you have an edit window open, and you click on pause, your edit window still has text input focus.
17:56:40 <peter1138> If the toolbar gained focused, then the edit window would lose focus.
17:56:55 <peter1138> One could argue this is correct, because you interacted with the toolbar window.
17:57:09 <LordAro> perhaps that behaviour could be specific to toolbar buttons that don't have a dropdown?
17:57:30 <LordAro> that non-focus-stealing behaviour*
17:58:00 <peter1138> Hah, well that system is definitely not aware of which buttons do which actions in a window.
17:58:16 <LordAro> protip: -j isn't a particularly useful method of build parallelism
17:58:53 <LordAro> peter1138: i am also just an ideas guy, no idea of the complexities of implementing such a system :po
18:01:35 <peter1138> I think the "cleanest" thing is that focus-stealing-prevention should only occur if the window being opened was not opened as a result of a user interaction.
18:02:48 <peter1138> Currently no new windows get focused if an editbox has focus, even if it's a user interaction.
18:03:32 <peter1138> The dropdown window has to gain focus, and then lose focus, to be automatically closed.
18:05:01 <peter1138> Hmm, and of course there are windows which can be manually opened, or automatically opened, So I can't cheat with using the window descriptions.
18:05:21 <xarick> gonna test what happens when I do stuff like this: height_lake = INT_MAX;
18:05:46 <kuhnovic> UI design is always so much more difficult that it seems on the surface
18:08:50 <peter1138> The code that focuses a new window is under new Window()->FinishInitNested()->InitializeData(). So getting a parameter to that to say that a window was opened automatically or manually means every single place where a window is opened would need to be modified.
18:09:48 <peter1138> TBH I've often thought the self-building calls are a bit annoying.
18:10:25 <peter1138> Everything being done through the constructor led to some virtual inheritance bugs at point.
18:11:15 <xarick> now gonna test height_lake = UINT_MAX;
18:11:20 <peter1138> Oh no, not another side-quest :(
18:13:30 <xarick> 4294967295, it's correct
18:15:08 <LordAro> i'm pretty sure the easiest solution is to change TileHeight to return int
18:15:37 <LordAro> i'm not sure it's the most correct solution - but i've just played around with changing all the other functions to return uint, and it's a huge amount of change
18:19:54 <xarick> can't compile without errors
18:20:04 <LordAro> this is not surprising
18:20:14 <LordAro> height variables are a complete mess of signed/unsigned
18:20:57 <peter1138> IIRC it's signed because you sometimes need a height difference.
18:21:05 <peter1138> unsigned - unsigned will not be quite right.
18:21:33 <LordAro> peter1138: my assessment of the code so far is "it depends"
18:21:44 <LordAro> there are very few cases so far where it's actually a difference
18:22:32 <_glx_> you should know by now that 4294967295 (unsigned) and -1 (signed) are the same value
18:23:12 *** virtualrandomnumber has joined #openttd
18:23:44 *** virtualrandomnumber has quit IRC ()
18:26:50 <peter1138> Opinion-detected, shielding-raised.
18:28:29 <xarick> uint8_t number >= int number
18:29:02 <xarick> nevermind, I think my approach is fine
18:29:42 <xarick> it's weird, but I don't wanna make the code uglier
18:29:52 <_glx_> comparing uint and int can have unexpected effects
18:29:58 <LordAro> two separate people have told you that it is not fine
18:30:19 <LordAro> even just an extra cast (and probably explanatory comment) would likely be enough
18:30:23 <xarick> yes, that's what would happen if TileHeight would return int, there are places doing uint comparing to Tileheight
18:31:10 <LordAro> clearly needs more strong types. TileHeight, TilePixelHeight, TileHeightDiff etc etc :D
18:31:50 <_glx_> you want to compare uint and uint, or int and int, never mix unsigned and signed
18:32:18 <_glx_> that's why compiler usually warns about that
18:33:39 <_glx_> unless you really know it's fine (and use cast then)
18:33:41 <Rubidium> peter1138: is that about #13297? I kinda agree that enums aren't the best solution, though it needs something that's stronger than a typedef and less annoying than strongtypedef ;(
18:34:09 <peter1138> The opinion detected was mine, but yes :)
18:35:14 <Rubidium> can you maybe push to stash where you have the perfect middle ground between typedef and stongtypedef? ;)
18:38:42 <xarick> does this look okay lordaro4353
18:39:47 <andythenorth> badges in newgrf debug window maybe? ๐
18:39:48 <xarick> looks so weird to me, but okay
18:39:59 <LordAro> but tile heights are weird generally
18:40:06 <andythenorth> `dumpinfo badges`
18:47:25 <peter1138> Rubidium, needs more opinions than just mine, because it might be reasonable...
18:47:58 *** ChanServ sets mode: +v tokai
18:48:37 <peter1138> A WeakType::Typedef similar to StrongType::Typedef might feasible, but with all the automatic conversions put back in place. But at that point... all that code for something that an enum could do?
18:52:57 <xarick> that doesn't look right
18:54:20 <xarick> let me check CMD_STORY_PAGE_BUTTON
18:54:51 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
18:55:19 <xarick> CommandCost CmdStoryPageButton(DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference); nevermind, it's correct
19:16:25 *** gelignite has joined #openttd
19:32:45 <andythenorth> boop boop badges eh
19:32:55 <andythenorth> colours next I think
19:33:09 <andythenorth> this should be badger-able
19:38:37 <peter1138> Why do I get the feeling I'm going to regret things :D
19:41:45 <xarick> can I touch/fix tgp.cpp codestyle?
19:42:14 <Rubidium> isn't regret like standard? Either you regret not merging it, or you regret having merged it at some point
19:55:54 <talltyler> Todayโs multiplayer shenanigans.
19:56:04 <talltyler> Correct use of Horse?
19:58:23 <peter1138> If it lets you do it, it can't be incorrect.
20:11:10 <talltyler> Iโm glad the snowplough, Garrett, and livestock wagons all have compatible braking systems ๐
20:17:32 *** kuka_lie has quit IRC (Quit: Lost terminal)
20:21:22 <andythenorth> can't assign a badge name depending on company colour
20:21:27 <andythenorth> or...can I? ๐
20:21:39 <andythenorth> do we have {COLOUR}?
20:24:37 *** Speedyn has joined #openttd
20:26:20 <andythenorth> maybe badges are not the solution for this part ๐
20:28:03 <talltyler> Why do you need to put the company colour in text?
20:30:55 <andythenorth> for the colour hints
20:31:15 <andythenorth> just "company colour, complementary company colour" is less good
20:31:29 <andythenorth> better to be direct
20:32:09 *** Speedy` has quit IRC (Ping timeout: 480 seconds)
20:32:47 <peter1138> I think it works better, otherwise there's no indication that some colour variations are fixed and others are CC-dependent.
20:33:56 <andythenorth> I tried both previously
20:34:54 <talltyler> I think โcompany colourโ is the most direct. If you change your company colour, the wagons will change.
20:36:38 <andythenorth> yeah I don't have the screenshots
20:36:44 <andythenorth> but it was somewhat worse
20:36:52 <andythenorth> as is 'complementary company colour'
20:37:15 <andythenorth> 'Company colour, complementary company colour, brown, grey'
20:37:28 <andythenorth> it's more cognitive work than 'red, pink, brown, grey'
20:43:32 <xarick> `long n = x + y * prime + _settings_game.game_creation.generation_seed;`
20:44:28 <xarick> any difference between long and int
20:45:29 <andythenorth> ok no badges for colours
20:45:45 <andythenorth> hmm, actual pixels? ๐
20:48:01 <stenyg> xarick: Long vs int is different sizes The long uses 64 bits. The int uses 32 bits, and so can only hold numbers up to ยฑ2 billion (-2^31 to +(2^31)-1).
20:49:00 <stenyg> while a long can hold -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
20:50:08 *** Speedyn has quit IRC (Ping timeout: 480 seconds)
20:50:55 <LordAro> stenyg: not always ;)
20:51:19 *** Speedy` has joined #openttd
20:51:45 <andythenorth> peter1138[d]: do I need to namespace badges somehow?
20:51:51 <andythenorth> e.g. horse_foo/bar?
20:54:36 <peter1138> Well, I don't think the purchase list name should change just because my company colour has changed.
20:55:04 <peter1138> For namespace... depends really. The are deliberately not unique to a NewGRF so that they can be shared.
20:55:43 <peter1138> On the other hand, if it's for some technical detail that wouldn't make sense for anything else ever, maybe.
20:56:05 <andythenorth> the case I have in mind is specific to Horse sprite resolution
20:57:42 <andythenorth> specific enough that I think `ih_ruleset_flags` is better than `ruleset_flags`
20:58:26 <andythenorth> some of the labels in that class will be specific to multiple unit trains
20:58:35 <andythenorth> `ih_ruleset_flags/my_fast_eurostar`
21:03:50 *** Speedy` has quit IRC (Read error: Connection reset by peer)
21:04:14 <peter1138> Alright, I'm slightly bored of one-change-at-a-time here ;)
21:05:02 *** Speedy` has joined #openttd
21:06:22 <peter1138> Hmm, vague idea about focus-stealing...
21:09:42 <stenyg> LordAro: Correct to that but in general . As a inte in some cases can only be 8 bits depending on architecture
21:20:46 <peter1138> Hmm, doing lots at once would be harder to review anyway.
21:23:59 <Rubidium> it depends on how similar the changes are, and whether they're trivial or not
21:24:40 <Rubidium> these last two enum class ones could've been one with two commits
21:31:54 *** gelignite has quit IRC (Quit: Stay safe!)
21:34:57 <xarick> i touched tgp, let's see how much it broke
21:39:20 <xarick> built with no warnings
21:39:38 <xarick> oh, nvm, i built master
21:41:03 <andythenorth> badgers will have to wait ๐
21:46:18 <LordAro> not all of it, certainly
21:46:31 <LordAro> remove the #define changes and you might have a shot
21:47:31 <LordAro> some of the changes in HeightMapSmoothCoastInDirection look wrong
21:48:19 <LordAro> as per usual, only make one sort of change at a time
21:48:22 <xarick> oops is valid tile x, x ๐ฆ
21:48:23 <LordAro> you've done a lot of changes
21:48:30 <LordAro> a lot of different changes
21:51:04 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:06:32 <xarick> looks like I didn't break it... so far
22:17:24 <peter1138> Hmm, I wonder what happened to r12566.
22:17:41 <peter1138> And r12568. Maybe they were in in a branch.
22:18:17 <peter1138> Ah probably, r12567 mentions "in trunk"
22:19:00 <Rubidium> svn commits that were missing were indeed likely in a branch
22:20:23 <xarick> LordAro: for clarification, you want me to change the #defines into functions, or the opposite, don't touch them?
22:20:34 <LordAro> xarick: don't touch them
22:20:49 <peter1138> What's the purpose of IRC if not for immediately realising the answer to your own question the moment you post it.
22:22:04 <peter1138> Hmm, I think I had a branch/stash for that one somewhere. What did I do...
22:24:15 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:43:19 <Rubidium> just keep a local branch to fix them, and once you've got a dozen or so make a PR?
22:43:35 <Rubidium> as there are definitely way more typos
22:45:53 <xarick> not much of a codechange
22:47:32 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:48:17 <Rubidium> you know there a document stating what to use, right?
22:52:51 <xarick> okay, seems to be Codechange
23:11:34 <LordAro> can't be much ZMA left now?
23:22:37 <peter1138> It's in every Window.
23:22:59 <peter1138> I have more patches to get rid of it, but because Window is everywhere, it's quite a bit change.
23:25:45 <goddess_ishtar> so when do I get my Developer role? ;p
continue to next day โต