Config
Log for #openttd on 2nd June 2024:
Times are UTC Toggle Colours
00:36:44  <_glx_> oh dependabot doesn't fork but creates branch in the repo, so a PR build is possible
01:06:51  <emperorjake> _glx_: That wax my first GRF. In earlier versions a I forgot to set the correct GRF version, and I had to fix it when OTTD stopped supporting obsolete GRF versions
01:11:00  <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #12745: Upgrade: Bump Apple-Actions/import-codesign-certs from 2 to 3 in the actions group https://github.com/OpenTTD/OpenTTD/pull/12745#pullrequestreview-2092196413
01:36:03  *** gelignite has joined #openttd
02:09:01  *** tokai|noir has joined #openttd
02:09:02  *** ChanServ sets mode: +v tokai|noir
02:15:46  *** tokai has quit IRC
02:26:05  *** debdog has joined #openttd
02:27:15  *** gelignite has quit IRC
02:29:29  *** D-HUND has quit IRC
02:51:34  *** gnu_jj_ has joined #openttd
04:41:31  <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/0d10c5e93c868deb12f04e92b36d07c2f5be16a9
04:41:32  <DorpsGek>   - Update: Translations from eints (by translators)
04:52:25  <yiffgirl> subgroups show up in main groups as greyed out, but only if not grouped by shared order
04:52:25  <yiffgirl> It would be nice if that worked as well but I guess you'd need some kind of "only some of this shared-orders grouping is within a subgroup" indicator
04:53:22  <yiffgirl> hm, that's one term for two separate concepts.
04:56:29  <yiffgirl> a vehicle can only ever have one set that it shares orders with but can be in any number of hierarchical player-made groups
05:51:06  <DorpsGek> [OpenTTD/OpenTTD] michalc commented on discussion #12744: How are older versions of AI Libraries downloaded from BaNaNaS? https://github.com/OpenTTD/OpenTTD/discussions/12744
06:02:04  *** SigHunter has quit IRC
06:24:35  <peter1138> Groups are unrelated to shared orders.
06:33:57  <andythenorth> time to refactor FIRS GS?
06:34:00  <andythenorth> probably
06:41:49  <andythenorth> should the GS and the GRF share common lang file?
06:55:07  *** SigHunter has joined #openttd
06:59:34  <pickpacket> Why does the town bribe setting matter in this condition? https://github.com/bjornwarmedal/OpenTTD/blob/master/src/town_cmd.cpp#L3568
07:00:39  <pickpacket> hate all the negative conditions in that function... "Is the company not able to bribe?"
07:11:56  *** Wolf01 has joined #openttd
07:46:19  <DorpsGek> [OpenTTD/eints] Kukoluk commented on issue #190: Software on windows ? https://github.com/OpenTTD/eints/issues/190
07:50:22  <DorpsGek> [OpenTTD/eints] PeterN commented on issue #190: Software on windows ? https://github.com/OpenTTD/eints/issues/190
07:57:47  <DorpsGek> [OpenTTD/eints] Kukoluk commented on issue #190: Software on windows ? https://github.com/OpenTTD/eints/issues/190
08:02:46  *** gelignite has joined #openttd
08:09:22  <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12746: Fix: Editbox behaved poorly with RTL languages and when editing long text. https://github.com/OpenTTD/OpenTTD/pull/12746
08:29:13  *** Flygon has joined #openttd
08:42:07  *** SigHunter has quit IRC
08:43:27  *** SigHunter has joined #openttd
08:47:29  *** SigHunter has quit IRC
08:49:42  *** SigHunter has joined #openttd
09:09:45  <Eddi|zuHause> pickpacket: that condition says: "only take the <unwanted> part into account if that setting is set, otherwise ignore it"
09:11:02  <Eddi|zuHause> (presumably "unwanted" means "has been caught bribing recently")
09:12:46  <pickpacket> oh!
09:14:18  <Eddi|zuHause> if bribing is disabled, you can't have been caught bribing.
09:14:26  <Eddi|zuHause> so checking for that is meaningless
09:16:23  <pickpacket> makes sense
09:17:04  <pickpacket> in other news my computer is very slow... Started compile a couple of hours ago now and it's still not done ๐Ÿ˜‚
09:17:06  <Eddi|zuHause> possibly that check is there so when you disable bribing mid game you're not eternally stuck on being banned
09:19:42  <pickpacket> isn't it strange that the bribe setting is a condition for showing any actions at all?
09:20:01  <pickpacket> I must be reading that code wrong but that's what it looks like to me
09:22:14  <pickpacket> OH!
09:22:17  <pickpacket> Yes
09:22:19  <pickpacket> that makes sense
09:22:24  <pickpacket> I'm a potato
09:55:14  <pickpacket> Never noticed before, but I'm getting warnings about variables that may be unitialised on first use. Should we do something about that?
09:55:30  <pickpacket> we = I, if notbody else is faster
10:15:32  <andriydohniak> Where are chunks like "ENGN" defined, and how are their sizes calculated on save / load?
10:21:11  <merni> PeterNviaGitHub: Does this solve https://github.com/OpenTTD/OpenTTD/issues/12357 ?
10:31:05  <_glx_> pickpacket: I think you get 4 warnings, release builds triggers them with GCC 12
10:34:00  <pickpacket> _glx_: possibly. Wouldn't it be better to get 0? :)
10:34:21  <andriydohniak> MY PATCH FINALLY WORKED!!!!!!!!!! ๐ŸŽ†
10:34:25  <andriydohniak> 10s ago
10:34:45  <andriydohniak> I was able to save the game with the new format, load it, do local multiplayer
10:34:59  <pickpacket> andriydohniak: ๐Ÿฅณ Well done!
10:35:00  <andriydohniak> I am sooo happy I figured it out!
10:35:18  <pickpacket> ride that high! You deserve it!
10:35:35  <andriydohniak> pickpacket: Now it's time to test it well, and clean it up
10:35:58  <andriydohniak> btw, if you don't know, I added more company support
10:36:08  <andriydohniak> for now up to 240
10:36:25  <pickpacket> I started a compile that ran for nearly three hours (my computer is crap and I love it, don't ask) before crashing at 88% because I had a typo in a variable name ๐Ÿ˜‚
10:36:36  <pickpacket> andriydohniak: REALLY???? THAT'S EPIC!!!
10:37:03  <andriydohniak> pickpacket: Yea, it took me 3 full days of work
10:37:09  <andriydohniak> and I had to patch the save format
10:37:17  <andriydohniak> and add another data type for saving
10:37:22  <andriydohniak> but I think it should work now!
10:37:28  <pickpacket> AMAZING!
10:37:33  <andriydohniak> pickpacket: This is NOT fun :)
10:37:35  <pickpacket> It would've taken me MONTHS
10:37:53  <andriydohniak> pickpacket: If I had your PC, it would have taken me years :)
10:38:14  <andriydohniak> for me a fresh compile is ~5 min, and a small change is from 1-3 min
10:38:15  <pickpacket> I've been wanting to do it but totally shied away because I know I wouldn't be able to finish it
10:38:35  <pickpacket> haha, if I were to do a large change I would use my work laptop
10:38:49  <pickpacket> for now it's just a couple of lines.
10:39:01  <andriydohniak> pickpacket: I am not a c++ dev, I am not an openTTD long time player, I just asked a question: How hard could it be?
10:39:13  <pickpacket> besides my todo list for the day is scrapped anyway because I kidnapped a cat
10:39:20  <andriydohniak> pickpacket: This is not right, are you running a debug build or release build?
10:39:21  <pickpacket> I'm not a C++ dev either :)
10:39:25  <pickpacket> release
10:39:29  <andriydohniak> Why?
10:39:33  <andriydohniak> It takes soo much longer
10:39:43  <andriydohniak> Do a debug build, with -O0
10:39:57  <pickpacket> uh... honestly just because it was the last cmake command in my history ๐Ÿ˜†
10:39:59  <andriydohniak> it will be much faster to build, and much usefull to patch
10:40:24  <andriydohniak> pickpacket: Read COMPILING.md, it tells you everything you need to know
10:40:45  <pickpacket> I should remember this...
10:40:59  <pickpacket> been a few months since last I did this
10:41:35  <pickpacket> that doc says a release build is faster, though
10:42:08  <pickpacket> I'm on debian, if that makes a difference
10:42:14  <andriydohniak> but TLDR:
10:42:14  <andriydohniak> mkdir build
10:42:14  <andriydohniak> cd build
10:42:14  <andriydohniak> CXXFLAGS="-O0" cmake ..
10:42:14  <andriydohniak> make -j "number of cores"
10:42:29  <andriydohniak> pickpacket: It's faster to run, but slower to build
10:42:39  <pickpacket> oh!
10:42:42  <pickpacket> thanks!
10:42:48  <andriydohniak> no prob
10:44:19  <pickpacket> I definitely want to check out your PR when it's finished, too :)
10:44:39  <andriydohniak> Also, when you change a compile flag, or change some setting in CmakeLists.txt, you have to rerun `CXXFLAGS="-O0" cmake ..` and `make clean`, `make`
10:44:50  <pickpacket> I've played with up to 64 companies in a heavily modded and pretty buggy version before
10:45:09  <pickpacket> Check!
10:45:22  <andriydohniak> pickpacket: I will add compatibility for loading older maps, and hopefully in 5-6 hours, I can publish a prototype
10:45:44  <andriydohniak> pickpacket: I think that might have been the Siffing Brit's version
10:46:06  <pickpacket> that one indeed! Did you play with us?
10:46:29  <pickpacket> I played in both the first big game and the battle royale
10:47:19  <andriydohniak> pickpacket: No, I started playing openTTD < 1 week ago ๐Ÿคฃ
10:47:27  <pickpacket> :D
10:47:43  <pickpacket> the first thing I did when I started was to build a NewGRF to add tea to the game!
10:47:57  <pickpacket> because, y'know, "how hard can it be?"
10:48:00  <pickpacket> :D :D
10:48:04  <andriydohniak> I literally just watched a tutorial, played some single player, watched the Spiff's video, and when I joined multiplayer, I asked why is there a 15 player limit
10:48:15  <andriydohniak> and "How hard would it be to change that"
10:48:27  <pickpacket> "because there are only 15 company colours"
10:48:29  <andriydohniak> the answer is "Very hard (for me) but possible)
10:48:40  <pickpacket> do you have any dev experience?
10:48:58  <andriydohniak> pickpacket: In c++ no, but I know rust, C, java, a bit o python
10:49:14  <pickpacket> Solid background!
10:49:20  <andriydohniak> pickpacket: The colors were the easyest thing to fix
10:49:25  <pickpacket> yeah?
10:49:33  <andriydohniak> yea, I just made them repeat
10:50:12  <andriydohniak> What was was the real challenge, is making sure that the every tile has enough memory to store the bigger owner indexes
10:50:13  <pickpacket> pretty same for me re dev background. C, Java, Python, Perl (object oriented at that), Ruby, a ton of shell scripts
10:50:21  <andriydohniak> and also storing bitsets of the owners
10:50:32  <pickpacket> wait... the tiles?
10:50:38  <andriydohniak> pickpacket: yep
10:50:41  <pickpacket> wow
10:50:58  <pickpacket> just so you know you're my personal hero of the day
10:50:59  <andriydohniak> It took me a lot of time to figure that out, and a lot of help
10:51:05  <andriydohniak> pickpacket: ty!
10:51:27  <pickpacket> :)
10:51:34  <andriydohniak> pickpacket: I literally started with 2 variable change, and thought that was it ๐Ÿคฃ
10:51:46  <andriydohniak> then 100 lines change, and I thought that was it
10:51:53  <andriydohniak> And repeat for like 10 times
10:52:04  <andriydohniak> Now I think this is it, but I am probably wrong
10:52:15  <andriydohniak> but at least the Proof of concept works
10:52:17  <pickpacket> That is a *big* dev effort. Amazing :)
10:52:39  <andriydohniak> Ok, gona go code!
10:52:44  <pickpacket> I've literally just changed a few if statement conditions and a tool description
10:52:45  <andythenorth> well
10:53:09  <andythenorth> I wonder how slow my GS event handling will be
10:53:13  <andriydohniak> pickpacket: That's a VERY good place to start
10:53:24  <pickpacket> :)
10:53:56  <andythenorth> oh lol, event handling blocks on news messages I think
10:54:28  <andythenorth> no, it's just slow to get through the queue
10:54:53  <andythenorth> "storybook buttons known to be unresponsive" ๐Ÿ™‚
10:55:22  <pickpacket> lol
10:57:54  <_glx_> andriydohniak: Default cmake does debug build, no need for `-O0`
10:58:27  <_glx_> But debug builds are super slow when running
10:59:29  <andriydohniak> _glx_: But for some reason the COMPILING.md says that -O0 is a good option
10:59:41  <andriydohniak> and I think the default is Release with debug info
10:59:53  <andriydohniak> so optimised but includes debug info
11:00:00  <_glx_> No, default is Debug
11:00:17  <andriydohniak> Are you talking about debug info, or optimisation level?
11:00:51  <_glx_> You need explicit CMAKE_BUILD_TYPE for anything other than Debug
11:02:04  <andriydohniak> _glx_: Debug with capital D, is a cmake profile, not a debug build. It is used for debugging, but the opt level is just a cmake setting
11:02:07  <johnfranklin> So pickpacket, why were you so passionate with tea last year?
11:03:18  <andriydohniak> _glx_: Actually, you are right
11:03:30  <pickpacket> johnfranklin: last year? I've been passionate about tea for... a long time...
11:04:12  <pickpacket> :D I drink more tea than water. I drink more tea than anyone else I've ever met. I'm not a tea geek or anything, but I enjoy it very very much
11:04:16  <pickpacket> not sure how that started
11:04:29  <johnfranklin> You released Tea Tea Deluxe 1.5 years ago
11:04:57  <pickpacket> yeah, but I loved tea long before I discovered OpenTTD :D
11:05:04  <johnfranklin> Wouldn't tea cause insomnia?
11:05:18  <peter1138> merni: Probably yes
11:06:00  <pickpacket> johnfranklin: I dunno... I only drink up to four or five pots a day... After 19:00 I try to stick to rooibos, but black tea is really my favourite
11:06:18  <pickpacket> when I've had trouble sleeping it hasn't been because of that
11:08:15  <peter1138> Only 5 pots a day, lol
11:09:01  <johnfranklin> How large is a pot?
11:10:05  <andriydohniak> There are some true Bri-ish people over here ๐Ÿคฃ
11:10:11  <peter1138> My loose tea pot is about 1 ltr
11:10:20  <johnfranklin> Pickpacket is German
11:10:22  <johnfranklin> IIRC
11:10:45  <peter1138> Nsh, Brits just use teabags and mugs.
11:11:07  <peter1138> And milk, of course.
11:11:36  <andriydohniak> https://en.wikipedia.org/wiki/List_of_countries_by_tea_consumption_per_capita
11:12:55  <johnfranklin> Strange, China is not at front
11:12:55  <johnfranklin> Most elderly here drink tea
11:13:24  <alfagamma7> peter1138: Eh that's how tea should be consumed
11:13:25  <andriydohniak> johnfranklin: but probably not in such high amounts
11:13:37  <johnfranklin> Or "tea" is restricted to some special types
11:13:41  <andriydohniak> alfagamma7: add lemon to it too ๐Ÿคฃ
11:13:58  <alfagamma7> I like coffee more so idc
11:14:21  <andriydohniak> the joke is that milk and lemon is not a good mix
11:14:30  <alfagamma7> I know
11:14:33  <andriydohniak> ok
11:14:36  <peter1138> Mmmm curdled
11:14:40  <johnfranklin> It would let milk become solid
11:15:03  <johnfranklin> I think Indians know it very much
11:15:07  <andriydohniak> peter1138: I never actually tried mixing tea with lemon and milk, mb curdled is better?
11:15:52  <peter1138> Unlikely.
11:16:04  <alfagamma7> People do like black tea with milk
11:16:18  <andriydohniak> alfagamma7: green + milk tastes weird
11:16:34  <alfagamma7> Though I find it to be less tea and more like something else
11:17:00  <alfagamma7> andriydohniak: Sounds horrific
11:17:14  <johnfranklin> Many bubble tea stores in China (they are very popular among young here) use green + milk
11:17:15  <andriydohniak> alfagamma7: not horrific, I finished it, I just didn't like it
11:17:32  <johnfranklin> I don't know if Longjing is green, if yes, then
11:17:42  <alfagamma7> No idea
11:18:03  <alfagamma7> But I believe China has more varieties of tea compared to India
11:18:16  <andriydohniak> johnfranklin: Just googled it, it is
11:18:38  <johnfranklin> We have a lot variety of green tea
11:19:12  <alfagamma7> I heard a lot about tea from a Chinese Singaporean once
11:19:36  <johnfranklin> But about black ones, not so much
11:20:06  <andriydohniak> johnfranklin: watch a SpiffingBrit video ๐Ÿคฃ
11:20:34  <andriydohniak> he will tell you all about that teeth yellowing mixture
11:25:05  <pickpacket> johnfranklin: my pot is 1.2 litres :) And I'm Swedish
11:25:28  <johnfranklin> What, 5L of tea in one day...
11:25:59  <johnfranklin> Oh, swedish also has รถ letter
11:27:08  <pickpacket> Most days it's only 4 pots. Or there abouts. One pot in the morning before I go to work. 6-8 cups during my 6h work day, usually another two pots after I get home
11:27:35  <pickpacket> well, mugs
11:27:47  <johnfranklin> theophyllinaholic?
11:28:14  <pickpacket> hahaha
11:28:26  <pickpacket> not sure what theophyllin is, but probably yes
11:29:02  <johnfranklin> The crucial thing in tea that stimulate body from sleepy
11:29:03  <pickpacket> I have been known to go a day or two without tea, when I've either run out or it's just been too warm to drink
11:29:14  <pickpacket> ah! The caffeine equivalent?
11:29:21  <johnfranklin> Yes
11:30:05  <pickpacket> Strangely enough I'm not addicted to it. I should be, but it appears I'm not. Some days I only drink rooibos and have no issues
11:32:03  <pickpacket> But I couldn't let a game like OpenTTD be without it
11:32:03  *** gelignite has quit IRC
11:32:17  <pickpacket> that would be heresy
12:10:01  <andriydohniak> pickpacket: black tea has 25% of caffene of coffe per unit of volume
12:10:18  <andriydohniak> depends on how you make tea and coffe of course
12:11:13  <pickpacket> I thought it was less
12:11:36  <andythenorth> adventures in GPT continue
12:59:00  <andythenorth> hmm we can't really prioritise StoryBook button events in the queue
12:59:08  <andythenorth> would get out of order state
12:59:29  <DorpsGek> [OpenTTD/team] haidermazhar opened issue #563: [ur_PK] Translator access request https://github.com/OpenTTD/team/issues/563
12:59:57  <andythenorth> the delay on getting to the click event can be multiple seconds though
13:00:22  *** tabytac has quit IRC
13:06:32  *** gelignite has joined #openttd
13:06:48  <andythenorth> wonder what happens if events are handled async
13:06:53  <andythenorth> can't imagine that going well
13:08:01  <andythenorth> "it's only slow sometimes", not sure what the cases are
13:11:17  *** Wolf01 has quit IRC
13:14:54  *** Wolf01 has joined #openttd
13:21:21  <DorpsGek> [OpenTTD/team] glx22 commented on issue #563: [ur_PK] Translator access request https://github.com/OpenTTD/team/issues/563
14:28:55  <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12720: Change: Use UK OSK layout for English (UK) https://github.com/OpenTTD/OpenTTD/pull/12720
14:36:10  <peter1138> print _spritecache.size()
14:36:10  <peter1138> (size_type) 161207
14:36:22  <peter1138> Reserved capacity for 202871 sprite cache entries (11360776 bytes)
14:36:27  <peter1138> Hmm, that's quite a lot too much ๐Ÿ˜ฆ
14:38:26  <peter1138> print _spritecache.capacity()
14:38:26  <peter1138> (size_type) 262144
14:38:33  <peter1138> Although less than if I don't prereserve.
15:40:54  *** Wolf01 has quit IRC
15:43:27  *** Wolf01 has joined #openttd
15:58:11  <DorpsGek> [OpenTTD/OpenTTD] JGRennison opened issue #12747: [Bug]: #12030 causes incorrect accounting of water infrastructure totals when removing objects on water https://github.com/OpenTTD/OpenTTD/issues/12747
16:27:20  <_glx_> and I tested many cases to check the count, but seems I missed some
16:32:23  <andriydohniak> I have introduced a new data type for saveloading, called SL_COMPANY_MASK, it is used to store company masks with arbitrary compile time known compay masks. I have also added the coresponding macro, and sl handlers.
16:32:50  <andriydohniak> My question is, how and where would I convert the old savefiles from the old CONDVAR to my new format?
16:33:03  <andriydohniak> Do I need to write a separate macro + sl handler for it?
16:33:53  <andriydohniak> The issues is that the previous versions just used integers to store this mask, and I am using an array, which expects a header, so it's incompatible with the current handlers
16:42:17  <andriydohniak> I have came up with a hacky solution, but should work
16:43:27  <andriydohniak> I just limited the max number of companies to be > 16, and put an assert to ensure this. Then I use the macro length field, and if the lenght in bytes <= 2, it's an old integer format
16:46:09  <michi_cc> Savegame conversion is usually handled with the savegame version
16:49:46  <andriydohniak> michi_cc: yes, this is separated by savegame version, the problem is that I can't reuse the same data type and logic, because the backing filetype changes
16:51:16  <andriydohniak> So I know that in old versions the data is stored in 2 bytes, no array. But I can't just put lenght 2 in my macro, because the current backing type is an array, which has a header, so it will read the size of 3 bytes, because it has a header
16:59:56  <andriydohniak> Ok, I think I have a better solution, 2 macros, 1 for the new save format, 2nd for old savefiles, based on the version. They both expand to practically the same thing, but the data type field is SLA_CHAR in the new one, and SLA_INT8, in the old one, so I can use that as a marker to figure out in the logic weather I should read an array, or bytes
17:05:21  <michi_cc> Data format changes aren't that uncommon in the code, as an example you can look at e.g. `industry_sl.cpp` around the whole `SlIndustryAccepted` change and conversion code with the `old_XXX` stuff.
17:14:25  <andriydohniak> michi_cc: Ok, thanks
17:16:17  <andriydohniak> Hmm, so you just have space for both versions, and then you just convert it in the afterload.cpp, correct?
17:19:50  <andriydohniak> I totally forgot there is a save/load handlers for the idividual blocks
17:19:52  <peter1138> That one is one per industry.
17:19:59  <andriydohniak> I should put it there
17:33:41  <michi_cc> Storage format conversions are usually done in the `_sl.cpp` chunk handlers, not AfterLoad. Everything that is using some kind of global is handled directly in the chunk handler.
17:42:19  *** Wormnest has joined #openttd
17:55:35  <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12748: Codechange: Pre-reserve vectors during NewGRF loading. https://github.com/OpenTTD/OpenTTD/pull/12748
18:43:08  <peter1138> So adding font-gamma to make OpenTTD Sans look nicer at 1x scale it clearly a hack.
18:45:19  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1246897451470815292/image.png?ex=665e0f3e&is=665cbdbe&hm=21319814857281a91a338758905b624b17f371be537e6ab38e71728578b01c68&
18:45:19  <andythenorth> GS intensifies
18:45:30  <andythenorth> it's really nice that both GRF and GS can write to the industry window without conflict
18:46:15  <andriydohniak> andythenorth: I see you constantly writing OpenGRF, and GS, can you quickly explain what all of that is?
18:46:21  <andriydohniak> Are they different mod formats?
18:46:34  <andythenorth> grf is the primary modding format for content (industries, vehicles, stations, etc)
18:46:44  <andythenorth> NewGRF is the accurate term
18:47:40  <andythenorth> GS is GameScript (possibly originally Goal Script), originally known as NoGo
18:48:01  <andriydohniak> So GS is the older one
18:48:12  <andriydohniak> And what is it usefull for?
18:49:04  <andriydohniak> Ahhh, so that's where Squirrel comes in
18:50:24  <andriydohniak> Ok, so OpenGRF is for adding items and industries and trains, etc, and gamescripts are for controlling all that without the player
18:50:32  <andriydohniak> like AIs
18:50:41  <andythenorth> GRF is much older than GS
18:50:54  <andythenorth> GS was more or less an accident arising from NoAI
18:50:58  <andythenorth> accident / side effect
18:51:59  <andythenorth> GS doesn't have a single use, it's general purpose scripting
18:52:18  <andythenorth> there aren't many GS in existence, it's not popular
18:52:41  <andythenorth> but the majority are either goal scripts (transport x amount of cargo) or town growth scripts
18:53:22  <andriydohniak> So the more popular thing is NewGRF, correct?
18:53:34  <andythenorth> by probably at least one order of magnitude
18:53:53  <peter1138> It's not that one is more popular than the other, they do different things.
18:54:12  <andythenorth> NewGRF is older, widely used, has extensive documentation, and is much easier to author for most of the author base
18:54:24  <andythenorth> it's also supported, and hasn't been declared dead, unlike GS
18:54:50  <andriydohniak> So if GS is dead, why are you so keen on resurecting it?
18:55:43  <andriydohniak> And it sounds super cool, if I won't be burned out, I might just join after I finish my current project :)
18:56:48  <andythenorth> whether it's actually dead is never conclusive, there's no single leader here ๐Ÿ™‚
18:57:08  <andythenorth> the author declared it dead, and not worth extending further
18:57:21  <andythenorth> [transposing words]
18:58:26  <andythenorth> I am doing a lot of GS because it's the only available API for lots of things
18:59:08  <andythenorth> it's quite interesting to try and build a modular framework out of it, and quite interesting to template it with python
18:59:23  <andythenorth> but it's quite like writing javascript in 2001
19:00:06  <andriydohniak> And GRF is not extencible?
19:00:25  <andriydohniak> Is GRF a scripting language, or is it just something declerative?
19:00:43  <andythenorth> GRF is bytecode, someone else would explain it better
19:00:56  <andythenorth> it's some kind of stack and operators
19:01:10  <_jgr_> GS/AI are not really dead
19:01:19  <andriydohniak> andythenorth: And there is no language to compile to it?
19:02:10  <andythenorth> there's nfo
19:02:14  <_jgr_> andythenorth: It's not stack-based
19:02:17  <andythenorth> and there's nml which compiles to nfo or grf
19:02:18  <peter1138> GS is like Javascript, NewGRF is like CSS
19:02:28  <_jgr_> andythenorth: In general you are better off using NML to create GRfs
19:03:14  <andythenorth> _jgr_: what actually is it?  I don't really have a picture.  Someone said once it was a fully x86-ish VM running inside the game, but I find that implausible
19:05:30  <_jgr_> Varaction2 is only a small bit of the GRF spec, but it's essentially a linear sequence of operations on an accumulator, the result of which can be used as the input to a switch to other action2s
19:05:59  <andriydohniak> _jgr_: so like a bytecode interpreter
19:06:04  <andriydohniak> Is it turing complete?
19:06:11  <andriydohniak> or just declerative
19:06:30  <_jgr_> There are no loops, so it's not turing complete
19:07:19  <andriydohniak> Ahh, that's the issue :(
19:07:24  <andriydohniak> that's quite sad
19:07:34  <_jgr_> On the upside that means that callbacks and graphics operations always complete in boudned time, which makes various other problems go away
19:08:19  <andriydohniak> so currently the game has 2 systems, 1 of which can't really do anything complex, and the other one is so old it'd very difficult to use
19:10:28  <andythenorth> not quite
19:10:54  <andythenorth> _jgr_: one of the really nice things about grf is that footguns like unclosed loops are pretty much eliminated ๐Ÿ™‚
19:10:58  <peter1138> No, there are 2 systems, they both do different things.
19:11:21  <andythenorth> grf will never have the arbitrary abilities of GS
19:13:26  <peter1138> But only because it's not intended to.
19:15:22  <andriydohniak> peter1138: Yes, but if the other system is in a bad state people are gona stretch the capabilities of the first one, instead of using the second one for it's intended purpose
19:15:23  <andythenorth> you will see me complain a lot about GS, but some of that is a me problem
19:15:32  <andriydohniak> YEEEEEEEEEEEEEEEEEEEEEEES
19:15:38  <peter1138> Neither is in a bad state.
19:15:42  <andriydohniak> I got old leves loading!!!!
19:15:50  <andriydohniak> My compatibility thingie works!!!!!!!!!!!!
19:16:27  <peter1138> Mostly the issue is andythenorth is unable to get ChatGPT to write GS for him, because, well, that's not what ChatGPT does.
19:16:37  <andythenorth> it's no worse than me at it ๐Ÿ˜›
19:17:41  <andythenorth> most of the issue comes from GS being dependent on a very outdated version of a minority language which is hard to understand or find documentation for
19:18:50  <andythenorth> by comparison nfo and nml are fantastically well documented, and the bytecode in nfo is actually 'fine' if you get used to it
19:24:16  <andythenorth> there's also some uncanny valley in GS, and I keep smacking myself in the face with it
19:24:57  <andythenorth> there's a storybook, but it requires a lot of manual management to update it, but I can probably framework that
19:25:16  <andythenorth> and there are UI features for players clicking buttons, but the response times are entirely unpredictable
19:26:23  <_jgr_> Having a single GS running asynchronously on the server is really the wrong execution model for storybooks with buttons in them
19:26:46  <andythenorth> uncanny valley
19:27:00  <andythenorth> without mistakes we'd never learn anything ๐Ÿ™‚
19:32:14  <_glx_> main issue of GS is it's a derivate of AIs
19:33:10  <andythenorth> _jgr_: given the constraints, there's no alternative?
19:33:23  <andythenorth> GS has to handle events...
19:34:06  <andythenorth> I had horrible ideas about buttons running lambdas that modify state in the GS, but that's likely to go very very wrong
19:34:22  <_glx_> there's always at least 1 tick delay between button click and response from GS
19:34:39  <andythenorth> I haven't tried polling the queue in async mode
19:34:46  <andythenorth> wonder what it would do
19:35:02  <andriydohniak> If anybody is interested, take a lood: https://github.com/JustLinuxUser/OpenTTD/tree/more_companies
19:35:02  <andythenorth> game news can put a lot of events on the stack I think
19:35:31  <_glx_> async mode just means GS can fire multiple command in 1 tick, it has no effect on events handling
19:35:42  <andriydohniak> At this point I am pretty sure there are no bugs that I introduced
19:35:42  <andythenorth> oh wait
19:36:20  <andythenorth> this is derived from the boilerplate example GS https://github.com/andythenorth/firs/blob/v5-release-my-savegame/src/gs/templates/main.pynut#L164
19:36:34  <andythenorth> that only pulls one event per iteration of main loop?
19:36:42  <andythenorth> there's no recursion or foreach loop
19:36:50  <_glx_> it can pull more than one
19:36:51  <andythenorth> so it will have minimum 5 tick per event?
19:37:10  <andythenorth> (rest of main shows the main loop and sleep(5)
19:37:27  <_glx_> but you still have max opcode per tick
19:37:43  <andythenorth> that's fine, I think that bugaboo is not hit so frequently as we worry about
19:37:49  <andythenorth> although there's no stats ๐Ÿ˜›
19:38:03  <andythenorth> and no way to write stats from *inside* GS afaik
19:38:10  <andythenorth> can't self-log if suspended ๐Ÿ˜›
19:38:51  <_glx_> only stat you have is framerate window
19:38:54  <andythenorth> can I just call HandleEvents() at the end of HandleEvents()
19:38:57  <andythenorth> and it will recurse?
19:39:01  <andythenorth> I am not a programmer ๐Ÿ˜›
19:39:39  <_glx_> never write something that way, unless you want a stack overflow
19:39:42  <andythenorth> ha
19:41:10  <andythenorth> well, it seems to work for now
19:41:17  <andythenorth> I guess a foreach or a do-while
19:41:22  <andythenorth> this might be faster
19:41:43  <andythenorth> there's very little latency now on click, except in the first month of the game when a lot of intialisation stuff runs
19:41:54  <andythenorth> I don't make much use of the free opcodes at game start yet
19:42:55  <_glx_> squirrel VM does some tail recursion, but it's better to avoid infinite recursion
19:43:16  <andythenorth> let's see what `GSEventController` has
19:43:46  <andythenorth> not much https://docs.openttd.org/gs-api/classGSEventController
19:43:55  <andythenorth> I'd have to write a do-while, which I distrust
19:44:19  <andythenorth> can events be added to the queue by OpenTTD while the GS is executing, or does it get a synchronous slot?
19:44:46  <_glx_> some events can (if triggered by GS itself)
19:44:58  <andythenorth> ok so it could deadlock
19:45:37  <ahyangyi> Is there a lock at all?
19:45:44  <andythenorth> I could put a hard limit on it, but I'd be pure guessing at the actual number
19:46:28  <_glx_> anyway if you reach max opcode limite GS goes to sleep, so it can't really deadlock the game
19:46:50  <_jgr_> andythenorth: The GS doesn't run in a separate thread, "OpenTTD" is not running when the GS is
19:46:58  <andythenorth> ok
19:48:06  <andythenorth> tempted to suggest being able to filter the event list, and leave events on the queue if they don't meet the filter
19:48:16  <andythenorth> I imagine that makes it worse for reasons I haven't thought of ๐Ÿ™‚
19:49:51  <andythenorth> ET_STORYPAGE_BUTTON_CLICK and ET_GOAL_QUESTION_ANSWER being two that have GUI responsiveness issues
19:50:04  <andythenorth> I guess out-of-order event handling can result in bad state
19:50:11  <andythenorth> but events can't guarantee state anyway
19:50:30  <_glx_> if you wait too much the data in event might be outdated  ๐Ÿ™‚
19:51:01  <andythenorth> maybe we should have timestamped them ๐Ÿ˜›
19:51:01  <_glx_> like vehicle IDs if it's then replaced
19:51:32  <andythenorth> generally I'm not relying on event handling, it's too unpredictable
19:51:49  <andythenorth> currently I've avoided it for things like industry opening, in favour of periodic polling
19:52:12  <andythenorth> the theory that slow-but-more-predictable is less painful to write for
19:52:31  <_glx_> one of the issues is script gets all events even those it doesn't care about
19:52:41  <andythenorth> yeah, there's no pub-sub or anything similar
19:53:29  <andythenorth> I've written an event manager that handles subscription, but all events have to be run through it
19:53:50  <_jgr_> The event queue doesn't look like it has any size bounds
19:54:24  <_jgr_> That seems suboptimal for GSs which don't bother calling GetNextEvent at all
19:54:55  <andythenorth> oh so if I don't frequently clear it, then call GetNextEvent after n years of gameplay?
19:55:00  <andythenorth> I will be calling for a long time?
19:55:09  <_glx_> yup
19:55:20  <andythenorth> oops
19:55:26  <andythenorth> ok line 9 is dubious https://gist.github.com/andythenorth/29733076a204aeec662fdb352b01f074
19:55:45  <andythenorth> not sure what else I can do except do-while, which I hate because I'm prone to failing to close them
19:56:18  *** SigHunter_ has joined #openttd
19:57:07  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1246915521228701766/image.png?ex=665e2012&is=665cce92&hm=51e4cc339ce297a3a32173ef4a3466a3eb9ab3e5d0a219e06bf98e1c0ec58daf&
19:57:07  <andythenorth> so at the start of my game, all these news messages are added due industry open
19:57:23  <_jgr_> You could just use an ordinary while loop?
19:57:52  <andythenorth> I never write them, got burned by leaving them unclosed in prod (ate all the CPU on a server)
19:57:58  <andythenorth> got told off a lot ๐Ÿ˜›
19:58:07  <_glx_> `while (GSEventController.IsEventWaiting()) { }
19:58:14  *** SigHunter has quit IRC
19:59:19  <andythenorth> should I put a counter and break in?
19:59:29  <andythenorth> not sure what limit to set
19:59:32  <andythenorth> 10? 100?
19:59:34  <andythenorth> 1000?
20:00:30  <_glx_> you should not get that many events per tick
20:01:02  <_glx_> though some ticks might get more than others
20:02:22  <andythenorth> wish I had better timing info ๐Ÿ˜›
20:02:28  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1246916869341053019/image.png?ex=665e2154&is=665ccfd4&hm=f0a10cc67035e46d30172e3139fb1fd609640f230910455d076824fc1f82c3da&
20:02:38  <andythenorth> that was percebtibly slow
20:02:56  <andythenorth> oh can I count how many times we've executed?
20:03:05  <andythenorth> so then I have timing in blocks of 5 ticks
20:06:56  <_glx_> https://wiki.openttd.org/en/Development/Script/Basics#event-system
20:07:42  <_glx_> you can easily only care for some event types
20:09:33  <andythenorth> so I could write filters here? https://github.com/andythenorth/firs/blob/v5-release-my-savegame/src/gs/templates/events.pynut
20:10:10  *** silent_tempest has quit IRC
20:10:43  <andythenorth> hmm there's a foreach I can drop there
20:15:19  *** SigHunter_ has quit IRC
20:15:47  <peter1138> Time for rooibos
20:19:09  <andythenorth> maybe I should cap that while loop
20:19:12  <andythenorth> scared of `while`
20:19:34  <_glx_> while loops are kinda safe in squirrel
20:21:08  <andythenorth> I'm experimenting with putting it in async mode
20:21:15  <andythenorth> not sure if that makes any difference here
20:21:19  <andythenorth> "doesn't fail"
20:21:27  <_glx_> as said async is just for commands
20:21:43  <_glx_> fire and forget vs fire and wait next tick for result
20:21:43  <andythenorth> is GetNextEvent a command or not?
20:21:49  <_glx_> it's not
20:21:51  <andythenorth> ok
20:22:23  <_glx_> commands are things a player could do
20:22:24  <andythenorth> so any expensive event handling functions can set async mode themselves
20:22:33  <_glx_> anything affecting game state is a command
20:22:42  <andythenorth> ok
20:22:43  <andythenorth> thanks
20:23:17  <_glx_> async is a nice addition for UI updates
20:24:04  *** SigHunter has joined #openttd
20:25:19  <andythenorth> ok so just the while loop makes the buttons substantially more responsive
20:29:22  <andythenorth> shall we assume GSEvent.GetEventType() is very cheap?
20:29:35  <andythenorth> I assume it's just looking up an index somewhere
20:29:37  <andythenorth> let's see ๐Ÿ˜›
20:30:41  <andythenorth> https://github.com/OpenTTD/OpenTTD/blob/master/src/script/api/script_event.hpp#L74
20:31:01  <_glx_> yeah that's cheap ๐Ÿ™‚
20:32:00  <andythenorth> thanks ๐Ÿ™‚
20:32:09  <andythenorth> hmm button handling is slow again now, and there's not much in the framerate window ๐Ÿ˜›
20:32:57  <andythenorth> yeah 5 second delay
20:33:51  <andythenorth> 10 second
20:36:26  <andythenorth> specific event handler need to use async
20:36:39  <andythenorth> fixed
20:38:24  <andythenorth> ok this is quite performant enough for now, at least on my 512x512 map
20:41:30  <_glx_> when done properly ๐Ÿ˜‰
20:42:13  <peter1138> I wonder what you were doing to make it so bad in the first place :p
20:42:44  *** SigHunter has quit IRC
20:46:53  *** gelignite has quit IRC
20:47:27  <andriydohniak> https://cdn.discordapp.com/attachments/1008473233844097104/1246928190778114109/image.png?ex=665e2bdf&is=665cda5f&hm=352b078d18fadecb619ad38c08920985e412b4996ba311c8e7acad1436ffdd81&
20:47:56  <peter1138> andythenorth: did you ever get to test with #12408?
20:48:22  <peter1138> Change: [Script] Allow GS to terraform/plant trees as deity. #12408
20:48:33  <andythenorth> peter1138: my GS is based on the Minimal GS example, which only pulls one event off the queue per main loop
20:48:49  <andythenorth> and I am not a very good programmer, so I didn't spot that
20:48:49  <_glx_> minimal is minimal ๐Ÿ™‚
20:49:53  *** SigHunter has joined #openttd
20:50:10  <andythenorth> peter1138: no but I could, might be 'interesting' with async ๐Ÿ˜›
20:50:21  <andythenorth> I am not going to recompile right now, it's bed time ๐Ÿ™‚
20:50:25  <andythenorth> 'ish'
20:53:54  <andriydohniak> andythenorth: How long does it take for you to recompile openTTD on debug mode?
20:54:04  <andythenorth> around 1-2 mins
20:54:20  <andythenorth> but I have to clear ./build and then sometimes fix VCPKG
20:54:26  <andythenorth> depending what Apple broke recently
20:54:30  <andythenorth> or what OpenTTD changed
20:54:39  <andriydohniak> doesn't make clean work?
20:54:42  <andythenorth> rebuilding is about 60% success rate
20:54:56  <andythenorth> I have been told to not try to use make clean
20:55:07  <andythenorth> instead rm ./build and rerun cmake
20:55:15  <peter1138> Who told you that?
20:55:22  <andythenorth> people here
20:55:35  <andriydohniak> Yea, when I was working on my thing sometimes I would get the weirdest errors possible, and nothing would make sense, and then `make clean` and `make` will just fix it
20:55:39  <peter1138> You might have misinterpreted somebody asking you to try that once when you managed to break your system.
20:55:46  <peter1138> But that doesn't mean ALWAYS do that.
20:56:01  <andythenorth> "cmake has a cache, which can mask errors, so rm build dir and try again"
20:56:09  <andythenorth> is the note I kept
20:56:17  <andriydohniak> andythenorth: make clean will clear all cmake caches
20:56:55  <andythenorth> I wonder how much more accurate GPT is than me
20:56:58  <andythenorth> 'some'
20:57:24  <andriydohniak> andythenorth: It's not, as soon as it has to write more then 100 words, it just spits out trash
20:57:36  <andythenorth> check the log for me ๐Ÿ˜›
20:57:48  <andythenorth> 80% confusion
20:58:10  <_glx_> I don't think `make clean` affects cmake cache, it only removes object files
21:00:05  <andriydohniak> _glx_: Cmake cache is object files
21:00:09  <andriydohniak> And kinda
21:00:38  <andriydohniak> Makefiles that cmake spits out use Cmake a lot, so it knows everything about what is happening where
21:01:42  <andriydohniak> https://cdn.discordapp.com/attachments/1008473233844097104/1246931776404852879/image.png?ex=665e2f36&is=665cddb6&hm=e2eee8095191b54bb60b9e93c98b37a5fb5ae1045f2642c506a586017fc80121&
21:01:59  <andriydohniak> So it keeps the structure, but it does clean all the build artifacts
21:02:44  <_glx_> I'm quite sure it won't delete CMakeCache.txt
21:03:17  *** Flygon has quit IRC
21:03:22  <andriydohniak> _glx_: Take a look at CMakeCache
21:03:33  <andriydohniak> It will not generate random runtime errors
21:03:46  <_glx_> which is the one affected when system libraries change
21:07:20  <_glx_> and a broken cmake cache can cause build failures, requiring deleting the cache and fully reconfigure
21:10:49  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1246934068818477186/image.png?ex=665e3158&is=665cdfd8&hm=b4d025b6d04466cf83acdfdcf863a8a6bbc711d74df31cab1e3ac16e5027faeb&
21:10:49  <andythenorth> can I make GSText clickable?  Or is that automatic for goals?
21:10:58  <andythenorth> I want to make the town and industry clickable
21:13:45  <peter1138> Hmm. It rebased. Will it build?
21:15:39  <peter1138> "No"
21:17:21  <peter1138> > void OpenGLSprite::Update(uint, uint, uint, const SpriteLoader::CommonPixel *): Assertion `_glGetError() == GL_NO_ERROR' failed.
21:17:22  <peter1138> Oops
21:37:43  <peter1138> Nice. This code that used to work now just smashes up my system.
21:37:55  <peter1138> Xorg stops responding.
22:00:58  <andythenorth> well
22:00:59  <andythenorth> naptime
22:01:10  <andythenorth> Zorg stops responding? ๐Ÿ˜ฎ
22:30:11  *** Wolf01 has quit IRC
22:54:11  *** HerzogDeXtEr has quit IRC

Powered by YARRSTE version: svn-trunk