IRC logs for #openttd on OFTC at 2024-09-27
⏴ go to previous day
00:02:30 *** Tirili has quit IRC (Quit: Leaving)
00:09:04 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
01:14:41 *** Smedles has joined #openttd
02:15:30 *** gnu_jj_ has joined #openttd
02:19:04 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
02:27:08 *** godbed_ has joined #openttd
02:30:34 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:30:39 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:59:27 *** bigyihsuan has joined #openttd
02:59:27 <bigyihsuan> what's the difference between `RoadType` and `RoadTypes`?
03:55:35 <bigyihsuan> i want to display a road type in a dropdown like below.
03:55:35 <bigyihsuan> 1. how do you get the dropdown to display a value in the first place (like a default value)?
03:55:35 <bigyihsuan> 1. how do you get a dropdown to display *specifically* a build-road roadtype dropdown row?
05:12:24 *** keikoz has quit IRC (Ping timeout: 480 seconds)
05:30:32 *** Guest4663 is now known as TinoDidriksen
07:59:05 <LordAro> bigyihsuan: iirc one is a bitset of the other?
08:23:38 <truebrain> I am still of the opinion that vcpkgs CI system is a very narrow set of "tests" 😛
08:24:31 <truebrain> but that you didn't test it with your own product (GitHub CI in this case) is kinda embarrassing 😛
09:07:15 <xarick> ShipPathCache is a deque
09:07:41 <xarick> how do I assert two deques to see if their contents match?
09:09:16 <xarick> assert(dummy_cache == dummy_cache2);
09:12:31 <xarick> yep, they're actually different
09:14:59 <xarick> why is it inconsistent 😦
09:18:25 <xarick> walking 28 trackdirs, put it at the entrance of top square
09:18:48 <xarick> one takes the path to the left, the other takes the path to the right...
09:56:33 <xarick> missing sprites or somethin?
10:17:56 <_glx_> truebrain: Still it takes hours to run all their tests
10:20:49 <xarick> `const bool node_water_patch_on_high_level_path = std::find(high_level_path.begin(), high_level_path.end(), node_water_patch) != high_level_path.end();`
10:20:49 <xarick> i think i found something where things diverge
10:21:19 <xarick> what exactly is high_level_path.end()
10:23:20 <xarick> i need a std::find(search from 0 to min(4, high_level_path.size())
10:30:09 <_glx_> First get an std::span then use std::find on it
10:37:12 <peter1138> bigyihsuan: RoadTypes is a bitmask of RoadType.
10:44:45 <xarick> how do i create a span? sorry, Copilot isn't helping
11:02:02 <xarick> well, it still asserts
11:16:21 <xarick> there's more afterwards
11:30:05 <xarick> high level pathfinder is at fault... it's all I can point so far for these divergences
11:30:32 <xarick> it does not consistently give the same paths
11:36:04 *** mindlesstux has quit IRC (Ping timeout: 480 seconds)
11:46:57 <bigyihsuan> bigyihsuan: Still looking for help on this. My current code has the dropdown successfully opening and selecting options, but it doesn't display that option in the dropdown box after selecting something
11:56:10 <bigyihsuan> ... Will I need to do some sort of hacky thing of building the dropdown list entry and setting it to OnDraw in the location of the dropdown...?
12:02:04 <peter1138> The WWT_DROPDOWN widget can display text quite easily.
12:04:24 <peter1138> Set string of the `WWT_DROPDOWN` to `STR_JUST_STRING`, then in the Window's `SetStringParameters()` check if widget is your widget, and use something like `SetDParam(0, GetRoadTypeInfo(road_type)->strings.name);`
12:09:47 <peter1138> If you want to do the icon as well, then you're in to custom drawing land, and... it's probably not worth it.
12:27:09 <_jgr_> bigyihsuan: I'll take a look at your PR after work
12:37:19 <peter1138> How long before we get the bug reports about no nightlies... 🙂
12:41:23 <LordAro> James is clearly slacking
12:53:17 <_glx_> checks for PRs are dead anyway so no possible merges
13:24:21 <johnfranklin> Lol, the phone autocorrected my typo (sufo) to sudo
13:53:50 <peter1138> Without yiffgirl there's no you?
14:19:36 <peter1138> So now you're drawing it twice.
14:20:17 <LordAro> feels like they might not have seen your comments and gone with the OnDraw method
14:21:40 *** HerzogDeXtEr has joined #openttd
14:21:50 <bigyihsuan> i saw the comments and attempted it anyway :bigunn:
14:22:07 <peter1138> Well, if you are manually drawing it, use STR_EMPTY for the string in theWWT_DROPDOWN widget.
14:22:34 <peter1138> (And don't do the stuff in SetStringParameters)
14:23:14 <bigyihsuan> using the SetDParam way works, at least. so i have a way to fall back on if this doesn't work
14:25:39 <bigyihsuan> setting to str_empty, but now the indexing is all sorts of weird. may want to abandon this method and instead use the setdparam method
14:26:13 <peter1138> Well, is it the correct road type?
14:26:20 <peter1138> Not sure why it needs weird indexing.
14:26:33 <peter1138> You just get the selected road types and use it.
14:28:15 <soylent_cow[m]> <johnfranklin> "sudo su root" <- i like sudo -i, though it appears to be a linux feature.... not seeing it in bsd man
14:34:33 <xarick> Observing what the high level path FindPath is doing...
14:35:16 <xarick> first I feed it with 4 origins
14:35:27 <xarick> does some search, and picks a path
14:35:37 <xarick> then i feed it with 1 origin
14:35:44 <xarick> picks a different path 😦
14:36:17 <xarick> i either don't understand pathfinders, or... something is broken
14:36:39 <xarick> the 1 origin is also present in the 4 origins
14:41:12 <xarick> why on the case of 4 origins, it didn't stop on the first path that had the destination but on the 1 origin case, it did?
14:41:27 <xarick> how does it decide when to stop
14:43:21 <xarick> im sure im missing some variables 😦
14:46:40 <_glx_> with 4 origins it checks all paths for the shorter one
14:56:49 <xarick> just noticed it always adds the path it just came from as a possible node
15:04:36 <xarick> looking at just the same origin (8,10,1), (8,10,2) was tested first on both runs, but the next step is where it diverges
15:05:58 <xarick> (8,10,3) was tested first on the 1-origin case, but on the 4-origin, (8,10,5) was first
15:06:35 <xarick> this little difference was enough to result in a different path 😦
15:09:42 <xarick> happened 1 step before
15:11:55 <xarick> 1-origin - 5. (8,11,2) -> 6. (9,10,4)
15:11:55 <xarick> 4-origins - 15. (9,10,4) -> 17. (8,11,2)
15:12:37 <xarick> who decides the order?
15:14:23 <xarick> but in the case of ties, what object goes first?
15:28:42 <xarick> /** Don't check for consistency. */
15:28:42 <xarick> # define CHECK_CONSISTY() ;
15:29:39 <xarick> /** Enable it if you suspect binary heap doesn't work well */
15:30:26 <_glx_> you can't compare runs with different start conditions
15:31:31 <xarick> is binary heap the better choice? i remember there were others
15:34:02 <bigyihsuan> bigyihsuan: W I D E
15:38:56 <bigyihsuan> bigyihsuan: wide and not as tall
15:49:48 <peter1138> Eh, the tallness was the dropdown 🙂
15:50:23 <peter1138> You shouldn't tweak those buttons, it'll make them harder to click.
15:51:04 <peter1138> Also, when designing UIs, do it with default fonts and font sizes at 1x or 2x interface scale.
16:01:49 *** akimoto has joined #openttd
16:14:02 <peter1138> (Also test it without all the road types loaded, etc)
16:16:35 <xarick> `inline bool operator<(const Node &other) const { return m_estimate < other.m_estimate; }`
16:17:10 <xarick> nevermind, it's a bad idea for sure
16:18:10 <xarick> binary heap dude is calling this
16:18:24 <xarick> he's the one responsible for ordering stuff
16:19:00 <LordAro> conceivably it should be sorting by something else if the estimate is equal
16:26:52 <talltyler> bigyihsuan: I would split that GUI into a toolbar for the terraforming tools (and the cursor size controls) and a land generation window for create, reset, and public roads.
16:27:38 <talltyler> Or maybe just split public roads into their own GUI
16:31:59 <bigyihsuan> but i'll try to take a look
17:04:29 <xarick> what is "hash table slot"
17:04:52 <xarick> but there can be 65536 different regions
17:06:05 <xarick> oh, nevermind, it also includes labels
17:06:41 <xarick> so... 65536 * theoretically 256 labels = big number trying to fit in 4096 slots
17:09:52 <LordAro> Rubidium: telling xarick to go read something hasn't worked yet
17:17:49 <truebrain> but maybe Rubidium breaks that cycle!
17:29:23 *** alfagamma0007 has quit IRC (Quit: User went offline on Discord a while ago)
17:31:02 <truebrain> This "Always Free" of Oracle Cloud seems to be malfunctioning at the end of the month 😛
17:31:37 <LordAro> £7.45? good grief, bin it immediately
17:31:52 <truebrain> the price is fine; even if they would charge us for all days, it would be fine
17:32:03 <truebrain> but ... why call something "Always Free" when it actually isn't, sometimes?
17:32:30 <truebrain> it was expected btw; we run 5 cores, where 4 are "Always Free"
17:32:31 <LordAro> do we go over some limit after 25 days?
17:32:38 <truebrain> so I guess they just calculate it per CPU minute or something
17:32:59 <truebrain> so it makes predicting your costs .. awkward
17:33:13 <truebrain> but I guess it is most fair; as in, you get the most "free" out of it
17:33:23 <truebrain> if you only run a workload for a day, even if it is with a lot of cores, it is still free
17:34:03 <LordAro> on that many cores :p
17:34:19 <truebrain> ah, yes, it is just a bit awkward described. It says: up to 4 VMs free. But later on, they say you get 3000 CPUhours free
17:34:21 <truebrain> that makes more sense 🙂
17:34:28 <truebrain> okay, I take it back; it does make sense, but it is just hard to read 😛
17:34:36 <LordAro> gotta read through the marketing
17:35:13 <truebrain> on none of the Cloud providers that is anywhere near "easy" 😛
17:35:28 <truebrain> I once again applied to the Cloudflare Open Source thingy; let's see if this year I do get a response 🙂
17:35:33 <truebrain> last year I never got a reply back ...
17:35:42 <truebrain> and reading their forums, I was not alone in that 😄
17:36:04 <truebrain> if Cloudflare wants to sponsor a bigger R2 for free, I can finally make my dream a reality: Cloud saves for everyone!
17:41:52 <LordAro> Buy_Cloudflare_Mornington_Transport_1974-09-09.sav
17:43:06 <truebrain> we now know average savegame files are ~3.1 MiB
17:43:11 <truebrain> so they aren't even that big 🙂
17:55:57 <peter1138> Hmm is vcpkg fixed yet...
18:04:16 <truebrain> can't believe the actual issue that they read env-vars case-sensitive, which on Windows doesn't work like that 😄
18:04:23 <truebrain> such a goofy thing to get wrong 😄
18:04:29 <truebrain> could have been us!
18:40:02 <xarick> I believe I found the culprit!
18:43:07 <xarick> it would be nice if this operation wouldn't change the order the items were at
18:46:41 *** akimoto has quit IRC (Ping timeout: 480 seconds)
19:39:12 <peter1138> Sounds like you don't want a binary heap.
19:40:55 <xarick> i dont understand binary heap
19:42:22 <xarick> does this look correct?
19:42:43 <xarick> [2] is higher than [3]
19:43:00 *** ChanServ sets mode: +v tokai
19:45:45 <Rubidium> we can't tell whether it is correct as you're providing too little information
19:48:53 <xarick> [1] is 0, [2] is 1600, [3] is 0, [4] is 1600, [5] is 1600, [6] is 1600
19:49:53 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
20:08:59 <xarick> it's removing [1], it's moving [3] to [1] and inserting a new one on [3]
20:10:40 <xarick> [1] is 0, [2] is 1600, [3] is 1600, [4] is 1600, [5] is 1600, [6] is 1600, [7] is 1600
20:11:15 <xarick> it kinda fixed itself... or
20:11:53 <Rubidium> ... it is doing exactly what a binary heap is supposed to do
20:14:21 <xarick> something gets out of order at some point
20:28:55 <xarick> looks like i found the problem
20:29:51 <xarick> it's removing [1], and inserting the new entry at [1], which happens to also be 1600
20:30:46 <xarick> so, all of them are 1600 now, however, the others 1600 have been inserted in descending order, but this one goes right to [1] 😦
20:33:21 <xarick> it has already inserted the previous one on spot 3, instead of spot 7
20:37:26 <xarick> doesn't handle ties graciously, it seems
20:41:50 <Rubidium> the way LordAro suggested hours ago
20:51:25 <xarick> i wanted to preserve order of insertion
20:54:05 <xarick> 2. Sounds like what I need
21:31:32 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
21:38:08 <truebrain> that would be a nice addition 😄
21:38:19 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
21:42:53 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:44:20 *** gelignite has joined #openttd
22:10:43 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:41:54 *** nielsm has quit IRC (Ping timeout: 480 seconds)
23:32:37 <bigyihsuan> bigyihsuan: separated into a new window
23:41:26 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
continue to next day ⏵