IRC logs for #openttd on OFTC at 2024-06-05
            
00:00:41 <DorpsGek> [OpenTTD/OpenTTD] Moth-Tolias updated pull request #12719: Change: Improved tree placement at worldgen https://github.com/OpenTTD/OpenTTD/pull/12719
00:18:34 <yiffgirl> looks a lot better. could probably go even lower
00:18:34 <yiffgirl> what do you folk think?
00:42:59 <DorpsGek> [OpenTTD/OpenTTD] ladysadie commented on pull request #12690: Feature: Add font resizing sliders to the game options UI. https://github.com/OpenTTD/OpenTTD/pull/12690#pullrequestreview-2097632054
02:02:01 *** amal[m] has quit IRC (Quit: Client limit exceeded: 20000)
02:09:15 *** tokai has joined #openttd
02:09:15 *** ChanServ sets mode: +v tokai
02:15:03 *** Wormnest has quit IRC (Quit: Leaving)
02:16:04 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
02:22:32 *** D-HUND has joined #openttd
02:25:54 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:28:12 *** CyChem has joined #openttd
02:29:58 *** CyChem has left #openttd
02:49:04 *** HerzogDeXtEr has joined #openttd
03:00:49 *** gnu_jj_ has joined #openttd
03:03:58 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:33:43 *** Flygon has quit IRC (Read error: Connection reset by peer)
04:43:27 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/1f636d94d41c76a56edb21a9bbe1433a109c8e37
04:43:28 <DorpsGek> - Update: Translations from eints (by translators)
04:44:24 <DorpsGek> [OpenTTD/OpenTTD] DefinitelyNotRau117 commented on pull request #12714: Add: Setting to disable news message for old vehicles https://github.com/OpenTTD/OpenTTD/pull/12714#issuecomment-2148844224
04:52:42 *** XYZ has joined #openttd
05:00:46 *** XYZ has quit IRC (Ping timeout: 480 seconds)
05:26:36 <andythenorth> Should I just write my own array.find()?
05:26:56 <andythenorth> As a util
05:27:01 <andythenorth> Maybe
05:31:40 <andythenorth> oh maybe superlib already did
05:32:01 <andythenorth> I keep forgetting that superlib has utils for common things that squirrel lacks
06:07:32 <andythenorth> hmm can't manipulate a GSList inside a loop over the list
06:07:33 <andythenorth> ok
06:08:02 <andythenorth> not surprising
06:19:50 *** SigHunter has quit IRC ()
06:22:38 *** SigHunter has joined #openttd
06:34:28 <peter1138> Iron Horse + debug build + valgrind = glacial
06:52:41 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #12753: Codechange: Use unique_ptr for NewGRF language_map. https://github.com/OpenTTD/OpenTTD/pull/12753#issuecomment-2149016327
07:15:44 <peter1138> Hmm, forums back to being slow again.
07:20:36 *** _rei4122 has joined #openttd
07:20:36 <_rei4122> andythenorth: In most cases Squirrel, I would consider whether a table can be used instead of an array
07:20:36 <_rei4122> The consumption of ticks is probably the same whether it is an array or a table.
07:21:44 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
07:27:58 *** SigHunter has joined #openttd
07:36:03 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
07:47:06 *** toktik has quit IRC (Remote host closed the connection)
07:47:26 *** toktik has joined #openttd
07:54:27 *** SigHunter has joined #openttd
08:26:16 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
08:27:50 *** Smedles has joined #openttd
08:28:21 <pickpacket> the consumption of tics, however, depends a lot on geographical location and time of year. Among other factors
08:28:40 <pickpacket> Does anyone feel like taking a gander at this? https://github.com/OpenTTD/OpenTTD/pull/12754
08:33:27 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
08:34:35 *** SigHunter has joined #openttd
08:52:14 *** SigHunter_ has joined #openttd
08:54:49 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
09:17:18 <andythenorth> _rei4122: how would one find an item in the array if it was a table?
09:17:58 <andythenorth> store the values as the keys, not the values?
09:18:39 <andythenorth> also trying to access a table by integer index fails in squirrel
09:25:26 <andythenorth> peter1138: you probably have FIRS active?
09:28:59 <_rei4122> andythenorth: local a = ["A","B","C"];
09:28:59 <_rei4122> local t = {A=A,B=B,C=C};
09:28:59 <_rei4122> foreach(x in a) {
09:28:59 <_rei4122> if(x == "B") {
09:28:59 <_rei4122> //...
09:29:00 <_rei4122> }
09:29:00 <_rei4122> }
09:29:02 <_rei4122> if("B" in t) {
09:29:02 <_rei4122> // ...
09:29:04 <_rei4122> }
09:32:01 <peter1138> andythenorth: No, just Iron Horse.
09:36:37 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #12754: Bribing possible if other co has excl. rights https://github.com/OpenTTD/OpenTTD/pull/12754#pullrequestreview-2098559946
11:31:21 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1247875404568723527/image.png?ex=66619e08&is=66604c88&hm=843af43b9ca312f6c92f11f9869f0ff7b21145c4c5178109210c5e5dc6fcc100&
11:31:21 <andythenorth> I did a bad thing
11:31:23 <andythenorth> not sure what yet πŸ˜›
11:32:20 <andythenorth> I tried logging inside the function used by a valuator, as I don't understand what it's doing
11:32:32 <andythenorth> but seems logging can't be used inside a valuator, it crashes
11:32:42 <andythenorth> probably doing it wrong
11:41:38 *** Flygon has joined #openttd
11:51:57 <_glx_> Opcode per valuator call is inverse proportional to list length
11:53:39 <andythenorth> wonder what this will evaluate as `return industry in ::persistent_storage["owned_industries"];`
11:53:46 <andythenorth> I thought it would be a bool
11:54:23 <andythenorth> I have it as a one line function, which is used for Valuate
11:54:23 <andythenorth> `
11:54:23 <andythenorth> industry_list.Valuate(VulcanIndustryOwnership.IsIndustryOwned);
11:54:23 <andythenorth> industry_list.RemoveBelowValue(1);
11:54:23 <andythenorth> `
11:54:50 <andythenorth> I'm not getting results that make sense, so either IsIndustryOwned() is wrong, or bool can't be detected as int in squirrel
11:55:14 <andythenorth> logging it either crashes the valuator, or returns 0 or 1 (depending where I put the logging lines)
12:28:22 <andythenorth> ach again crashed the valuator
12:28:27 <andythenorth> pfff
12:30:16 <andythenorth> I guess Valuate can't be use for lists that might have unpredictable size
12:31:53 <peter1138> Crashed, or excessive CPU usage?
12:38:37 <andythenorth> excessive CPU usage
12:41:28 <andythenorth> possibly GSLog is too expensive
12:44:35 <DorpsGek> [OpenTTD/OpenTTD] flowprint updated pull request #12683: Fix: Timetable precision https://github.com/OpenTTD/OpenTTD/pull/12683
12:45:26 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12752: Add: Setting for not connecting 'double depots' with track https://github.com/OpenTTD/OpenTTD/pull/12752#pullrequestreview-2099029098
12:50:49 <andythenorth> maybe Valuators don't really work
12:50:57 <andythenorth> might try just using arrays
13:08:18 <andythenorth> why is valuate so slow?
13:10:22 <andythenorth> 364 industries on the map
13:10:36 <andythenorth> valuating them with a simple function shouldn't be impossible
13:14:38 <andythenorth> maybe my loop is unclosed somewhere? https://gist.githubusercontent.com/andythenorth/2fae22718f23e56bf6a5232dfc352e67/raw/df53e71875d70156f35a68d976a345b35c98d4a2/gistfile1.txt
13:31:46 <peter1138> You definitely want to call GetIndustryType() 6 times instead of putting it in a local outside the loop.
13:32:01 <peter1138> (That won't affect much, but just generally...)
13:34:39 <Eddi|zuHause> my python brain wants to make a lamda out of that
13:34:55 <Eddi|zuHause> or a list comprehension
13:39:24 <Eddi|zuHause> ind_ids = [industries[ind_name].id for ind_name in [...]]; valuate(lambda ind: gettype(ind) in ind_ids)
13:39:40 <Eddi|zuHause> (pseudocode)
13:50:28 <_jgr_> You'd probably be better off getting rid of the valuate entirely, in favour of just doing a normal loop over industry_list
14:07:44 <pickpacket> LordAro: I totally agree that four levels of parenthesis is too much for an if statement. I found it frustratingly difficult to deal with the fact that the whole thing is a negation to begin with
14:09:13 <pickpacket> I split it into multiple lines with explanatory comments when dealing with it myself. Would that be better than attempting to break it into multiple statements or even functions?
14:09:38 <peter1138> Valuate should be prefered but the instruction cost penalises it.
14:10:22 <LordAro> pickpacket: multi-line-if < multiple statements, imo
14:10:35 <LordAro> functions seems excessive, unless there are multiple places it could be used
14:24:06 <DorpsGek> [OpenTTD/OpenTTD] LDprg started discussion #12756: Add a all coverages overlay https://github.com/OpenTTD/OpenTTD/discussions/12756
14:28:11 <ahyangyi> Hmm, GS development sounds very *fun*
14:32:31 <DorpsGek> [OpenTTD/OpenTTD] steve-goldman commented on pull request #12752: Add: Setting for not connecting 'double depots' with track https://github.com/OpenTTD/OpenTTD/pull/12752#pullrequestreview-2099406092
14:37:04 <andythenorth> yeah I need to stop using Valuate, I don't understand it
14:37:12 <andythenorth> and I can't log inside the function it calls
14:38:27 <andythenorth> this is supposed to round-robin distribute industries across 'manufacturers' https://gist.githubusercontent.com/andythenorth/5c831e706cda70db8161ced343788450/raw/85d61decb93a82ac94635434f2e003558a56bc76/gistfile1.txt
14:38:31 <andythenorth> but it....doesn't
14:38:39 <andythenorth> some industries just don't get assigned an owner
14:40:39 <andythenorth> they're removed after the first Valuate I think
14:40:48 <andythenorth> but I can't easily log
14:45:45 <_jgr_> The use of `index` is confusing here, that doesn't really look right?
14:47:39 <_jgr_> Ah, actually it's fine, I see what you are doing
14:48:24 <_jgr_> The whole thing is O(N^2) in the number of industries
14:49:09 <andythenorth> whether the industry has an owner is non-deterministic
14:49:34 <andythenorth> I have a GS button that reruns industry_list.Valuate(VulcanIndustryOwnership.IsIndustryOwned);
14:49:41 <andythenorth> the contents of the list vary between runs
14:51:03 <andythenorth> I can't figure out what the trigger is though
15:31:43 *** debdog has joined #openttd
15:46:02 <DorpsGek> [OpenTTD/OpenTTD] steve-goldman updated pull request #12752: Add: Setting for not connecting 'double depots' with track https://github.com/OpenTTD/OpenTTD/pull/12752
15:51:18 <DorpsGek> [OpenTTD/OpenTTD] steve-goldman commented on pull request #12752: Change: Do not automatically connect double depots with track https://github.com/OpenTTD/OpenTTD/pull/12752#issuecomment-2150406921
15:53:46 *** XYZ has joined #openttd
16:01:51 *** XYZ has quit IRC (Ping timeout: 480 seconds)
16:20:36 <peter1138> Well, how are you defining ownership?
16:32:44 *** gelignite has joined #openttd
16:41:22 *** SigHunter_ has quit IRC (Remote host closed the connection)
16:42:23 *** SigHunter has joined #openttd
16:58:53 <andythenorth> static function IsIndustryOwned(industry) {
16:58:53 <andythenorth> return industry in ::persistent_storage["owned_industries"];
16:58:53 <andythenorth> }
16:59:22 <andythenorth> I need to write a debugger I think
16:59:34 <andythenorth> I have half of a bad one
16:59:43 <andythenorth> inspecting state is not easy
17:00:08 <andythenorth> and sometimes the bugs in my debugger compound the issue πŸ˜„
17:07:12 <andythenorth> my GS is all in here https://github.com/andythenorth/firs/tree/v5-release-my-savegame/src/gs/templates
17:07:15 <andythenorth> such as it is
17:23:57 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12752: Change: Do not automatically connect double depots with track https://github.com/OpenTTD/OpenTTD/pull/12752#pullrequestreview-2099819928
17:30:49 <DorpsGek> [OpenTTD/OpenTTD] steve-goldman updated pull request #12752: Change: Do not automatically connect double depots with track https://github.com/OpenTTD/OpenTTD/pull/12752
17:31:34 <DorpsGek> [OpenTTD/OpenTTD] steve-goldman commented on pull request #12752: Change: Do not automatically connect double depots with track https://github.com/OpenTTD/OpenTTD/pull/12752#pullrequestreview-2099835972
17:36:43 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #12752: Change: Do not automatically connect double depots with track https://github.com/OpenTTD/OpenTTD/pull/12752#pullrequestreview-2099845538
18:14:29 *** Wormnest has joined #openttd
18:21:51 <andythenorth> /me waiting for someone to take pity on my squirrel πŸ˜›
18:50:37 <DorpsGek> [OpenTTD/OpenTTD] ladysadie commented on pull request #12690: Feature: Add font resizing sliders to the game options UI. https://github.com/OpenTTD/OpenTTD/pull/12690#pullrequestreview-2100031922
19:00:33 <ahyangyi> I'm not squirrel-literate :S
19:06:08 <andythenorth> what does a static function do vs. a function?
19:06:52 <_glx_> context ?
19:07:25 <andythenorth> squirrel
19:07:47 <DorpsGek> [OpenTTD/OpenTTD] JGRennison opened pull request #12757: Fix #12030: Water infrastructure totals when using DC_FORCE_CLEAR_TILE to remove objects on water https://github.com/OpenTTD/OpenTTD/pull/12757
19:09:04 <_glx_> there's no static function in squirrel
19:09:59 <andythenorth> there's a keyword for it
19:10:03 <andythenorth> and superlib uses it a bit
19:11:05 <andythenorth> I think it possibly makes the function shared between all instances of the class?
19:11:11 <_glx_> Squirrel's classes support static member variables. A static variable shares its value between all instances of the class. Statics are declared by prefixing the variable declaration with the keyword static; the declaration must be in the class body.
19:11:12 <andythenorth> because the function is just a var in a table slot?
19:11:39 <_glx_> Statics are read-only.
19:11:52 <andythenorth> trying to figure out why 'UpdatePage' is not found in the context https://github.com/andythenorth/firs/blob/v5-release-my-savegame/src/gs/templates/grind/grind_persistent_storage.pynut#L30
19:12:11 <andythenorth> I don't know what the context is for `this` here, I assumed it would be the class instance
19:12:19 <andythenorth> but it might be the caller of the function
19:13:37 <_glx_> this should be the instance, anyway I don't think `static function UpdatePage()` is valid
19:13:50 <andythenorth> me neither
19:14:09 <andythenorth> GPT added some of them, I probably fed it SuperLib
19:14:23 <_glx_> and if it was, then you could not access this in it
19:17:19 <andythenorth> I've pushed proof that UpdatePage() can be accessed by the class instance
19:17:39 <andythenorth> unless the instance doesn't exist in the constructor maybe
19:20:24 *** Wolf01 has joined #openttd
19:22:37 *** debdog has quit IRC (Ping timeout: 480 seconds)
19:25:41 <andythenorth> fixed it
19:26:03 <andythenorth> had to pass the context around as a parameter
19:26:12 <andythenorth> not sure I want to know why
19:26:35 <andythenorth> https://github.com/andythenorth/firs/blob/v5-release-my-savegame/src/gs/templates/grind/grind_persistent_storage.pynut#L13
19:27:38 <andythenorth> I suspect the context for GrindStoryPagePersistenStorageButtonHandler will be EventManager, where it is called
19:27:59 <andythenorth> rather than the GrindStoryPagePersistentStorage class instance
19:28:19 <andythenorth> anybody else want to try writing GS? It's quite an adventure
19:32:42 <andythenorth> what do I need to do with GS dates in wallclock?
19:32:52 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1247996581685493821/image.png?ex=66620ee3&is=6660bd63&hm=847a38fcfc3eceea1aafeb258fcbec99cb4251167a0205efb9beadaaabfe076f&
19:32:52 <andythenorth> the story page date is correct on creation
19:33:04 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1247996632000106607/image.png?ex=66620eef&is=6660bd6f&hm=acad0fd5a01280c0e0b4a39b5976edca622ad42b6cc99820b2ee9d22c1a1aa25&
19:33:04 <andythenorth> but wrong after an update
19:33:13 <andythenorth> `GSStoryPage.SetDate(this.story_page, GSDate.GetCurrentDate());`
19:33:23 <_glx_> it's economy date
19:33:34 <_glx_> and it starts at 0 in wallclock
19:34:09 <andythenorth> is there a method to get the economy date?
19:34:14 <andythenorth> I saw a mode get added then removed
19:34:30 <andythenorth> can't find anything here https://docs.openttd.org/gs-api/classGSDate#a72f52ff6262dd936b614d6e0840b7983
19:35:54 <_glx_> I though the doc was updated to tell which date was returned
19:36:23 <andythenorth> maybe it's WIP πŸ™‚
19:38:53 <_glx_> anyway all GSDate functions use economy time
19:39:31 <andythenorth> the StoryBook page initial date is set by OpenTTD?
19:41:43 <_glx_> SetDate and GetDate use calendar time
19:44:03 <_glx_> but there's no way to get current calendar time yet
19:44:49 <_glx_> scripts will need some API changes to support wallclock
19:47:00 <andythenorth> fair enough πŸ™‚
19:50:44 <andythenorth> hmm a small thing that would really help
19:50:52 <andythenorth> so we have newgrf debug
19:51:25 <andythenorth> for GS I _can_ write my own debug info, for example, to map industry IDs on the map to the industry name
19:51:39 <andythenorth> but I have to do it in story book, or flood the log with extraneous info
19:51:54 <andythenorth> and the story book is not super easy to navigate or search
19:52:14 <_glx_> squirrel has some debug mechanism, but nobody wants to write a debugger
19:52:20 <andythenorth> also fair
19:52:50 <andythenorth> right now, just having the industry instance ID in the industry inspection window would be helpful πŸ™‚
19:53:24 <andythenorth> I can't log inside Valuate because it crashes
19:53:34 <andythenorth> so I'm having to try and inspect everything via storybook
19:53:49 <_jgr_> Putting more stuff in the existing debug windows is much easier than writing a script/Squirrel debugger
19:54:06 <andythenorth> industry type ID and instance ID would be helpful
19:54:27 <andythenorth> otherwise I have to do a story page for every industry, or one giant story page which is hard to search
19:54:45 <andythenorth> I've tried logging, but if I log with linebreaks, I run out of log and it gets cleared
19:55:17 <andythenorth> and if I log a string repr of an array, it's so wide, it takes forever to scroll horizontally, and is very hard to find the item that triggered the breakpoint
19:55:51 <andythenorth> I can log for specific industry instances to debug them, but it doesn't survive a newgame
19:57:59 <andythenorth> I guess I could patch the log scrollback locally
19:59:42 <andythenorth> I do have some things logging to storybook, but that's very slow to render the text and I got lolzed at πŸ™‚
20:02:46 <_jgr_> https://cdn.discordapp.com/attachments/1008473233844097104/1248004108179341412/image.png?ex=666215e6&is=6660c466&hm=ec338262a38d1cb2e70293aa95a223dcab9bab61bde01d789055dfd99fda479e&
20:02:46 <_jgr_> I've been a bit keen about adding stuff to the debug windows, but some stuff along these lines seems generally useful and not too objectionable for vanilla
20:03:33 <_glx_> yeah your fork has a lot more debug
20:04:50 <andythenorth> yes, these would be good
20:05:02 <andythenorth> I could switch to JGRPP alternately
20:05:50 <andythenorth> is this already a patch?
20:07:16 <_jgr_> There is no vanilla PR for it
20:09:22 <andythenorth> wonder if my jgr fork builds πŸ™‚
20:10:37 <DorpsGek> [OpenTTD/OpenTTD] ladysadie commented on pull request #12690: Feature: Add font resizing sliders to the game options UI. https://github.com/OpenTTD/OpenTTD/pull/12690#pullrequestreview-2100193704
20:11:06 <DorpsGek> [OpenTTD/OpenTTD] ladysadie commented on pull request #12690: Feature: Add font resizing sliders to the game options UI. https://github.com/OpenTTD/OpenTTD/pull/12690#pullrequestreview-2100194416
20:14:23 <andythenorth> yes there's some nice stuff there
20:14:29 <andythenorth> just the window contents is nice
20:14:44 <andythenorth> but also 'duplicate' and 'log this to console'
20:15:03 <andythenorth> wish I could duplicate the GS storybook πŸ™‚
20:16:22 *** gelignite has quit IRC (Quit: Stay safe!)
20:28:24 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1248010557416669336/image.png?ex=66621be7&is=6660ca67&hm=1b708e09576f7a32a76725e4004de4842627930a8f79796d9877fcbeb1a9a223&
20:28:24 <andythenorth> yeah this is better QoL πŸ™‚
20:28:52 <andythenorth> Index 50, and I can see it in the Story Book
20:59:12 <peter1138> Well
21:40:57 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:44:37 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1248029739038408757/image.png?ex=66622dc5&is=6660dc45&hm=42041a51a29c07441ee92ae9989f5ce95c8d398217b24319b8eeee6b3d458c8c&
21:44:37 <andythenorth> tiny_font eh πŸ™‚
21:45:55 <andythenorth> think I made my industry allocator work also πŸ™‚
21:46:09 <andythenorth> sacked off Valuate, just used foreach
22:04:06 *** cockroach has joined #openttd
22:08:04 <cockroach> so I've been wondering, with the new wallclock time mode (I *love* it!), how do I convert seconds to months for FIRS industries? i.e. if the industry requires X crates every three months, how do I convert that to wallclock time?
22:11:36 <cockroach> is it simply the same amount of time as in the olden days? 3 minutes?
22:18:04 <FLHerne> Yes
22:19:16 <cockroach> excellent. thanks.
22:22:15 <Eddi|zuHause> basically, all things "economy" still work on the original timeframes
22:22:56 <Eddi|zuHause> 1 month ~ 1 minute
22:22:56 <cockroach> ah ok. so it's just the world (new vehicles & stuff) that's ticking slower.
22:23:24 <Eddi|zuHause> correct
22:23:30 <cockroach> very nice
23:33:14 <talltyler> cockroach: The new β€œindustry cargo scale” setting does change the time scale of FIRS, e.g. if you set the scale to 50% the industry will require engineering supplies every 6 months/minutes.