Config
Log for #openttd on 15th January 2023:
Times are UTC Toggle Colours
10:36:14  <andythenorth> saveload of the game restarts the GS?
10:36:37  <nielsm> yes
10:36:56  <nielsm> exept the GS gets a chance to fill its data from saved data before starting for real
10:37:05  <nielsm> (AI works the same way)
10:38:13  <andythenorth> how do I find the GS API version in doxygen? https://docs.openttd.org/gs-api/index.html
10:38:20  <andythenorth> needs set in the info nut
10:38:56  <nielsm> it should be the same as the game version, afaik
10:39:18  <andythenorth> thanks
10:39:23  <andythenorth> https://docs.openttd.org/gs-api/ has nothing πŸ™‚
10:39:35  <nielsm> raise a bug on it
10:39:55  <andythenorth> is it a bug?  I don't know what's intended πŸ™‚
10:40:13  <andythenorth> GS has always been the unloved third child of the APIs πŸ™‚
10:40:47  <petern> Data Structures is not empty but...
10:41:08  <petern> Same for ai-api.
10:41:53  <andythenorth> let's see what I can break
10:41:56  <andythenorth> usually it's valuators
10:41:58  <andythenorth> which baffle me
10:42:29  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #10358: Codechange: Remove objectspec `enabled` flag and shuffle members. https://github.com/OpenTTD/OpenTTD/pull/10358#pullrequestreview-1249183647
10:43:26  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10356: Fix #10057: FallbackParagraphLayout fails to properly wrap https://github.com/OpenTTD/OpenTTD/pull/10356
10:43:29  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #10057: [Bug]: FallbackLayouter fails to properly wrap during first word after run change. https://github.com/OpenTTD/OpenTTD/issues/10057
10:44:06  <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #10354: Fix #10177: company list password padlock showed after switching to single player https://github.com/OpenTTD/OpenTTD/pull/10354#pullrequestreview-1249184596
10:52:12  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #10359: Fix #10009: bad overflow protection when taking out loans https://github.com/OpenTTD/OpenTTD/pull/10359
10:52:54  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10354: Fix #10177: company list password padlock showed after switching to single player https://github.com/OpenTTD/OpenTTD/pull/10354
10:52:57  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #10177: [Bug]: NetworkCompanyIsPassworded state is not cleared when switching to single player https://github.com/OpenTTD/OpenTTD/issues/10177
10:54:41  <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #10359: Fix #10009: bad overflow protection when taking out loans https://github.com/OpenTTD/OpenTTD/pull/10359#pullrequestreview-1249186443
10:55:19  <petern> Simple fixes = simple reviews = Rubidium commit count++
10:56:10  <Rubidium> and --bugcount :)
10:56:19  <Rubidium> (hopefully)
10:58:07  <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #10358: Codechange: Remove objectspec `enabled` flag and shuffle members. https://github.com/OpenTTD/OpenTTD/pull/10358
11:00:09  *** Etua has joined #openttd
11:04:54  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10359: Fix #10009: bad overflow protection when taking out loans https://github.com/OpenTTD/OpenTTD/pull/10359
11:04:57  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #10009: [Bug]: Ineffective overflow protection in CmdIncreaseLoan https://github.com/OpenTTD/OpenTTD/issues/10009
11:25:31  <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10227: Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI https://github.com/OpenTTD/OpenTTD/pull/10227#pullrequestreview-1249194317
11:30:37  <Samu> how do i create a sub group as an ai, need to test something
11:33:29  <Samu> got it, nvm
11:41:09  <Samu> okay, there is still a problem, or maybe not, depending on how you view it
11:41:24  <petern> Rename for clarity is terrifying coming from you
11:42:09  <Samu> if i have a parent group and a child group, on the GUI side of things, the last_year profit of the parent group, includes the profit of itself + the child group
11:43:00  <Samu> if i have 1 vehicle in parent group and 0 in child group, the profit last year is -Β£400 or wtv
11:43:32  <Samu> for the parent group
11:44:06  <Samu> if i have 1 vehicle in child group, and 0 in parent group, the profit last year is still -Β£400 for the parent group
11:44:20  <Samu> for the AI side of things, however, it's Β£0'
11:45:17  <Samu> I may be biased, but I prefer it that way
11:45:29  <Samu> but it certainly doesn't match that of the GUI
11:46:46  <Samu> should I solve this?
11:50:20  <nielsm> Samu: I believe it does match the GUI, just not in the place you expect
11:50:35  <nielsm> you see how in the GUI there is a grey/red/yellow/green dot next to each group?
11:51:22  <Samu> yes
11:51:42  <nielsm> that indicates whether that group had a profit last year (as relevant to the company score calculation) that is not present (grey), negative (red), under 10k (yellow) or above 10k (green)
11:52:05  <Samu> that's the profit last year min age
11:52:16  <Samu> I'm refering to profit last year only
11:53:10  <nielsm> you are saying that the info you get from the function does not exist in the gui, I'm saying that it does just not in the way you expect
11:54:36  <nielsm> I would recommend documenting what the function actually does, and leave the functionality alone
11:56:50  *** Wolf01 has joined #openttd
11:59:57  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1064151956668559381/Unnamed_1978-05-26.png
11:59:57  <Xarick> Group 0 is parent, has no vehicle, Group 1 is child, has bus in it with negative last year profit.
12:00:41  <Samu> From the script side of things, however, things don't seem to be coherent
12:00:55  <Samu> it says num of vehicles in group 0 is 1
12:01:21  <Samu> in that function, it includes vehicles in child groups
12:01:48  <Samu> but in the one that gets profit last year, it doesn't include the profit of that vehicle
12:11:47  *** Etua has quit IRC
12:27:22  <andythenorth> on the plus side, compiling FIRS GS is almost instant
12:27:32  <andythenorth> on the negative side, much else πŸ™‚
12:27:44  <Eddi|zuHause> petern: "use one engineID for all articulated parts" is problematic because each switch can only branch in 256 ways, and you can only have 256 concurrent IDs for branch targets/spritesets
12:28:23  <Samu> okay, i know how to fix this, but then GetProfitThisYear would also need to be changed, I rather have them both relate with the same criteria
12:28:47  <Eddi|zuHause> plus var61 has some limitations within cb36
12:29:09  <Eddi|zuHause> because of potential circular dependencies
12:29:11  <Samu> I'm on the opinion of improving documentation
12:29:36  <Samu> to reflect that it does not include child groups
12:30:15  *** WormnestAndroid has joined #openttd
12:31:04  <andythenorth> ok there are 2 things mixed up here, (1) I have no clue how to GS (2) I am unclear on what I want to do with GS
12:31:13  <andythenorth> I do love the first stage of any project like this πŸ˜›
12:31:27  <andythenorth> stumbling cluelessly towards an uncertain goal, with unfamiliar tools
12:42:14  *** TROILUS has quit IRC
12:48:34  <andythenorth> hmm
12:48:45  <andythenorth> probably the first thing to do is figure out how limited GS is
12:49:14  <andythenorth> got no concept of how the opcodes limit relates to what can actually be done
12:50:26  <andythenorth> will it make a log entry if I exceed opcodes?
12:55:33  <andythenorth> the MinimalGS boilerplate only loops every 5 game days
12:55:44  <andythenorth> hmm
12:55:51  <andythenorth> maybe I just try flooding it and see what happens
12:59:05  <michi_cc[d]> If a scripts exceeds the opcode limit, it will just be suspended until the next game tick. Nothing more and nothing less.
13:09:56  <glx[d]> Every command also delay for a tick
13:25:38  <LordAro> been a while sincr we had a "RB fixes everything" commit spree
13:32:23  <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #10357: Fix #9865: removing files with the console always failed https://github.com/OpenTTD/OpenTTD/pull/10357#pullrequestreview-1249229982
13:34:15  <Pruple> pre-release cleanout?
13:35:04  <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #10355: Change #10077: make maximum loan a positive multiple of the loan interval https://github.com/OpenTTD/OpenTTD/pull/10355#pullrequestreview-1249230600
13:35:52  <michi_cc[d]> Well, RC2 is somewhat overdue. But life.
13:36:29  <LordAro> or actual release?
13:41:21  <andythenorth> is there a way I can detect suspension?
13:41:35  <andythenorth> I'm not obsessed by this, just don't understand the execution environment at all
13:41:39  <glx[d]> Suspension of ?
13:41:43  <michi_cc[d]> No, it is transparent to the script.
13:42:11  <andythenorth> so I have no way to know if I'm trying to do unachievable things, but I could write my own logging framework?
13:42:25  <michi_cc[d]> It is conceptutally the same as when your OS multi-threads and switches threads.
13:42:33  <andythenorth> I will know the tick, or the date etc, and could compare if it changed?
13:42:36  <andythenorth> before a task completed
13:44:05  <michi_cc[d]> Suspension is on the actual interpreter level. The script could even be suspendend in the middle of comparing the tick. The opcode limit simply decides how many "MHz" your script CPU has.
13:44:08  <glx[d]> Scripts are supposed to be event driven
13:44:55  <michi_cc[d]> I.e. with a low opcode limit you have a slow "CPU", and a high opcode limits means a faster "CPU".
13:45:03  <andythenorth> ok thanks
13:45:24  <andythenorth> glx[d]: I know, but all the ones I've seen just run on scheduled loops
13:45:33  <andythenorth> there may be others
13:45:58  <glx[d]> Scheduled loop is a kind of event
13:46:03  <michi_cc[d]> And just like on the computer itself, a complicated algorithm will take a long time on a slow CPU, so the amount of work a script can do in a given game time is limited.
13:46:06  <nielsm> ideally the AI and GS scripts should have a queue of "things to do" where each thing to do is very small, and game events get to skip the queue and get handled ASAP
13:46:46  <nielsm> so they can re-evaluate the situation often and react to game events fast
13:46:54  <andythenorth> ideally I would get the confusion stage as fast as possible and start trying things
13:46:55  <andythenorth> πŸ˜›
13:46:57  <andythenorth> GS is weird
13:47:24  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10357: Fix #9865: removing files with the console always failed https://github.com/OpenTTD/OpenTTD/pull/10357
13:47:27  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #9865: [Bug]: `rm` (and by extension `del`) always fails https://github.com/OpenTTD/OpenTTD/issues/9865
13:47:40  <nielsm> you can think of it as the game simulation keeps running in the background of your script all the time
13:47:47  <michi_cc[d]> The added complication is that anything that causes a Command to be executed immediately ends the current time slice as it has to wait for the game loop to process the event, which takes until the next game tick.
13:48:33  <michi_cc[d]> So any command action (e.g. building something, giving orders, setting town growth, changing a goal) is quite costly.
13:48:49  <nielsm> another thing for GS is that you should handle game saving and loading, ideally as fast as possible
13:49:30  <nielsm> while I haven't actually written any real GS myself (Eternal Love doesn't count) I think the approach I would take is store all internal data in a form ready to save, so nothing has to be converted on load or save
13:50:10  <andythenorth> GS is quite uncanny valley
13:50:12  <michi_cc[d]> Going by random comments on the internet, the save/load opcode limit seems to be somewhat low. It might the same as the usual NewGRF things that apprently everybody knows that but nobody ever bothered to do any kind of proper report for it.
13:50:22  <andythenorth> superficially GS is really approachable, but eh, nope
13:50:33  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #10355: Change #10077: make maximum loan a positive multiple of the loan interval https://github.com/OpenTTD/OpenTTD/pull/10355#pullrequestreview-1249234151
13:51:04  <andythenorth> so I have no real way to know how many opcodes I'm consuming?
13:51:31  <andythenorth> maybe there's a tick counter I can use as a proxy
13:51:47  <Rubidium> andythenorth: can't be more than a few lines of C++ code in the right place
13:51:48  <nielsm> you can probably count opcodes from the squirrel code structure, more or less
13:52:23  <andythenorth> it's not that I think there's a problem BTW πŸ™‚
13:52:28  <andythenorth> it's more that there's no way to know πŸ˜›
13:52:43  <andythenorth> I don't know if I can write e.g. a monthly loop that looks at every town
13:52:52  <andythenorth> unless I write some kind of performance monitor
13:53:04  <Rubidium> it will have counted them, so just dump that value each time the script execution is done. But alas, that's 33+ lines of debug per second
13:53:06  <andythenorth> Flash games this used to be simple, there was an FPS counter πŸ˜›
13:53:40  <andythenorth> and then we had to write an async network sendload handler
13:53:41  <michi_cc[d]> The thing that will probably limit you at lot more is the one commend per tick limit, from which you can easily calculate how many town actions you can do at most per month.
13:54:20  <andythenorth> so is every GS method a command?
13:54:22  <petern> It's not like co-operative multitasking on RISC OS.
13:54:24  <andythenorth> or just SetX()
13:54:32  <petern> That might be a concept familiar to you πŸ™‚
13:54:58  <michi_cc[d]> 74 ticks per day * 30 days a month -> at most 2220 commands per month.
13:55:06  <andythenorth> hmm
13:55:37  <michi_cc[d]> A command is anything that is transmitted over the (network) command system, i.e. mostly write actions that need to sync game state over network.
13:55:48  <andythenorth> it was noticeable that when dP wrote the electricity pylon placer it took months to place a full chain of pylons
13:56:08  <andythenorth> although it was instant if run before gamestart πŸ˜›
13:56:21  <nielsm> command = things that affect the game state and must be visible by all players
13:56:39  <michi_cc[d]> Yeah, because the command tick limit doesn't apply during world generation as there is no network sync there.
13:56:54  <andythenorth> ok so just plain squirrel isn't a command, e.g. just creating objects etc?
13:57:01  <andythenorth> declaring vars
13:57:04  <michi_cc[d]> No.
13:57:26  <petern> Querying game state isn't either.
13:57:26  <michi_cc[d]> Commands are the stuff that is in *_cmd.cpp basically.
13:58:04  <michi_cc[d]> So buy a vehicle, clear a tile, plant a tree, terraform land, set town growth, change manager name, place sign and a lot more actions like this.
13:58:34  <andythenorth> is there anything in the API docs that indicates a command? https://docs.openttd.org/gs-api/classGSTown.html#a3d4f59e3a19bec8a8b5c5e6253998b64
13:58:46  <andythenorth> or does it have to be by reference to ottd src?
13:59:23  <nielsm> actually there isn't, and that probably ought to be there
13:59:35  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #10355: Change #10077: make maximum loan a positive multiple of the loan interval https://github.com/OpenTTD/OpenTTD/pull/10355
14:00:03  <michi_cc[d]> Rule of thumb would be almost all SetXXX, and in this case also Perform/Expand/Found.
14:00:13  <petern> Could do with async stuff tbh πŸ™‚
14:04:34  <andythenorth> I don't have super fancy ideas right now
14:05:20  <andythenorth> but the ideas I do have likely require walking all towns and all industries multiple times within a monthly loop, or every 7 days or so
14:06:34  <petern> Might be a problem on a 4kx4k map, but then what isn't?
14:10:08  <andythenorth> 16k maps in JGRPP though
14:10:51  <petern> What's that?
14:12:46  <andythenorth> also does it really matter if the GS is behind?
14:12:55  <Pruple> I once started writing a gamescript that renamed towns based on their location. It really didn't work well on any but the smallest maps...
14:13:08  <petern> Behind what?
14:13:24  <andythenorth> behind the gameplay
14:13:35  <andythenorth> if there's supposed to be e.g. a monthly loop
14:13:38  <andythenorth> but things aren't getting done
14:13:42  <andythenorth> maybe fine?
14:15:03  <petern> Oh. Well if it takes longer than a month that could be a problem.
14:15:22  <andythenorth> ah
14:15:31  <andythenorth> ok so it could just run through everything
14:15:56  <andythenorth> I'm taking design cues from MinimalGS, which is the boilerplate example Zuu made, and has a single MonthEnd loop
14:16:31  <andythenorth> ok so if all towns could be visited over the course of a month, it doesn't all have to happen at once on last day
14:17:04  * andythenorth wonders how all these citybuilder scripts work
14:17:30  <petern> They give up and build it into their own server.
14:18:04  <andythenorth> every time I look at GS, I consider requesting an extension to grf spec πŸ˜›
14:19:46  <andythenorth> βœ… wouldn't have to manage saveload state
14:19:58  <andythenorth> βœ… performance would just work, no opcodes to worry about
14:20:07  <andythenorth> βœ… events are handled on callbacks
14:20:28  <andythenorth> βœ… better debugging and developer tools
14:20:50  <andythenorth> βœ… every problem looks like a nail, if you all understand is hammers
14:22:07  <frosch> did you ask chatgpt about that? "better debugging and developer tools" is lolz πŸ™‚
14:22:48  <andythenorth> it's quite a low bar in both cases πŸ˜›
14:23:10  <andythenorth> reload_newgrfs is a thing though
14:23:11  <Pruple> andythenorth: I think this is correct. GS is for gametypes, not for extending NewGRF functionality.
14:25:37  <frosch> andythenorth: i don't know "printf debugging + break points + directly interpreted code" vs "internal variables + no break points + manual reverse engineering from nfo errors to nml to pynml to template..."
14:25:57  <Pruple> I also, incidentally, enjoy the way the rail sprites in action 3 cargo 2 are in a completely different order from the base sprites πŸ™‚
14:26:32  <andythenorth> frosch: also as an author GS log is quite useful
14:27:27  <andythenorth> oh I did have an idea for making GS better to work with
14:27:37  <andythenorth> storybook can have buttons?
14:27:48  <andythenorth> I think I can write a custom debugger / dev tool in the storybook
14:29:06  <petern> 2% health in Doom is not a good idea.
14:29:25  <andythenorth> my Doom isn't working any more
14:29:26  <andythenorth> M1 issues
14:31:08  <andythenorth> ok so is there any reason in principle we couldn't extend town grf spec?
14:31:28  <andythenorth> there was a long and silly discussion many years ago about GS replacing grf for things like that, with people who are no longer here
14:31:45  <andythenorth> well Pruple is still here
14:32:08  <Pruple> extend town grf spec to do what?
14:32:38  <supermop_Home> power
14:32:45  <andythenorth> have a monthly callback, instead of managing it from a stupid industry loop, like I currently do
14:33:03  <andythenorth> and also to be able to put text into the town window
14:33:23  <andythenorth> some of the gameplay things I want to do, I already did in grf, it's just weird
14:33:36  <andythenorth> also grf callback for company town rating
14:34:12  <Pruple> actually, thinking about towns the other day, there are two variables I'd quite like (tm) for towns; the count of towns, and the global population. basically in order to figure out how relatively large the town is.
14:34:26  <supermop_Home> google is basically worthless these days
14:34:44  <andythenorth> map global storage πŸ˜›
14:35:54  <andythenorth> wonder if I deleted my FIRS town effects branch
14:36:36  <supermop_Home> "godox jr flash not firiring FE2" just gives you a bunch of boilerplate affiliate marketing site reviews of the flash, not any forum discussion of people having issues with their flash not firing, or people using the flash on an FE2
14:37:08  <andythenorth> https://github.com/andythenorth/firs/blob/advanced_town_economy/src/templates/monthly_town_loop.pynml
14:37:37  <Pruple> "influence town behaviour"... towns have behaviour?
14:38:32  <supermop_Home> growing is a behavior i guess
14:38:36  <andythenorth> building houses and stuff
14:39:03  <andythenorth> grf can't control growth directly, but building choice can be driven from a town register that FIRS can write to
14:39:28  <andythenorth> and industries in the town can change production based on town 'happiness'
14:39:48  <andythenorth> I abandoned it because I can't write to the town window
14:40:04  <andythenorth> so there has to be a weird 'Plaza' industry to tell the player about town
14:40:06  <andythenorth> but
14:40:14  <andythenorth> the only way to get a Plaza into every town is...
14:40:15  <andythenorth> ...GS
14:40:22  <Pruple> "town happiness" sounds like something that should be a gamescript. and possibly newgrf agnostic. πŸ™‚
14:40:25  <andythenorth> all roads lead to GS, but it just sucks
14:40:31  <petern> Pruple: Sorry 😦
14:40:55  <andythenorth> but GS basically we don't know if it works or not
14:41:20  <andythenorth> ok, so now that's all sorted, I need a GS timer
14:41:39  <andythenorth> and a 'restart the GS' button in storybook
14:42:18  <supermop_Home> pruple i'd also like the nature of the growth to be specific to type of town, where type is somehow related to the industries it has nearby, which means you'd want grfs to have more influence on towns?
14:42:41  <andythenorth> FIRS GS knows about all the FIRS industries
14:42:46  <andythenorth> that's not agnostic but eh
14:43:16  <glx[d]> There have been discussions about one script per town
14:43:25  <andythenorth> it detects the economies as well, because it's not allowed to read GRF parameters currently https://github.com/andythenorth/firs/blob/gs-is-real/src/gs/firs.pynut
14:43:55  <andythenorth> I am unclear about the 'multiple GS' thing
14:44:01  <andythenorth> what opportunity does it unlock?
14:44:06  <andythenorth> more smaller GS being written?
14:44:11  <Pruple> supermop_Home: I think, typically, most towns will have most industries nearby, so that's not very useful. Unless you're limiting your industries by town, which is something your houses can mirror by simply using the same town categorisation. πŸ™‚
14:44:47  <supermop_Home> like a well served town that doesn't have industries nor a central, well connected location might grow as a bedroom community with lots of residences, but wouldn't grow a a large central business district
14:45:20  <supermop_Home> Pruple i guess that depends on what you consider 'nearby'
14:45:48  <supermop_Home> but usually on a steeltown type game i might only have a handful of blast furnaces across the map
14:45:53  <supermop_Home> not one per each town
14:48:36  <andythenorth> if I write the GS to do it, you might get one blast furnace, near the middle πŸ˜›
14:48:38  <andythenorth> dunno
14:52:44  <supermop_Home> i'd be down with one furnace per 512*512 chunk
14:52:56  <supermop_Home> as long as its not on top of a mountain
14:54:32  <supermop_Home> andythenorth making big grey solid slabs for walls then pasting them into another psd where i add layer effects and noise, clamp to pallet, and paste back
14:54:51  <supermop_Home> i worry its a little too shaded though
14:55:39  <petern> Campfires are better for cooking food in early game, tho
14:56:18  <supermop_Home> petern: FIRS: Paleolithic Basic economy?
14:57:37  <petern> FIRS: Minecraft economy. Where gold is uselsss...
14:57:57  <andythenorth> we should have a second currency though
14:58:00  <andythenorth> now you mention it
14:58:08  <andythenorth> because money is too easy
14:58:22  <petern> OpenNFT?
15:01:21  <FLHerne> petern: at least it's not Copper
15:01:50  <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #10330: Codechange: Rework 'start_date' parameter for AIs as a game setting https://github.com/OpenTTD/OpenTTD/pull/10330
15:02:08  <petern> That gives you the ability to zoom in.
15:06:24  <Samu> https://github.com/OpenTTD/OpenTTD/pull/10227#discussion_r1070364864 help me here, how do i reorder this struct in a manner that makes sense
15:06:48  <Samu> and memory friendly or soemthing
15:07:00  <Samu> didn't quite understood
15:07:06  <Samu> understand*
15:15:45  <andythenorth> GS I have to use special MP-safe random, not squirrel random?
15:16:29  <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #10227: Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI https://github.com/OpenTTD/OpenTTD/pull/10227#pullrequestreview-1249264907
15:17:01  <petern> Have I started a trend by shuffling ObjectSpec about? :p
15:17:02  <andythenorth> what's the point of RandItem()?
15:17:07  <andythenorth> it does same as Rand()?
15:17:26  <andythenorth> both return "A random value between 0 and MAX(uint32)."
15:17:59  <andythenorth> is there nothing for lists like python's random.choice() ?
15:18:12  <Samu> includes 0 but does not include the max(uint32)
15:18:21  <andythenorth> I don't mean "what's the point?" πŸ™‚
15:18:24  <Samu> max(uint32) - 1
15:18:27  <andythenorth> I mean "it is confusing, why both?"
15:18:40  <petern> /* static */ uint32 ScriptBase::RandItem(int unused_param)
15:18:40  <petern> {
15:18:40  <petern> return ScriptBase::Rand();
15:18:40  <petern> }
15:18:56  <petern> I suspect RandItem() is a compatibility function for something that was removed.
15:19:23  <Samu> it's for valuators
15:20:19  <Samu> my_list.Valuate(GSBase.RandItem) i think
15:20:42  <Samu> my_list.Valuate(GSBase.RandItem())
15:21:29  <andythenorth> not even going to try and understand valuators today πŸ™‚
15:21:40  <andythenorth> every time I read about them, I abandon my GS project
15:22:24  <andythenorth> how do I get a random number? `GSBase.Rand()` is an invalid expression
15:23:58  <Samu> local random_number = GSBase.Rand()
15:24:03  <andythenorth> thanks
15:24:44  <andythenorth> do I have to type convert to string to use as string arg?
15:24:50  <andythenorth> `        local cabbage = GSText(GSText.STR_CABBAGE, GSBase.Rand());
15:24:50  <andythenorth> GSTown.SetText(town, cabbage);`
15:24:54  <andythenorth> is invalid expression
15:25:15  <andythenorth> string code is `STR_CABBAGE     :The random number is {YELLOW}{COMMA}`
15:26:30  <andythenorth> hmm it's working though
15:26:45  <andythenorth> how can it work, i.e. town window shows correct result
15:26:52  <andythenorth> but script crashes at that line
15:27:11  <Samu> https://docs.openttd.org/gs-api/classGSText.html
15:29:08  <andythenorth> I am baffled πŸ™‚
15:29:09  <Samu> you are putting a GSBase.Rand() for the value of {COMMA}? im not sure, i don't work with strings on my gs
15:29:18  <andythenorth> yes
15:29:25  <andythenorth> that should generate an integer no?
15:30:30  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1064204941469700106/image.png
15:31:30  <Samu> doesn't even compile?
15:32:01  <Samu> such a small screenshot, can't see whole error
15:32:08  <andythenorth> the screenshot includes the full path
15:32:19  <andythenorth> which includes my username which is one half of the auth creds, so nope
15:33:25  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1064205677536477254/image.png
15:33:48  <andythenorth> ach I frigging hate GS πŸ™‚
15:33:51  <andythenorth> I am going to play tanks
15:34:20  <andythenorth> it's soooo hard and it makes me feel so stupid
15:34:38  <andythenorth> it is the most complex programming language I have ever tried to use
15:37:50  <Samu> i actually don't know what's wrong, let me dig my own GS that used strings
15:38:34  <andythenorth> it's not actually the worst language I have ever tried to use
15:38:46  <andythenorth> 2000 era javascript was
15:39:20  <andythenorth> the only debugger was window.alert() iirc
15:42:34  <andythenorth> ok, 'expression expected'
15:42:38  <andythenorth> what does it mean?
15:42:51  <andythenorth> google does not find anything relevant for squirrel language
15:44:06  <andythenorth> ok `Log.Info(GSBase.Rand());` does not work
15:44:16  <andythenorth> so how is GSBase.Rand() used?
15:45:00  <Samu> strange, let me test that here
15:45:51  <andythenorth> ok, the issue is incorrectly formatted comment, several lines away
15:46:00  <andythenorth> */ instead of /*
15:47:15  <Samu> works for me, I tried AIBase.Rand() though
15:48:20  <nielsm> andythenorth: you should be able to get extensions for various programming text editors to do syntax highlighting of squirrel code
15:48:37  <nielsm> to make that kind of issues easier to spot
15:48:40  <andythenorth> yeah it works, I'm just not reading the errors correctly Samu
15:49:20  <andythenorth> jfs-: I'd have to write my own for Squirrel πŸ™‚
15:49:24  <andythenorth> or change editor
15:49:29  <andythenorth> Squirrel is basically dead
15:49:52  <Samu> i also like a syntax highliter
15:49:55  <Samu> need one
15:50:11  <andythenorth> in my editor, lua highlighter seems to pick up some of squirrel entities
15:50:17  <nielsm> one new (or "new") use that popped up recently was in team fortress 2, they added support for map scripting via squirrel
15:51:11  <nielsm> there are definitely multiple extensions for VSCode to support squirrel syntax
15:52:18  <andythenorth> there's a Valve guide to it
15:52:52  <andythenorth> ok on a 256x512 map, it seems I can set town window text per month
15:53:28  <andythenorth> I'll try a bigger map
15:54:05  <Samu> i dont use VSCode, i have Notepad++ and Visual Studio 2022 :(
15:54:17  <Samu> is VSCode worth using over Visual Studio?
15:54:36  <nielsm> vscode is worth using over NPP
15:54:47  <Samu> uhm, ok
15:54:50  <nielsm> but I'd say it's complement to Visual Studio
15:54:57  <andythenorth> slow 4k x 4k map is very slow
15:55:09  <andythenorth> maybe I crashed it on river gen
15:55:23  <andythenorth> yeah ottd has hung
15:55:49  <glx[d]> I use vscode for nml
15:55:53  <scrubbles> https://upload.wikimedia.org/wikipedia/commons/6/68/Harringay_West_station_Gresley_J50_0-6-0T_geograph-2888613-by-Ben-Brooksbank.jpg
15:55:54  <scrubbles> tanks
15:56:23  <andythenorth> such
15:56:44  <andythenorth> game has hung again
15:56:52  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1064211579672985680/image.png
15:58:18  <petern> Again?
15:58:23  <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1064211959765020672/image.png
15:58:23  <andythenorth> and again
15:58:37  <petern> It's changed, that's not hung.
15:59:22  <andythenorth> I've turned off rivers
15:59:35  <andythenorth> ^ that's two separate attempts with a restart between them
16:00:13  <andythenorth> hmm are towns limited by name generator?
16:00:13  <andythenorth> I asked for 9999, but I don't seem to have 9999
16:00:36  <nielsm> yes
16:00:51  <nielsm> if the name generator runs out of names you just don't get any more towns
16:01:07  <andythenorth> ok
16:01:19  <andythenorth> so I need to work around that for testing GS
16:01:30  <andythenorth> can we make ffwd faster on 4k^2 maps?
16:01:37  <andythenorth> it's practically 1x game speed
16:01:59  <nielsm> https://github.com/OpenTTD/OpenTTD/issues/8088
16:02:04  <andythenorth> ok it's 8x πŸ˜›
16:03:10  <petern> Hmm, did I reorder original HouseSpecs properly...
16:03:24  <petern> Shame c++ doesn't have named initialization.
16:03:30  <andythenorth> fuck me, even scrolling the map to the corner takes 20 seconds on 4k^2
16:03:39  <andythenorth> this is lolz
16:04:13  <andythenorth> ok I've made the GS monthly loop fail
16:04:19  <petern> Yeah, and players pick 4kx4k by default because bigger is better, naturally...
16:05:15  <andythenorth> ok so now I have a data point
16:05:24  <andythenorth> making GS fail is trivial
16:05:42  <andythenorth> I was hoping it might just be false concerns
16:06:40  <andythenorth> ok so if it fails every month
16:06:44  <Rubidium> petern: https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers
16:06:56  <andythenorth> why do some towns get updated some months, and others in other months?
16:06:56  <andythenorth> it's one foreach loop
16:07:08  <andythenorth> if the loop exits early, it should restart next month no?
16:08:10  <andythenorth> it seems to be resuming the foreach, like it was suspended?
16:08:28  <andythenorth> but this means the monthly loop isn't being called fresh at least once per month
16:09:17  <andythenorth> this is why every time someone has to explain to me what 'event driven' means?
16:09:24  <andythenorth> but why isn't there a monthly loop event?
16:10:53  <andythenorth> 🧠
16:12:45  <andythenorth> ok one step at a time, how do I increase the number of opcodes?
16:14:05  <andythenorth> found it in settings πŸ™‚
16:14:27  <andythenorth> woah max is only 250k
16:17:13  <andythenorth> ok that gets through all towns on the map in about 4 months
16:17:22  <andythenorth> so if it was maybe 1m opcodes, that might be enough?
16:17:24  <andythenorth> or maybe 2m
16:18:17  <andythenorth> found the ini file
16:19:36  <petern> So when do we require C++20? πŸ™‚
16:21:20  <andythenorth> script_max_opcode_till_suspend is used for GS as well as AI?
16:21:32  <andythenorth> I set `max      = 10000000` and recompiled
16:21:36  <andythenorth> then changed the setting
16:21:47  <andythenorth> still 4 months to so to walk all the towns on a 4k^2 map
16:22:22  <Samu> isn't it only 2500 ops?
16:22:34  <Samu> on game script initialization
16:22:40  <andythenorth> dunno πŸ™‚
16:22:55  <andythenorth> but my change has made no difference to my very crude test
16:23:15  <Samu> but yeah, 2500, in no way that would be able to deal with 10k towns
16:23:30  <andythenorth> it's only 5k towns, OpenTTD limits the setting
16:23:41  <andythenorth> you can enter 9999, but then it adjusts the value
16:23:47  <Samu> hmm
16:23:50  <andythenorth> 5k towns is not many
16:24:15  <Samu> you can have more than 5k towns if you use very high number of towns and 4k map size
16:24:37  <andythenorth> I am entering 'custom' for the number
16:24:41  <andythenorth> that's capped to 5k
16:24:52  <andythenorth> also capped in JGRPP 😦
16:25:07  <andythenorth> /me generates 16k^2 map
16:25:16  <Samu> custom is capped to 5k because... they didn't like me adjusting that to 20k
16:25:19  <andythenorth> oh it's building 64k towns πŸ™‚
16:25:23  <Samu> kek
16:25:24  <andythenorth> JGRPP ftw
16:25:53  <andythenorth> this is so slow
16:25:58  <andythenorth> it really needs to be a lot faster
16:26:17  <andythenorth> it's been running 2 mins or so
16:26:19  <FLHerne> the generation?
16:26:21  <andythenorth> just to make a map
16:26:30  <FLHerne> an impractically huge map
16:26:48  <Samu> i dont think you can get all towns have added extra text via GS
16:26:59  <Samu> with newGRF however, that's possible
16:27:10  <andythenorth> grf can't do it, not in the spec
16:27:19  <andythenorth> still waiting for this map
16:27:22  <Samu> oh :(
16:27:26  <andythenorth> 3 mins now
16:27:31  <andythenorth> this is silly
16:27:39  <andythenorth> why is it so slow?
16:28:16  <andythenorth> ok done, ~4 mins
16:28:23  <Samu> oh, well newgrf can add extra text to industries at least, i thought they could do it for towns too
16:28:28  <Eddi|zuHause> depends on various settings
16:28:44  <andythenorth> ugh GS factor 0.5
16:28:50  <andythenorth> this is not going to be viable for testing
16:29:36  <Samu> you want to update 5000 towns at every month, all at once?
16:30:07  <andythenorth> 64k
16:30:43  <andythenorth> but the first problem is that the game is only running at 0.6x even if I put the map in the corner and close everything except FPS
16:31:30  <andythenorth> Samu: do I want to?  no
16:31:43  <andythenorth> does the game support players making 16k^2 maps with 64k towns? yes
16:31:46  <Samu> on my Company Value GS, when i try to update goal texts for the 15 companies, it's not instant at all...
16:32:40  <Samu> it's over time, it sends multiple DoCommands, one for each company text i wanna update... GS's aren't really all that good
16:32:53  <andythenorth> ok so maybe only use GS at game start, when it has free opcodes
16:32:59  <Samu> 15 is still manageable
16:33:10  <Samu> 5000 however.... that's just unfeasible
16:33:19  <andythenorth> but it needs to be feasible
16:33:59  <andythenorth> if the base game can update the town stats for that number of towns, then it's clearly not impossible
16:34:17  <JGR> If the town already has the right text, you don't have to "update" it, just doing that alone nets you a very large saving on most maps
16:34:32  <JGR> Likewise for other things to set like town growth
16:35:49  <JGR> Vanilla doesn't support 16k^2 maps so they're not going to be moved by arguments about those πŸ˜›
16:36:19  <andythenorth> no but the JGRPP playerbase is significant
16:36:30  <JGR> It also isn't the end of the world if "monthly" processes take longer than a calendar month
16:36:57  <andythenorth> no, but then gameplay shouldn't be designed on the assumption that things will complete in a month
16:36:58  <JGR> The 16k^2 subset of that is effectively 0
16:38:27  <andythenorth> it's interesting to try
16:38:36  <andythenorth> 4k^2 5k towns is ... slow
16:38:52  <andythenorth> 16k^2 64k towns is...pathological
16:39:05  <andythenorth> but the 4k^2 case is unsupportable anyway
16:40:17  <andythenorth> 2048^2 is also slow
16:40:18  <JGR> For most players the number of towns isn't linear with the map area
16:40:33  <andythenorth> ok, GS really is quite unworkable in this format
16:40:47  <JGR> With bigger maps you can have much more space between towns instead of just having more of them
16:41:32  <andythenorth> agreed, I'm just trying to find the limits πŸ™‚
16:41:38  <Eddi|zuHause> absurd number of towns could use some early exit in case of a) town name generator runs out of names, or b) map runs out of space
16:42:29  <Eddi|zuHause> both are kinda fuzzy to check
16:43:06  <andythenorth> ok with ~3k towns, GS can get through them all in about 5 game days
16:43:09  <JGR> Players trying to do extreme size maps just have to accept that things will be a bit slower
16:43:28  <andythenorth> trying to do everything in a single month-end check doesn't work
16:44:02  <andythenorth> ah the 5 days is because MinimalGS boilerplates that
16:44:12  <andythenorth> `        // Loop with a frequency of five days
16:44:12  <andythenorth> local ticks_used = GSController.GetTick() - loop_start_tick;
16:44:12  <andythenorth> GSController.Sleep(max(1, 5 * 74 - ticks_used));
16:44:12  <andythenorth> `
16:44:23  <andythenorth> let's remove that
16:45:28  <andythenorth> hmm quite hard to test, my test consists of randomly sampling by opening some town windows
16:45:37  <andythenorth> very unreliable
16:45:49  <andythenorth> I could just log the loop instead
16:46:05  <JGR> Also, are you using release/non-debug builds for this?
16:46:20  <andythenorth> no, but it's a good question πŸ™‚
16:46:37  <andythenorth> cmake -DCMAKE_BUILD_TYPE=Release ..
16:46:44  <andythenorth> is what I used
16:46:53  <JGR> That should be fine
16:48:17  <andythenorth> ok still using random sampling, but it's actually about a month to do 3k towns
16:48:21  <andythenorth> even with the sleeps removed
16:49:06  <andythenorth> how many ticks in a month?
16:49:14  <andythenorth> 2220?
16:49:25  <andythenorth> probably more than a month to do 3k then
16:53:02  *** Wormnest has joined #openttd
16:55:16  <andythenorth> lol 'town happiness', but measured biannually? πŸ˜›
16:55:43  <andythenorth> (biennially)
16:56:27  <JGR> You only need to use a command if the happiness is different to the last measurement interval's
16:56:44  <andythenorth> ah so I could just keep an internal representation of state?
16:57:57  <andythenorth> "or the town window text could just be a grf callback"
16:59:06  <JGR> Not much chance of getting that into v13, so it depends how long you're prepared to wait
17:02:18  <andythenorth> a long time
17:02:34  <andythenorth> v13 is all about variants and all the other things πŸ™‚
17:02:43  <andythenorth> this GS vs GRF thing is a long-standing puzzle
17:04:16  <Samu> Setting text requiring a DoCommand is the issue imo
17:04:52  <Samu> or just DoCommand DC_EXEC in general
17:05:22  <petern> Required for network games though.
17:05:23  <JGR> GSs are only run on the server, not the clients
17:08:28  <petern> In theory the server might be able to do magic for GS commands, but... it doesn't.
17:11:01  <andythenorth> also fixing one symptom won't address the general case
17:11:12  <andythenorth> even if town window text was set differently
17:11:29  <andythenorth> there might be 5k industries that I try to set a production flag for each month
17:12:04  <andythenorth> NotGRFTowns then?
17:12:30  <glx[d]> Even vanilla game loop doesn't check every thing each month
17:12:51  <glx[d]> Don't expect GS to be able to handle it
17:13:08  <petern> Maybe if GS could batch up commands it would help, if that was possible.
17:14:01  <glx[d]> But command may depend on the result of previous one
17:14:32  <petern> But not always.
17:15:09  <andythenorth> glx[d]: I know, but some things are ~guaranteed, like industry production and town pax production πŸ™‚
17:16:26  <petern> I can batch commands to an API and it can either execute until the first fails, or execute all ignoring failures.
17:16:50  <petern> And then it can return a result that gives the status of each command.
17:16:55  <petern> But that's just web stuff...
17:17:08  <JGR> The GS execution model makes this fairly difficult
17:18:20  <JGR> It'd probably be easier to add commands which take an array of townID and value pairs
17:21:49  <andythenorth> or not try and do things that require that πŸ™‚
17:21:53  <andythenorth> I guess
17:22:11  <andythenorth> FWIW, my goal is to make town cargos have an effect πŸ˜›
17:22:20  <andythenorth> which is remarkably difficult currently
17:23:41  <petern> What's a town cargo and what's the effect you are looking for?
17:25:05  <andythenorth> e.g. deliver goods to town, get an effect πŸ™‚
17:25:24  <andythenorth> it's so instinctive, the wiki used to literally explain that it didn't work that way
17:25:55  <andythenorth> the effect ideally would be open to interpretation by house grfs
17:25:59  <andythenorth> and industries in the town
17:26:39  <petern> The cargo TE_* stuff was meant to do some things, but I think it doesn't....
17:26:41  <andythenorth> for goods  substitute any other cargo, with possibly different effects
17:26:54  <andythenorth> cargo TE_ is just one of those historical messes πŸ™‚
17:27:00  <andythenorth> shows CS was considering the whole idea
17:27:06  <andythenorth> nearly works
17:27:25  <andythenorth> currently I can use town registers to store a happiness value
17:27:40  <andythenorth> I can only count cargos delivered to actual industries, not houses
17:27:49  <andythenorth> industries and houses can then read that
17:28:01  <andythenorth> I have a weird fake town monthly loop using industries
17:28:20  <petern> I don't think TE_ was an original thing.
17:30:01  <Samu> Im testing this GS on a 4k map 12k towns https://gist.githubusercontent.com/SamuXarick/48ab15372743278759902a7493fe7903/raw/646cd1d43c3ec1718357b78d3aaf123e1d12d45e/gistfile1.txt
17:31:29  <andythenorth> effect of food and water was in TTD I think
17:31:32  <petern> https://github.com/OpenTTD/OpenTTD/commit/99577265deda433fa0ea7cd29ed26b82743e3762
17:31:35  <andythenorth> which TE is supposed to extend
17:31:43  <andythenorth> well you'd know then πŸ™‚
17:32:02  <petern> Before TE_, the code literally just tested the cargo type.
17:32:18  <petern> So anything that moved to using cargo type instead of TE is missing the point.
17:32:30  <petern> TE_ is intended to be fleshed out with new ideas and effects.
17:32:44  <petern> Whatever that might be πŸ˜‰
17:32:53  <andythenorth> currently FIRS just turns it all off, because then it disappears from arctic / desert town window
17:32:57  <andythenorth> which is at least nice
17:33:04  <petern> Well that's grand.
17:33:16  <petern> for passengers, TE_PASSENGERS should be set, etc...
17:33:34  <petern> TE_PASSENGERS can also be set for say tourists...
17:34:05  <andythenorth> town_growth_effect, town_growth_multiplier
17:34:10  <petern> But it looks like the code was either never implemented, or someone though it was wrong and reverted it.
17:34:16  <andythenorth> yeah passengers has passengers
17:34:29  <andythenorth> when was it reverted?
17:34:42  <petern> t->supplied[CT_PASSENGERS].new_act += MoveGoodsToStation(CT_PASSENGERS, amt, ST_TOWN, t->index, stations.GetStations());
17:34:50  <petern> yeah, hardcoded as CT_PASSENGERS still...
17:36:40  <petern> Well I have a new project now.
17:37:40  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1064236946169266257/Unnamed_1950-12-06.png
17:37:40  <Xarick> 158 days
17:38:08  <petern> if (FindFirstCargoWithTownEffect(TE_FOOD) != nullptr) t->goal[TE_FOOD] = TOWN_GROWTH_DESERT;
17:38:17  <petern> That kinda does things...
17:38:43  <andythenorth> is t->supplied determined only by houses? or also industries?
17:38:47  * andythenorth could read the code
17:39:18  <petern> House production only I think.
17:39:52  <andythenorth> ah it's `t->received[TE_FOOD]` etc I need to read
17:44:57  *** Flygon has quit IRC
17:46:52  <andythenorth> ok so DeliverGoods()
17:47:48  <TallTyler> As I understand it, town_growth_multiplier was a TTDPatch thing. There was some sort of β€œimproved” town growth algorithm that’s way too β€œgame design” for OpenTTD.
17:47:59  <petern> Yes of course that pile of pre-dead shotgunners means an archvile is about to spawn...
17:48:02  <TallTyler> It’s described on a wiki somewhere
17:48:06  <andythenorth> petern: err...what if every cargo was just tracked in town->received rather than tracking the town effect?
17:48:14  <andythenorth> or some backwards compatible equivalent
17:48:21  <andythenorth> then expose the cargo amounts as a grf var on the town
17:48:39  <andythenorth> I know that 'how?' is a bad way to design spec
17:48:47  <andythenorth> but sometimes it's basic infrastructure needed πŸ˜›
17:56:32  <andythenorth> hmm https://github.com/OpenTTD/OpenTTD/discussions/8635
17:56:38  <andythenorth> continue there?
17:57:01  <andythenorth> it's been Zorged, so I'm kind of not wanting to touch it
17:58:44  <Pruple> I think there's still a lack of clarity about what anyone's trying to achieve by extending the town spec
17:58:50  <andythenorth> +
17:59:01  <petern> "Why do you not have feature requests?" "Zorg"
17:59:16  <andythenorth> we have been here before a few times with spec πŸ˜›
17:59:31  <andythenorth> I usually frame my goals around tweaking what's possible πŸ˜›
17:59:34  <andythenorth> as it seems more likely
17:59:41  <andythenorth> but it's a bad way to get a spec
17:59:46  <petern> Yes
18:00:14  <andythenorth> working within the constraints is a game in itself πŸ˜›
18:03:30  <andythenorth> FML https://weblogs.openttd.org/openttd/2010/08/03.html#204417-704
18:03:34  <JGR> andythenorth: You don't have to read all his posts
18:03:58  <JGR> If you've got more stuff to add I'd just add it
18:04:08  *** gelignite has joined #openttd
18:04:23  <JGR> It'll get lost if it's only in here
18:04:48  <Samu> im getting API compatibility script not found on 13.0-RC1
18:04:58  <Samu> if i set API requirements to 13
18:05:02  <Samu> am i doing it wrong?
18:09:44  <andythenorth> "Peter's TownGrowthChallenge" or something πŸ˜„ https://wiki.openttd.org/en/Development/Design%20Drafts/NewGRF/Town%20Control
18:09:56  <Rubidium> Samu: it's missing in 13.0-RC1
18:10:05  <petern> Eh, delete that
18:10:14  <petern> Wasn't even my idea, heh
18:10:29  <petern> GS replace that
18:11:00  <Rubidium> Samu: but it has already been fixed in the 13 branch
18:11:11  <Samu> ah, nice
18:13:51  *** andythenorth is now known as Guest1423
18:13:52  *** Guest1423 is now known as andythenorth[d]
18:22:43  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1064248282014040156/Unnamed_1950-01-0115.png
18:22:43  <Xarick> Steeltown FIRS cargo info i could gather via GS
18:23:50  <andythenorth[d]> you don't need to do that πŸ˜›
18:24:00  <andythenorth[d]> you can just know what the cargos are via the compile
18:24:16  <andythenorth[d]> * certain assumptions were made
18:26:04  <Samu> CC_NOAVAILABLE feels wrong
18:26:18  <Samu> seems that there's a class that is not yet named
18:26:31  <andythenorth[d]> πŸ™‚
18:26:34  <Samu> 1024, 2048, 4096
18:26:53  <andythenorth[d]> probably countable bulk, covered, hazardous
18:26:55  <andythenorth[d]> or something
18:26:59  <andythenorth[d]> look them up πŸ™‚
18:28:26  <petern> <https://www.teslarati.com/wyoming-phase-out-evs-2035/> lol 'merica
18:33:30  <dP> https://cdn.discordapp.com/attachments/1008473233844097104/1064250997167362138/Screenshot_from_2023-01-15_22-25-11.png
18:33:30  <dP> πŸ˜†
18:34:13  <Samu> https://github.com/OpenTTD/OpenTTD/blob/master/src/script/api/script_cargo.hpp#L26-L38
18:34:21  <Samu> are there more CC's than those?
18:34:27  <dP> gs could execute commands instantly if game didn't try to delay the server for "fairness" or smth
18:36:05  <Samu> oh, there are
18:36:06  <Samu> https://github.com/OpenTTD/OpenTTD/blob/master/src/cargotype.h#L38-L52
18:36:08  <dP> having the server one or two ticks ahead doesn't seem like a big enough deal worth crippling gamescripts
18:36:31  <petern> It still needs to send them to the clients though, so still can't do a huge number.
18:36:32  <glx[d]> GS has same limitations as AIs
18:36:49  <glx[d]> because it's the same framework
18:36:56  <petern> It does, but it GS doesn't need the same limiations.
18:37:30  <dP> petern: on command is just a few bytes, it will take hundres if not more to become a problem
18:37:41  <glx[d]> but yeah GS could be less limited
18:37:58  <petern> andy wants to do 3000 πŸ™‚
18:38:29  <glx[d]> will trigger opcode limit at some point πŸ™‚
18:39:01  <Samu> can there be more custom cargo classes between 1 << 10 and 1 << 14?
18:39:23  <Samu> FIRS seem to have set something in that interval
18:39:53  <glx[d]> I can count 4 πŸ™‚
18:44:57  <glx[d]> but the best is to look at the spec <https://newgrf-specs.tt-wiki.net/wiki/Action0/Cargos#CargoClasses_.2816.29 >
18:45:06  <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/750d89d37b372b808e616091913f7e48f6d4d0ea
18:45:07  <DorpsGek>   - Update: Translations from eints (by translators)
18:48:26  <Samu> ah, why aren't they in openttd enums?
18:49:06  <petern> Because they're custom...
18:49:43  <Samu> but newgrfs are speccing them
18:51:51  <andythenorth[d]> no
18:52:19  <andythenorth[d]> newgrfs are using a bitmask that is conventionally defined in the spec
18:52:38  <andythenorth[d]> does OpenTTD even know about classes, other than the bitmask?
18:53:38  <Pruple> outside a few specific cases I don't think so
18:53:58  <Pruple> eg, passenger class cargos use bus stops instead of truck stops
18:55:09  <Pruple> unless you're doing some flavour thing, I don't see why AIs need to know about them either
18:55:12  <andythenorth[d]> hmm is GS writing to log a command?
18:55:20  * andythenorth[d] doesn't want to abandon GS :P
18:55:33  <andythenorth[d]> partly because I made FIRS compile one and I think that's neat
18:56:17  <andythenorth[d]> there are unexplored bits of the spec, like having GS mess with industries
18:56:59  <glx[d]> maybe 3 CC_XX need to be added
18:57:24  <glx[d]> logging is not a command andy
18:57:35  <glx[d]> you can do it as much as you want πŸ™‚
18:58:03  <glx[d]> commands are usually what a player could do
18:58:59  <glx[d]> with an effect on the world of course
19:02:29  <petern> I just powered on my laptop... it's got Edge opened on the OpenTTD download page, showing the latested download is 1.11.1
19:02:43  <DorpsGek> [OpenTTD/OpenTTD] ldpl commented on pull request #10355: Change #10077: make maximum loan a positive multiple of the loan interval https://github.com/OpenTTD/OpenTTD/pull/10355#issuecomment-1383226208
19:03:07  <FLHerne> sounds like you might as well sell the laptop :p
19:03:29  <petern> I don't think it's worth anything
19:05:13  <andythenorth[d]> wonder if I could write a GS that says "You have too many towns / industries, I'm taking my toys home"
19:05:37  <andythenorth[d]> if my GS is trying to do stuff like manage industry amounts and roleplay towns a bit
19:05:52  <andythenorth[d]> and player has 3k towns and 5k industries....why bother?
19:06:07  <andythenorth[d]> plausible?
19:07:27  <FLHerne> alternatively, ignore towns/industries the player isn't interested in?
19:07:47  <andythenorth[d]> how would we know?
19:07:53  <andythenorth[d]> measure presence there?
19:13:33  <Pruple> but "When you start to use >4k*4k, you can't go back" D:
19:14:19  <petern> Oh no, this trackpad doesn't support 2-finger scrolling
19:17:16  <FLHerne> andythenorth[d]: yeah, whether serviced or within the town zone of a station that's serviced or something
19:17:53  <FLHerne> although I can get behind the "just don't have 5000 pointless industries" thing
19:17:58  <petern> Hmm, did at least put an SSD in it at some point.
19:23:29  <andythenorth[d]> Pruple: official wiki? πŸ˜›
19:23:47  <Pruple> Discord channel #openttd: , same thing
19:24:11  <andythenorth[d]> I guess it's because once you've invested that long in generating the fricking map πŸ™‚
19:24:13  <andythenorth[d]> you don't want to lose it
19:24:27  <andythenorth[d]> not that I want to tell people how to play, but eh
19:24:42  <andythenorth[d]> doesn't minecraft have some kind of infinite map thing?
19:38:55  <FLHerne> technically it's not unlimited anymore
19:39:10  <FLHerne> just so unreasonably huge that no-one could ever notice
19:55:50  <Samu> dumpinfo cargotypes
19:56:13  <Samu> doesn't mention those above 1 << 9
20:02:30  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1064273394884952165/Unnamed_1950-01-0116.png
20:14:44  <andythenorth[d]> some industry sets require pax / workers at secondaries?
20:20:51  <TallTyler> Some of mine, but I'm phasing that out
20:20:57  <TallTyler> It's pretty grindy
20:31:22  <glx[d]> Samu: probably because they were "added" to the spec after the introduction in openttd source, and nobody updated
20:32:21  <glx[d]> and even if there are not in the enum everything still works fine
20:32:48  <glx[d]> (internally)
20:43:54  <andythenorth[d]> ok so one useful grf thing would be the ability to force an industry to be built in x% of towns
20:44:05  <andythenorth[d]> without massively skewing the rest of the industry counts
20:44:35  <andythenorth[d]> shops, builders yards etc
20:51:47  <Samu> why isn't Xarick account logged off when I leave discord webpage?
20:54:06  <andythenorth[d]> hmm I need to tokenise all the FIRS industry IDs in my GS
20:54:17  <andythenorth[d]> maybe I can put them in table slots or something
20:54:53  <andythenorth[d]> oh I did already πŸ˜›
20:57:37  <petern> Discord accounts don't leave the server, they just get marked offline.
20:57:41  <petern> "server"
20:58:28  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1064287477604569108/image.png
20:58:47  <Samu> #10355 preview
20:59:13  <petern> Works for me.
20:59:26  <petern> Unless you mean it crashed after doing something.
20:59:31  <reldred> You can check out, but you can never leave.
20:59:42  <andythenorth[d]> is reload_gs a thing?
20:59:55  <reldred> *such a lovely place*
21:00:08  <andythenorth[d]> floppy disk icon -> load savegame -> ? icon -> open AI/GS debug
21:00:10  <andythenorth[d]> every time πŸ˜›
21:00:29  <Samu> let me test locally
21:00:30  <andythenorth[d]> maybe I can hotkey something
21:03:45  <andythenorth[d]> ok alt+D
21:03:48  <andythenorth[d]> opens debug
21:03:52  <andythenorth[d]> QoL improvement
21:04:34  <Samu> where do i find the local browser openttd install folder or something, wanna see if there's a crash report there
21:07:15  <andythenorth[d]> hmm still have to detect the industry type by fingerprinting cargo I think
21:07:19  <andythenorth[d]> can't just query it
21:07:34  <andythenorth[d]> lol shave that yak gud
21:08:19  <andythenorth[d]> nope, we can https://github.com/OpenTTD/OpenTTD/commit/b8a8891a8656c0482a045505e531c812c60026df
21:13:53  *** HerzogDeXtEr has quit IRC
21:14:38  *** nielsm has quit IRC
21:17:52  <glx[d]> there are no crash reports for browser version (and it's somewhere in browser db I guess)
21:18:43  <glx[d]> it's just a webpage
21:19:01  <Samu> think it's the autosave, it crashes
21:19:29  <andythenorth[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1064292768253497444/image.png
21:19:44  <andythenorth[d]> if I can just learn GS syntax and debugging
21:19:47  <andythenorth[d]> and stop feeling stupid
21:19:50  <andythenorth[d]> it has a lot of potential
21:20:21  <andythenorth[d]> I don't really understand the table slots model
21:20:32  <andythenorth[d]> it seems like everything is one giant dict, except when it isn't
21:20:43  <andythenorth[d]> but I can do stuff like
21:20:59  <andythenorth[d]> where I've built a big table copyin

Powered by YARRSTE version: svn-trunk