IRC logs for #openttd on OFTC at 2025-11-29
⏴ go to previous day
00:47:51 *** lobstarooo has joined #openttd
00:47:51 *** lobster has quit IRC (Read error: Connection reset by peer)
01:10:46 *** tokai|noir has joined #openttd
01:10:46 *** ChanServ sets mode: +v tokai|noir
01:17:40 *** tokai has quit IRC (Ping timeout: 480 seconds)
01:18:21 <jfkuayue> wait how i type this
01:19:00 <jfkuayue> space + touchpad middle button.
02:31:13 *** kuka_lie has quit IRC (Quit: Lost terminal)
02:54:05 *** Tirili has quit IRC (Quit: Leaving)
03:23:41 *** gnu_jj_ has joined #openttd
03:27:05 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:40:08 *** Wormnest has quit IRC (Quit: Leaving)
04:39:59 <DorpsGek> - Update: Translations from eints (by translators)
07:50:55 <mmtunligit> *dont code when youre tired, you make stupid mistakes*
08:03:16 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
08:23:25 <LordAro> mmtunligit: woah, deja vu
08:23:53 <mmtunligit> this PR has me feeling liek the entire circus
08:30:57 *** Zathras_4 has joined #openttd
08:50:49 <kuhnovic> I don't need to be tired to make stupid mistakes
09:02:41 <mmtunligit> does discord formatting come through on IRC?
09:03:04 <mmtunligit> or is it just the raw text
10:06:45 <mmtunligit> ah, so my italics for emphasis were not seen lol
10:13:28 <peter1138> Sort of. Discord just wraps text with asterisks for italics, which in the traditional world means bold.
10:15:31 <peter1138> Not sure which of those works, and which would get me banned from the server :)
10:21:51 <peter1138> *bold* _underlined_ /italic/
10:22:39 <mmtunligit> i wonder why it didnt adopt the standard
10:23:24 <michi_cc[d]> *italic* **bold** is Markdown syntax
10:23:32 <Borg> so.. Pernament Storage for Object (per GRF) was extended to 256 bytes...
10:24:01 <Borg> kinda exceesive.. anyway.. do we have Global Pernament Storage (per GRF) ? I could not find anything like that in newGRF spec..
10:24:05 <michi_cc[d]> So apparently Discord though thata Markdown sounded more modern than IRC 🙂
10:24:08 <peter1138> Borg, 256 entries, not 256 bytes.
10:24:19 <peter1138> And no, there is no per-grf storage.
10:24:21 <Borg> if so.. maybe smarter decision would be to do 128 entries per object.. and 128 entries global
10:24:39 <Borg> and those upper 128 entries could be accessible from whatever mode (general or related)
10:25:11 <Borg> maybe... do we have any newGRF that sport 256 entries of pernament storage?
10:25:32 <peter1138> Apparently 16 wasn't enough otherwise it would not have been extended.
10:26:05 <Borg> okey.. so still.. maybe some poll on tt-forums for this...
10:27:10 <Borg> another solution.. is to have yet another access mode.. like.. world.. are they any bytes free for this?
10:27:49 <Borg> so.. there could be 256 entries global.. but now.. moving data around would requires extra steps.. store into temporary.. (or use last chain result) and switch access mode.. and store data
10:31:23 <peter1138> Probably quite a few NewGRFs aren't going to work properly in 1.8 anyway.
10:32:16 <andythenorth> NewGRF isn't for map-global things
10:32:22 <andythenorth> For that you should use GS
10:32:25 <peter1138> andythenorth, snowline.
10:32:37 <Borg> andythenorth: can GS access pernament storage of objects now?
10:33:07 <Borg> also.. using GS for that would be excessive..
10:33:35 <andythenorth> peter1138: it never was a consistent rule eh 😛
10:33:53 <Borg> peter1138: no worries.. I can backport whatever I want to my fork :)
10:34:04 <Borg> but.. I pretty much play only w/ my own GRFs..
10:34:19 <peter1138> Or just switch your OS to Linux and run current OpenTTD.
10:35:04 <Borg> but im happy right now :)
10:36:54 <Borg> it seems there are free bytes for VarAction2.. 0x80 are reserved for this
10:37:12 <Borg> so having 83 87 8B for world/global variables is possible
10:37:39 <Borg> but.. if noone ever requested that :) might not be needed indeed...
10:37:53 <Borg> I was toying w/ global electricity idea today...
10:38:06 <Borg> per Town is interesting, especially in multiplayer.. but :) well. idea sparked
10:39:46 <peter1138> Parent Parent Parent scope.
10:39:49 <Borg> oh cant use 83 its for Parent scope
10:40:35 <peter1138> I'm not sure if 0x80+ is specifically reserved, or if just those values are treated specially.
10:40:40 <peter1138> In the code it's the latter.
10:41:17 <Borg> * if 80 or greater, this is a randomized or variational
10:41:21 <Borg> is this comment invalid?
10:42:57 <peter1138> It doesn't match the code, and I don't think it appears in the NewGRF spec.
10:44:01 <Borg> yeah it doesnt.. the question is about spec.. whatever values > 128 are allowed for sprites..
10:44:15 <Borg> that would be weird.. having holes reserved for special values
10:44:16 <peter1138> The spec never mentions that `num-ent1` and `type` overlap, and that you can't have a `num-ent1` of 0x80 or more.
10:44:42 <peter1138> I'm willing to bet that nothing does use other values > 0x80;
10:45:05 <peter1138> But the spec currently doesn't say no.
10:45:16 <Borg> 0x87 0x8B 0x8F would be ok [;
10:45:29 <peter1138> These days most current sets have no idea what num-loaded/num-loading are for.
10:45:41 <peter1138> NML kind made everyone use variables instead of those.
10:46:08 <mmtunligit> if i wanted to embed an editbox in a dropdown, is that something id have to change in the dropdown files or is there some other way to do it, i can think of a few ways to cheat it but id like to do it properly
10:49:38 <peter1138> You'd need to change the dropdown code.
10:50:05 <Rubidium> wait! what? you don't have a stash for that? :D
10:50:33 <peter1138> Until recently dropdowns always closed when you clicked, so... no :)
10:51:10 <peter1138> 914 files to compile, eesh.
10:51:27 <peter1138> (I tried rebasing an old branch, failed, and of course that means it's back to that old branch...)
10:52:41 <mmtunligit> additionally, should i make a separate PR for that?
11:13:44 <xarick> I'm experimenting unordered_map with a std::vector helper for the indexes sorting
11:14:15 <xarick> but i'm not getting it right yet for removal of items 😐
11:15:41 <xarick> 21 seconds adding 30 million items
11:16:28 <andythenorth> wonder how fast Horse would compile with 30 million trains
11:23:33 <peter1138> andythenorth, well, I did have a patch to increase the engine limit...
11:24:37 <mmtunligit> extremely wanting to cheat and have the collections dropdown menu just also open an editbox that looks like its part of the dropdown but technically isnt, i cant even begin to wrap my head around properly embedding one
11:24:38 <peter1138> But as variants are already a shit-show for AIs probably not wise :)
11:25:10 <peter1138> Separate window might work, but watch out for focus issues.
11:26:00 <mmtunligit> yeah, it just feels wrong and i dont want to be hacky but also i want something that works
11:28:52 <peter1138> Depends where you want the filter to be. If it's at the top of the dropdown, then adding an editbox at the top isn't too much hassle, right?
11:29:09 <peter1138> Then you can just have a parameter to turn that on/off.
11:30:30 <mmtunligit> yeah at the top wouldnt be hard, i guess i just have it my head that i shouldnt "cheat"
11:31:04 <peter1138> I can imagine that having an text filter to search for game language, currenty, etc, might be useful, as well.
11:31:32 <peter1138> ... in which case it's entirely possible to add editbox functionality as a separate PR that does that.
11:33:20 <mmtunligit> yeah, i can do the hacky way now and once its actually done and works i or someone else could go back and put something properly in the dropdown list. itd make searching through cargotypes so much nicer and imo, solve the whole railtype mess
11:33:26 <mmtunligit> just type in the thing you want
11:34:56 <peter1138> Should I have a go at the general dropdown-filter box?
11:36:12 <mmtunligit> yeah i think its a good idea and useful feature, and would also personally appreciate it, and seeing how you do it
11:42:23 <Borg> oh ;) I see some actions
11:52:19 <peter1138> But JGRPP already uses an additional type, though in traditional fashion it treats that as an extension which has more stuff behind it.
11:55:29 <andythenorth> that frosch post contains strong opinions 🙂
11:55:58 <andythenorth> is there any need for random action 2 that couldn't be substituted by something else?
11:56:07 <andythenorth> (obviously we have legacy grfs)
11:56:34 <peter1138> Should I leave the house today?
12:07:32 <Borg> oh so there are moar values in 0x80 range... still, my range fits :)
12:30:50 <andythenorth> typeahead widget 🙂
12:31:01 <andythenorth> can I hit enter to accept the result?
12:32:08 <peter1138> No, because at the moment it does absolutely nothing.
12:40:53 <Borg> the enter hit should work only when there is just 1 item left..
12:41:40 <peter1138> Step 1: make it work at all...
12:47:54 <peter1138> I actually forgot that it... works here for free...
12:49:13 <mmtunligit> yeah thats why i wanted to make it as an actual dropdown feature and not just a hack
12:49:33 <peter1138> Looks like you might not need to do any of it :D
12:50:14 <pickpacket> God I really want to get back to coding on the game. Life's been very busy
12:52:51 *** kuka_lie has joined #openttd
12:55:29 <peter1138> Okay, so you can stuff filterable text into a dropdown item, it doesn't have to be displayed.
12:55:49 <peter1138> Means it's possible to filter in badges attached to railtypes.
12:56:10 <peter1138> Of course nobody does that yet...
12:57:00 <peter1138> Should the height of the dropdown window shrink/expand? Hmm.
12:58:05 <michi_cc[d]> Hierarchical dropdowns with filters in level and freely configurable badge display and groupings in a window that can be detached to a floating toolbar /s
12:58:29 <peter1138> michi_cc[d], did you add text filter already?
12:58:54 <michi_cc[d]> No, only hierarchy, and not even configurable 😛
12:59:10 <peter1138> So no conflict there.
12:59:25 <michi_cc[d]> It was "synthesis" of all railtype selection PRs/ideas 🙂
13:01:13 <peter1138> Hmm, is it useful to filter the per-company vehicle menus?
13:01:24 <peter1138> The top-level ones.
13:01:37 <mmtunligit> does the filter text stay saved when you close and reopen the dropdown?
13:02:14 <peter1138> That's going to require some... engineering.
13:02:26 <mmtunligit> yeah i can imagine
13:02:53 <peter1138> Some kind of mostly-unique ID for each drop down.
13:03:02 <peter1138> But it may want to be shared for common things.
13:03:37 <peter1138> Currently I can't even turn it off, so everything has a filter.
13:04:41 <mmtunligit> yeah theres still work to be done before you get to that point, and saving the text wouldnt even be desireable in all cases
13:05:16 <mmtunligit> railtypes definently, my PR, i think so, to match the behavior of the other filters
13:05:23 <mmtunligit> game languge? probably not
13:05:58 <mmtunligit> only if the limit eve gets increased a bunch
13:06:01 <tabytac> yeah probable not (until that cursed 255 company patch gets merged into vanilla :P)
13:06:15 <mmtunligit> and you wouldnt want it in the sort-by dropdowns either
13:06:18 <peter1138> I think the language and currency lists are actually long enough to warrant filters.
13:06:29 <mmtunligit> no im not saying no filters
13:06:40 <mmtunligit> im saying saving the text wouldnt be desireable there
13:06:51 <mmtunligit> but it probably is in the railtype menu
13:09:27 <peter1138> What about when you don't have NewGRF railtypes loaded and there's only 4 types?
13:09:51 <peter1138> Basically -- trying to define an arbitrary cut-off point based on length is... tricky.
13:11:15 <mmtunligit> yeah youd want an option when drawing to only show the filter when X items or more are in the list, or if there are GRF items in the list
13:11:35 <mmtunligit> dunno which one is more useful long term
13:12:45 <mmtunligit> i know theres generally an "avoid magic numbers" directive which has me leaning to "show if GRF items exist"
13:12:56 <tabytac> im not sure if its worth hiding the filter box when you only have the default 4 track types (or 3 in some climates)
13:13:54 <peter1138> For consistency it's best to keep it there.
13:14:02 <tabytac> yeah thats kinda my thinking
13:15:24 <tabytac> can you publish your branch on this in gh peter? want to look at a few things if you dont mind
13:17:09 <peter1138> I've not even made a branch yet, it's just working-tree :)
14:09:05 <rito12_51026> michi_cc[d]: A total rework?
14:11:35 <michi_cc[d]> No, the /s at the end is kinda important 🙂
14:52:03 *** lobster has joined #openttd
14:58:49 *** lobstarooo has quit IRC (Ping timeout: 480 seconds)
15:01:58 *** Wormnest has joined #openttd
15:32:36 <Borg> I never did rebasing.. (or barely remembers).
15:32:51 <Borg> always just merging into topic.. and then back once done :)
15:32:57 <Borg> but I guess its not best workflow..
15:47:26 <Timberwolf> Can a game script get the current *calendar* date instead of the *economy* date?
15:53:13 <_glx_> well it's something to implement
16:08:43 <Timberwolf> Horrible idea: create story page, read date, delete.
16:53:05 <Rubidium> well... it could be missing capitalisation, e.g. This Things song is not the one I expected"
17:48:27 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
17:56:47 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
17:57:03 *** WormnestAndroid has joined #openttd
18:07:24 <xarick> after Randomize list dump which processed correctly, KeepTop10 screwed it over
18:12:08 <peter1138> For something should be sorted, unordered_map seems wrong.
18:14:16 <xarick> I have a vector with indexes sorted
18:17:54 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:18:03 *** WormnestAndroid has joined #openttd
18:21:00 <xarick> regression finally passes with unordered_map!
18:21:32 <xarick> im suspicious this will still be slow
18:27:41 <xarick> well, it is slow at removing
18:27:41 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:29:16 *** WormnestAndroid has joined #openttd
18:31:23 <peter1138> I remember wondering if there was some value that is invalid that could be used as a "is deleted" marker, but no, all keys and all values are valid.
18:34:22 <peter1138> Filtering a drop down list should probably also shrink the size of the dropdown?
18:43:17 <_glx_> Clear() is calling clear() on the containers, and its complexity is linear in the size
18:47:43 <_glx_> and for map, set, or vector the effect will be the same when clearing
18:51:58 <Rubidium> vector.clear() might be constant complexity
18:52:36 <peter1138> Yeah, map/set may have complex memory allocations behind the scenes. vector does not.
18:52:52 <peter1138> Argh at trying to resize a window :/
18:54:14 <xarick> this->keys is a vector
18:55:16 <peter1138> If it's unsorted, then yes you have to search each elemented.
18:59:27 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
18:59:29 *** WormnestAndroid has joined #openttd
18:59:50 <xarick> well, time to delete everything
19:00:19 <xarick> got this into a regression passable state but finding in a vector is just slow
19:01:21 <peter1138> Yeah, removing from a vector is faster when it's sorted, but you still need to move everything after it forwards, and when it's sorted moving everything after it backwards when inserting.
19:10:03 <peter1138> Hmm, string_filter.AddLine() isn't doing what I thought.
19:23:53 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
19:24:04 *** WormnestAndroid has joined #openttd
19:26:14 <peter1138> Maybe I need "unfilterable" items.
19:28:31 <peter1138> What about vehicles unloading at stations?
19:28:53 <peter1138> Also, what if they're waiting years on full load and nothing turns up.
19:29:08 <peter1138> Also, why am I writing here, not in the PR.
19:31:01 <talltyler> Unloading should be covered too, if I'm reading the code properly 🙂
19:31:27 <talltyler> If they wait for full load for years, they're not breaking down but they're also not making you any money...
19:33:12 <talltyler> Also friendly reminder that I'm trying to solve "players hate breakdowns and turn them off" not "everyone should play my way" 🙂
19:33:31 <peter1138> Friendly reminder that I'm just thinking of things, I'm not against it.
19:34:14 <peter1138> (Also "friendly reminder" is a phrase best left alone because it does have connotations.)
19:36:30 <xarick> unordered_map actually is interesting in a way
19:36:48 <xarick> items are ordered by insertion order
19:40:00 <peter1138> They can be but I'm not sure it's gauranteed to stay that way.
19:42:06 <_jgr_> Ordered by insertion order suggests that the hash function is broken?
19:42:29 <_jgr_> In any case you should not try to rely on that
19:43:49 <xarick> when i optimized river flow i used unordered set
19:44:04 <xarick> and i was counting on it to be ordered by insertion
19:46:44 <peter1138> Yup, don't rely on order. It's called "unordered" for a reason :)
19:47:31 <xarick> need to refresh my memory
19:48:48 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
19:48:58 <xarick> i'm only using to see if it contains inserted items
19:50:01 <xarick> i use the auxiliary vector queue for the ordered by insertion instead
19:51:08 <peter1138> Hehe, slightly broken when in bottom-up mode.
19:51:25 *** WormnestAndroid has joined #openttd
19:57:36 <xarick> copilot never tires of giving me alternatives to
19:57:43 <xarick> deal with ScriptList containers
20:08:23 * peter1138 mumbles about CONTRIBUTING.md
20:11:42 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
20:12:41 *** WormnestAndroid has joined #openttd
20:23:34 <peter1138> Okay. Filter persistence?
20:28:47 <talltyler> Fair enough, I did not intend any of the other connotations of the phrase “friendly reminder” 🙂
20:45:56 *** Borg has quit IRC (Quit: leaving)
20:49:50 <peter1138> Ok, persistent filter text is useful for rail type toolbar menus.
20:57:29 <_zephyris> @peter1138 I'm enjoying the filter. I think being at the top works is fine for infrequently used 'dumb ordered' (like alphabetical currency options). Not sure about the toolbars - probably best to keep the main option in the same position at the top, what are you thinking?
21:02:33 <peter1138> The filter *has* to be at the top (or bottom, for bottom-up menus). It is an "actual" widget, not a drop down item itself, so it cannot be positioned in between other items.
21:03:49 <peter1138> If some kind of sorting/configuring stuff is added later, if they are drop down items they will have to be below, or if they are also actual widgets that can be wherever they need to be in the layout.
21:13:28 <peter1138> "Why do so many rail types match 'AC'?"
21:14:00 <peter1138> Because JP+ Tracks puts the word "Track" on everything.
21:14:52 * Rubidium wonders whether enough people will get annoyed by that to file bug reports for the NewGRF
21:18:04 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
21:19:40 *** WormnestAndroid has joined #openttd
21:27:54 *** Wormnest has joined #openttd
21:36:46 <mmtunligit> peter1138: i was having the same bug the other day, was really weird and hard to get rid of
22:08:49 <peter1138> Hmm, okay, Windows.
22:20:11 * peter1138 ponders trying to rebase 14826 on to 14842.
22:22:00 *** kuka_lie has quit IRC (Quit: Lost terminal)
22:29:06 <peter1138> Probably sharing the text filter is not quite right :)
22:29:29 <peter1138> Possibly having a filter at all makes no sense.
22:42:50 <jfkuayue> I think I can easily distinct “British Chinese takeaways” and “real Chinese for Chinese” from the names of restaurants…
22:43:48 <jfkuayue> Wait there is another type
22:45:12 <jfkuayue> “The Ivy Asia” type, which you generally don’t go there
23:17:42 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:23:28 <honza_> could someone please give me advice why this check failed and how to solve it? I am little lost in github stuff
23:24:43 <_glx_> honza_: it's because you have merge commits, we prefer rebases
23:25:52 *** lobstarooo has joined #openttd
23:26:39 <honza_> I can see that, but I don't know how to revert or fix that
23:29:14 *** lobster has quit IRC (Read error: Connection reset by peer)
23:30:28 <michi_cc[d]> `git rebase origin/master` (or whatever your upstream branch is called). Rebase command will remove merge commits by defaut.
23:33:47 <honza_> it seems it is rebased to master, but how do I get rid of the merge commits? Should I squish them together?
23:43:56 <peter1138> honza_, reset to the first commit, the one you want to keep, and then rebase.
23:44:39 <peter1138> Of course, you're making it harder for yourself by committing to master on your local repository, instead of using a branch.
23:55:05 <honza_> git reset 5640f8b239cd13ce3c848a066ed8188fedc5ece
23:55:05 <honza_> git rebase origin/master
23:56:38 <honza_> if so, it does not seem to solve anything
continue to next day ⏵