IRC logs for #openttd on OFTC at 2023-08-23
โด go to previous day
01:24:26 *** Wormnest has quit IRC (Quit: Leaving)
02:02:48 *** herms has quit IRC (Quit: bye)
02:16:50 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:39:19 <Eddi|zuHause> i... don't think going to bed helps in any way...
02:52:01 *** tokai|noir has joined #openttd
02:52:01 *** ChanServ sets mode: +v tokai|noir
02:59:04 *** tokai has quit IRC (Ping timeout: 480 seconds)
07:09:13 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
07:09:29 *** D-HUND is now known as debdog
07:10:11 *** HerzogDeXtEr has joined #openttd
07:44:44 *** milek7 has quit IRC (Remote host closed the connection)
07:53:04 <andythenorth> is it stupid to CargoMonitor on every industry, and then persist that for maybe 3 months?
07:53:34 <andythenorth> I'm not trying to support 16k maps with industry 'high', so probably fine?
07:57:54 <locosage> it's not stupid in principle
07:58:22 <locosage> the purpose of cargo monitor is to provide a way for gs to track cargoes without the game having to save every possible thing gs authors can need
07:58:44 <locosage> but how performant it actually is is a separate question
08:14:50 *** virtualrandomnumber has joined #openttd
08:15:02 *** virtualrandomnumber has quit IRC (Remote host closed the connection)
08:24:09 *** milek7 has quit IRC (Remote host closed the connection)
08:59:52 <Eddi|zuHause> well, if it's "not performant" the gamescript might not finish in time before the month rolls over
09:01:46 <andythenorth> tests showed that's a real concern if the GS issues non-async commands
09:02:01 <andythenorth> but it wasn't a concern for read-only operations so far
09:02:22 <andythenorth> I don't know which category CargoMonitor falls into, as reading it causes it to be cleared
09:03:32 <locosage> I don't recall cargo monitor sending any network commands
09:03:51 <locosage> and clearing it is not an issue as it only runs on server
09:24:05 <Eddi|zuHause> even if it's not operating through commands, it might still run out of opcodes
09:33:30 *** milek7 has quit IRC (Remote host closed the connection)
09:39:17 <andythenorth> I can't quickly find a reference to how many opcodes we have
09:39:28 <andythenorth> but we can probably increase them
09:39:47 <andythenorth> depends how fast we want ffwd to be ๐
09:42:59 <locosage> if ffwd is too slow call it daylength :p
09:49:11 <Eddi|zuHause> opcodes is configurable in the .cfg
09:58:11 <andythenorth> squirrel lolz about when 0 == false, and when it doesn't
09:58:29 <andythenorth> there's probably a rule about how it evaluates, but fucked if I can figure it out
09:58:47 <andythenorth> maybe there's strict and less strict comparison operators or something
10:01:55 <locosage> hm, I get gcc warnings on master...
10:02:05 <locosage> `warning: โ<unnamed>.MidiFile::DataBlock::realtimeโ may be used uninitialized`
10:02:34 <locosage> `src/music/midifile.cpp:225:96: target.blocks.push_back(MidiFile::DataBlock(block->ticktime + deltatime));`
10:23:49 <andythenorth> can't persist any squirrel classes in GS savedata?
10:24:18 <andythenorth> I guess I need to serialise / deserialise then ๐ฆ
10:34:37 <andythenorth> `In particular, instances of classes can't be saved including GSList. Such a list should be converted to an array or table on save and converted back on load.
10:34:37 <andythenorth> The function is called as soon as the user saves the game, independently of other activities of the script. The script is not notified of the call. To avoid race-conditions between Save and the other script code, change variables directly after a Sleep, it is very unlikely, to get interrupted at that point in the execution. See also https://wiki.openttd.org/en/Development/GS/Save%20and%20Load for
10:43:15 <_glx_> Automatic conversion of Script not wanted here
10:44:41 <_glx_> (Becomes GS or AI depending on the API being generated)
11:04:19 <locosage> hm, preview survey result shows titlegame numbers...
11:05:13 <locosage> does it actually send title game or is that preview somewhat misleading?
11:06:01 <locosage> also, is there a way too see what data is actually sent?
11:06:07 <locosage> or, at least when it sends something
11:11:55 *** Flygon has quit IRC (Read error: Connection reset by peer)
11:15:43 <locosage> btw, framerate averages would be interesting to survey
11:25:53 <_jgr_> You'd need a fair bit of context to interpret anything useful from framerate numbers
11:26:12 <andythenorth> it's not in openttd src
11:27:29 <andythenorth> oh it's already been fixed in checkout
11:31:27 <andythenorth> src looks correct
11:33:17 <locosage> _jgr_: even without context it can show how many players have performance issues
11:33:43 <locosage> and in correlation with smth like total vehicle number it can somewhat explain why
11:38:08 <_glx_> andythenorth: API doc generation autoreplaces `Script` with `AI` or `GS`
11:38:36 <andythenorth> shall I just point the empty wiki page to the one with content?
11:38:36 <_glx_> So classnames are correct
11:40:42 <andythenorth> fixed in the wiki
13:09:08 *** telk5093 has joined #openttd
13:10:25 <telk5093> nvm, it seems that domain has changed
13:25:05 <andythenorth> "Constant too long" ๐ฎ `VulcanIndustryCargoStatsManager.StoreCargoAmount(industry, 'accepted', cargo, cargo_amount);`
13:25:18 <andythenorth> limited number of params for squirrel?
13:26:43 <andythenorth> or class name is too long?
14:19:09 <truebrain> telk5093: Yeah, I had to change the URL as cloudflare only offers free SSL for subdomains, not subsubdomains ๐ฆ sorry about that
14:29:09 *** _aD has quit IRC (Quit: leaving)
14:40:11 <andythenorth> is there any way to step in GS log breakpoints?
14:40:30 <andythenorth> the information I want is logged in the steps following the breakpoint search string
14:40:42 <andythenorth> but not in a way that makes a useful search string for breaking on
16:55:41 *** Wormnest has joined #openttd
17:05:19 <andythenorth> crashed OpenTTD, but it's not crashing ๐
17:05:36 <andythenorth> 100% CPU use on that core
17:06:35 <andythenorth> seems to be related to the story book ๐
17:09:12 <andythenorth> yeah, repeatable
17:09:47 <peter1139> You should just sit on it, then repeatedly claim there's a known issue but nobody's interested in fixing it.
17:10:24 <andythenorth> wasn't that what I was supposed to stop doing?
17:11:41 <_glx_> infinite loop somewhere ?
17:12:27 <_glx_> but you should know the process ๐
17:12:27 <andythenorth> well I did write a deliberate recursion
17:12:36 <andythenorth> recursion with no max-depth
17:13:18 <_glx_> infinite recursion on GS should not be an issue because limited opcodes
17:14:03 <_glx_> oh unless this stuff is not in the opcode checks
17:15:30 <_glx_> anyway you know where to put bug reports ๐
17:15:39 <andythenorth> not sure if it's not just me
17:23:16 *** gelignite has joined #openttd
17:29:05 <andythenorth> cause is probably going to be funny
17:30:36 <andythenorth> unrelated: there might already be a way to pretty-print things, but Squirrel's .tostring() is generally very not usefull
17:30:55 <truebrain> "Spin", such a MacOS thing to say
17:31:08 <andythenorth> I think there's even a spindump util
17:31:33 <truebrain> Nobody is going to understand it except 0.1% of the people ๐
17:31:40 <andythenorth> what's the more common term?
17:32:23 <truebrain> I read the title, and was like: does it rotate the game?! ๐
17:32:23 <_jgr_> "Spin" usually implies that somethign useful is also happening ๐
17:32:45 <truebrain> Silly Mac users ๐
17:32:52 <andythenorth> I'm now googling 'spin vs. hang' but google is spinning
17:32:55 <truebrain> Just pulling your leg, to be clear
17:33:15 <andythenorth> well yes, but I thought the same when I typed it ๐
17:35:20 <andythenorth> anyway, we've got a nice big complicated GS now, for when we want to replace Squirrel
17:35:23 <_glx_> extracted the zip and building the right version
17:35:37 <andythenorth> we should merge 11141 ๐
17:35:43 <andythenorth> it's unlikely to be causing the hang
17:36:17 <_glx_> yeah, but your script is using the additions in it
17:36:47 <andythenorth> that's why we should merge it ๐
17:44:06 <_jgr_> 11141 doesn't bump the savegame version
17:44:46 <_glx_> I guess andythenorth has more than #11141 applied
17:45:10 <andythenorth> I wonder whether I rebased it to something else
17:45:10 <andythenorth> that would be weird
17:45:38 <_jgr_> The save loads fine for me
17:45:45 <_jgr_> It's just the script which doesn't work
17:45:50 <andythenorth> wonder if there are cmake cached files though
17:46:18 <andythenorth> usually I re-run cmake before compiling
17:46:28 <_glx_> retrying after rebasing the pr
17:46:51 <_glx_> and again 550 files to compile
17:50:28 * andythenorth considers making an industry inspector tool in story book
17:50:34 <andythenorth> there's a 'choose tile' cursor thing
17:51:19 <_jgr_> Inspecting industries is useful even when you aren't doing anything with scripts
17:51:43 <_glx_> would be better to have a button in the industry window
17:53:23 <_jgr_> Industries already have a debug window
17:54:16 <_jgr_> It only includes a not particularly useful subset of the available info though
17:55:21 <_glx_> rebased pr can load the save
18:00:51 <_jgr_> Adding stuff to the debug window is something that I've been tinkering with for a while now
18:02:34 <_glx_> drawaing the story book is super slow
18:05:49 <andythenorth> currently it's going in the story book
18:06:05 <andythenorth> oh slow discord post ๐
18:07:15 <andythenorth> it would be nice to be able to navigate GS tables
18:07:24 <andythenorth> or, if that's too wild
18:07:37 <andythenorth> designate a specific table for persistent storage and navigate that
18:09:24 *** _aD has quit IRC (Ping timeout: 480 seconds)
18:14:15 <andythenorth> _jgr_: how appropriate for PRs is it? ๐
18:17:53 <_jgr_> andythenorth: It's a question of what subset/features would be actually wanted
18:18:12 <andythenorth> debugging: you don't know what you want, until you want it ๐
18:18:34 <_jgr_> I am very keen on debug windows and console commands, but vanialla on the whole is not
18:18:46 <andythenorth> this is a cyclical thing
18:18:52 <andythenorth> there was a period of adding debug info
18:19:09 <andythenorth> but it pre-dated formal reviews
18:19:15 <andythenorth> it was back in the days when devs could just commit
18:20:23 <_jgr_> The storybook thing seems to be pathological performance issues in string formatting, I will post when I've got some clearer info
18:22:05 <truebrain> andythenorth: That is simply not true; don't invent an alternative history please ๐
18:23:11 <andythenorth> have I been mistaken
18:24:10 <truebrain> Pretty sure it is much simpler: nobody created it. For similar reasons vanilla didn't have any hard-to-trace desync or crash in a while
18:25:23 <truebrain> And specific for debugging, I think nobody wants to battle the GUI .. I respect _jgr_ he looked past that ๐
18:29:13 <_jgr_> It's not so difficult when it's just text ๐
18:30:02 <truebrain> I get annoyed by the size of it, want to make it pretty and 3 days later just abandon the branch ๐
18:30:30 <truebrain> Honestly, mainly it is the constant recompiling and restarting that annoys me ...
18:31:28 <truebrain> So I just debug with printf statements because of it. Your approach is more useful ๐
18:35:29 <andythenorth> it's the loading of saves that's killing me ๐
18:35:44 <andythenorth> caching last loaded game, and a console command to reload it ;P
18:36:05 <andythenorth> if I name my save 'a'sav' I can use `load a` I think
18:37:24 <andythenorth> there's 'load index' but I don't understand that ๐
18:37:49 <truebrain> Doesn't 'reload' exist?
18:38:18 <andythenorth> did you add that using a time machine?
18:38:29 <andythenorth> that's excellent
18:38:40 <truebrain> That has existed for ... so many years ๐
18:39:15 <andythenorth> if you *do* have a time machine can you go back 12 months and tell me in 2022?
18:39:21 <andythenorth> it will save lots of GS dev time
18:39:23 <truebrain> Always bothered me that we named it 'restart' and 'reload' .. such close names with slightly different interaction
18:39:37 <andythenorth> I'm surprised I never found it by accident
18:39:43 <truebrain> andythenorth: Will do. Did it still happen like you wrote in 2022?
18:39:43 <andythenorth> I use reload_newgrfs a lot
18:39:55 <truebrain> Means I never invented a timemachine, sorry
18:40:09 <andythenorth> or you did, but then you had to time travel to uninvent it
18:40:14 <andythenorth> both are equally true
18:40:26 <truebrain> This hurts my brain
18:41:13 <andythenorth> neither are equally true
18:41:26 <andythenorth> so now my GS is nearly working
18:41:36 <andythenorth> can we throw out Squirrel? ๐
18:41:45 <andythenorth> I've put like a year of dev in
19:07:26 <peter1139> Alright, how do I get docker to use br0 instead of creating its own set of bridges and stupid NAT setup...
19:13:28 <andythenorth> can you plug an ethernet cable into it?
19:13:36 * andythenorth lives in an imaginary world
19:16:16 <_glx_> so for me #11226 takes a lot of time in `UniscribeParagraphLayout` stuff
19:17:22 <andythenorth> we don't have many places where large amounts of text are present
19:17:30 <_glx_> oh yeah more that hundred 2900+ lines
19:18:03 <_glx_> stop abusing the system
19:18:06 <andythenorth> I wonder if anything else can trigger this, like very long readme.txt
19:18:58 <andythenorth> might not use string handling the same way?
19:19:22 <_glx_> a readme rarely have lines that long
19:19:33 <andythenorth> I should video the effect on fps, when it _doesn't hang_ ๐
19:19:49 *** gelignite has quit IRC (Quit: Stay safe!)
19:21:43 <andythenorth> my cable connection is down, I'm on my phone ๐
19:25:22 <peter1139> So is it a hang or just very slow..
19:26:20 <peter1139> And should I acquire a beer?
19:26:26 <_glx_> very slow (at least in my testings)
19:26:45 <_glx_> and using a debug build inside MSVC
19:29:04 <_glx_> hmm wondering if story page could be drawing non visible strings (or at least running the layouter to check they are visible)
19:29:41 <truebrain> peter1139: yes on the beer
19:30:11 <_jgr_> Some of the string calls are via GetStringHeight from GetPageElementHeight
19:30:15 <peter1139> Yes, it probably lays out everything so that it knows how much scrolling is necessary, and what y-position to draw.
19:30:32 <truebrain> the window was never intended to contain so much text ๐
19:30:37 <_glx_> layouting 2900+ chars string is hard ๐
19:30:46 <truebrain> one could argue whether it is a bug at all, or just "don't do that" ๐
19:31:11 <truebrain> (does the window have a scrollbar at all? ๐ )
19:31:44 <_glx_> it has, but the handle is very very small here
19:32:44 <truebrain> I somewhat doubt the actual content is useful in this state ๐
19:33:42 <_glx_> we could detect when a script tries to pass a stupidly long string
19:33:57 <truebrain> an "anti-andy" mechanism ๐
19:35:40 <truebrain> a proper solution would be to prerender windows and their virtual content in separate buffers, and render those ๐ But we have been down this road before ๐
19:36:45 <_glx_> in the screenshot attached to the report, the first string doesn't even fit
19:37:08 <_glx_> (all the white text is part of the same string)
19:37:30 <andythenorth> I read 'beef' not 'beer'
19:37:45 <truebrain> it really is abuse, what is being displayed here ๐
19:38:04 <andythenorth> imagine a 16k map
19:38:49 <_glx_> of course it is, abusing story book instead of properly requesting improvement of industry debug window
19:39:01 <truebrain> well, that the story book is used for debugging, sure
19:39:04 <andythenorth> hmm, imagine if we could console gs_dumps [path to slot]
19:39:08 <andythenorth> and get that in a file
19:39:09 <truebrain> but the amount of text is just not something we can handle ๐
19:39:33 <truebrain> I also truly doubt it is actually useful to the operator, to have that much text available in that window ๐
19:39:34 <andythenorth> I'm in no way hoping to keep this
19:39:50 <andythenorth> it's just a way to eyeball whether I fucked up the storage or not
19:40:01 <_glx_> splitting into more strings could help
19:40:15 <truebrain> andythenorth: so make smaller strings, and it will be fine ๐
19:40:16 <andythenorth> for the very specifc case I have, I only need one slot value
19:40:25 <andythenorth> either the migration worked, or I broke it
19:40:52 <andythenorth> `dump gs_table [identifier]`
19:41:21 <truebrain> and although we could ofc improve the performance of the game and render this slightly better, it won't be long till our dear andy shoves in more data, and the same problem happens again ๐ ๐ Sorry, I understand the reason etc, but I really doubt this is really a bug ๐
19:41:32 <truebrain> bit similar to saying a game with 60k RVs is slow ๐
19:41:32 <andythenorth> I can always log this alternately
19:42:16 <andythenorth> do we want 'max strings' on story book?
19:42:55 <peter1139> What does this do in multiplayer?
19:43:09 <_glx_> it's not the number of strings (I think you have something like 106 strings), but their length
19:43:10 <truebrain> andythenorth: a common-sense imposed one, sounds reasonable ๐
19:44:04 <truebrain> so 300k of string-data in that window
19:44:08 <_glx_> I could see the ram usage growing
19:44:08 <truebrain> feels excessive ๐
19:44:25 <peter1139> Somewhere there should be a limit to string length, maybe it was limited before the switch to std::string :)
19:44:39 <truebrain> hahaha, that might very well be true ๐
19:45:00 <peter1139> I completed level 1 or Xor, but level 2 is suddenly evil. Hard because it's evil :/
19:45:10 <_glx_> the limit was around 2048 (buffer size)
19:45:35 <peter1139> So less, but only ~50% less.
19:46:00 <_glx_> and I think nobody ever managed to reach it before
19:46:08 <truebrain> 2048 for the full story-book?
19:46:08 <peter1139> Or is that 30% less, relative percentages confuse me :D
19:46:27 <andythenorth> it's nearly 50% less
19:46:31 <truebrain> our buffer-sizes were insane ๐
19:47:06 <_glx_> yeah and the buffer was a global variable ๐
19:47:34 <truebrain> anyway, close ticket with "please just don't do this" works for me; but setting some line limit also sounds sane .. 2048 sounds a bit much ๐
19:49:51 <_glx_> 1000 would be more or less a 10 lines string in this window with default width
19:50:33 <truebrain> was more thinking about 256 or something ๐
19:50:45 <truebrain> but more the question: is 300k chars the problem, or 3000 chars per line the problem?
19:50:51 <truebrain> as I can see both being a real issue here ๐
20:01:34 <andythenorth> oof now trying to write squirrel in python
20:04:57 <_glx_> ah VS 17.7.2 fixes "Users who opened a folder containing a CMake project may have experienced an indefinite hang in Visual Studio. The race condition causing this hang has been identified and fixed."
20:14:43 <peter1139> If the huge story book runs fine on a server but "kills" clients, it's worth sorting.
20:15:59 <peter1139> I have a beer but I got it from the Co-op as I don't really fancy going out to a pub alone. Oh well.
20:19:17 <truebrain> pretty sure servers running such GSes won't have many client sfor long ๐
20:20:03 <_jgr_> The problem is only when you have the window open and in view
20:20:32 <_jgr_> Just closing it is a simple enough fix at the user end
20:47:39 <andythenorth> truebrain: I accept your challenge ๐
20:47:55 <andythenorth> can I run a server on my MBP?
20:48:21 <truebrain> no, it would crash our website
20:58:12 <andythenorth> rebuild it as a single web app
21:05:08 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:10:17 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:01:42 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:12:35 <Eddi|zuHause> for some people it's an MBP, for other people it's the largest DDoS ever.
22:44:30 *** _aD has quit IRC (Quit: leaving)
continue to next day โต