IRC logs for #openttd on OFTC at 2024-06-17
            
01:34:05 *** silent_tempest has joined #openttd
01:34:05 <silent_tempest> peter1138: There are so many font styles
01:34:29 <silent_tempest> But like is there really a player out there who wants to use an italic font in OpenTTD?
01:36:27 <silent_tempest> I'm really tempted to just filter for the Medium,Regular styles
01:36:29 <silent_tempest> Maybe Bold?
01:45:02 *** Flygon has joined #openttd
02:09:51 *** debdog has joined #openttd
02:13:12 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:29:23 <DorpsGek> [OpenTTD/OpenTTD] Vinixss updated pull request #12769: Fix #12365: Company inauguration date should use calendar year in wallclock mode https://github.com/OpenTTD/OpenTTD/pull/12769
02:56:54 *** gnu_jj_ has joined #openttd
03:00:17 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:59:34 <DorpsGek> [OpenTTD/OpenTTD] Vinixss updated pull request #12769: Fix #12365: Company inauguration date should use calendar year in wallclock mode https://github.com/OpenTTD/OpenTTD/pull/12769
04:07:47 *** keikoz has joined #openttd
04:43:40 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/7db70f9c3feb96d7d19f7b0b07d0fad66283aba5
04:43:41 <DorpsGek> - Update: Translations from eints (by translators)
05:22:52 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:16:07 *** peter1138 has joined #openttd
06:16:07 <peter1138> What's the point of building a font picker and then not allowing the user to pick a font?
06:20:01 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12794: Codefix: Add missing `const` inside script functions. https://github.com/OpenTTD/OpenTTD/pull/12794
06:21:51 <LordAro> peter1138: why couldn't the existing function just have been marked const?
06:22:06 <peter1139> Sorry?
06:23:11 <LordAro> in the above, you duplicated thr function
06:23:55 <LordAro> i was going to comment, but then i wasn't logged in, so didn't
06:24:23 <peter1139> Because some users of it need the non-const version.
06:26:16 <LordAro> oh right, yeah
06:26:29 <LordAro> silly bit of c++
06:26:52 <peter1139> There is a way to avoid duplicating it, and that is to make the non-const version call the const version, but then return with a const_cast. But I'm not sure that works with const_iterator vs iterator.
06:30:23 <peter1139> We already had the non-const and const variants of the other function, GetCargoProduced.
06:47:25 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #12790: Add: Interface and classes to list system fonts. (WIP) https://github.com/OpenTTD/OpenTTD/pull/12790#pullrequestreview-2122007782
06:48:26 <peter1139> Okay, now for the standard OpenTTD benchmark. Wentbourne.
06:49:53 <peter1139> Oh except our release binaries are slower than my own binaries.
06:55:12 <andythenorth> I have found another GPT niche
06:55:35 <andythenorth> I often write a python module, slowly, with syntax errors, then look at it and realise why it's completely wrong, once it's "working"
06:55:35 <dwfreed> stealing people's copyrighted content?
06:55:45 <andythenorth> GPT automates that in about 3 minutes
07:13:29 <DorpsGek> [OpenTTD/survey-web] survey-summary[bot] pushed 1 commits to main https://github.com/OpenTTD/survey-web/commit/8bfa9f7d573cd99eb39e9dec928c9c205286ba28
07:13:30 <DorpsGek> - Add: summary for week 24 of 2024 (by OpenTTD Survey)
07:15:06 <peter1139> Hmm, so I guess my insert and remove are going to be slow, as it may have to move up to 63 other entries around to keep the list sorted.
07:17:50 <peter1139> Oh yes, and GB() doesn't like returning more than 32 bits, forgot about that.
07:27:28 *** YourOnlyOne has joined #openttd
07:33:02 *** toktik is now known as Guest9883
07:33:06 *** toktik has joined #openttd
07:33:07 *** Guest9883 has quit IRC (Remote host closed the connection)
07:54:34 <andythenorth> lunch?
08:07:16 *** kuhnovic has joined #openttd
08:07:16 <kuhnovic> Coffee.
08:07:32 *** ahyangyi has joined #openttd
08:07:32 <ahyangyi> Tea.
08:10:17 <truebrain> oeh, almost enough surveys to make quartily reports πŸ˜„
08:11:16 *** andriy has joined #openttd
08:20:28 * peter1139 ponders shuffling bits.
08:40:15 <andriy> Hey, I can't seem to open the game when compiling. I get "OpenTTD Game Console Revision 7 - 20240616-better_ui-maa82a525cb" in the terminal instead of a GUI window
08:41:22 <peter1139> Have you managed to build without SDL, and therefore got a dedicated-only server build?
08:41:50 <andriy> I don't know! but if so, that's funny :)
08:41:57 <peter1139> And... didn't you already build and run the game?
08:44:18 <andriy> Yea, a tonn of times, but for some reason it just doesn't work now
08:44:42 <andriy> And I don't think I corrupted my SSD yet, so all the packages should still be there
08:48:39 <ahyangyi> peter1139: Hmm, sounds nice
08:50:13 <ahyangyi> I should try build that too
08:50:49 <_glx_> Any added flag in start command ?
08:54:55 <andriy> I didn't add anything, now trying to compile in a different machine and test that. But I am 99% sure it's my fault :)
08:57:03 <andriy> Ok, I think I *did* corrupt my ssd! Because I have a built stock openttd, and it doesn't launch now
08:57:09 <peter1139> Added bonus effect, SDL sometimes has an ASCII-art mode...
08:57:51 <andriy> I get en error `Error: No available language packs (invalid versions?)`
08:58:03 <andriy> I will try updating my arch, mb that will fix it
09:02:48 *** andriy has quit IRC (Quit: WeeChat 4.3.2)
09:04:12 *** andriy has joined #openttd
09:05:24 <peter1139> That error just means your language files are built for a different version.
09:05:55 <andriy> It works now
09:42:55 <andriy> is there no way to set the maximum size of the widget?
09:52:05 <peter1139> Alright, moving the flags around makes this work better.
09:53:47 <peter1139> There's no way to limit the size of a resizable widget, we've never needed to.
09:54:48 <peter1139> For a non-resizable widget the size will be clamped in UpdateWidgetSize, but that's actually the minimum size which is almost the same thing if the widget is not resizable.
09:56:03 <andriy> I have a graph, and I have a list, I want both of them to grow, because 1. we want the graph to be able to become big, 2. We want to show the full names in the list, and making the minimal size of the widget to be the max number of chars in a company name * size of the widest char is just unresonable
09:56:49 <andriy> I am thinking mb Just making the of the list to be constant, and being OK with sometimes cutting the company name
09:58:06 <peter1139> Either you do that, or step -1 of your PR is implementing maximum widget sizes...
09:58:25 <andriy> I forgot that the original Key window had the same issues (although it was solvable in that case)
09:58:42 <andriy> I think I just keep that limitation
09:58:57 <andriy> It would be funny and compleatly in character for me to add max size
10:00:17 <peter1139> The graph window could do with non-1,1 resize step too, it's kinda jumpy when it's resized.
10:02:02 <andriy> But then It would be a pain to adjust, and not solve the issue, because the max size of the company name is 32 chars, and I think the widest char is W, and this *Does* take up half the screen. So if I make it able to expand to that size, The graph will have 2 sizes. 1 minimal, 2nd minimal + half the screen
10:05:27 <andriy> I don't think even maxsize would help, it would still make the selector widget take up half the screen
10:06:14 <andriy> You can check that by changing the name of your company to all Ws, and opening up the company window, The title uses FC_NORMAL, so you can see the actuall maximum size of the company name
10:06:22 <andriy> it's just huge
10:07:18 <andythenorth> truebrain: I hope the AI makes it for us
10:14:22 <DorpsGek> [OpenTTD/team] brmacd commented on issue #564: [pt_BR] Translator access request https://github.com/OpenTTD/team/issues/564
10:38:04 <peter1139> Stick with FS_SMALL like the current cargo filter ;)
10:39:33 <andriy> No way
10:39:38 <andriy> that is horrible
10:40:29 <andriy> If I do set the same size limit as the previous key window, then we are not loosing any functionality, we are not gaining as much functionality as possible, but we are not loosing any
10:40:32 <andriy> so its fine
10:43:26 <peter1139> Well, you are as you can't resize the graph to the same size -- unless your filter is turn-off-able.
10:43:45 <andriy> That is true.............
10:44:07 <andriy> Mb just make the company names wrap? :rofl:
10:44:57 <andriy> Actually I was thinking I should give myself 1 more week, and try to make it togglable
10:45:36 <andriy> If so, it would truly be a strict functionality superset
10:46:19 <andriy> ....well unless you have a vertical monitor.....
10:49:31 <peter1139> It's not yet clear to me why having it built in to the graph window is a benefit over the existing separate window.
10:51:06 <andriy> As of right now, I do have to agree with you.
10:52:17 <andriy> but then again managing separate windows is a bit more chalenging, especially because the Cargo graph exists
10:54:43 <andriy> Fine, I will make it a separate window
10:55:51 *** keikoz has joined #openttd
10:55:51 <peter1139> "It's not clear to me" doesn't mean "change everything" :)
10:56:23 <andriy> It's not clear to me either, so with a heavy heart I have to review my assumptions
10:56:33 <peter1139> Your PR doesn't even mention that the key is moved from the separate window to built in to the graph window.
10:56:56 <andriy> I made my PR to fail and gain feedback
10:57:10 <andriy> I was not expecting it to ever get merged in the current state
10:57:22 <peter1139> That's fine, this is just feedback too :)
10:57:35 <andriy> that is true :)
10:57:52 <_glx_> Makes me think the "toggle" button could just be removed and replaced with CTRL handling
10:58:11 <andriy> I already have double click configured to toggle
10:58:19 <andriy> but not everybody knows the shortcuts
10:58:51 <_glx_> Ctrl is quite common for multiselection in many softwares
10:59:07 <andriy> and because most of the controls of the graph are mouse controls, I think double click is very good, but Ctrl-click is fine too
10:59:23 <andriy> If I figure out how, I will add Ctrl-click to toggle too
10:59:42 <andriy> but honestly I don't see much benefit to ctrl-click as opposed to double click
11:00:18 <andriy> Or you mean Ctrl click to select multiple at the same time?
11:00:31 <andriy> And then apply an action like disable or enable?
11:00:36 <andriy> That is just slow
11:06:34 <andriy> I see a couple of common usecases with graphs:
11:07:26 <andriy> 1. Search for a sepecfic plot, to check it. In this case you can use the filter, or just scroll through, and click on the option you want. It will be highlighted over top of everything else
11:07:53 <andriy> 2. Compare 2 or more plots. Disable all, search and toggle everything you want 1 by 1
11:09:32 <andriy> 3. From the plot get the name. Click on the plot, if there are a lot of plots in the same space, you can click on the wrong one, and toggle it off untill you get to the correct one. I try to help minimize doing that, but when the lines are overlapping exactly, you have to do it
11:09:51 <andriy> and I don't see any scenario where it would be better to ctrl click to select multiple at the same time
11:10:03 <andriy> + the cost of implementation
11:12:58 <andriy> But I don't play this game that much, and I do agree that I might be wrong on this one and might be missing something, so please feel free to chime in
11:33:13 <DorpsGek> [OpenTTD/OpenTTD] JustLinuxUser commented on pull request #12793: Feature: Make the graph UIs more usable https://github.com/OpenTTD/OpenTTD/pull/12793#issuecomment-2173145805
12:13:16 *** asymptotically2 has quit IRC (Remote host closed the connection)
12:14:13 *** asymptotically2 has joined #openttd
12:45:43 <peter1139> Boop
12:52:08 <pickpacket> Beep
12:57:54 *** andriy has quit IRC (Ping timeout: 480 seconds)
13:17:46 <DorpsGek> [OpenTTD/OpenTTD] John2Baird opened issue #12795: Mouse Cursor Breaks when a physical mouse is being used on Android [Bug]: https://github.com/OpenTTD/OpenTTD/issues/12795
13:18:06 *** HerzogDeXtEr has joined #openttd
13:18:51 *** andriy has joined #openttd
13:19:48 <andriy> Beep?
13:21:13 <DorpsGek> [OpenTTD/OpenTTD] PeterN closed issue #12795: Mouse Cursor Breaks when a physical mouse is being used on Android [Bug]: https://github.com/OpenTTD/OpenTTD/issues/12795
13:21:16 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on issue #12795: Mouse Cursor Breaks when a physical mouse is being used on Android [Bug]: https://github.com/OpenTTD/OpenTTD/issues/12795
13:22:14 <andriy> You start with a Beep, you end with a Boop, what is so difficult about that? Damm those devs, can't get anything correctly ;(
13:24:30 <peter1139> You are, of course, entirely wrong. https://www.youtube.com/watch?v=Nd9MzxIbuQI
13:26:13 <andriy> Beep->BOOP!
13:26:31 <andriy> you can hear it, low beeeeep, boooop
13:28:25 <Eddi|zuHause> that's clearly a boop-beep
13:29:15 *** andriy has quit IRC (Quit: WeeChat 4.3.2)
13:32:27 <andriydohniak> I now think it's blip blop
13:33:22 <andriydohniak> (my irc client is a pain to use, I am open to any recomendations, preferably gui with discord-ish emoji and markdown support)
13:42:20 <peter1139> You could just use Discord.
13:44:48 <andythenorth> Lunch?
13:44:57 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1252257681947889675/IMG_7225.jpg?ex=66718f59&is=66703dd9&hm=b437fbc37bed4511d947dc0701cba0ced962d5ed4d6c443f05277214991c721c&
13:45:20 <LordAro> andriydohniak: irc has neither of those, why would any "support it" ?
13:45:55 <LordAro> terminal-based weechat certainly won't
13:47:40 <peter1139> Hmm, I think I need my MTB to get these squares.
13:48:32 <peter1139> andythenorth, you can't eat the bridge. Unless you're monsieur mangetout.
13:49:18 <pickpacket> andriydohniak: no markdown support, but thelounge.chat is super πŸ™‚
13:52:46 <andythenorth> Can GPT irc yet?
13:52:50 <andriydohniak> andythenorth: Do you think you can calculate the camera height based on this picture?
13:53:24 <andythenorth> Probably, it’s just maths? πŸ˜›
13:53:39 <andriydohniak> I don't belive you!
13:54:29 <peter1139> Between 5' and 6' above ground.
13:54:57 <andriydohniak> peter1139: What about above the river water level or sea level?
13:55:13 <peter1139> Are you changing the parameters of the question?
13:55:44 <andriydohniak> peter1139: I said camera height, I didn't say related to what
13:56:30 <andythenorth> If the image has the lens length in it, isn’t basic maths?
13:56:32 <andriydohniak> but now you are gona say that it's probably soma Cannon hand held camera and it's height is ~10sm
13:56:58 <andriydohniak> andythenorth: Idk, I wouldn't call it basic because I don't know it
13:58:10 <andythenorth> It’s just trig I imagine
13:58:40 <andythenorth> Height and width of the bridge piers is probably known
13:59:04 <andythenorth> And the towers on the hill in the background
13:59:54 <andythenorth> Could probably approximate it by drawing on a map in pencil
14:00:22 <andriydohniak> I think you need perspective matrix transformations to solve this
14:01:22 <andythenorth> I did technical drawing in school, geometry can do a lot on paper with no calcs at all
14:01:50 <andriydohniak> andythenorth: do it! and send a picture of it, I am very curious now
14:03:17 <andythenorth> Would need an Ordnance Survey map
14:04:35 <andriydohniak> andythenorth: Let's do a little friedly competition, and try to determine the height of the camera above water with any methods possible, and compare the results
14:05:08 <andythenorth> I could cheat and just check my phone
14:05:14 <peter1139> "any methods possible"
14:05:30 <andythenorth> Water is tidal btw
14:05:49 <andythenorth> One of the highest tidal ranges in the world
14:06:00 <andriydohniak> On this picture
14:08:59 <peter1139> The deck height is known. The tower height is known. From spective lines, the camera position. is above half way up the towers, but below where the cables attach.
14:10:18 <peter1139> perspective...
14:10:37 <andythenorth> There are background landmarks that make trig easy to find the lat-long point
14:10:51 <andriydohniak> https://cdn.discordapp.com/attachments/1008473233844097104/1252264199132942417/ridge.png?ex=6671956b&is=667043eb&hm=ab0191e05a324f42138bf19632541674c41064220b22c4a066774e1c1f0edf73&
14:10:51 <andriydohniak> Look at the water level difference
14:11:15 <peter1139> The bridge itself is enouhg of a landmark to know where the photo was taken.
14:11:56 <peter1139> Tides do that :)
14:12:15 <andriydohniak> I just wasn't expecting that much
14:16:01 <andriydohniak> I found this <https://riverlevels.uk/river-avon-saltford>
14:16:08 <andriydohniak> water levels in this river live
14:16:34 <andriydohniak> If only we find the exact date the picture was taken...
14:20:16 *** nielsm has joined #openttd
14:22:44 <andriydohniak> I can't find the image source, so I give up
14:31:14 <peter1139> The image source is andythenorth.
14:31:35 <peter1139> Unless you mean your dreary overcast picture.
14:33:48 * Rubidium wonders what you consider to be the camera in this instance
14:34:38 <Rubidium> or at least the reference point of the camera to take the height from
14:38:37 <LordAro> https://maps.app.goo.gl/x52YGAHxLzuTbtZg7 hardly need trig for this
14:51:40 *** techmagus has joined #openttd
14:53:26 *** YourOnlyOne has quit IRC (Ping timeout: 480 seconds)
15:02:35 <andythenorth> https://photo.stackexchange.com/questions/50816/how-to-determine-camera-location-from-an-existing-photograph
15:06:07 <Rubidium> andythenorth: that's under the assumption that there are no lenses/mirrors in between the camera and the photographed objects. There's not enough information to be sure that's the case for the photograph the discussion is about ;)
15:21:48 <andythenorth> did it strip the EXIF stuff?
15:22:29 <andythenorth> looks like it did
15:23:17 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1252282427569868901/image.png?ex=6671a665&is=667054e5&hm=c4909c9f7add386c67789783aa8ffd98ac88dcec906350f86549f3eaa504cc52&
15:23:17 <andythenorth> ok here we go
15:23:19 <peter1139> Hmm, inserts/appends are too common.
15:23:39 <andythenorth> also bonus points for anyone who can do it from shadow angle, given the time of day and date
15:23:57 <peter1139> How fast is std::popcount...
15:24:33 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1252282747226030243/image.png?ex=6671a6b1&is=66705531&hm=aa30c5d5ee60d65a1e9f215eaf36a5ef096ef7030dca66d4db3b6242b4cd0af9&
15:24:33 <andythenorth> this church tower in the background is hard to see in the discord png, but
15:25:47 <andythenorth> lat long 51.3990064424538, -2.636430767067154
15:26:00 <andythenorth> then it's just triangles
15:38:03 <andriydohniak> peter1139: Very fast, it will probably use popcnt instruction on most hardware
15:38:13 <andriydohniak> https://www.felixcloutier.com/x86/popcnt
15:38:59 <andriydohniak> and for larger bitsets if you have avx or other verctor extentions, it will probably use that
15:39:40 <andriydohniak> I was making a chess engine in rust (very basic one) and I used bitsets for board representation
15:39:50 <andriydohniak> So I learned all about it there
15:39:57 <Rubidium> andriydohniak: there being an instruction on most hardware doesn't necessarily mean that it's faster
15:40:50 <Rubidium> having said that, the old implementation of CountBits seemed to be slower than the std::popcount variant
15:41:00 <andriydohniak> Rubidium: https://news.ycombinator.com/item?id=20917832
15:41:07 <andriydohniak> 3 cycles
15:41:11 <andriydohniak> that is frigging fast
15:42:49 <Rubidium> andriydohniak: now read the fourth post of that page where the non-popcount version is significantly faster
15:42:52 <andriydohniak> but again, the implementation would probably need to mask off unused bits first (depends on how it stores the bitfield), mb move some registers around, so you should check the compiler output
15:43:30 <andriydohniak> Rubidium: Look at the compiler flags
15:43:46 <andriydohniak> he used haswell architecture
15:43:51 <andriydohniak> thats from 2013
15:43:52 <peter1139> Yes, I am actually counting bits up to a specific bit, and ignoring bits higher than that.
15:44:15 <andriydohniak> so you need to add 1 more AND op
15:44:35 <peter1139> And it's a 64 bit value.
15:45:32 <andriydohniak> https://cdn.discordapp.com/attachments/1008473233844097104/1252288026177048730/image.png?ex=6671ab9b&is=66705a1b&hm=03d602785e1ca4c54003201f46f1a0c08cf0919085c23b93c9d1b688f9b7909d&
15:45:36 <andriydohniak> also this
15:45:49 <andriydohniak> peter1139: How fast do you need this to be?
15:46:05 <andriydohniak> and what exactly is the purpose of this calculation
15:47:36 <andriydohniak> Rubidium: also look at how the compiler optimised it to be AVX instructions, last responce
15:48:17 <peter1139> Replaced a fixed-size array with a vector and a list (as a bitmask) of which array indices are used.
15:48:58 <Rubidium> andriydohniak: just remove the -march=haswell and it'll be even worse... because the default is much older
15:49:08 <peter1139> Potentially it's better just to store the index with each item, which is simpler but requires searching items to find the correct one.
15:49:39 <andriydohniak> peter1139: So you are adding and removing items randomly from your list, that's why you want the bitset
15:49:45 <andriydohniak> correct?
15:50:01 <peter1139> That also uses at least 1 byte (but potentially 8 bytes due to alignment) per item, whereas the bitmask is a fixed 64 bits.
15:50:35 <andriydohniak> peter1139: but you add and remove items 1 at a time, correct?
15:50:45 <andriydohniak> and you want the bit count to check the used size?
15:50:57 <peter1139> And and remove 1 at a time, and not very often. Get is way more common.
15:51:10 <andriydohniak> then just use a counter
15:51:24 <andriydohniak> increment when you put the item in, decrement when removing
15:51:33 <andriydohniak> as simple as that
15:51:57 <peter1139> No, it's not the size of the data. Vectors already have that.
15:52:52 <andriydohniak> I am gona re read your messages, because I don't get your data structure
15:53:23 <Rubidium> peter1139: so are you trying to find the bit index of the Nth set bit?
15:53:46 <_jgr_> I've done something along these lines with a CargoTypes bitmask, though it was not in any sort of fast path, I just wanted to reduce memory use
15:53:56 <andriydohniak> Rubidium: If so there is a separate instruction for that
15:54:04 <peter1139> Well it is entirely a CargoTypes bitmask :)
15:54:14 <andriydohniak> its called forward bitscan
15:54:31 <andriydohniak> https://www.felixcloutier.com/x86/bsf
15:54:33 <peter1139> And no, it is counting the number of set bits up to (and including) a specific bit.
15:54:58 <andriydohniak> peter1139: if its <= 64 bit, thats a mask + popcnt
15:55:32 <_jgr_> Test if the `1 << N` bit is set, and if so the offset is `std::popcnt(mask & ((1 << N) - 1))`
15:55:49 <peter1139> If I have a vector of 3 items, and the mask is set to 0b10001001, then the first item has an "index" of 0, then second item has an "index" of 3, and the last item has an "index" of 7.
15:56:41 <peter1139> A std::map could also do this, of course.
15:56:42 *** Ox7C5 has joined #openttd
15:57:13 <andriydohniak> peter1139: but that is kinda slow for 64 items
15:57:44 <andriydohniak> and what happens when you have item 1, and item 5, and you want to incert item 2?
15:57:57 <peter1139> That's the slow bit.
15:58:17 <peter1139> It needs to insert it between 0 and 1, moving 1 to 2.
15:58:22 <andriydohniak> you want this: https://en.cppreference.com/w/cpp/container/priority_queue
15:58:24 <andriydohniak> not vector
15:58:29 <_jgr_> If the vector size is capped at 64, it's likely fast enough that it's not worth worrying about
15:58:30 <peter1139> But in my brief testing that doesn't actually happen very often.
15:58:45 <andriydohniak> just add the index to the value, you can use std::pair for that
15:59:07 <andriydohniak> or create your own struct
15:59:12 <peter1139> IIRC priority_queue is something completely other :)
15:59:33 <andriydohniak> No, because it solves everything you want
16:00:00 <andriydohniak> You can insert an arbitrary numbered item, and it will place it correctly
16:00:03 <peter1139> For reference my implementation is called "StupidVector" because it's a stupid idea that I got carried away with :)
16:00:11 <andriydohniak> you can store the index with the value
16:00:17 <andriydohniak> so no need to calculate it
16:00:36 <andriydohniak> it is dynamic so it will save space when little items are present
16:01:12 <andriydohniak> Ok, I am wrong, this implementation only allows for getting the top item
16:01:30 <andriydohniak> but you can do a sorted vec
16:01:37 <andriydohniak> that what I was thinking about
16:04:40 <andriydohniak> https://cdn.discordapp.com/attachments/1008473233844097104/1252292843536515213/image.png?ex=6671b018&is=66705e98&hm=88f2dcabb8c79c3cbcbea51e9e3551fe114f68077f74b51f5ceb0ae62959d374&
16:04:40 <andriydohniak> It would look something like this
16:04:50 <andriydohniak> and the blue part is the vector
16:05:18 <andriydohniak> so when you want to add an item, you put it at the back, and sort the vector
16:05:54 <_jgr_> Putting it at the back and then re-sorting is not an efficient way to do inserts
16:06:28 <andriydohniak> _jgr_: I am not sure what exactly is it that he is doing, but I would assume most inserts to be sequentional
16:06:46 <andriydohniak> but yea, there probably are better ways of doing this
16:06:48 <_jgr_> You can just use lower_bound and insert
16:07:32 <peter1139> I don't search because the "index" is not stored with each item at the moment.
16:07:45 <peter1139> But I know precisely where to insert it, so that's easy.
16:08:11 <peter1139> This code is solved and works, I'm just considering performance :)
16:08:13 <_jgr_> If you can time travel into the future you can use std::flat_map to do the std::vector<std::pair> stuff for you
16:08:45 <andriydohniak> peter1139: we are talking about 64 elements here! A syscall probably takes longer
16:10:26 <_jgr_> _jgr_: Hmm, actually this is not what I thought it was, bit disappointing
16:10:49 <andriydohniak> peter1139: how big is your item size?
16:12:03 <peter1139> In one use, a mere 16 bytes, in another use, it's 136 bytes.
16:12:13 <peter1139> That sounds tiny, but.
16:12:39 <peter1139> 16 * 64 = 1024 bytes, and 136 * 64 = 8704 bytes.
16:13:35 <peter1139> This is of course still in "what's the point" territory.
16:14:33 <_jgr_> At a wild guess, is the latter one struct GoodsEntry?
16:14:37 <peter1139> Yup
16:15:23 <peter1139> When we (I mean I) bumped the number of cargo types I didn't pay much attention to it.
16:15:51 <andriydohniak> peter1139: I think saving 8k you are mb saving some memory, but I think you are definitly making it slower then a fixed size array
16:16:21 <andriydohniak> I think at 8k*.....
16:16:31 <peter1139> 8704 bytes per station :)
16:16:45 <peter1139> It is not much but adds up.
16:17:18 <_jgr_> StationCargoList and FlowStatMap are both a bit fat, I just moved those out of GoodsEntry into another struct via unique_ptr
16:17:24 <andriydohniak> peter1139: But how often is the array accesed? when the train comes, or more often?
16:18:34 <peter1139> _jgr_, yeah, that's probably more sane :)
16:20:00 <peter1139> I moved some of the flags out of GoodsEntry::status as otherwise it would create an entry just because it's accepted nearby.
17:13:10 <peter1139> I wish C++ had a C# style `?.` (`?->`) operator.
17:16:13 <LordAro> you could achieve it with a std::optional/unique_ptr style type
17:22:09 <peter1139> Ah yes, the C++ solution is "don't allow nulls"
17:29:18 *** gelignite has joined #openttd
17:37:30 <LordAro> https://stackoverflow.com/a/77887874 easy. lol
17:59:29 *** Wormnest has joined #openttd
18:09:02 <silent_tempest> peter1138: I see your point. 160 options is also a lot.
18:09:49 <silent_tempest> Prioritizing the fonts seems like a good solution
18:10:18 <silent_tempest> I mena intelligently sorting the list seems like a good idea
18:10:34 <silent_tempest> mean*\
18:27:39 <peter1139> I sorted families by name, and fonts by weight.
18:27:45 <peter1139> This is mostly "standard".
18:29:13 <peter1139> I could just PR my font chooser at this point, it does already work.
18:35:05 <silent_tempest> Do or don't. But please make a decision and stick by it
18:42:07 <andythenorth> ooof
18:42:22 <andythenorth> I just tried to ffwd reality to make my AWS scheduled job run
18:46:11 <peter1139> Yes but did you?
18:46:54 <andythenorth> no I had to run it at 1x like everyone else
18:47:02 <peter1139> Hmm, maybe limit fonts by language should be togglable.
18:47:08 <andythenorth> GPT has crashed
18:47:23 <andythenorth> and AWS isn't logging my scheduled job
18:47:27 <peter1139> It's have an existential crisis.
18:47:30 <andythenorth> lunch?
18:47:47 <silent_tempest> andythenorth: Already working on it
18:47:56 <silent_tempest> Why do you post that in the chat?
18:48:03 <silent_tempest> Do you know someone here IRL?
18:50:05 <andythenorth> it's a mem
18:50:24 <silent_tempest> ok
18:52:45 <LordAro> gotta love the mems
19:01:13 <peter1139> Hmm, which bit do I fix first...
19:02:18 <silent_tempest> Did you make a decision then Peter?
19:06:03 <andythenorth> hmm is there some big outage? πŸ˜› GPT is down and Blitz πŸ˜›
19:06:21 <silent_tempest> NFL Blitz? πŸ˜›
19:06:28 <silent_tempest> What is Blitz actually
19:06:45 <andythenorth> mobile game
19:08:59 *** Ox7C5 has quit IRC ()
19:11:34 <peter1139> Rebase and recompile, rebase and recompile.
19:12:40 <peter1139> Hmm, can I make runs use the same data structure.
19:17:02 <peter1139> Oh, there are two data structures that are very similar.
19:19:27 <peter1139> This is a weird combination of generic interface and code duplication.
19:23:20 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
19:34:48 *** gelignite has quit IRC (Quit: Stay safe!)
19:45:06 <andythenorth> pff I have AWS triggering notifications
19:45:11 <andythenorth> and I play Blitz while I wait
19:45:17 <andythenorth> but the notifications capture the mouse πŸ˜›
19:45:23 <andythenorth> bad gaming experience
19:53:04 *** YourOnlyOne has joined #openttd
19:54:37 *** techmagus has quit IRC (Ping timeout: 480 seconds)
19:59:07 <peter1139> Ah yes, if fonts are comma-separated, then I can't have "family, style".
20:01:09 <silent_tempest> Okay so you'll be uploading your own PR then?
20:02:19 *** YourOnlyOne is now known as techmagus
20:05:37 *** m811 has joined #openttd
20:07:32 *** moll has quit IRC (Ping timeout: 480 seconds)
20:31:15 <peter1139> I guess using separator other than , will be fine.
20:32:22 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:43:27 <peter1139> I have no font with a ";" in its name.
20:48:03 <silent_tempest> Is the IRC bridge working properly?
20:53:21 <aperezdc> silent_tempest: seems to be, I read you in IRC just fine :]
21:03:09 <silent_tempest> Okay thanks
21:03:46 <silent_tempest> Did i do something wrong?
21:15:14 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12796: Codechange: Avoid making copies of layout runs. https://github.com/OpenTTD/OpenTTD/pull/12796
21:28:22 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:32:19 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #12796: Codechange: Avoid making copies of layout runs. https://github.com/OpenTTD/OpenTTD/pull/12796#pullrequestreview-2123940911
21:58:55 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12796: Codechange: Avoid making copies of intermediate layout runs. https://github.com/OpenTTD/OpenTTD/pull/12796
22:47:57 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:31:28 *** YourOnlyOne has joined #openttd
23:33:06 *** techmagus has quit IRC (Ping timeout: 480 seconds)