IRC logs for #openttd on OFTC at 2023-02-10
            
00:18:22 *** herms123 has quit IRC (Quit: Leaving)
00:30:02 <DorpsGek> [OpenTTD/OpenTTD] valisak opened issue #10461: [Crash]: https://github.com/OpenTTD/OpenTTD/issues/10461
00:35:08 *** Alkel_U3 has quit IRC (Quit: maintenance)
00:36:09 *** Alkel_U3 has joined #openttd
00:48:12 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on issue #10461: [Crash]: https://github.com/OpenTTD/OpenTTD/issues/10461
00:49:01 <glx[d]> I guess we will need a 13.1 soon
01:09:17 *** felix has quit IRC ()
01:22:11 *** felix has joined #openttd
01:24:58 <DorpsGek> [OpenTTD/OpenTTD] glx22 opened pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462
02:16:28 *** felix has quit IRC ()
02:34:07 *** felix has joined #openttd
03:09:52 *** Wormnest has quit IRC (Quit: Leaving)
03:26:19 *** felix_ has joined #openttd
03:26:19 *** felix has quit IRC (Read error: Connection reset by peer)
03:31:06 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462#pullrequestreview-1292328950
03:39:15 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462#issuecomment-1425130267
03:43:43 *** D-HUND has joined #openttd
03:47:03 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:05:27 <DorpsGek> [OpenTTD/OpenTTD] glx22 updated pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462
04:12:42 *** Flygon has joined #openttd
04:14:43 *** TROILUS3 has joined #openttd
04:20:13 *** TROILUS has quit IRC (Ping timeout: 480 seconds)
04:20:13 *** TROILUS3 is now known as TROILUS
04:38:56 *** keoz has joined #openttd
05:16:21 *** JohnFranklin has joined #openttd
05:30:47 *** John_Franklin has joined #openttd
05:36:55 *** JohnFranklin has quit IRC (Ping timeout: 480 seconds)
05:37:01 *** John_Franklin is now known as JohnFranklin
05:56:57 *** keoz has quit IRC (Ping timeout: 480 seconds)
06:02:50 *** JohnFranklin has left #openttd (Closing Window)
06:37:29 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
06:39:03 *** Smedles has joined #openttd
07:15:16 *** sla_ro|master has joined #openttd
07:15:56 <DorpsGek> [OpenTTD/OpenTTD] KenvinMS opened issue #10463: [Crash]: When I Opened the Game, my screen became flash, then game shut off. https://github.com/OpenTTD/OpenTTD/issues/10463
07:19:16 <petern> <https://www.tt-forums.net/viewtopic.php?p=1258258#p1258258> Wow, that's revisionist...
07:22:11 <andythenorth> "For a long time, OpenTTD had only one type of road. I made a small patch, and in the short space of several years, NRT was in trunk."
07:37:00 <petern> For the new meme to work, you need to claim something you were completely uninvolved with, and claim a few hours.
07:38:29 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on issue #10460: [Bug]: docker latest points to 13.0-RC1 Version mismatch with 13.0 stable https://github.com/OpenTTD/OpenTTD/issues/10460
07:38:32 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain closed issue #10460: [Bug]: docker latest points to 13.0-RC1 Version mismatch with 13.0 stable https://github.com/OpenTTD/OpenTTD/issues/10460
07:39:00 <andythenorth> does it also have to mention TTDPatch?
07:41:35 <TrueBrain> "For a long time, OpenTTD had only one type of road. I made a small patch in a few hours, and in the short space of several years, NRT was in trunk."
07:41:44 <TrueBrain> petern: Fixed it for you
07:41:56 <TrueBrain> 😄
07:42:01 <petern> 🙂
07:42:41 <TrueBrain> And this will be crawled soon, so in a few years people really believe it
07:42:43 <TrueBrain> Nice
07:43:40 <petern> Oh yes, I need to buy some pedals
07:44:25 <LordAro> what's the actual story? magicbuzz not involved at all? happened to make the patch right at the end of years of refactoring?
07:44:36 <kamnet> petern: Oh well, hell, I patched OpenTTD half a decade before that LOL
07:44:36 <kamnet> Where's my credit?
07:45:04 <kamnet> (actually should be documented somewhere on the forums when i asked about it)
07:46:49 <petern> Not involved at all, the engine pool stuff was just my experiment that went too far 🙂
07:46:57 <petern> Crankbrothers Candy 11 Pedals
07:46:57 <petern> £399.99
07:47:03 <petern> Such value
07:47:42 <LordAro> nice
07:50:18 <andythenorth> Goes it faster?
07:53:23 <andythenorth> hmm just had a horrific idea
07:58:39 <TrueBrain> Put it next to the others on that pile over there :p
08:13:54 <andythenorth> regions could have counts of different tile types
08:14:13 <andythenorth> storing the exact tiles that are e.g. water will be horrible for memory use
08:14:33 <andythenorth> but statistics, e.g. 80% water etc
08:14:41 <andythenorth> would be fine
08:29:45 <TrueBrain> Or the exact count, also cheap
08:36:56 <andythenorth> I had a mad idea about probability vectors
08:37:50 <andythenorth> 'amount if water in direction n from tile o'
08:37:54 <petern> probability deque
08:38:44 <andythenorth> I have been reading about random walks and monte carlo things
08:38:46 <andythenorth> I should stop
08:46:29 <petern> I did a random walk, it was quite muddy.
08:47:22 <andythenorth> step forward: mud
08:47:29 <andythenorth> step backward: mud
08:51:25 <petern> Hmm, router update time.
08:52:42 <petern> *) leds - fixed turning off LEDs after system shutdown
08:52:43 <petern> Well
09:11:22 <andythenorth> I like my electronics to stay on after they're off
09:12:56 *** ag has joined #openttd
09:12:56 <ag> What
09:22:21 *** D-HUND is now known as debdog
09:22:56 <DorpsGek> [OpenTTD/OpenTTD] valisak commented on issue #10461: [Crash]: Drawing town action's description as spectator https://github.com/OpenTTD/OpenTTD/issues/10461
09:34:40 <andythenorth> can we make a tree-hider that follows the cursor? 🙂
09:34:43 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1073537491673546832/image.png
09:35:04 <petern> Do it.
09:36:01 <andythenorth> I am now going to say words as though I understand the rendering pipeline
09:36:06 <andythenorth> I think we can assume I don't
09:36:37 <andythenorth> but the sprite sorter must have a check for item visibility
09:36:55 <andythenorth> so that could have a conditional check of distance to cursor
09:36:58 * andythenorth clooks
09:37:57 <andythenorth> IsInvisibilitySet might be a thing to search with
09:38:39 <andythenorth> ok so maybe DrawTile_Trees is the place
09:39:27 <andythenorth> wonder if we have a way to resolve which tile the cursor is currently over
09:42:30 <andythenorth> `LandInfoWindow(TileIndex tile) : Window(&_land_info_desc), tile(tile)` looks like it might give clues
09:44:07 <dP> andythenorth: that's an interesting idea
09:44:28 <andythenorth> I am trying to find cursor tracking currently
09:44:47 <andythenorth> land info tool etc must monitor cursor position
09:44:58 <dP> check GetTileBelowCursor
09:45:46 <andythenorth> thanks
09:48:09 <andythenorth> ok how do I convert OTTD_Point to a TileIndex?
09:48:11 <andythenorth> let's see
09:51:33 <andythenorth> ` Point pt = GetTileBelowCursor();
09:51:33 <andythenorth> if ((pt.x == ti->x) && (pt.y == ti->y)) return;
09:51:33 <andythenorth> `
09:51:53 <andythenorth> is Point screen coords, and TileInfo map coords?
09:53:24 <andythenorth> no GetTileBelowCursor resolves that
10:04:31 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1073544984860561428/Screen_Recording_2023-02-10_at_10.03.09.mov
10:04:36 <andythenorth> moving the cursor doesn't trigger a tree redraw currently
10:04:40 <andythenorth> so that's running on fast ffw
10:04:53 <andythenorth> patch is
10:04:53 <andythenorth> ` Point pt = GetTileBelowCursor();
10:04:53 <andythenorth> if ((ti->x < pt.x + 64) && (ti->x > pt.x - 64) && (ti->y < pt.y + 64) && (ti->y > pt.y - 64)) return;
10:04:53 <andythenorth> `
10:05:03 <andythenorth> 64 is arbitrary
10:06:46 <dP> just add MarkWholeScreenDirty();
10:07:45 *** Samu has joined #openttd
10:08:53 <andythenorth> ha that totally kills FPS 🙂
10:09:30 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1073546244401659954/image.png
10:10:50 <dP> yeah, I guess it's a bit much xD
10:10:54 <dP> is that release build tho?
10:11:02 <andythenorth> not sure, might be
10:11:06 <andythenorth> yes probably
10:11:38 <Samu> hello, I'm listening to "old" music https://www.youtube.com/watch?v=70HNg7WNVC4
10:11:51 <dP> you can MarkTileDirtyByTile then
10:12:18 <andythenorth> MarkTileDirtyByTile(ti->tile); is less bad
10:13:01 <dP> but you need to mark all tiles in the area
10:13:35 <petern> Ah balls, 9 spd cassette with 8 spd shifter...
10:13:39 <dP> unfortunately there doesn't seem to be function for marking tilearea's
10:13:41 <andythenorth> ` if ((ti->x < pt.x + 64) && (ti->x > pt.x - 64) && (ti->y < pt.y + 64) && (ti->y > pt.y - 64)) {
10:13:41 <andythenorth> MarkTileDirtyByTile(ti->tile);
10:13:41 <andythenorth> return;
10:13:41 <andythenorth> }
10:13:41 <andythenorth> `
10:13:48 <andythenorth> is all I have currently
10:13:49 <dP> only `SetSelectionTilesDirty` that does selected area
10:14:17 <dP> ah, right, you do it in rendering code
10:14:47 <dP> though idk how it works if you mark dirty in rendering code
10:14:52 <andythenorth> tree_cmd.cpp DrawTile_Trees
10:14:54 <dP> would it try to redraw them again
10:15:10 <andythenorth> fps feels like it is now redrawing all tiles often
10:15:23 <andythenorth> the whole game lags, and the trees don't hide / show very quickly
10:15:52 <dP> you can try to move it out of render and only leave the check
10:16:08 <dP> you can look how cmclient implements land info or industry tooltips for that
10:16:22 <dP> `GuiPrepareTooltipsExtra` is the function to look for
10:20:12 <petern> Okay, buy 9 speed shifter for £86 or buy 8 speed cassette for £20...
10:21:13 <andythenorth> you go much faster with 9 speed though
10:21:29 <petern> That... isn't... no...
10:21:31 <reldred> Nyooom
10:21:52 <reldred> I need to buy a pump
10:22:09 <reldred> My wheel no wanna do the wheel thing atm
10:22:12 <andythenorth> is the 9 speed more closely spaced, or wider ratio range?
10:23:02 <petern> It's 11-34T, I can get an 8 speed in 11-34T as well.
10:23:22 <andythenorth> is £20 more or less than £86?
10:23:25 <petern> But as the shifter is 8 speed, I can't properly use the 9 speed anyway 😄
10:23:31 <petern> Somewhat less.
10:23:40 <petern> And I'd need a new 9 speed cassette at some point anyway.
10:24:42 <petern> Hmm, maybe the chain though.
11:12:02 <Samu> i have something against this https://github.com/OpenTTD/OpenTTD/blob/master/src/company_cmd.cpp#L705-L706
11:12:55 <Samu> actually line 707 included
11:13:16 <Samu> the is_ai check is unnecessary
11:13:44 <Samu> and if i'm the local company in the ai company, i'd still like to receive the popup message
11:16:47 <Samu> if the company is not AI, AI::NewEvent will deal with it accordingly and won't send the event anyway
11:31:53 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10459: Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs https://github.com/OpenTTD/OpenTTD/pull/10459
11:34:01 <Samu> poor english skills
11:35:16 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10459: Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs and show buy company dialog window even when playing in the AI company https://github.com/OpenTTD/OpenTTD/pull/10459
11:48:22 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #10459: Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs and show buy company dialog window even when playing in the AI company https://github.com/OpenTTD/OpenTTD/pull/10459#pullrequestreview-1293017770
11:50:07 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #10459: Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs and show buy company dialog window even when playing in the AI company https://github.com/OpenTTD/OpenTTD/pull/10459#pullrequestreview-1293026628
12:08:38 <Samu> I keep forgetting that Game Scripts also deal with human companies
12:08:47 <Samu> not everything is AI
12:11:41 <Samu> if a vehicle type is disabled for AIs, and i switch to that AI company, can I still buy vehicles of that type for the company?
12:15:41 <Samu> the answer is yes, just tested
12:16:57 *** TROILUS has quit IRC (Read error: Connection reset by peer)
12:17:09 *** TROILUS has joined #openttd
12:53:03 *** WormnestAndroid has quit IRC (Remote host closed the connection)
13:02:37 <petern> Hmm, Twitch now shows you previous chat messages when you join a stream.
13:04:59 <andythenorth> is that a net positive?
13:06:13 <Samu> the code around engine availability is quite confusing
13:07:01 <andythenorth> ?
13:07:26 <andythenorth> railtype available, exclusive preview period, engines never expire, intro date with random factor
13:07:33 <andythenorth> what else is there?
13:07:46 <andythenorth> oh GS can allow / disallow engine also
13:08:10 <petern> It's quite simple: is the engine available? yes/no
13:08:48 <andythenorth> I have to go to the shops
13:08:58 <andythenorth> but can't we just ask chatGPT if the engine is available?
13:10:27 <dP> only up to year 2021
13:11:28 <andythenorth> nobody should play past 2021 anyway
13:11:40 <andythenorth> imagine if IRL got paused in 2021
13:17:44 <petern> It kinda did
13:17:49 <petern> Well, 2020-2021
13:21:11 *** keoz has joined #openttd
13:24:24 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1073595285118402620/Screen_Recording_2023-02-10_at_13.23.10.mov
13:24:24 <andythenorth> implementation is horrific, feature might be interesting
13:25:02 <andythenorth> using the ? tool just improves screen drawing speed in the horrible patch
13:25:12 <andythenorth> I haven't actually patched the ? tool
13:25:42 <andythenorth> just seems to trigger more redraws more often
13:25:51 <petern> Should I get road tyres?
13:26:08 <andythenorth> are you going on roads?
13:27:07 <petern> Usually.
13:27:23 <petern> My trike has Schwalbe Black Jacks, which are somewhat knobbly.
13:27:46 <dP> andythenorth: after a bit of though I'm not sure there is a use for this feature
13:27:57 <dP> going full transparent mode is still better for building
13:28:06 <andythenorth> it's more of an 'inspect'
13:28:19 <dP> there isn't really a downside to just staying in transparent
13:28:24 <andythenorth> agreed for building
13:28:25 <dP> except when you need pretty screenshots
13:28:37 <andythenorth> I just miss the trees, because I always have them turned off
13:28:53 <andythenorth> also a trees implementation could be generalised later
13:28:57 <andythenorth> to more than trees
13:29:04 <andythenorth> and then to e.g. fog of war overlay
13:29:56 <dP> that sounds like a bit too much generalisation :p
13:30:03 <andythenorth> 'later'
13:30:08 <dP> it's not like fow magically dissipate around cursor :P
13:30:09 <andythenorth> tree hiding does follow e.g. autorail tool, and does aid building
13:30:32 <andythenorth> ha actual fog mode
13:30:32 <andythenorth> not fog of war 😄
13:31:05 <dP> fog disaster, move the mouse quickly to blow it away
13:31:28 <Samu> AIs can't answer script goal questions!
13:31:40 <andythenorth> dP: did you find a faster implementation?
13:31:41 <Samu> not sure how important that is for AIs, but
13:31:44 <andythenorth> my 3 line patch is lame
13:32:02 <dP> I could probably make it faster
13:32:07 <dP> just don't see a point
13:32:11 <andythenorth> for the lolz of course
13:32:21 <andythenorth> stick it on a wasm build, see what people do with it
13:32:28 <dP> my lolz list as already owerflowing :P
13:32:44 <andythenorth> hmm
13:32:51 <andythenorth> patreon funded openttd dev
13:33:02 <andythenorth> but only for the lolz
13:33:14 <andythenorth> I was always against the idea of paying people to work on 'useful things'
13:33:20 <andythenorth> because then it's just a job
13:33:25 <andythenorth> with deadlines and crap
13:33:43 <andythenorth> 1 month per year, pay someone to make stupid things
13:34:21 <TallTyler> Some of us make stupid things without being paid 😛
13:34:40 <andythenorth> for some of us that's due to less-than-ideal circs
13:34:54 <andythenorth> for some it's an aspect of privilege 😛
13:34:59 <petern> Hmm, BMX tyres are 20". That might be a bad idea.
13:35:08 <dP> integrate with streamlabs so stupid things can happen on donations
13:35:35 <dP> hm, kinda on my lolz list already xD
13:36:02 <andythenorth> petern: I have Big Ben tyres FWIW
13:36:08 <andythenorth> they seem to be bombproof
13:36:30 <andythenorth> they're quite fat and slow
13:36:53 <petern> Yeah, too fat for my trike.
13:38:53 <andythenorth> these were awesome but might be discontinued http://www.cyclerepairman.co.uk/26%60-x-1.6-Continental-Sport-Contact-ATB-Commuting-tyre/www.cyclerepairman.co.uk/26%60-x-1.6-Continental-Sport-Contact-ATB-Commuting-tyre/2639.htm
13:38:55 <andythenorth> so fast
13:39:08 <andythenorth> and I have pulled 2 inch metal staples out of them, no puncture
13:39:14 <Samu> there's no storyscript for AIs too :p
13:39:24 <andythenorth> nearly slick, but not quite
13:40:00 <andythenorth> samu AI should get a story book maybe?
13:40:07 <andythenorth> so it can explain its thinking? 😛
13:44:24 <petern> Ah, sjs have a wide range of 20" tyres.
13:45:12 <Samu> :) not sure how AIs would comunicate with GS's
13:46:42 <Samu> via events, but still, how would they read goal questions, what buttion would they "press", etc
13:46:55 <Samu> how would they know what question is being asked
13:49:48 <dP> normally AIs would need a dedicated api for communication with GS
13:49:57 <dP> but I doubt it's useful enough for anyone to bother making it
13:51:35 <dP> you basically need a dedicated ai for each gamescript anyway
14:15:21 <ag> Lot of work for nothing then
14:16:27 <LordAro> since when has that ever stopped anyone?
14:18:10 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411
14:18:21 <Samu> i made a template! it's not quite like I wanted
14:18:49 <Samu> I wanted to avoid passing MAX_COMPANIES
14:21:38 <Samu> https://github.com/OpenTTD/OpenTTD/pull/10411/commits/966dee37b9dfd1882fb818eb9014ee922ba175ed#diff-88e5b6c0a7c202f09d40e5a721b54aeec678086c7116459241d4fab02f30a33c
14:21:45 <Samu> example in town_cmd.cpp
14:22:15 <Samu> AI::BroadcastNewEvent has a skip_company
14:22:26 <Samu> which can be ommited
14:22:44 <Samu> there's a default value when ommited, but i don't know how to do that with template
14:28:39 <Samu> maybe the file name could be renamed to something else?
14:29:00 <Samu> I couldn't find a suitable file to place this template
14:33:38 <petern> https://cdn.discordapp.com/attachments/1008473233844097104/1073612715836309616/image.png
14:33:38 <petern> Nice, dual pricing...
14:33:50 <andythenorth> is that VAT, at 300%?
14:34:08 *** WormnestAndroid has joined #openttd
14:41:25 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411#pullrequestreview-1293294216
14:44:16 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411#pullrequestreview-1293298875
14:46:20 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411#pullrequestreview-1293302474
14:50:06 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
14:50:10 *** WormnestAndroid has joined #openttd
15:00:58 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411#pullrequestreview-1293331278
15:04:24 *** virtualrandomnumber has joined #openttd
15:07:10 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462#pullrequestreview-1293342841
15:08:12 *** virtualrandomnumber has quit IRC ()
15:17:39 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462#issuecomment-1425954477
15:28:17 <DorpsGek> [OpenTTD/OpenTTD] glx22 updated pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462
15:31:50 <Samu> the engine availability code is still.... not good :(
15:31:56 <Samu> my code
15:32:16 <DorpsGek> [OpenTTD/OpenTTD] glx22 updated pull request #10462: Fix #10461, 59645c6: Properly check for _local_company validity https://github.com/OpenTTD/OpenTTD/pull/10462
15:33:02 <Samu> an engine preview is sent to AI
15:33:22 <Samu> a copy should also be sent to GS, about the company receiving the preview
15:34:17 <Samu> but if an engine preview is sent to an AI but the AI can't build vehicles of that engine type
15:34:26 <Samu> what should be done about GS?
15:34:48 <Samu> no copy sent to GS, i guess
15:35:43 <Samu> but if the company is Human...
15:36:01 <Samu> should the GS receive a copy of that event?
15:42:13 *** debdog has quit IRC (Quit: Initiating getting-the-hell-out-of-here maneuver!)
15:53:56 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10411: Expose more functions to game scripts https://github.com/OpenTTD/OpenTTD/pull/10411
15:57:45 <Samu> fixed the issue
15:58:07 <Samu> I had it fine, made it broken, stupid me
16:23:27 *** HerzogDeXtEr has joined #openttd
16:51:25 <TrueBrain> https://www.spaghettify.dev/
16:51:25 <TrueBrain> Can we make this mandatory?
16:57:52 <andythenorth> the comments part is excellent
16:58:03 <andythenorth> I think we've all been and done that
16:58:44 <andythenorth> "Overly Descriptive Names" though, I feel seen 😦
16:58:54 <andythenorth> like the example is actually real code I wrote
17:02:51 *** Wormnest has joined #openttd
17:16:29 <Samu> now I'm wondering, what was the purpose of Clamping bankrupt company value?
17:17:10 <Samu> some sort of limitation?
17:17:19 <andythenorth> does it overflow to positive if it gets to a big enough negative value?
17:17:39 <Samu> I don't know, need to test
17:17:59 <glx[d]> at some point squirrel world could be 32bit or 64bit depending on target cpu
17:19:17 <glx[d]> now we force it to 64bit as the 32/64 mismatch may cause issues
17:23:31 <petern> TrueBrain: I don't need an AI for that 😄
17:28:23 <glx[d]> and we keep finding clamping issues since
17:30:19 *** TROILUS has quit IRC (Read error: Connection reset by peer)
17:30:28 *** TROILUS has joined #openttd
17:35:31 *** Wolf01 has joined #openttd
17:38:46 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1073659307528302642/image.png
17:38:46 <Xarick> looks good!
17:47:37 <Samu> what to do about 10458
17:47:47 <Samu> close PR?
17:48:11 <Samu> or undo the move
17:48:25 <Samu> but keep PR, since it has other things, or keep everything as is
18:06:53 *** crem1 has joined #openttd
18:08:33 *** crem has quit IRC (Ping timeout: 480 seconds)
18:12:17 *** tokai has joined #openttd
18:12:18 *** ChanServ sets mode: +v tokai
18:14:08 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
18:19:15 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
18:31:24 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #10462: Fix #10461, Fix #10280: Town actions GUI issues https://github.com/OpenTTD/OpenTTD/pull/10462#pullrequestreview-1293781001
18:39:25 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #10462: Fix #10461, Fix #10280: Town actions GUI issues https://github.com/OpenTTD/OpenTTD/pull/10462
18:39:28 <DorpsGek> [OpenTTD/OpenTTD] glx22 closed issue #10461: [Crash]: Drawing town action's description as spectator https://github.com/OpenTTD/OpenTTD/issues/10461
18:39:31 <DorpsGek> [OpenTTD/OpenTTD] glx22 closed issue #10280: [Bug]: Error message when performing town action with not enough cash does not say "not enough cash" https://github.com/OpenTTD/OpenTTD/issues/10280
18:39:40 <glx[d]> 2-in-1
18:40:13 <DorpsGek> [OpenTTD/team] serg-bloim opened issue #397: [uk_UA] Translator access request https://github.com/OpenTTD/team/issues/397
18:46:40 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on issue #10463: [Crash]: When I Opened the Game, my screen became flash, then game shut off. https://github.com/OpenTTD/OpenTTD/issues/10463
18:48:26 <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/7bd475b86c6c9f06a94cf85b3ad46dc538f8c3dd
18:48:27 <DorpsGek> - Update: Translations from eints (by translators)
18:48:52 <DorpsGek> [OpenTTD/team] glx22 commented on issue #397: [uk_UA] Translator access request https://github.com/OpenTTD/team/issues/397
18:56:03 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #10443: Fix: [Script] ScriptBase::Rand() return value was between -MIN(int32) and MAX(int32) https://github.com/OpenTTD/OpenTTD/pull/10443
19:03:40 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim opened pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
19:03:54 <frosch> https://cdn.discordapp.com/attachments/1008473233844097104/1073680729210355723/image.png
19:03:54 <frosch> I love that this was sent to abuse@ 🙂
19:04:16 <LordAro> :D
19:04:21 <LordAro> one for kamnet :p
19:04:22 <frosch> (it looks like an image, but it is actually text with weird background color and formatting
19:11:07 <Samu> wow, no compatibility?
19:11:11 <Samu> just merged?
19:12:47 <Samu> how many scripts is it gonna break
19:13:03 <LordAro> my guess is zero
19:17:11 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464#pullrequestreview-1293844712
19:25:20 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #10459: Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs and show buy company dialog window even when playing in the AI company https://github.com/OpenTTD/OpenTTD/pull/10459#pullrequestreview-1293862242
19:29:16 <Samu> i see some AIs using Rand with %
19:32:36 <TrueBrain> frosch: lol
19:33:41 <Samu> Search "Base.Rand" (1461 hits in 87 files of 358 searched)
19:33:49 <Samu> that's a lot
19:34:27 <Samu> Search "Base.Rand()" (32 hits in 17 files of 358 searched)
19:34:37 <Samu> Rand() itself isn't used much
19:35:21 <andythenorth> are we all learning WASM yet?
19:36:25 <Samu> ChooChoo is using abs(AIBase.Rand() % TICKS_PER_DAY)
19:36:41 <Samu> so yeah, negative values are used, and unwanted
19:37:35 <Samu> i think having no compatibility layers for the random function is a big risky, way too many scripts use random
19:39:25 <Samu> even libraries
19:41:05 *** crem2 has joined #openttd
19:44:32 <petern> I'm learning WASD
19:44:41 <andythenorth> I'm learning asdf
19:44:59 <LordAro> QWOP
19:45:21 <TrueBrain> wtf
19:47:55 *** crem1 has quit IRC (Ping timeout: 480 seconds)
19:49:36 <petern> QAOP is more sensible
19:49:39 <Samu> well, what to do with my PR that tried to fix Rand
19:52:17 <andythenorth> I'm learning [cursors]
19:55:23 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10373: Allow Scripts to convert returned uint32 values to int64 https://github.com/OpenTTD/OpenTTD/pull/10373#issuecomment-1426268982
19:55:36 <frosch> the problem with WASM seems to be, that imports and exports are like C linkage imports/exports, so the keeping a stable/compatible API is just as complicated
19:56:10 <TrueBrain> just as complicated as?
19:56:40 <frosch> imports are just prototypes with N args of simple types
19:56:52 <frosch> so whenever you add another parameter, you have to make a new method
19:57:06 <frosch> which means essentially adding a version number to every symbol
19:57:13 <TrueBrain> yeah, I get what you mean, I was wondering to what you were comparing it
19:57:29 <TrueBrain> "just as complicated" as what? 🙂
19:58:14 <frosch> some C++ libraries add namespaces with "version number", so all symbols are distinct between different versions
19:58:29 <TrueBrain> or, maybe phrased differently: so no change with Squirrel 😉
19:58:33 <frosch> c libaries usually add new names, so you have foo1, foo2, foo3
19:59:33 <TrueBrain> so I wonder why you see it as a problem 😄
19:59:49 <TrueBrain> they didn't solve this particular problem for you, no 🙂 But neither did Squirrel 🙂
19:59:52 <frosch> hmm, good point, our squirrel api is similar
20:00:09 <TrueBrain> well, we use a global version number, instead of an per-API-endpoint
20:00:12 <TrueBrain> but tomato tomato 🙂
20:00:27 <frosch> i was comparing it to dynamically types languages, just add a new member to a dict/struct/etc, and nothing changes
20:00:38 <TrueBrain> ah, yeah, no 🙂
20:01:01 <TrueBrain> the main thing that concerns me a bit, but I have to work with it a bit more to actually know, how different higher-languages are converted
20:01:08 <TrueBrain> I am afraid some really quickly want to use globals
20:01:19 <TrueBrain> which can be hard to save/load
20:02:05 <frosch> well, i am more on the newgrf track, so most things are pure functions without side effects
20:02:30 <TrueBrain> but do the compilers actually work like that, is what worries me somewhat
20:02:42 <TrueBrain> strings etc seem to be placed in the global space, which makes sense
20:02:43 <frosch> i want to make some performance tests. newgrf barely have any own code, and mostly call api methods to read "computed variables"
20:02:49 <TrueBrain> but can we differentiate between read-only and read-write?
20:03:26 <TrueBrain> in other words, can we guard that they actually are "without side effects"? 🙂
20:03:30 <TrueBrain> and does a user actually know
20:03:32 <frosch> squirrel only has strings for debug output 🙂
20:03:55 <frosch> for game texts we use stringids, and textstack, all integers, no strings
20:04:12 <TrueBrain> we, yes. But can we restrict that same usage for WASM? 🙂
20:05:49 <frosch> ok, so you want to check when wasm compilers start allocating memory?
20:06:12 <TrueBrain> it reads to me that we have far less control on what they do .. so that is a concern I have
20:06:20 <TrueBrain> one I am only going to discover by actually trying 😄
20:07:09 <frosch> i read it as: "globals" are fine for us, they are limited and known in advance. "memory" we can restrict to zero, so imports and grow-commands fail
20:07:54 <Samu> glx[d], are you still planning a worldwide change to SQIntegers? Need to decide what to do
20:08:20 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:11:28 <Samu> looks like you are
20:11:34 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:11:50 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:12:13 <glx[d]> samu: <https://github.com/OpenTTD/OpenTTD/compare/master...glx22:OpenTTD:SQInteger> <-- that's what I have for now
20:12:14 <TrueBrain> frosch: : yeah, so as soon as you use a string, you will do a `(memory $0 1)`
20:12:36 <TrueBrain> on its own not an issue, but it does mean that it can be a bit tricky to know there are no side-effects
20:13:04 <frosch> it just means: no strings for newgrf. strings for gs are fine
20:13:04 <Samu> okay, can i safely close my pr then?
20:13:24 <Samu> you're not planning compatibility for old apis, it seems
20:13:30 <frosch> it that a deal breaker for you? do you want to parse json inside newgrf?
20:13:35 *** TROILUS has quit IRC (Read error: Connection reset by peer)
20:13:56 <TrueBrain> this is way too early to indicate if anything is a dealbreaker, in any way shape or form 😄
20:13:59 *** TROILUS has joined #openttd
20:14:09 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim commented on pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464#pullrequestreview-1293934796
20:14:28 <TrueBrain> one can always adjust the VM code to not allow silly stuff
20:15:18 <frosch> sounds like trueasm 🙂
20:15:22 <TrueBrain> owh, I misunderstood the WASM instructions .. a `global` can still have `(memory $0 0)`
20:15:36 <TrueBrain> no, I mean to say: this is more about collecting "how does it actually work" 🙂
20:15:48 <frosch> "global" are like "extern int", "memory" is actually heap with mallloc
20:16:15 <TrueBrain> that was what I was thinking
20:16:30 <TrueBrain> but it seems to be more nuanced or something ..
20:16:34 <TrueBrain> toying with new stuff is confusing 😉
20:16:57 <frosch> well, wasm developers also seem to be toying :p
20:16:57 <TrueBrain> I made a global `z` of type `int` .. the `wat` file now contains `(global $module/z (mut i32) (i32.const 0))`
20:17:56 <frosch> they started with "tables" to avoid mixing code addresses with data. and then they added "reference type", which seems to throw "tables" out of the window.
20:18:17 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim commented on pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464#issuecomment-1426292990
20:18:44 <TrueBrain> so it appears to me that globals can also be defined from WASM
20:18:54 <TrueBrain> where the documentation suggested they had to be defined outside first
20:18:56 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:19:07 <TrueBrain> (suggested to me, that is)
20:19:36 <Samu> glx[d], did you decide -1 ScriptAirport::GetMaintenanceCostFactor(AirportType type) randomly? are you also going to chance the GetMaintenanceCostFactor of rail and road to -1? Cus it's currently 0.
20:19:47 <frosch> "globals" can be either "extern" or "static", you can define a global without importing it
20:19:58 <frosch> then it's only known to your wasm module
20:19:59 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:20:02 <TrueBrain> so now the question .. can we iterate all globals 🙂
20:20:21 <Samu> glx[d], I prefer it changed to -1, honestly
20:20:27 <glx[d]> samu it was -1
20:20:32 <dP> why is the first thing you want to do with a potential modding framework is to cripple it? 😜
20:20:37 <frosch> haha, i tried reading the opcodes, they were incredibly hard to read
20:20:42 <glx[d]> 0xFFFF for uint16 is -1
20:20:51 <frosch> so no idea where indirect adressing is possible 🙂
20:20:56 <DorpsGek> [OpenTTD/OpenTTD] serg-bloim updated pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464
20:21:09 <Samu> ah, yeah!
20:21:57 <Samu> okay, when you get to ScriptRoad::GetMaintenanceCostFactor, and ScriptRail::GetMaintenanceCostFactor, don't forget to make it -1 too, for consistency :)
20:22:55 <frosch> hmm, alternative option could be: allow wasm modules to set up globals and memory during initialisation, but lock them readonly for functions which must be pure
20:22:57 <Samu> 0xFFFF for uint16 was actually returning 65535
20:23:00 <Samu> not -1
20:23:11 *** gelignite has joined #openttd
20:23:15 <TrueBrain> frosch: which is why I am looking if we can iterate all globals
20:23:19 <TrueBrain> as if they are read-only, that is fine
20:23:20 <frosch> so, wasm modules can setup all the data they want, read it, but it throws if pure functions change them
20:23:54 <Samu> ah, no, you're right
20:24:02 <Samu> no wait, i'm wrong
20:24:06 <Samu> i'm right
20:24:10 <Samu> damn i'm so confused right now
20:24:26 <Samu> https://github.com/OpenTTD/OpenTTD/blob/master/src/script/squirrel_helper.hpp#L50
20:24:28 <frosch> you could also scan the binary, whether it contains any "store" instructions 🙂
20:24:28 <TrueBrain> ah, yes, you can iterate them; so then it is easy
20:24:41 <TrueBrain> you can even check the type (read vs readwrite)
20:25:01 <Samu> (int32)(uint16)65535 = 65535
20:25:02 *** TROILUS has quit IRC (Remote host closed the connection)
20:25:08 <frosch> oh, with "iterate" you meant iterating from outside the vm?
20:25:10 <TrueBrain> `wasm_globaltype_mutability`
20:25:11 *** TROILUS has joined #openttd
20:25:30 <TrueBrain> yeah, with wasmer and other implementations, after reading the `.wasm`, you can just get a list of all globals
20:25:44 <Samu> not -1
20:25:45 <TrueBrain> and during VM runtime, you can just check with `wasm_globaltype_mutability` whether those are mutable or not
20:25:58 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #10464: Reset late counter for the entire group. https://github.com/OpenTTD/OpenTTD/pull/10464#pullrequestreview-1293945752
20:26:10 <TrueBrain> it cannot be changed, it seems
20:26:20 <TrueBrain> but that is fine, in my opinion
20:27:12 <TrueBrain> https://www.assemblyscript.org/ has a cute TypeScript -> WAT thingy, which helped me understand a bit more how a higher-language is translated to WASM 🙂
20:27:26 <glx[d]> but it was supposed to be -1, and this value is only returned if `@pre` is not respected
20:30:09 <Samu> okay
20:31:54 <glx[d]> and all these auto type conversions are why I want to use SQInteger for all API functions
20:32:30 <glx[d]> and convert if needed in the functions
20:32:45 <glx[d]> explicit vs implicit
20:33:22 <glx[d]> also using SQInteger allows to check the ranges where needed
20:42:22 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10373: Allow Scripts to convert returned uint32 values to int64 https://github.com/OpenTTD/OpenTTD/pull/10373
20:49:34 *** herms has joined #openttd
20:58:47 <Samu> funny
20:59:21 <Samu> SQInteger points to https://github.com/OpenTTD/OpenTTD/blob/master/src/script/squirrel_helper.hpp#L55
21:00:54 <glx[d]> SQInteger is int64
21:02:24 <Samu> I expected it to use something internal, not squirrel_helper
21:03:19 <glx[d]> squirrel_helper is what's doing the move from/to squirrel virtual machine
21:05:04 <Samu> my bad
21:09:15 <DorpsGek> [OpenTTD/OpenTTD] edward-bailey opened issue #10465: [Crash]: Application Crashes if user does nothing when prompted to enter password when connecting to multiplayer server https://github.com/OpenTTD/OpenTTD/issues/10465
21:10:29 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on issue #10465: [Crash]: Application Crashes if user does nothing when prompted to enter password when connecting to multiplayer server https://github.com/OpenTTD/OpenTTD/issues/10465
21:14:01 <glx[d]> if only people actually tested betas and RCs
21:14:14 <LordAro> that'd be nice
21:16:04 <glx[d]> should be easy to reproduce, building master
21:18:25 <andythenorth> nightly and RC used to get tested a lot by coop
21:19:30 <andythenorth> the equivalent playerbase would be using JGRPP now
21:19:54 <andythenorth> things change
21:20:04 <DorpsGek> [OpenTTD/OpenTTD] edward-bailey commented on issue #10465: [Crash]: Application Crashes if user does nothing when prompted to enter password when connecting to multiplayer server https://github.com/OpenTTD/OpenTTD/issues/10465
21:24:28 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on issue #9823: [Bug]: Can't start a local server and connect to it on the same machine https://github.com/OpenTTD/OpenTTD/issues/9823
21:24:44 <FLHerne> frosch: wait, you're serious about wasm?!
21:25:47 <frosch> i want to check the implications
21:26:24 <frosch> even if we keep all newgrf api the same, and restrict wasm to what callbacks can do, it still solves the issue of action2 limits, callback result limit, and what not
21:26:48 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on issue #10465: [Crash]: Application Crashes if user does nothing when prompted to enter password when connecting to multiplayer server https://github.com/OpenTTD/OpenTTD/issues/10465
21:27:20 <FLHerne> Are existing wasm interpreters compatible with the whole synchronous-lockstep thing?
21:27:28 <FLHerne> historically JS has a lot of floats
21:28:14 <glx[d]> this->CloseConnection(res) with this == nullptr
21:28:16 <FLHerne> "everything numeric is a double" (I know wasm itself lacks that problem, but aiui wasm interpreters have largely evolved from JS ones?)
21:28:29 <frosch> we have two options for floats 🙂 there is a wasm implementation on gh, which states it's being determinisitic, specifically talking about floats. but we can also just disable floats
21:29:44 <frosch> i just see it as: newgrf are reaching the limits what a2+va2+a3, if we need a new syntax, we can as well use one with existing infrastructure
21:30:21 <glx[d]> ah `myclient` is null at that point
21:31:10 <FLHerne> ok, I can see the appeal
21:31:12 <TrueBrain> it would mean we have to educate some people in how to do something like Rust, or Javascript, or one of those languages that can be translated into wasm 😛
21:31:35 <FLHerne> replace Squirrel too plz :p
21:32:12 <andythenorth> https://pythondev.readthedocs.io/wasm.html
21:32:31 <andythenorth> oh wait, that's running python, not compiling from it?
21:32:43 <TrueBrain> yeah, make no mistake, that is compiling Python, the interpreter, to WASM. Not Python-script alone 😛
21:33:44 <TrueBrain> frosch: I wonder if we can bring a C struct inside the WASM memory, so it can directly access, say, industry members
21:33:50 <TrueBrain> or do we have to wrap everything in functions? 🙂
21:34:17 <TrueBrain> function-based API is easier to maintain, I guess, but also requires a lot of wrappers 😛
21:34:55 <frosch> that's exactly what i am exploring 🙂
21:35:33 <frosch> expose a immutable memory segment, and have api methods for "get_cargospec(cargolabel)", which gives you a start-offset
21:35:37 <andythenorth> ok rust then 😛 I unsubscribed from javascript in 2002
21:35:54 <frosch> allows extending the cargospec at the end, without worries about compatibility
21:36:03 <frosch> kind of like virtual classes
21:36:49 <TrueBrain> would it also be a moment to rethink some of the NewGRF inner workings? 😛
21:37:08 <andythenorth> seems can learn Rust by guessing https://play.rust-lang.org/?version=stable&mode=debug&edition=2021
21:37:23 <andythenorth> I type function foo() and it tells me to use fn foo()
21:37:30 <frosch> sure some, but don't get too excited 🙂 the hardest part of newgrf is still, that you have to deal with the arbitrary ttd mechanics
21:37:40 <TrueBrain> but do we?
21:37:46 <TrueBrain> say, we leave the current API for what it is
21:37:50 <TrueBrain> and build a new one next to it?
21:37:54 <TrueBrain> would that be too ambitious? 😛
21:39:03 <frosch> i'll give you an example: industry stockpiles. industries can stop accepting cargo, when stockpile is full. ECS people complained that it does not work, industries get too much cargo
21:39:57 <frosch> reasons are: (1) cargo is delivered in packages, so if industry has 995 waiting, and you deliver a package of 10, you cannot deny 5 overshooting 1000. (2) ottd updates acceptance in station loop, so is delayed by up to 256 ticks
21:40:14 <frosch> similar "engine mechanics" apply to drawing tiles, sprites and more
21:40:25 <frosch> all those things do not become easier by switching to wasm
21:40:45 <frosch> you have to switch to factorio instead then :p
21:40:49 <TrueBrain> well, just to play devils advocate, one could say: also change how this new API works
21:41:06 <TrueBrain> so, in your example: when cargo is delivered, run a piece of WASM that handles the cargo handling for that industry, instantly
21:41:20 <TrueBrain> so yeah, much more factorio-style 😉
21:41:37 <TrueBrain> (including updating of station acceptance, I mean)
21:41:58 <frosch> it's an issue of optimisation vs. modability
21:42:03 <TrueBrain> yup
21:42:07 <TrueBrain> but CPUs are more powerful now 🙂
21:42:14 <frosch> ottd does certain shortcuts for speed. that restricts what is possible to change
21:42:31 *** gelignite has quit IRC (Quit: Stay safe!)
21:42:41 <frosch> trains can change running cost depending on engine speed and slope, because ottd computes costs every day
21:42:57 <frosch> trains cannot adjust maxspeed depending on date, because ottd only recomputes max-speed on track-type change
21:43:26 *** berndj has quit IRC (Remote host closed the connection)
21:43:36 <TrueBrain> haha 🙂
21:43:40 <TrueBrain> the weird little details 😛
21:43:40 <andythenorth> I am now a Rust programmer https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a43bcdee37b2bee445ef05ccb7ecf050
21:44:00 *** berndj has joined #openttd
21:44:20 <Xaroth> My condolences, andy.
21:44:38 <TrueBrain> this is also what I meant the other day with the remark: you can push a lot of game logic to WASM, if you go this route; and yes, I realise that is pushing it 😛
21:44:44 <andythenorth> can we embed a rust function in every tile?
21:44:47 <andythenorth> 😛
21:45:14 <TrueBrain> at a certain point you are better off starting a new game 😄
21:45:14 <frosch> i don't believe wasm makes newgrf faster
21:45:22 <TrueBrain> no, it won't make it faster for sure
21:45:28 <frosch> newgrf are almost no own code, but mostly calling api methods in ottd
21:45:42 <TrueBrain> but did anyone suggest it would? 🙂
21:46:04 <frosch> your "move more game logic into wasm" implies it would :p
21:46:11 <TrueBrain> then you are missing the point
21:46:14 <andythenorth> did this arise because I keep whining about Squirrel? or was it just the correct time to look at it? 🙂
21:46:18 <TrueBrain> as performance was not the consideration for that remark
21:46:28 <TrueBrain> WASM has the unique position that it can be compiled from complex piece of code
21:46:32 <TrueBrain> say, the whole station-handling
21:46:44 <TrueBrain> we can just make WASM out of that, in like .. minutes of coding work
21:46:58 <TrueBrain> so it pushes the boundary of what wasn't possible, as writing it in NewGRF would be .. well .. impossible? 🙂
21:47:03 <Xaroth> andythenorth: if you want we can just blame you for it regardless? :P
21:47:11 <andythenorth> thanks
21:47:22 <Xaroth> (that said, I think TB is onto something interesting)
21:47:27 <Xaroth> (so good job andy)
21:48:09 <TrueBrain> so basically the question I am trying to ask: should the NewGRF API be at the same place? 🙂
21:48:31 <frosch> xaroth: can you change your nick to something not starting with X? i have a mental filter for people starting with X and about 6 letters
21:48:33 <TrueBrain> (and yes, I am pushing it, I know 😛 But sometimes it is just nice :P)
21:48:48 *** XarothBrook has joined #openttd
21:48:48 <XarothBrook> frosch: I can use my long name if that works better?
21:48:53 <andythenorth> imagine if there was some commonality in the API, where it's appropriate 😛
21:48:54 <bigyihsuan> ~~just casually port ottd to rust~~
21:48:54 <XarothBrook> also I had that name first.
21:49:10 <Xaroth> Look, now there's two of me!
21:49:15 <TrueBrain> take another example, town growth. If we add the different algorithms we have now in small WASMs, that would also allow for a mod to add new methods
21:49:19 <TrueBrain> that line of thought 🙂
21:49:36 <dP> vanilla as a mod
21:49:59 <andythenorth> yes
21:50:25 <TrueBrain> I mention this as I think CPU is far less of a problem these days than when NewGRF was created; so we have more choices, I would guess
21:50:40 <TrueBrain> drawing our screen is mostly still the most expensive job 😛
21:50:43 <frosch> ok, so you want to port parts of ottd to wasm 🙂
21:51:00 <TrueBrain> well, one could argue that every train has its own WASM VM
21:51:12 <TrueBrain> not the train-type, or the engine, but the whole train
21:51:14 <frosch> so far attempts to reimplement original industries in newgrf failed, because original industries are such a mess with so many exceptions, that noone wants to deal with the arbitrary details :p
21:51:28 <TrueBrain> that is a true problem
21:51:30 <bigyihsuan> dP: tbf that's how factorio does it, vanilla is a mod
21:51:31 <TrueBrain> the old AI had the same
21:52:08 <dP> actually on big games simulation is still the most time-consuming
21:52:09 <TrueBrain> also something to just experiment with, honestly .. it might be horrible for reasons X / Y / Z 😛
21:52:37 <frosch> we mostly have to throw-out savegame compatibilty for a few years, until we have a stable api 🙂
21:52:41 <dP> and sometimes "big" is just an empty 4k map :p
21:52:48 <TrueBrain> frosch: haha, yes 😛
21:53:15 <TrueBrain> and for sure not something that can be reached in one day
21:53:35 <TrueBrain> but with WASM the line of NewGRF and GS can become blurry really easily 😛 So it can be iterative
21:54:12 <dP> imo api should never be fully cast in stone like newgrf or gs
21:54:23 <TrueBrain> which brings me back to the point: do you intent to replace the full NewGRF API, or do we part ways with some .. odd parts of the current NewGRF? (and leave the current NewGRF for those parts?). Not looking for an answer btw 😛
21:55:16 <dP> api stability is good until it makes adding things a pain
21:55:23 <TrueBrain> anyway, back to reality; curious what you figure out with shared memory frosch 🙂
21:57:35 <frosch> i am still scared that the add-on api would be specified by something like linux-headers, defining all the prototypes of imported things 🙂
21:57:55 <frosch> i am so used to defining asm-style "newgrf register X bit Y contains this"
21:58:20 <TrueBrain> new way of thinking 😄
21:58:28 <TrueBrain> for a game almost .. 30 years old .. 😄
21:58:30 <frosch> i am also used to python-style dynamic typing. but i never had to design a stable c/c++ api
21:59:13 <frosch> i encounter shared-object ABI problems only as a user of external libraries, not as a designer of them
21:59:26 <TrueBrain> well, we have Squirrel API as an example
21:59:37 <TrueBrain> so hopefully that helps a tiny bit 🙂
22:00:31 <frosch> like people downloading pyqt and some other packages with lots of libraries, and then encountering incompatible libcrypto :p
22:00:58 <frosch> TrueBrain: i did not have the impression, that our squirrel api was that successful :p
22:01:14 <andythenorth> for authors, or for core game?
22:01:16 <TrueBrain> the API itself is fine I think?
22:01:31 <dP> for anyone 🤣
22:01:38 <frosch> i think for ai it works
22:01:47 <andythenorth> my $0.02 the API is fine, in narrow bounds
22:01:52 <frosch> but for gs the main-loop thingie with event-polling appears wrong
22:02:03 <TrueBrain> yeah, but that is not as much related to how the API is presented
22:02:12 <TrueBrain> but yeah, I get what you mean 🙂
22:02:16 <frosch> gs mostly react to game events, so some async event executor would be more fitting
22:02:27 <andythenorth> the actual API
22:02:27 <andythenorth> - the docs are basically fine, but lack examples
22:02:27 <andythenorth> - I have been able to extend the API, it seems clean
22:02:28 <TrueBrain> come to think of it, having an API with only functions can make things a lot easier for compatibility
22:02:39 <TrueBrain> having variables can be difficult to keep in sync
22:02:48 <TrueBrain> unless we can have setter/getter over them .. hmm
22:02:55 <frosch> oh, and of course, the biggest problem: gs only runs on server
22:03:09 <frosch> so it has to call weird setters, which send stuff to clients, and the actual logic is inside ottd again
22:03:12 <dP> gs api is basically just a wrapper for network commands
22:03:17 <DorpsGek> [OpenTTD/OpenTTD] glx22 opened pull request #10466: Fix #10465: Don't try to close an already closed connection https://github.com/OpenTTD/OpenTTD/pull/10466
22:03:19 <frosch> like, the city growth rate disaster 🙂
22:03:21 <dP> at least in the part that actually does something
22:03:29 <frosch> a gs calling a command to update growth-rate of a single town
22:03:39 <andythenorth> the problems I've had with GS
22:03:39 <andythenorth> - the execution environment is basically just weird
22:03:39 <andythenorth> - it's trivial to write really pathological code
22:03:39 <andythenorth> - squirrel 2 is dead
22:03:56 <frosch> even if there was a bulk-command, it would still not be good
22:03:57 <andythenorth> the narrow part of the API is not where the problem is 🙂
22:04:17 <TrueBrain> glx[d]: something feels off in the logic you present .. line 239 also use `my_client`?
22:05:03 <TrueBrain> so `my_client` is deleted in `ReceivePackets`?
22:06:17 <glx[d]> yes
22:08:53 <glx[d]> just before Receive_SERVER_ERROR() returns NETWORK_RECV_STATUS_SERVER_ERROR which is then returned by HandlePacket() and finally returned by ReceivePackets()
22:09:16 <andythenorth> frosch: it only takes about 6 minutes real time on a large map, on fast forward
22:09:32 <andythenorth> 9999 towns or so
22:09:38 <TrueBrain> so isn't then the issue more that the window shouldn't be closed by `SERVER_ERROR`, I wonder?
22:09:57 <andythenorth> only 960ms in my 32 town test map
22:09:57 <TrueBrain> but instead, for example, by closeconnection?
22:10:28 <TrueBrain> or `ClientError`
22:10:46 <TrueBrain> seems a bit weird at least, your PR, with the reasoning behind it .. but I can't put my finger on it 😄
22:11:01 <frosch> is my_client set to nulltpr in the destructor?
22:11:05 <TrueBrain> yes
22:11:25 <frosch> is this again some deferred-free magic? or is "this" also invalid in that method?
22:11:43 <TrueBrain> static-function
22:11:50 <frosch> oh
22:11:53 <glx[d]> oh client error closes the window
22:12:04 <glx[d]> let's try
22:12:05 <TrueBrain> in general, this `my_client` is very weird
22:12:10 <TrueBrain> it is some kind of singleton, but not really
22:12:11 <TrueBrain> or something
22:12:27 <TrueBrain> I blame young me or Rb or DV for writing this 😛
22:12:54 <glx[d]> I think it was you 😉
22:13:18 <TrueBrain> pointing fingers .. pff 😛
22:13:29 <TrueBrain> makes it easier to say: it is shit 🙂
22:13:31 <frosch> i see, CloseConnections calls "delete this"
22:13:40 <frosch> and every caller has to "return" afterwards 🙂
22:13:50 <TrueBrain> yeah, it is just bad
22:14:45 <glx[d]> but ClientError() seems to also close the window, so it might be better to not close the window too early
22:15:00 <TrueBrain> it only closes it with `CLOSE_QUERY`
22:15:06 <TrueBrain> in your case it is with `SERVER_ERROR`
22:15:12 <TrueBrain> but changing that ofc is easy 😛
22:16:38 <glx[d]> and we don't want the switch to menu in this case
22:17:15 *** keoz has quit IRC (Ping timeout: 480 seconds)
22:17:33 <TrueBrain> I am still missing why `CloseConnection` is already called, I have to admit
22:18:05 <TrueBrain> closing the window doesn't seem to call that?
22:18:37 <glx[d]> NetworkDisconnect() in query text handler
22:18:45 <TrueBrain> owh, that guy ..
22:19:09 <TrueBrain> on `OnQueryTextFinished` I guess?
22:19:42 <TrueBrain> what a way to terminate the connection .. just yoink the whole network stack
22:19:48 <TrueBrain> this "singleton" 😛
22:20:48 <TrueBrain> lol, it even tries to send a Quit message to the server
22:21:24 <TrueBrain> so yeah, it seems it would be better to first close the connection, then call the CloseWindowById 😛 Far less side-effects 😄
22:21:30 <glx[d]> yes to be nice if user discard the password window before server timeout
22:21:32 <TrueBrain> and now I need a shower ... what a code ... 😛
22:22:06 <andythenorth> would we consider UI windows backed by WASM? 😛
22:23:19 <TrueBrain> glx[d]: : so I guess closing the window after line 214 and not closing it in `SERVER_ERROR` should also fix the issue? Well, I leave it to you; what a weird piece of code 😛
22:23:34 <frosch> andythenorth: have you ever used a ui framework with a C api?
22:23:40 <andythenorth> 'no'
22:23:46 <frosch> lucky you 🙂
22:24:39 <frosch> andythenorth: gs api for https://en.wikipedia.org/wiki/Tk_(software) ?
22:25:10 <andythenorth> do we have to write our own widget toolkit? 😛
22:25:32 <frosch> oh even better, we could offer an X11 api :p
22:25:35 <andythenorth> I was just thinking of maybe a story book that didn't have button click latency of multiple seconds 😛
22:25:37 <glx[d]> well just not closing it in Receive_SERVER_ERROR() works, but returning to game menu is a bit too much 🙂
22:26:09 <glx[d]> so yeah I'll try to make it less "violent"
22:26:51 <TrueBrain> frosch: : what I guess would be fun with WASM, that we can have an API like: `get_industry_property(0x90)` or what-ever, and for a language like C++ or Rust have a header-file that makes something like `this.cargo_acceptance()` work, with some inline functions
22:27:04 <TrueBrain> didn't consider that yet, that the compiler will just optimize that out back to the API functions
22:27:12 <TrueBrain> sorry, might be obvious, but just now realise that 😄
22:27:59 <TrueBrain> glx[d]: : fun fact, there are 8 places that close the join window 😄
22:28:00 <TrueBrain> lol
22:28:00 <frosch> did you notice the similarity to truegrf?
22:28:13 <TrueBrain> in what sense?
22:28:44 <frosch> you define these "high level variables" like nml, and then have a stack machine to write your code
22:29:04 <TrueBrain> yeah, indeed. But this time it can be done by an actual compiler
22:29:05 <TrueBrain> 😄
22:29:05 <frosch> i forgot what you called your stack-machine in truegrf
22:29:13 <TrueBrain> it is some RPN, all I remember
22:29:18 <andythenorth> the RPN stack thing?
22:29:21 <andythenorth> I was going to learn RPN 😛
22:30:00 <frosch> though wasm also has if/else, which is unsual for RPN :p
22:30:00 <TrueBrain> but with TrueGRF the issue was it had to be able to synth NewGRF .. so something like WASM isn't going to fly, as that cannot be encoded as a NewGRF 😛
22:30:36 <TrueBrain> and yes, I would be happy if I can burn that RPN with fire 😛
22:31:34 <TrueBrain> but yeah, the more I think about it, the more I consider it unavoidable to also have some boilerplate in the language used to compile to WASM 🙂 Which is honestly not even a bad thing .. means the API can stay simple
22:31:35 <kamnet> Queston for devs WRT Bananas. I'm working on a revision of George's Toyland to Mars Conversion, which contains graphics assets from TTO. Since Toyland to Mars has already been uploaded to Bananas, is there any objection to me adding my revisions?
22:32:24 <TrueBrain> are you now asking if it is okay to upload copyrighted material you don't have a license for, or am I misreading this? 😛
22:32:28 <frosch> kamnet: don't ask questions you don't want an answer for
22:33:11 <frosch> i never used the mars conversion set, no idea what it's about, i only had TTD, no TTO
22:33:57 <TrueBrain> so I gather from these remarks that TTO had a mars landscape? TIL 🙂
22:33:59 <kamnet> I'm asking that since there's already a known copy of the copyrighted assets, would it be permisable to add another which fixes what is broken in the previous one. It's very much a judgment call IMO, and if anybody has an objection then I won't add it.
22:34:27 <TrueBrain> sorry, but what a silly question .. you now force us to look into the other asset, and possibly take it down for copyright infringement?
22:34:33 <TrueBrain> you do understand we have a due diligents, right?
22:35:01 <kamnet> Yep. Thus my reason for asking.
22:35:14 <TrueBrain> so tnx, now you make me look into that ....... something I was not looking forward to
22:35:22 <TrueBrain> and no, it is not okay to upload any work you don't own the license of
22:35:23 <TrueBrain> ever
22:35:28 <TrueBrain> which is common sense, sorry 😦
22:35:48 <TrueBrain> we even explicitly ask you when uploading to BaNaNaS 🙂
22:35:50 <kamnet> Nothing to be sorry for.
22:38:41 <TrueBrain> luckily for us, it only happens once a blue moon that someone reports uploaded content by someone who didn't own the license to do so 🙂 Running platforms in good-faith is always a bit tricky 🙂
22:38:50 <TrueBrain> many games had a lot more issues moderating these kind of systems
22:38:53 <TrueBrain> we have been lucky 🙂
22:39:35 <kamnet> The devs have always done an excellent job of protecting the community and doing what is right.
22:40:02 <Samu> glx[d], since you've reviewed https://github.com/OpenTTD/OpenTTD/pull/10458, I am about to undo the Script Settings move I've done, and go back to what you had done. I already have the branch ready. It will only have the minor changes requested. Do you aprove? Do I click "Force push origin"?
22:40:32 <Samu> I regretted having done the move
22:40:42 <glx[d]> which changes are you doing ?
22:40:56 <TrueBrain> kamnet: we try to 🙂
22:41:03 <glx[d]> because GSConfig as it is now is fine
22:41:56 <Samu> the minor changes like the simplification arastasis mentioned, some Config static function being removed, and call in constructor
22:41:57 <DorpsGek> [OpenTTD/team] ppxppy opened issue #398: [pt_PT] Translator access request https://github.com/OpenTTD/team/issues/398
22:42:08 <Samu> and minor typoes
22:44:02 <Samu> I will of course, have to rename the PR and the message, it's being undone
22:44:13 <Samu> that is, if I press the button
22:44:31 <DorpsGek> [OpenTTD/team] ppxppy opened issue #399: [pt_PT] Translator access request https://github.com/OpenTTD/team/issues/399
22:44:51 <glx[d]> maybe push it in another branch and mention it in #10458 first
22:45:03 <Samu> okay
22:45:26 <glx[d]> just in case #10458 is finally prefered 😉
22:45:26 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:49:12 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10458: Codechange: Move AI settings back to ai_gui https://github.com/OpenTTD/OpenTTD/pull/10458#issuecomment-1426445046
22:49:31 <Samu> :)
22:51:21 <andythenorth> was I going to sleep?
22:51:23 <andythenorth> pls advise
22:51:30 <TrueBrain> only after counting 12 more sheep
22:52:26 <kamnet> You probably were but now I'm going to keep you awake all night, so soz.
22:52:30 <andythenorth> is it one sheep per tick?
22:52:35 <andythenorth> or can I batch them?
22:52:38 <frosch> you can also count trains
22:52:41 <frosch> or wagons
22:52:47 <frosch> livestock wagons with sheep
22:52:50 <andythenorth> oh WASM
22:52:57 <TrueBrain> omg, this got out of hand quick
22:52:58 <glx[d]> hmm annoying NETWORK_ERROR_TIMEOUT_PASSWORD can happen at 2 different moments
22:52:58 <andythenorth> we can convert Train Whack! directly
22:52:59 <TrueBrain> you guys ...
22:53:10 <andythenorth> Train Whack! is just stupid client side javascript
22:53:19 <glx[d]> server password or company password
22:53:46 <andythenorth> I was going to make Train Whack! in GS, but it will take 10s to generate the trains
22:56:40 <andythenorth> ok 12 sheep counted 😄
22:57:13 <Samu> I'm going to sleep, take care everyone
22:57:19 *** Samu has quit IRC (Quit: Leaving)
23:31:18 <DorpsGek> [OpenTTD/team] glx22 commented on issue #399: [pt_PT] Translator access request https://github.com/OpenTTD/team/issues/399
23:56:18 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #10458: Codechange: Move AI settings back to ai_gui https://github.com/OpenTTD/OpenTTD/pull/10458#issuecomment-1426505937