IRC logs for #openttd on OFTC at 2023-02-07
            
00:05:59 *** jact[m] has joined #openttd
00:10:06 *** sla_ro|master has quit IRC ()
00:11:58 *** tuxayo has joined #openttd
00:54:44 *** linda[m]1 has joined #openttd
01:42:24 *** jeeg[m] has joined #openttd
02:02:59 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
02:14:11 *** WormnestAndroid has joined #openttd
02:19:24 *** dag[m] has joined #openttd
02:39:21 *** karoline[m] has joined #openttd
02:57:23 <TROILUS> Hi how to display timestamp when server running? It's only "dbg: [net] Map generation percentage complete: 35".
03:07:16 <glx[d]> for dedicated server timestamp is enabled by default
03:09:10 <glx[d]> else it's show_date_in_logs in [gui] section of openttd.cfg
03:09:23 *** Wormnest has quit IRC (Quit: Leaving)
03:20:09 <TROILUS> glx[d] but when I start the dedicated server, it's only dbg: xxxxxxx, without timestamp.
03:20:59 <TROILUS> like pb.koi.moe/9E
03:25:01 <glx[d]> <https://gist.github.com/glx22/e450344c4d3215e764bc8b096d015982> <-- that's what I get, and `show_date_in_logs` is set to true in openttd.cfg
03:26:54 <glx[d]> if it's set to false there's no timestamp
03:40:31 *** KiriDore has joined #openttd
03:45:06 *** teun has quit IRC (Remote host closed the connection)
03:45:06 *** MasterOktagon has quit IRC (Remote host closed the connection)
03:45:06 *** discord_user_f4a0790 has quit IRC (Remote host closed the connection)
03:45:06 *** dP has quit IRC (Remote host closed the connection)
03:45:06 *** Merni has quit IRC (Remote host closed the connection)
03:45:06 *** JGR has quit IRC (Remote host closed the connection)
03:45:06 *** Dank_meme_kong has quit IRC (Remote host closed the connection)
03:45:06 *** Happpy has quit IRC (Remote host closed the connection)
03:45:06 *** Brickblock1 has quit IRC (Remote host closed the connection)
03:45:06 *** BriggsSaint has quit IRC (Remote host closed the connection)
03:45:06 *** scrubbles has quit IRC (Remote host closed the connection)
03:45:06 *** Gwyd has quit IRC (Remote host closed the connection)
03:45:06 *** TonyPixel has quit IRC (Remote host closed the connection)
03:45:06 *** EmperorJake has quit IRC (Remote host closed the connection)
03:45:06 *** bigyihsuan has quit IRC (Remote host closed the connection)
03:45:06 *** All_Heil_Lord_Pepe has quit IRC (Remote host closed the connection)
03:45:06 *** Yozora has quit IRC (Remote host closed the connection)
03:45:06 *** glx[d] has quit IRC (Remote host closed the connection)
03:45:06 *** XarothBrook has quit IRC (Remote host closed the connection)
03:45:06 *** frosch has quit IRC (Remote host closed the connection)
03:45:06 *** kamnet has quit IRC (Remote host closed the connection)
03:45:06 *** Xarick has quit IRC (Remote host closed the connection)
03:45:06 *** GLaDOS has quit IRC (Remote host closed the connection)
03:45:06 *** wyndbain has quit IRC (Remote host closed the connection)
03:45:06 *** reldred has quit IRC (Remote host closed the connection)
03:45:06 *** osswix has quit IRC (Remote host closed the connection)
03:45:06 *** imlegos has quit IRC (Remote host closed the connection)
03:45:06 *** TrueBrain has quit IRC (Remote host closed the connection)
03:45:06 *** Pruple has quit IRC (Remote host closed the connection)
03:45:06 *** michi_cc[d] has quit IRC (Remote host closed the connection)
03:45:06 *** TallTyler has quit IRC (Remote host closed the connection)
03:45:06 *** mlt has quit IRC (Remote host closed the connection)
03:45:06 *** RatCircus has quit IRC (Remote host closed the connection)
03:45:06 *** petern has quit IRC (Remote host closed the connection)
03:45:06 *** andythenorth[d] has quit IRC (Remote host closed the connection)
03:45:06 *** DorpsGek_v has quit IRC (Remote host closed the connection)
03:45:22 *** DorpsGek_v has joined #openttd
03:46:46 *** D-HUND has joined #openttd
03:46:58 *** KiriDore_ has quit IRC (Ping timeout: 480 seconds)
03:50:07 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:52:16 *** D-HUND is now known as debdog
04:04:43 *** natmac[m] has joined #openttd
04:05:30 *** Flygon has joined #openttd
04:10:20 *** grag[m] has joined #openttd
04:15:13 *** TROILUS8 has joined #openttd
04:15:20 <TROILUS8> glx[d] thanks, it works.
04:20:43 *** TROILUS has quit IRC (Ping timeout: 480 seconds)
04:20:44 *** TROILUS8 is now known as TROILUS
04:31:49 *** ist5shreawf[m] has joined #openttd
04:39:03 *** keoz has joined #openttd
04:51:46 *** ookfof[m] has joined #openttd
07:22:24 *** sla_ro|master has joined #openttd
07:31:57 *** andythenorth has joined #openttd
07:31:57 <andythenorth> ok let's write some GS classes πŸ˜›
07:32:08 <andythenorth> wonder if I can bloat the memory use again
07:32:41 <andythenorth> Squirrel seems to not garbage collect things used in class constructors in some circumstances
07:45:59 *** dP has joined #openttd
07:46:00 <dP> what's the simplest way to see savegame version?
07:59:15 <andythenorth> eh squirrel does have lambdas πŸ˜„ GG
07:59:46 *** KiriDore_ has joined #openttd
07:59:47 <andythenorth> oh
07:59:55 <andythenorth> guess which version of Squirrel doesn't have lambdas
08:00:51 <andythenorth> ugh
08:01:04 <andythenorth> I want to pass anonymous functions into class constructors
08:01:08 <andythenorth> for simple expressions
08:01:26 <andythenorth> like `industry count should be maintained as town_count / 2`
08:01:54 <andythenorth> without having to write named functions in the class for all possible cases of that
08:06:07 *** KiriDore has quit IRC (Ping timeout: 480 seconds)
08:17:57 *** KiriDore has joined #openttd
08:23:03 *** KiriDore1 has joined #openttd
08:24:23 *** KiriDore_ has quit IRC (Ping timeout: 480 seconds)
08:28:15 *** KiriDore has quit IRC (Ping timeout: 480 seconds)
08:33:18 *** LordArtoo is now known as LordAro
08:48:01 *** petern has joined #openttd
08:48:01 <petern> dP: load the savegame and look at the gamelog
09:23:22 <andythenorth> lol, Squirrel lack of named / optional function args bites me again πŸ˜„
09:23:41 <DorpsGek> [OpenTTD/OpenTTD] orudge commented on pull request #10451: Fix: Ensure logo for Windows Store common assets package is named correctly https://github.com/OpenTTD/OpenTTD/pull/10451#issuecomment-1420452014
09:23:49 <DorpsGek> [OpenTTD/OpenTTD] orudge merged pull request #10451: Fix: Ensure logo for Windows Store common assets package is named correctly https://github.com/OpenTTD/OpenTTD/pull/10451
09:24:00 <andythenorth> IndustryTypeMonitor(industry_type, 7, true, true, false, 3, 6);
09:24:09 <andythenorth> what is this, 1992?
09:24:26 <andythenorth> GOTO 10
09:25:34 <andythenorth> ok going to python template that crap πŸ™‚
09:26:49 <andythenorth> for the audience at home....GS is actually fun
09:26:54 <andythenorth> and we haven't done enough of it
09:27:02 <andythenorth> but it is like choosing to poke yourself in the eye for amusement
09:27:34 <andythenorth> it could do so much for gameplay QoL though
09:27:37 <andythenorth> as well as the lolz
09:31:17 *** Etua has joined #openttd
09:35:10 <andythenorth> wonder if can make my own lambda constructor
09:35:40 <andythenorth> horrific idea, wonder if Squirrel 2 has eval()
09:35:55 <dP> andythenorth: your gs isn't slow enough? 😜
09:37:28 <andythenorth> ?
09:37:54 <andythenorth> hmm seems Squirrel 2 does not have eval()
09:37:57 <andythenorth> this is probably a good thing
09:39:52 <petern> Heh
09:41:49 <andythenorth> wonder if I can fake a lambda
09:41:58 <andythenorth> with a list of function names / operators
09:42:15 <andythenorth> probably not πŸ™‚
09:58:24 <dP> so nice to have openttd compile under 1 min again...
09:58:42 <dP> can work on stuff without forgetting what I was doing every compile xD
10:05:59 <petern> New PC?
10:08:30 <dP> yeah, new laptop
10:14:41 <dP> oh, wow, my previous one was made in 2011
10:14:57 <dP> no wonder it wasn't quite cutting it even after ram upgrades xD
10:15:50 <dP> even back then it was just a cheap acer
10:22:40 *** Flygon_ has joined #openttd
10:25:14 *** Etua has quit IRC (Quit: Etua)
10:26:57 <petern> Oh no, you'll now be a proponent of 4kx4k maps 😦
10:28:25 *** Flygon has quit IRC (Ping timeout: 480 seconds)
10:42:22 *** Samu has joined #openttd
11:01:01 <dP> nah
11:01:27 <dP> I don't play for more than a few hours per game :p
11:02:59 <dP> also, it's not ever faster than my desktop I used for last 3 years
11:03:02 <dP> shame on intel
11:03:10 <dP> I though it could at least beat in on single core
11:24:49 <DorpsGek> [OpenTTD/OpenTTD] GrzegorzDrozd opened issue #10453: [Bug]: Unknown NewGRF is reporting compatibility issue. https://github.com/OpenTTD/OpenTTD/issues/10453
11:27:38 <DorpsGek> [OpenTTD/OpenTTD] PikkaBird commented on issue #10453: [Bug]: Unknown NewGRF is reporting compatibility issue. https://github.com/OpenTTD/OpenTTD/issues/10453
11:28:40 <DorpsGek> [OpenTTD/OpenTTD] PikkaBird commented on issue #10453: [Bug]: Unknown NewGRF is reporting compatibility issue. https://github.com/OpenTTD/OpenTTD/issues/10453
11:38:25 <Samu> wow github desktop can let me select multiple commits now
11:38:34 <Samu> then gives me the option to squash and rebase
11:38:43 <Samu> the tool is becoming great
11:48:29 <DorpsGek> [OpenTTD/OpenTTD] GrzegorzDrozd commented on issue #10453: [Bug]: Unknown NewGRF is reporting compatibility issue. https://github.com/OpenTTD/OpenTTD/issues/10453
11:48:37 <Samu> 6013 ms
11:50:28 <Samu> 3282 ms
11:51:16 <Samu> meh, real world gains are not that impressive
11:51:29 <Samu> release build gains, i mean
11:53:42 <Samu> 32186 ms
11:57:18 <Samu> 122706 ms
11:57:33 <Samu> in debug build
11:57:50 <Samu> @calc 3282 / 6013
11:57:50 <DorpsGek> Samu: 0.545817395642774
11:58:06 <Samu> @calc 32186 / 122706
11:58:06 <DorpsGek> Samu: 0.2623017619350317
11:58:24 <Samu> the gains are much more pronounced in debug mode
12:01:48 <petern> Odd that...
12:02:22 <LordAro> twice as fast is still an excellent speed up
12:14:25 *** TallTyler has joined #openttd
12:14:25 <TallTyler> Lots of people are reporting a web translator issue, which I’m also experiencing: https://github.com/orgs/OpenTTD/teams/translators/discussions/13
12:59:47 <dP> if command has a tile argument like BuildDock is tile sent twice in the packet?
13:00:58 <dP> as tile and as data
13:08:21 *** glx has joined #openttd
13:08:21 <glx> Only if more than one tile arg
13:09:00 *** glx is now known as Guest4004
13:09:01 *** Guest4004 is now known as glx[d]
13:09:10 <glx[d]> But the first one is automatically checked for validity
13:11:28 <glx[d]> TallTyler: I changed it yesterday without issues
13:12:16 <glx[d]> But I had other strings to fix after this one
13:14:04 <glx[d]> Oh I think it's because the string was already 'correct' because it was not touched between the AI/GS split, and my recent cleanup
13:15:27 <dP> glx[d]: I mean the first one. It seems to replace the command tile with it but something is still sent in the packet tile
13:18:02 <dP> this special tile handling adds nothing but confusion imo
13:18:16 <dP> if all commands need tile just make it first argument
13:18:31 <dP> as it was before
13:24:15 <TallTyler> glx[d]: Yeah, it was the last in my list to fix and β€œsave and go to next string” just directs me to the same page without having saved.
13:25:56 <dP> `cmd=CmdBuildDock tile=1175868 data.size()=7`
13:26:10 <dP> tile(4) + station_id(2) + adjacent(1)
13:26:15 <dP> so, yeah, tile is sent twice
13:41:24 <DorpsGek> [OpenTTD/OpenTTD] ldpl opened pull request #10454: Codechange: Swap comments for CommandHelper::Post overloads https://github.com/OpenTTD/OpenTTD/pull/10454
13:46:28 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #10454: Codechange: Swap comments for CommandHelper::Post overloads https://github.com/OpenTTD/OpenTTD/pull/10454#pullrequestreview-1287134732
13:47:18 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #10454: Codechange: Swap comments for CommandHelper::Post overloads https://github.com/OpenTTD/OpenTTD/pull/10454#pullrequestreview-1287136214
13:47:35 <TallTyler> Beat you to it πŸ˜›
13:55:51 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler merged pull request #10454: Codechange: Swap comments for CommandHelper::Post overloads https://github.com/OpenTTD/OpenTTD/pull/10454
14:15:20 <Samu> i need a little help here, https://gist.github.com/SamuXarick/9109eef71e3728c692a7f404a8ad36aa
14:15:37 <Samu> I want IncreaseGeneratingWorldProgress to happen 4 times
14:16:05 <Samu> the first time is on the first tile
14:17:00 <Samu> and the last time, i don't want it to do on the few tiles remaining
14:17:15 <Samu> let's say, we have
14:17:46 <Samu> normal_tiles size 4321
14:18:04 <Samu> frequency is 4321 / 4 = 1080
14:18:44 <Samu> I want the first call on IncreaseGeneratingWorldProgress right on the first tile it iterates
14:18:55 <Samu> the second call, can be on 1080 tiles after that
14:19:13 <Samu> the 3rd, 1080 after the 2nd
14:19:21 <Samu> and the 4th, 1080 after the 3rd
14:19:34 <Samu> there would be a 5th, that I do not want to call
14:19:48 <Samu> @calc 1080 * 4
14:19:48 <DorpsGek> Samu: 4320
14:19:53 <Samu> it's not exactly 4321
14:20:18 <Samu> i dont want it to call it the 5th time just for 1 tile, how do i do this?
14:21:45 <glx[d]> Use 3 intervals, not 4
14:22:08 <glx[d]> And do the 4th increase at the end
14:22:34 <dP> `update_freq = normal_tiles.size() / 4 + 1;` should be good enough for this case
14:23:02 <Samu> normal_tiles size can be a random number
14:23:07 <glx[d]> Progress bar doesn't have to be precise
14:27:14 *** nielsm has joined #openttd
14:33:04 <Samu> https://gist.github.com/SamuXarick/9109eef71e3728c692a7f404a8ad36aa trying this
14:37:59 <Samu> nop :(
14:38:47 <Samu> should be gwp < 4
14:39:54 <DorpsGek> [OpenTTD/OpenTTD] bloomask opened pull request #10455: Merge checks for file [#HSFDPMUW] https://github.com/OpenTTD/OpenTTD/pull/10455
14:40:20 <LordAro> uh
14:41:26 <LordAro> i mean, i guess?
14:42:21 <TallTyler> Why does the PR description read like something ChatGPT wrote?
14:42:31 <TallTyler> Especially the checklist
14:42:49 <LordAro> yeah
14:45:06 <Samu> is there a free chatgpt anyhere
14:45:13 <Samu> that doesn't require an account
14:46:25 <LordAro> there is not
14:47:44 <Samu> i hate regiresting everywhere
14:47:51 <Samu> just for curiosity
14:48:07 <LordAro> everyone does
14:48:44 <LordAro> unfortunately, these things would get overrun with spammers and other assorted unpleasant things without it
14:51:32 <dP> bloomaskviaGitHub: the heck is that hashtag
14:56:57 <Samu> alright, I did it, i actually needed 5
14:57:08 <Samu> not 4
14:57:21 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #10455: Merge checks for file [#HSFDPMUW] https://github.com/OpenTTD/OpenTTD/pull/10455#issuecomment-1420912277
14:57:24 <DorpsGek> [OpenTTD/OpenTTD] PeterN closed pull request #10455: Merge checks for file [#HSFDPMUW] https://github.com/OpenTTD/OpenTTD/pull/10455
14:57:40 <petern> No offence but...
14:58:05 <Samu> ^_^
14:58:07 <petern> The change is technically fine, but the PR text is so generic it doesn't related to what actually changes.
14:59:18 <TallTyler> Yeah, and the change is not really much of an improvement
15:02:16 <dP> botophobes πŸ€–
15:04:47 <petern> Who isn't scared of bots?
15:05:47 <petern> <https://www.youtube.com/watch?v=2IPAOxrH7Ro>
15:33:15 <petern> Heh, no arguing, just deleted their branch.
15:53:44 *** kamnet has joined #openttd
15:53:44 <kamnet> petern: LOL I read this as "I've never published a successful project in my life but let me immediately join yours and start lecturing you on coding standards, you simpletons!"
15:56:23 <glx[d]> google returns some results for the hashtag, but not its origin or meaning
16:03:46 <Samu> i think i manaed to gain 2 more seconds in debug build!
16:05:02 <Samu> 29202 ms
16:05:19 <Samu> it was 32186 ms
16:05:25 <Samu> yes!!! success!
16:07:56 <Samu> 3152 ms on release build, down from 3282 ms
16:08:31 <Samu> over my previous attempt :)
16:09:26 <Samu> release build: master: 6013 ms -> 3152 ms on my most recent changes
16:09:49 <Samu> debug build: master: 122706 ms -> 29202 ms on my most recent changes
16:12:13 <petern> "#HSFDPMUW just helps me, to find my pull-requests better. :)"
16:12:33 <petern> Basically it's meaningless.
16:14:23 *** TROILUS7 has joined #openttd
16:15:04 *** TROILUS has quit IRC (Remote host closed the connection)
16:15:04 *** TROILUS7 is now known as TROILUS
16:15:31 <dP> my only guess that someone does some research and added hashtag to somehow make it easier to find their commits later
16:16:20 <petern> Yes, different account though.#
16:16:56 *** Pruple has joined #openttd
16:16:56 <Pruple> if it was all the same account, they wouldn't need an additional tracking method
16:19:35 *** TROILUS has quit IRC (Remote host closed the connection)
16:19:38 *** TROILUS4 has joined #openttd
16:22:38 <TallTyler> Hey linkgraph experts -- currently my economy/calendar date split sets the economy date to 0 when starting a new game, and to the calendar date when loading a new game. This is mostly to avoid breaking stored dates like vehicle last service dates, but particularly linkgraph updates (because I don't understand them).
16:22:38 <TallTyler> I would like to set economy date to 0 in all cases, to avoid creating a somewhat duplicate variable that always starts from 0 and only gets used in the network game list. Are these linkgraph dates stored in the savegame, or are they initialized each time a game is loaded? If the former, would everything break if I iterated through them (only when loading old savegames) and set them all to 0?
16:28:56 <Samu> there is a linkgraph_sl.cpp
16:29:02 <Samu> if that is of any help :O
16:58:38 <andythenorth> nap time?
17:01:23 <petern> Nope.
17:18:47 <andythenorth> oof
17:18:53 <andythenorth> that means it's more work time then
17:20:13 <petern> It's after 5pm Hmm.
17:29:55 *** Wolf01 has joined #openttd
17:32:21 *** TROILUS has joined #openttd
17:35:43 *** TROILUS4 has quit IRC (Ping timeout: 480 seconds)
17:48:12 <DorpsGek> [OpenTTD/OpenTTD] ZarTek-Creole opened issue #10456: [Bug]: Translation issue https://github.com/OpenTTD/OpenTTD/issues/10456
17:52:47 <Samu> down to 27970 ms! but i'm already cutting too many corners
17:53:50 <DorpsGek> [OpenTTD/eints] frosch123 closed issue #123: Cant correct translated words https://github.com/OpenTTD/eints/issues/123
17:54:01 <DorpsGek> [OpenTTD/eints] frosch123 closed issue #131: Gender variation for strings returns error https://github.com/OpenTTD/eints/issues/131
17:55:48 *** Flygon_ has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:56:13 <Samu> IsValidTile is expensive
17:57:08 <Samu> 27832
18:01:17 <petern> If you call it enough...
18:02:30 <Samu> is it '-(int)Map::SizeX()' or '(int)-Map::SizeX()'
18:02:32 <TallTyler> TallTyler: I answered my own question with an assertion failure 😦
18:03:12 <DorpsGek> [OpenTTD/eints] frosch123 opened issue #133: Reverting translations fails https://github.com/OpenTTD/eints/issues/133
18:04:14 *** frosch has joined #openttd
18:04:14 <frosch> i could claim the review-todo-list already mentions "do not try to revert translations", but I guess noone notices, if there are months between two PRs πŸ™‚
18:07:36 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on issue #10456: [Bug]: Translation issue https://github.com/OpenTTD/OpenTTD/issues/10456
18:08:02 <TallTyler> dP: Are those screenshots in #10456 from cmclient?
18:08:21 <Samu> 3099 ms in release build!
18:10:05 <dP> TallTyler: I can't access that link so idk
18:10:38 <TallTyler> https://cdn.discordapp.com/attachments/1008473233844097104/1072580161087754240/i.png
18:11:59 <TallTyler> Samu: Are you trying to solve #10452 or something else?
18:12:16 *** tokai|noir has joined #openttd
18:12:16 *** ChanServ sets mode: +v tokai|noir
18:12:33 <dP> TallTyler: yeah, that's almost certainly cmclient
18:12:48 <dP> unless jgr copied some of its features
18:13:19 *** Gwyd has joined #openttd
18:13:19 <Gwyd> JGR has something simlar with the zoning but different UI
18:13:30 <Gwyd> Also fewer town sorting options
18:14:32 <Samu> TallTyler, something else
18:14:51 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on issue #10456: [Bug]: Translation issue https://github.com/OpenTTD/OpenTTD/issues/10456
18:14:54 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler closed issue #10456: [Bug]: Translation issue https://github.com/OpenTTD/OpenTTD/issues/10456
18:19:13 *** tokai has quit IRC (Ping timeout: 480 seconds)
18:19:51 <dP> though would be nice to use webtranslator for cmclient as well
18:20:12 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on issue #10450: [Bug]: Wrong signal spacing while using autoplacement feature https://github.com/OpenTTD/OpenTTD/issues/10450
18:20:52 *** gelignite has joined #openttd
18:25:30 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on issue #10453: NewGRF-created error messages don't identify the NewGRF https://github.com/OpenTTD/OpenTTD/issues/10453
18:40:12 <TallTyler> In english.txt, what determines if a string parameter uses {RAW_STRING}, {STRING}, or {STRINGn} where n is a number 1-5?
18:41:18 *** JGR has joined #openttd
18:41:18 <JGR> RAW_STRING is for `const char *` parameters
18:41:44 <JGR> The N is the number of parameters associated with the string parameter
18:42:35 <glx[d]> frosch: I didn't expect that, I had no issue to update french language yesterday
18:43:32 <glx[d]> oh but I didn't set it to AI
18:45:54 <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/0c36e4a7710056f7d892c73fcd4511b32d90f250
18:45:55 <DorpsGek> - Update: Translations from eints (by translators)
18:47:16 <TallTyler> I'm trying to solve #10453 by adding the NewGRF name to the error message, like `{WHITE}The NewGRF "{RAW_STRING}" has returned a fatal error: {}{STRING5}`, but it won't build and I'm getting 171 unrelated errors. I've added a `SetDParamStr(0, c->GetName());` and bumped up the other params by one. Not sure how to diagnose the problem.
18:48:07 <glx[d]> check the string usage order
18:48:08 <JGR> 171 errors suggests that you've made a syntax error such as mismatched braces
18:48:54 <TallTyler> The errors are in other files πŸ™‚
18:49:22 <glx[d]> and when you get that many errors start with the first one πŸ™‚
18:49:32 <glx[d]> it often implies all the other
18:50:09 <TallTyler> I suspect it's some issue in generating strings. The errors are in string.cpp, string_func.h, and bitmath_func.h
18:50:27 <TallTyler> strgen_base.cpp too
18:52:09 <TallTyler> Relevant code: https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_gui.cpp#L44-L67
18:52:50 <JGR> What is the code that you've changed, which is causing the error?
18:54:05 <TallTyler> https://github.com/2TallTyler/OpenTTD/tree/show_newgrf_in_error
18:55:01 <TallTyler> I just added the string usage order to english.txt and it's building so far, that may have fixed it
18:55:18 <TallTyler> Even though they are consumed from left to right already
18:56:23 <TallTyler> Yeah, that fixed it. It builds now...just crashes when the error is thrown πŸ˜›
18:57:14 <JGR> Indices are 0-indexed
18:57:52 <TallTyler> Ah, maybe that will help
18:58:04 <JGR> I think you can just remove them
18:58:15 <TallTyler> It didn't build until I added them
18:59:52 <TallTyler> Removed them and it builds fine? Is my computer haunted? Nothing else changed. πŸ™ƒ
19:00:41 <frosch> be careful with those newgrf error messages
19:00:45 <JGR> Make and wobbly timestamps, perhaps?
19:00:57 <frosch> the custom messages are directly from actionB, and newgrf require specific parameter orders
19:03:38 <frosch> though i guess prepending a string in front should be fine
19:03:38 <TallTyler> How would I test to ensure I haven't broken anything? It works with my modern NewGRF -- is it different with old NewGRFs?
19:03:52 <frosch> it's the "error->message" strings, which are problematic
19:06:18 <frosch> hmm, i do not quite understand what you want to fix
19:06:25 <frosch> isn't the newgrf name already part of the message?
19:06:39 <JGR> There's nothing wrong with the change in terms of parameter ordering
19:06:45 <frosch> ah, you want "name" instead of "filename" πŸ™‚
19:07:09 <frosch> https://newgrf-specs.tt-wiki.net/wiki/NML:Error <- i guess if the two examples work, all work
19:07:19 <frosch> and yes, i think your change is fine wrt. parameter order
19:07:28 <TallTyler> https://cdn.discordapp.com/attachments/1008473233844097104/1072594464788459650/error.png
19:07:28 <TallTyler> Popup errors created by NewGRFs themsevles don't show the filename
19:07:36 <TallTyler> ^ that's the changed version
19:08:05 <TallTyler> These aren't for crashes, they're the ones that NewGRFs can generate themselves
19:08:49 <frosch> ah, newgrf providing custom messages may not include their name
19:08:54 <frosch> while all the default messages do
19:09:06 <TallTyler> Right
19:09:25 <TallTyler> Mine do, but whatever is being reported in #10453 does not
19:09:27 <frosch> ah well, better duplicate than missing πŸ™‚
19:11:35 <TallTyler> Hmm, what NewGRF creates an error but doesn't give a custom message, so I can test?
19:11:37 <frosch> newgrf are supposed to include a "{STRING}" in their error messages, which ottd fills in "SetDParamStr(3, c->filename);" πŸ™‚
19:12:02 <frosch> try av8 with plane-speed factor != 1x
19:12:11 <frosch> iirc it complains about being unbalanced
19:14:03 <TallTyler> No popup for that, it just shows in the NewGRF window
19:14:44 <frosch> you can probably hack ottd for testing to always show the window
19:14:53 <TallTyler> And the NewGRF window error isn't touched by my change, it's a different string
19:17:48 <frosch> https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf.cpp#L6987 <- maybe always passing STR_NEWGRF_ERROR_MSG_FATAL or ERROR may trigger it?
19:20:13 <TallTyler> Nope, no popup
19:21:01 <TallTyler> Like you said though, occasionally duplicating the NewGRF name in addition to the filename probably isn't a big problem
19:21:18 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler opened pull request #10457: Add: Show NewGRF name in NewGRF-created errors https://github.com/OpenTTD/OpenTTD/pull/10457
19:34:58 *** Wormnest has joined #openttd
19:36:32 <DorpsGek> [OpenTTD/OpenTTD] frosch123 approved pull request #10457: Add: Show NewGRF name in NewGRF-created errors https://github.com/OpenTTD/OpenTTD/pull/10457#pullrequestreview-1287873686
19:36:59 <andythenorth> it should look in Github blame
19:37:06 <andythenorth> XML-RPC it
19:38:03 <andythenorth> name and shame the author
19:39:13 <frosch> today an intern at work asked why we use json instead of xml. they saw a lot of xml in c#, so it must be good, right?
19:41:10 <andythenorth> why was xml so slow though?
19:44:59 <andythenorth> we shall never know πŸ˜›
19:46:19 <andythenorth> is this chatGPT doing research? o_O https://www.reddit.com/r/openttd/comments/10vgtbt/best_mod/
19:47:56 <frosch> did you fill in the kamnet poll?
19:48:44 <andythenorth> can't remember πŸ™‚
19:48:47 <andythenorth> I think not
20:04:14 <andythenorth> hmm patch time
20:04:22 <andythenorth> maybe SetGrowthRate can be SetGrowthRates
20:04:24 <andythenorth> and take a list
20:04:25 <andythenorth> GG
20:04:58 *** Xarick has joined #openttd
20:04:58 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1072608929902776453/screenshot11.png
20:04:58 <Xarick> minimap screenshot isn't that useful
20:05:37 <Samu> I was hoping for desert/normal/rainforest designated areas in the screenshot
20:05:39 <andythenorth> so first param TownID
20:05:39 <andythenorth> bool ScriptTown::SetGrowthRate(TownID town_id, uint32 days_between_town_growth)
20:05:55 <andythenorth> I want to pass a list
20:06:02 <andythenorth> where can I cargo cult a list from?
20:06:19 <andythenorth> `[(town_id, days_between_town_growth)]`
20:06:39 <andythenorth> presumably I can pass a list? There's some type available for that?
20:08:50 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:09:47 <andythenorth> we seem to have some kind of classes with iterators?
20:09:48 <andythenorth> const Town *t : Town::Iterate()
20:10:02 <andythenorth> but that's iterating the town pool?
20:10:10 <andythenorth> I just want a general purpose array of pairs
20:11:03 * andythenorth now reading about std pair
20:11:07 <andythenorth> might be the wrong thing
20:12:22 <andythenorth> C++ for noobs guide I am reading says arrays have to be of fixed length, known in advance
20:13:05 <dP> I don't think there is any gs method accepting a list currently
20:13:13 <andythenorth> I am not aware of one
20:13:37 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler merged pull request #10457: Add: Show NewGRF name in NewGRF-created errors https://github.com/OpenTTD/OpenTTD/pull/10457
20:13:40 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler closed issue #10453: NewGRF-created error messages don't identify the NewGRF https://github.com/OpenTTD/OpenTTD/issues/10453
20:13:45 <dP> it's a question of squirrel api integration not c++ standard types
20:14:27 <andythenorth> I just want to dump a squirrel array() in as param
20:14:27 <dP> also it will probably be of questionable utility unless you somehow pass a list to a network command as well
20:14:52 <JGR> That bit is easy
20:15:09 <JGR> It's all the squirrel related bits which are a pain in the posterior
20:16:07 <andythenorth> I was just going to try and call ScriptTown::SetGrowthRate for each list item
20:16:15 <andythenorth> but from OpenTTD
20:16:24 <andythenorth> not squirrel, where it's dog slow
20:16:50 <andythenorth> only 32 towns on the map, but it's 960ms *minimum* to set the growth rates
20:16:51 <andythenorth> that's nuts
20:16:59 <andythenorth> but squirrel is nuts
20:17:15 <JGR> If you're not doing it from a GS, then you shouldn't be faffing about with any of the Script* classes at all
20:17:27 <andythenorth> I want a single cmd from GS
20:17:34 <andythenorth> not saying it's a good idea, I just want to try patching
20:17:57 <dP> it's slow because every network command takes a tick
20:18:20 <andythenorth> so just moving it down 1 layer in the stack will still be dog slow
20:18:25 <JGR> Probably your best bet is to create a new class which holds town ID and town growth rate pairs
20:18:29 <dP> it's probably way simpler to just get rid of that extra tick delay than pass arrays around xD
20:18:37 <JGR> Then add a "Commit" method which actually does the network stuff
20:18:50 <andythenorth> I have formed the impression that the extra tick delay is non-removable at this point
20:19:01 <andythenorth> I thought it was baked into the MP architecture design?
20:20:15 <dP> not really, there is nothing in mp architecture that absolutely needs a delay
20:20:29 <andythenorth> /me wonders how close a valuated GS list is
20:20:29 <dP> may need to move some calls around
20:20:35 <andythenorth> maybe I could just pass a valuated list πŸ˜›
20:20:40 <dP> but it's there for "fairness" not some technical reason
20:20:54 <andythenorth> well yes
20:20:59 <andythenorth> ok
20:21:11 *** Hobbyboy has quit IRC (Quit: The BNC has broken!)
20:21:19 <andythenorth> but doesn't the client stutter if GS executes too many cmds?
20:21:56 <andythenorth> when I cut the sleep time down in the script, the game begins to stutter
20:22:27 <dP> maybe but it's not related to commands
20:22:46 <JGR> This is a hint that your script needs optimising
20:23:00 <glx[d]> commands are always async in network game, even the local ones
20:23:35 *** Hobbyboy has joined #openttd
20:23:45 <andythenorth> JGR: the one I tested was just a button handler
20:23:48 <glx[d]> in SP it's possible to skip the forced sleep for GS
20:23:59 <andythenorth> I was trying to improve button response time
20:24:00 <glx[d]> (it's done for mapgen)
20:24:04 *** bigyihsuan has joined #openttd
20:24:04 <bigyihsuan> is there a limitations reason why during world gen the game is fixed to a single point and zoom?
20:25:11 <dP> glx[d]: you can skip sleep in mp as well, just need to distribute commands to client after execution
20:25:50 <dP> all that matters for clients is that they execute commands in the same order as server
20:25:51 <glx[d]> but all commands are queued
20:25:56 <dP> server doesn't have to wait for anyone
20:26:45 <dP> glx[d]: they don't have to be
20:26:57 <dP> for server I mean
20:26:58 <glx[d]> simpler to do it like that πŸ™‚
20:27:58 <bigyihsuan> https://cdn.discordapp.com/attachments/1008473233844097104/1072614722765074472/image.png
20:28:26 <dP> it's not much harder to do it differently ;)
20:28:53 <glx[d]> local commands must insert correctly between received commands
20:29:08 <dP> I actually did that in cmserver recently, just can't test yet because need to redo the whole command system in 13.0
20:29:53 <dP> redo because it sucks, not because I removed delay :P
20:32:13 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1072615792262254743/screenshot14.png
20:32:13 <Xarick> much more useful :=)
20:36:47 <bigyihsuan> https://cdn.discordapp.com/attachments/1008473233844097104/1072616942730477709/image.png
20:37:20 <bigyihsuan> https://cdn.discordapp.com/attachments/1008473233844097104/1072617079297028196/screenshot1.png
20:37:43 <bigyihsuan> idk why the river gen makes those square rivers
20:40:46 <FLHerne> Is that some patched version? Never seen anything like that
20:41:15 <bigyihsuan> this is a quick 2-line change in landscape.cpp on jgrpp's fork
20:41:24 <bigyihsuan> swapped std::min to std::max
20:42:02 <dP> bigyihsuan: because tentacles are getting censored 😜
20:42:02 <FLHerne> I guess std::min was the right choice then :p
20:42:03 <petern> It's probably manhattan radius...
20:42:27 <andythenorth> might write a task scheduler inside my GS
20:42:39 <FLHerne> andythenorth: this sounds a bit silly
20:42:40 <andythenorth> to sequence commands for different things
20:43:37 <andythenorth> well I'm using MinimalGS as a base
20:44:02 <andythenorth> and it has a MonthEnd() method, which is the common loop for e.g. dealing with things like industry and town behaviour
20:44:16 <andythenorth> but putting everything in month end will be slow
20:44:24 <andythenorth> and it also tends to overlap with savegame
20:44:30 <bigyihsuan> https://cdn.discordapp.com/attachments/1008473233844097104/1072618882885501009/image.png
20:44:30 <bigyihsuan> petern: most probably, circular tile search isn't even a circular search lol
20:44:30 <bigyihsuan> let me swap it for something more circular
20:44:55 <andythenorth> I was going to manually space out different gameplay loops over the month, to reduce contention
20:45:15 <andythenorth> but keeping track of manual crap, I might as well just put a bunch of queues in table slots
20:45:18 <andythenorth> and then assign priorities
20:45:24 <andythenorth> and measure which ones are furthest behind
20:45:25 <dP> bigyihsuan: it's manhattan circle :p
20:46:30 <andythenorth> town processing queue, industry processing queue, object processing queue, road processing queue etc
20:46:59 <andythenorth> I wish I could manually manage the GS event queue also
20:47:00 <andythenorth> maybe I can
20:47:01 <andythenorth> let's look
20:47:05 <dP> don't forget queue of queues :p
20:47:15 <JGR> bigyihsuan: If you scroll up a little in that file, there's some code for ellipses which you could borrow
20:48:29 <glx[d]> event queue is a queue, but if you can process it often enough you can dispatch in your own groups
20:48:51 <andythenorth> the desire to manage it comes from handling button clicks
20:48:51 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1072619977808551936/screenshot17.png
20:48:51 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1072619978009874612/screenshot16.png
20:48:51 <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1072619978269929604/screenshot15.png
20:48:51 <Xarick> 17 = master; 16 = DistanceSquare(t, p.first) <= 50 && DistanceMax(t, p.first) <= 6; 15 = DistanceSquare(t, p.first) < 49
20:49:12 <andythenorth> and in one click, samu bounces the entire scrollback πŸ˜›
20:49:14 <andythenorth> GG WP
20:49:31 <Samu> sorry
20:49:39 <andythenorth> anyway story page button latency is bad
20:49:58 <andythenorth> so because the button doesn't respond, it gets clicked again and again
20:49:59 <Xarick> so, master puts more rainforest
20:50:03 <andythenorth> just filling the queue with junk events
20:51:13 <andythenorth> GSEventController.IsEventWaiting seems to exist
20:51:27 <glx[d]> I think ideally you want to process events at start of every GS tick, but command delay don't make that easy
20:52:13 <dP> in button case ideally it would disable until handled
20:52:31 <andythenorth> that would be at least explicit to the player
20:52:59 <andythenorth> I mean...other applications do have the problem of UI latency when busy
20:53:05 <andythenorth> but it's not normal in game
20:53:35 <dP> gs is just not suited for ui by design
20:53:47 <dP> ui needs to run on the client
20:54:22 <glx[d]> GS UI is handled like the old internet πŸ™‚
20:55:25 <dP> lol, was about to write the same
20:55:25 <andythenorth> wonder what would happen if we just bubbled UI events to the top of the queue
20:55:39 <JGR> Which queue? πŸ˜›
20:55:48 <dP> got distracted by googling what "web 1.0" actually means xD
20:56:20 <andythenorth> the event queue, or at least there seems to be one
20:56:21 <andythenorth> `ScriptEventData *data = (ScriptEventData *)ScriptObject::GetEventPointer();`
20:56:33 <Samu> 16 is closer to master than 17
20:56:37 <frosch> let gs run some browser and serve some js :p
20:56:42 <Samu> than 15, i mean, 17 is master ,lol
20:56:57 <andythenorth> frosch: no fair if there's not perl
20:57:10 <glx[d]> perl is the server itself
20:57:17 <andythenorth> cgi-bin
20:57:22 <andythenorth> chmod 777
20:58:01 <glx[d]> I think I did some cgi in C and O'Caml a long time ago
20:58:05 <frosch> tb was against linking qt, i am sure he wont mind linking chromium
20:58:59 <dP> don't need the whore chome, just link webassebly :p
20:59:09 <JGR> "just" πŸ˜›
20:59:18 <Samu> how do i zoom a screenshot?
20:59:27 <JGR> Move closer to the screen
20:59:35 <Samu> take a screenshot with zoom applied, so that i dont have to use paint to amplify it
20:59:53 <Samu> amplify 8x
21:00:00 <dP> JGR: well, yeah, linking wasm runtime is the easy part
21:00:01 <andythenorth> if we move script UI to browser
21:00:07 <andythenorth> I won't be able to use it
21:00:15 <andythenorth> breaks my 'no html for OpenTTD' rule πŸ˜›
21:00:28 <andythenorth> I suppose I could just template it and never look again
21:00:30 <glx[d]> use xhtml then πŸ˜‰
21:00:38 <andythenorth> react?
21:01:06 <andythenorth> could we actually prioritise GS button events ?
21:01:11 <andythenorth> not sure it helps, but eh
21:01:16 <dP> it won't
21:01:31 <andythenorth> because it will be slow anyway?
21:02:01 <frosch> wasm is compiled, that would be more suitable to include in a newgrf πŸ™‚
21:02:02 <glx[d]> unless GS UI events are handled in a special function like Save()
21:02:03 <dP> even if you rewrite it all it can only ever hope to be fast enough in single player
21:02:11 <andythenorth> ok
21:02:21 <andythenorth> but OpenTTD lags in MP anyway
21:02:26 <andythenorth> the UI is often a bit behind
21:02:31 <andythenorth> so maybe that's fine πŸ˜›
21:03:10 <glx[d]> in MP, if UI fires a command you have to wait for the server
21:03:45 <JGR> In OpenTTD, we already have a bytecode format which is run on all of the clients...
21:04:03 <glx[d]> (NFO)
21:04:03 <JGR> Which supports things like callbacks which are handy for UIs
21:04:08 <dP> frosch: tbh, if I were to add wasm I'd replace both
21:04:24 <dP> though for server stuff gs is fine
21:04:26 <andythenorth> it was decided in 2012 that GS would be the future of modifying anything global
21:04:34 <andythenorth> and grf is for localised items
21:04:37 <andythenorth> πŸ˜›
21:04:50 <andythenorth> what's the ratio of released grfs to GS?
21:05:50 <glx[d]> in theory callbacks in GS work (Save() function is a nice example)
21:06:18 <dP> on practice they don't 🀣
21:06:51 <glx[d]> yeah because we don't allow them to call commands or sleep
21:07:31 <glx[d]> but all the info.nut stuff is used like callbacks
21:10:26 *** HerzogDeXtEr has joined #openttd
21:15:11 *** gelignite has quit IRC (Quit: Stay safe!)
21:21:22 <andythenorth> so callback is immediate, not queue processing?
21:21:29 <andythenorth> some function is assigned to handle it ?
21:23:51 <glx[d]> but that won't help for GS UI
21:24:52 <andythenorth> yeah I was just curious
21:25:22 <andythenorth> I can read ahead down the queue by pulling all the events off, and putting them in my own structure
21:25:25 <glx[d]> it's just calling a squirrel function from openttd
21:26:05 <andythenorth> maybe I can pause the rest of the script while story page is open
21:26:09 <andythenorth> and just handle ui
21:28:02 *** AviationGamerX has joined #openttd
21:28:02 <AviationGamerX> https://cdn.discordapp.com/attachments/1008473233844097104/1072629838340423802/image.png
21:28:02 <AviationGamerX> quick translation question, what is Game loop reffering to, there is no direct translation for my language
21:28:02 <AviationGamerX> is it refering to repeating of a game, like a time lapse of the game,
21:28:02 <AviationGamerX> or a specific loop in the game?
21:28:20 <AviationGamerX> this is the english lang file
21:28:57 <dP> main loop in the game code
21:29:04 <glx[d]> game loop is what happens every tick
21:29:26 <AviationGamerX> what exactly is a tick
21:30:14 <glx[d]> and `_GL_` things are sub total of game loop
21:30:45 <AviationGamerX> oohhh alr I got it now thanks
21:31:15 <AviationGamerX> so a tick is like a loop of code
21:31:58 <dP> tick is one iteration of the main loop
21:33:15 <dP> every tick advances the game a little by processing vehicles(vehicle tick), landscape(world tick), etc..
21:33:29 <AviationGamerX> that's cool
21:33:41 <AviationGamerX> I see now thanks my dudes
21:33:58 <AviationGamerX> the hard part is turning all that into words
21:34:12 <glx[d]> btw it's the performance window (or a similar name) under '?' menu in openttd
21:34:52 <AviationGamerX> glx[d]: alr thx, I almost never know where on earth I am translating
21:35:00 <AviationGamerX> and context can differ a lot
21:35:13 <glx[d]> yeah context is important πŸ™‚
21:35:43 <glx[d]> and knowing what the window looks like can also help
21:36:45 <glx[d]> we try to use descriptive string names, but sometimes it's not enough
21:37:26 <dP> yeah, frame rate is basically a debug window so it's all gamedev terms
21:38:49 <AviationGamerX> ye hopefully I get most terms right
21:38:54 <AviationGamerX> only 680 words to go
21:41:12 *** TrueBrain has joined #openttd
21:41:12 <TrueBrain> frosch: what is the worst that can happen, right? πŸ˜„
21:42:24 <frosch> tb reading backlog, when i talk bs πŸ™‚
21:42:41 <TrueBrain> it is funny, I never read Discord's backlog .. just by scrolling down it caught my eye
21:42:44 <TrueBrain> so you were just unlucky πŸ˜›
21:44:09 <TrueBrain> btw, WASM is becoming increasingly interesting, just in general. It is sneaking in more and more places where you wouldn't expect it. You can run it on the edge with Cloudflare .. they are building Kubernetes operators in WASM, as it is a lot cheaper / faster / less memory .. it is a fun technology to monitor
21:44:36 <TrueBrain> to stick in OpenTTD's technology, it replaces both Squirrel and NewGRF
21:45:09 <TrueBrain> so I wonder when the first games ship with WASM support instead of lua support .. if there aren't already
21:45:16 <TrueBrain> can't wait to see where this is in 5 years πŸ˜„
21:45:32 <TrueBrain> also: https://www.theverge.com/2023/2/7/23587454/microsoft-bing-edge-chatgpt-ai
21:47:04 <frosch> i wonder how long gpt will last until there is the equivalent of SEO to fill its results with spam
21:47:24 <TrueBrain> haha
21:47:37 <TrueBrain> you are not wrong .. and it would be good business, I am afraid
21:48:16 <frosch> imo it's the main reason why gpt is better than regular web search right now. web search is just filled with junk
21:48:29 <Samu> got 6 screenshots of the minimap -> the top one is how it is generated in master, the other 5 is me, trying to replicate master https://imgur.com/a/kPqLRDA
21:48:33 <glx[d]> and paying junk
21:48:42 <Samu> which one is the best at replicating?
21:48:51 <andythenorth> frosch: the main use of gpt right now is probably generating SEO pages...
21:48:56 <andythenorth> so it will feed itself
21:49:06 <andythenorth> but then again...that crypto watermark
21:49:20 <andythenorth> but that will be detectable and removable by other bots
21:50:05 <andythenorth> when I worked in adtech, about 10 years ago, we figured we were writing ad placement bots which optimised for publishing into systems where the clicks were mostly from ad fraud bots
21:50:07 <Samu> i can't find the perfect variables for an exact replica :(
21:50:43 <frosch> andythenorth: were you active in both businesses?
21:51:51 <frosch> maybe you can save bandwidth cost, if you run ad-placement bot and ad-click-fraud-bots on the same node
21:52:02 <TrueBrain> btw, if you ever want to try WASM in OpenTTD: https://docs.wasmer.io/ecosystem/wasmer/getting-started . It is really easy to get started πŸ˜›
21:52:15 <andythenorth> frosch: before I quit that industry, I did consider doing that as a service
21:52:18 <TrueBrain> it would be funny to know how much quicker GS/AI swould be that way πŸ˜›
21:52:19 <andythenorth> basically diceroll fraud
21:52:47 <andythenorth> could have just been rng, making sure to use a statistically valid fraud pattern
21:53:26 <andythenorth> so in wasmer, we pick the language we want, and hit a defined API? πŸ˜›
21:53:42 <andythenorth> no more complaining about squirrel?
21:54:17 <frosch> we just write a newgrf interpreter in wasm, which can run old newgrfs and attach them to the new endpoints :p
21:54:34 <TrueBrain> andythenorth: yes. Basically any main-stream language
21:54:35 <dP> andythenorth: yes, but if you want python it's tricky
21:54:37 <andythenorth> can't we just write a transpiler in wasm?
21:54:59 <TrueBrain> frosch: you laugh, but from NML that is doable πŸ™‚
21:55:15 <TrueBrain> well, from NFO too
21:55:17 <TrueBrain> so from NewGRF too
21:55:24 <TrueBrain> so yeah, doable, not even complicated, honestly
21:55:36 <TrueBrain> creating that new ABI however .... πŸ˜›
21:55:40 <dP> it's even the best approach for newgrf compatibility imo
21:55:57 <TrueBrain> (one that is bug-compatible, as otherwise people will complain :D)
21:56:00 <andythenorth> well I am deep into GS, and I'm not going to stop now, so the channel can be complaining about Squirrel 2 for next 10 years
21:56:06 <andythenorth> or we could do something interesting πŸ™‚
21:56:17 <TrueBrain> there isn't a Squirrel -> WASM yet
21:56:22 <TrueBrain> so that is an interesting one too πŸ˜›
21:56:22 <frosch> can we have "your newgrf is running an outdated firmware version, please upgrade" errors?
21:56:28 <TrueBrain> hahaha
21:56:30 <TrueBrain> +1 πŸ™‚
21:56:33 <andythenorth> TrueBrain: personally I do not see this a downside πŸ˜›
21:57:30 <frosch> just update your pynut templates to pywasm :p
21:57:38 <andythenorth> that was my thinking
21:57:53 <andythenorth> I am about to start moving the GS config into FIRS python classes
21:57:59 <andythenorth> just the methods have to be in squirrel
21:59:18 <andythenorth> it's quite funny how nearly capable GS is though
22:00:35 <glx[d]> yeah GS is very capable and at the same time very limited
22:00:51 <TrueBrain> and it scales so poorly with map-size ....
22:01:33 <glx[d]> even for 64x64 2500 startup ticks are not enough for award GS
22:02:59 <frosch> is there any way to make wasm deterministic?
22:03:06 *** keoz has quit IRC (Ping timeout: 480 seconds)
22:03:57 <TrueBrain> isn't it already?
22:04:22 <dP> I recall some article about it years ago, it was nearly deterministic iirc
22:04:35 <TrueBrain> https://github.com/wasmx/fizzy
22:04:35 <TrueBrain> Hihi, random implementation for C++, and claims to be exactly that frosch πŸ™‚
22:04:48 <frosch> i have no idea what wasm can do, and how it communicates with the outside
22:05:25 <TrueBrain> Without WASI, it cannot communicate to the outside πŸ˜›
22:05:35 <TrueBrain> and WASI allows -everything- πŸ˜›
22:05:44 <TrueBrain> (it is often compared to linux syscalls, WASI)
22:06:34 <TrueBrain> but yeah, basically you give the Squirrel interface to WASM, and that is all you can talk to the outside world
22:09:00 <TrueBrain> funny, a lot of docs around WASM still talk about it like it only works for browsers ... it kinda outgrown that already πŸ˜›
22:09:04 <TrueBrain> but docs take a while to catch up πŸ˜„
22:09:40 <frosch> sure, but how would an event-driven thing work? would wasm run some main loop and poll for events, or is there something like "hardware interrupts"?
22:09:51 <TrueBrain> up to you
22:09:56 <TrueBrain> WASM runs in a VM
22:10:06 <TrueBrain> so you can call a function in the WASM to make it event-based
22:10:15 <TrueBrain> but it can also run its own loop and do stuff
22:10:56 <frosch> hmm, i guess i can't ask the right questions πŸ™‚
22:11:42 <frosch> let's take a vehicle. i don't want to run a VM instance for every vehicle
22:12:12 <TrueBrain> owh, you crazy man .. your head jumped a different direction than I expected πŸ˜„
22:12:18 <frosch> so i guess the VM would restart for every vehicle, and there would be some ver limited persistent storage gain
22:12:30 <TrueBrain> you can do it many ways .. it is just a stack-based language in a VM
22:12:45 <TrueBrain> so you could even run a VM per vehicle, and call a function every time something happens
22:12:54 <andythenorth> can we run a VM per tile?
22:12:56 <andythenorth> very small
22:13:00 <andythenorth> very very small
22:13:05 <TrueBrain> just the usual problems arise .. memory overhead, etc
22:13:08 <andythenorth> https://playgameoflife.com/
22:13:33 <TrueBrain> but basically, you create a WASM VM with "imported functions", which are the API to your application
22:13:59 <frosch> ok, so we could run a VM for each industry and limit memory to 1 kib?
22:14:03 <TrueBrain> the WASM exports functions, which you can call from your application
22:14:28 <TrueBrain> I am not completely sure how much implementations handle memory
22:16:15 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:18:31 <TrueBrain> per page, which is 64 KiB
22:18:34 <TrueBrain> so yeah, you can do that πŸ˜›
22:20:26 <TrueBrain> now I wonder if you can easily share an memory object between host and VM
22:20:28 <andythenorth> can we let them run multi-threaded, and have cbs to main thread for game state? πŸ˜›
22:20:32 <TrueBrain> or that they have to go via APIs
22:21:08 <frosch> are heap and stack separate?
22:21:28 <frosch> persistent heap would be very limited, while stack can be larger
22:21:39 <frosch> callbacks can exchange stuff via stack
22:22:10 <TrueBrain> I would think that the model "one VM per NewGRF / GS / AI" fits more with WASM
22:22:15 <andythenorth> can we say 'promises' a lot?
22:22:22 <TrueBrain> the "one VM per object" .. I am less sure about if that can function
22:22:33 <TrueBrain> but something to just try out, tbh .. WASM is so relatively new .. πŸ™‚
22:22:55 <frosch> we need one VM per object, with saveable/recoverable state for command-testruns πŸ™‚
22:23:21 <TrueBrain> you do understand the implications of what you say, right? πŸ˜„
22:23:24 <frosch> which would work if there was very limited persistent storage
22:23:39 <TrueBrain> that would allow basically to move all game logic out of the game, into WASM πŸ˜›
22:23:50 <andythenorth> 640Kb is enough for anyone
22:24:38 <frosch> huh? "all game logic" does not match the "limited persistent storage" πŸ™‚
22:24:54 <TrueBrain> why not? πŸ™‚
22:25:18 <TrueBrain> the language barrier is high today
22:25:34 <TrueBrain> this morning I tried to explain some things in English .. I gave up. My brain says "no" today 😦
22:26:28 <frosch> well, either way, i need to find some wasm description without marketing bla
22:26:41 <frosch> maybe gpt knows
22:27:03 <andythenorth> one WASM VM per tile, running on AWS lambdas
22:27:04 <TrueBrain> https://docs.wasmer.io/integrations/examples/instance
22:27:04 <TrueBrain> Just look through the examples πŸ™‚
22:28:41 <TrueBrain> wasmer is written in Rust, so a lot of things makes more sense in Rust πŸ˜› Not saying wasmer is the best out there btw .. just to more known one
22:31:11 <TrueBrain> but mostly I was thinking 1 NewGRF is 1 WASM, as with GS: 1 GS is 1 WASM
22:31:24 <TrueBrain> you seem to be thinking about something else .. and that is a bit difficult to grasp what you actually have in your head πŸ™‚
22:33:36 <Samu> which function is more cpu intensive, DistanceSquare or DistanceMax
22:33:59 <andythenorth> have you instrumented them? πŸ˜›
22:34:40 <frosch> TrueBrain: i am fine with 1 GS = 1 WASM, that matches the current GS behavior of one single-threaded script running on the server
22:35:29 <frosch> but newgrf are different. they run on all clients, and callbacks have very limited side effects, e.g. vehicles cannot talk to industries behind openttd back
22:35:50 <JGR> The NewGRF execution model is much closer to something like eBPF
22:35:52 <TrueBrain> lol, that would be funny πŸ˜›
22:36:09 <Samu> let's test
22:36:27 <frosch> wasm says it's a stack-based machine, which sounds very similar to how newgrf callbacks work
22:36:39 <frosch> put input data on the stack, run some function, get results from the stack
22:36:48 <frosch> just there are probably more details πŸ™‚
22:36:50 <TrueBrain> that is exactly what it is, yes πŸ˜›
22:37:13 <TrueBrain> and it imports functions, tables, memory, and globals
22:39:30 <Samu> DistanceSquare: 109789 ms
22:42:23 <Samu> DistanceMax: 155973 ms
22:42:32 <Samu> now I know
22:43:43 <dP> random idea of the day: superhot mode for openttd - time only moves when you're out of money
22:45:17 <andythenorth> https://docs.wasmer.io/ecosystem/wasmer/wasmer-features 'metering'
22:46:17 <TrueBrain> frosch: seems most WASM runtimes have a stack for the function to execute, and can use "imported" globals to write information persistently
22:46:26 <TrueBrain> which seems to suggest you can strongly limit how much persistency things have πŸ™‚
22:47:08 <TrueBrain> so yeah, it seems to fit that model too .. but this really is the point you have to try to actually know πŸ˜„
22:48:57 <TrueBrain> owh, lol, the C API is "standarized" πŸ™‚
22:49:12 <TrueBrain> so you can switch implementations without breaking anything πŸ˜› That is silly
22:54:47 <TrueBrain> frosch: https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format <- think that is what you need to understand WASM πŸ™‚
22:56:49 <andythenorth> mozilla docs always so well written
22:57:14 <TrueBrain> mostly, this explains it from the WASM side, instead of from the API side .. which makes it a bit more clear what can be in a WASM file itself πŸ™‚
23:03:38 * andythenorth enjoys greatly
23:04:43 <TallTyler> dP: Or maybe below a certain threshold? I imagine that would be possible with a GS
23:05:24 <dP> well, yeah, if considered seriously there should be some threshold
23:05:56 <dP> also can not just pause/unpause but get slower the more money you have
23:07:38 <TallTyler> Actually changing game speed might need fast-forward with β€œmaximum fast forward speed” slowed way down
23:07:54 <andythenorth> https://en.wikipedia.org/wiki/Inverted_World
23:08:07 <andythenorth> ^ time goes wrong story
23:08:14 <Samu> I'm so tempted to PR it :p but it's almost pointless! https://github.com/SamuXarick/OpenTTD/pull/7/files
23:09:09 <Samu> instead of 6 seconds, that function now takes 3 seconds, or in other words, generating a 4k map is 3 seconds faster
23:09:40 <Samu> and yet, it's not an exact replica, it's an approximation of the original result
23:09:49 <Samu> but very convincing
23:10:32 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:10:35 <andythenorth> ok sleeping time
23:10:47 <andythenorth> TrueBrain: WASM was a good bed time story πŸ˜‰
23:11:03 <TrueBrain> Sleep well πŸ™‚
23:15:24 <Samu> time for bed
23:15:41 <Samu> cyas goodnight
23:15:43 *** Samu has quit IRC (Quit: Leaving)
23:17:23 <petern> So the code is more complex, uses more memory and improves a 4kx4k generation time by 3 seconds...
23:21:16 <dP> Xarick: why is there so much rainforest? I don't seem to get generation like this in openttd
23:22:48 *** Extrems has quit IRC (Quit: ZNC 1.7.5 - https://znc.in)
23:22:53 *** Extrems has joined #openttd
23:38:08 *** sla_ro|master has quit IRC ()