IRC logs for #openttd on OFTC at 2020-06-02
            
00:00:13 <andythenorth> is there any reason town layout couldn't be newgrfed?
00:00:47 <andythenorth> cb when wanting to build a road, with a tile location for an existing road piece
00:00:58 <andythenorth> newgrf returns direction to grow in, or none
00:03:13 <_dp_> also... judging by symptoms of 1.10.1 desyncs I'm certain 1.10.2 will be desyncing as well, just not sure if it's subsidies or smth else
00:04:22 <_dp_> these rare desyncs are a royal pita to debug
00:05:30 *** sla_ro|master2 has quit IRC
00:05:55 <orudge> So in the past year, around 10,000 people have downloaded OpenTTD via the Windows Store; apparently around 80-125 users have played OpenTTD from the Store on average each day for the past month (presumably that depends on them having some kind of MS telemetry enabled anyway). "Average engagement minutes" is about 47 minutes.
00:08:06 *** Progman has quit IRC
00:08:29 *** keoz has quit IRC
00:11:10 *** andythenorth has quit IRC
00:12:14 <_dp_> I bet 99/100 played for 5 minutes and 1 for 50 hours xD
00:57:19 <Gadg8eer> Anyone online with m4nfo experience?
01:05:41 <FLHerne> Unlikely
01:06:55 <FLHerne> What are you trying to code?
01:18:13 <Gadg8eer> Bridges.
01:19:58 <FLHerne> Oh, right, NML doesn't do those yet :-/
01:20:15 <FLHerne> Yexo might be worth asking, if he's still here
01:39:57 *** gelignite has quit IRC
01:50:48 *** Wrench_In_The_Plan has quit IRC
01:55:25 <Speeder_> can GS spawn disasters?
01:55:34 <Speeder_> also can GS destroy player-owned vehicles?
01:55:59 <_dp_> no and no
03:07:12 *** Flygon has joined #openttd
03:07:22 *** Wrench_In_The_Plan has joined #openttd
03:07:58 *** Wormnest has quit IRC
03:08:23 *** spnda has quit IRC
03:15:06 *** Wormnest has joined #openttd
03:19:52 *** Wrench_In_The_Plan has quit IRC
03:37:05 <Gadg8eer> When is Yexo usually online?
03:39:14 *** adikt has quit IRC
03:43:36 *** adikt has joined #openttd
03:51:17 <Eddi|zuHause> Gadg8eer: not at 4AM, apparently.
04:21:16 <Gadg8eer> It's 5AM there? Sorry, I'm in the Pacific time zone.
04:23:17 *** blathijs has quit IRC
04:30:17 *** blathijs has joined #openttd
04:31:44 *** adikt has left #openttd
04:31:56 *** adikt has joined #openttd
04:38:13 *** Gadg8eer has quit IRC
04:41:57 *** blathijs has quit IRC
04:43:23 *** Wormnest has quit IRC
04:43:51 *** D-HUND has joined #openttd
04:47:15 *** debdog has quit IRC
04:49:49 *** Wormnest has joined #openttd
04:50:18 *** blathijs has joined #openttd
05:20:19 *** glx has quit IRC
05:26:09 <Speeder_> reinforcing the "STUF" jokes, I found out a lot of companies make random "unrelated" products...
05:26:17 <Speeder_> volkswagen for example also make... sausages.
05:27:18 <Speeder_> michelin, make car tyres and... the guide (well, that was intended to make people use the tyres to buy new one... restaurant owners in cities that has no cars even get mad, say it is "prejudice"). and I just learned Peugeot is best manufacturer of pepper mills O.o
05:27:25 <Speeder_> in fact they invented pepper mills
05:47:05 *** mindlesstux6662 has quit IRC
05:47:57 *** mindlesstux6662 has joined #openttd
06:02:57 <Eddi|zuHause> Speeder_: there was a thing in east german state-run-economy which focused on making big heavy industry cooperations, like steel works and stuff, and then they noticed they need some consumer products, so they picked a random product, and the steel plant now also had to make leather jackets.
06:03:38 <Speeder_> O.o
06:04:02 <Eddi|zuHause> there were lots of things like this
06:29:49 *** Gadg8eer has joined #openttd
06:31:26 <Gadg8eer> Lost internet for a couple hours. Anyone say anything important?
06:34:32 *** keoz has joined #openttd
06:45:22 *** mindlesstux6662 has quit IRC
06:46:05 *** mindlesstux6662 has joined #openttd
06:46:08 *** gnu_jj_ has quit IRC
07:06:12 <Eddi|zuHause> there's a log, you know.
07:06:15 <Eddi|zuHause> @logs
07:06:15 <DorpsGek> Eddi|zuHause: https://webster.openttdcoop.org/index.php?channel=openttd
07:12:46 *** gnu_jj has joined #openttd
07:21:58 <Gadg8eer> @logs
07:21:58 <DorpsGek> Gadg8eer: https://webster.openttdcoop.org/index.php?channel=openttd
07:31:43 *** Gustavo6046 has quit IRC
07:46:58 <DorpsGek_III> [OpenTTD/website] LordAro merged pull request #159: Add: Download description for Ubuntu 20.04 https://git.io/JfWMK
07:47:33 <LordAro> need review on website#160
07:49:12 *** andythenorth has joined #openttd
07:52:33 <DorpsGek_III> [OpenTTD/website] Eddi-z approved pull request #160: Add: 1.10.2 release announcement https://git.io/JfiVF
07:52:46 <LordAro> alas not
07:53:50 <Eddi|zuHause> pass the time with some music: https://www.youtube.com/watch?v=w2183RAw968
07:58:23 <Eddi|zuHause> (this song was used as the title song in the german version of https://en.wikipedia.org/wiki/Once_Upon_a_Time..._Man )
08:02:08 <LordAro> very nice
08:02:25 *** sla_ro|master has joined #openttd
08:09:36 <Eddi|zuHause> it's also very philosophical, and frighteningly current, despite being almost 50 years old
08:09:49 <Eddi|zuHause> ... how can a song about time be... timeless? :p
08:21:01 *** sla_ro|master has quit IRC
08:22:31 *** sla_ro|master has joined #openttd
08:45:39 <Yexo> _dp_: I made a judgement call on what I figured the state of those issues was. I might very well be wrong and there might be desyncs hidden in there. Either way, at this point having 1.10.2 out with several bugfixes is a good thing. Perfect is the enemy of good and all
09:00:13 *** Gadg8eer has quit IRC
09:05:15 <andythenorth> yo
09:20:50 <LordAro> andythenorth: giv website#160 approval
09:22:14 <DorpsGek_III> [OpenTTD/website] andythenorth approved pull request #160: Add: 1.10.2 release announcement https://git.io/Jfioa
09:22:23 <andythenorth> you gonna merge?
09:22:39 <DorpsGek_III> [OpenTTD/website] LordAro merged pull request #160: Add: 1.10.2 release announcement https://git.io/Jfin2
09:23:20 <andythenorth> :)
09:23:20 <DorpsGek_III> [OpenTTD/website] LordAro created new tag: 1.3.9 https://git.io/Jfioo
09:41:36 *** Wolf01 has joined #openttd
09:49:21 *** cHawk- has quit IRC
09:51:35 *** iSoSyS has joined #openttd
10:35:49 *** cHawk has joined #openttd
10:45:02 *** iSoSyS has quit IRC
11:04:54 *** WormnestAndroid has quit IRC
11:05:07 *** WormnestAndroid has joined #openttd
11:06:09 *** WormnestAndroid has joined #openttd
11:15:19 *** gelignite has joined #openttd
11:15:23 *** cHawk has quit IRC
11:16:10 *** Smedles has quit IRC
11:17:09 *** Smedles has joined #openttd
11:18:29 *** cHawk has joined #openttd
11:23:07 *** Smedles has quit IRC
11:24:21 *** Smedles has joined #openttd
11:39:32 *** Samu has joined #openttd
11:44:03 <Samu> @topic
11:44:03 <DorpsGek> Samu: 1.10.1 | Website: *.openttd.org (source: github, translator: translator, server list: servers, wiki: wiki) | Don't ask to ask, just ask | 'Latest' is not a valid version, 'Most recent' neither | English only
11:46:06 <LordAro> @topic set 1 1.10.2
11:46:06 *** DorpsGek changes topic to "1.10.2 | Website: *.openttd.org (source: github, translator: translator, server list: servers, wiki: wiki) | Don't ask to ask, just ask | 'Latest' is not a valid version, 'Most recent' neither | English only"
12:07:06 *** duckfullstop has quit IRC
12:07:46 *** luaduck has joined #openttd
12:12:40 *** Smedles has quit IRC
12:13:59 *** Smedles has joined #openttd
13:37:37 *** Gustavo6046 has joined #openttd
14:02:56 *** murr4y has quit IRC
14:13:18 *** heffer_ has joined #openttd
14:16:14 *** heffer has quit IRC
14:21:15 <andythenorth> hmmm
14:22:10 <DorpsGek_III> [OpenTTD/OpenTTD] James103 closed issue #7665: Possible infrastructure count overflow leading to negative infrastructure maintenance costs https://git.io/fjMSK
14:22:10 <DorpsGek_III> [OpenTTD/OpenTTD] James103 commented on issue #7665: Possible infrastructure count overflow leading to negative infrastructure maintenance costs https://git.io/fjMSK
14:25:30 <DorpsGek_III> [OpenTTD/OpenTTD] James103 commented on issue #7660: Crashlog window does not show that crash.png was created, even though it is. https://git.io/fj1xT
14:26:30 <DorpsGek_III> [OpenTTD/OpenTTD] LordAro commented on issue #7660: Crashlog window does not show that crash.png was created, even though it is. https://git.io/fj1xT
14:27:19 <andythenorth> I can probably re-implement var 41 in newgrf, using var 40 and var 61, and fake recursion
14:28:28 <andythenorth> just walk forward along the consist, and yield a result (count) if ID doesn't match, otherwise check next vehicle
14:29:03 <andythenorth> done as a procedure, it's probably quite tidy
14:29:09 <andythenorth> is this even evil?
14:31:06 <DorpsGek_III> [OpenTTD/OpenTTD] James103 commented on issue #7660: Crashlog window does not show that crash.png was created, even though it is. https://git.io/fj1xT
14:31:06 <DorpsGek_III> [OpenTTD/OpenTTD] James103 closed issue #7660: Crashlog window does not show that crash.png was created, even though it is. https://git.io/fj1xT
14:37:49 <DorpsGek_III> [OpenTTD/website] James103 commented on issue #117: There's a couple of layouting/responsiveness issues in the OpenTTD website. https://git.io/Jed55
14:39:42 <andythenorth> hmm but var 61 isn't cached
14:39:45 <andythenorth> and comes with warnings
14:45:16 <DorpsGek_III> [OpenTTD/OpenTTD] James103 commented on issue #7972: Impossible/invalid orders aren't marked as such in the order list https://git.io/JvGub
14:52:52 <DorpsGek_III> [OpenTTD/website] LordAro commented on issue #117: There's a couple of layouting/responsiveness issues in the OpenTTD website. https://git.io/Jed55
14:57:13 <DorpsGek_III> [OpenTTD/website] James103 opened pull request #161: Fix: paddings in website footer https://git.io/Jfi7z
15:06:45 *** murr4y has joined #openttd
15:33:28 *** nielsm has joined #openttd
15:38:12 *** glx has joined #openttd
15:38:12 *** ChanServ sets mode: +v glx
15:49:29 *** virtualrandomnumber has joined #openttd
15:50:53 <DorpsGek_III> [OpenTTD/nml] glx22 opened pull request #155: Add: Support for parameters in switches https://git.io/Jfidi
16:01:54 <FLHerne> glx: "imbricated" is my new word for the day :D
16:02:28 <glx> I didn't check dictionnary :)
16:03:02 <FLHerne> Well, it does seem to be a word, but I'd never heard of it
16:03:17 <FLHerne> And I thought I knew ALL the words! :p
16:03:44 <andythenorth> maximum consist length is 127?
16:05:23 * andythenorth trying to work out how many var 61 checks might get run
16:05:53 <andythenorth> if each vehicle in the consist checks var 61 on all preceding vehicles
16:06:10 <DorpsGek_III> [OpenTTD/nml] glx22 updated pull request #78: Add: optimise switches https://git.io/Jed1S
16:06:13 <andythenorth> is that length factorial?
16:06:41 <andythenorth> this would run every time graphics chain is resolved
16:07:56 <glx> oups I forgot to check regression
16:08:20 <LordAro> andythenorth: n + n-1 + n-2 + ...
16:08:22 <LordAro> surely?
16:08:33 <LordAro> which is... i should know this
16:08:37 <LordAro> n^2 ?
16:08:46 <glx> how nice I failed the rebase it seems
16:09:43 <andythenorth> LordAro it's definitely a GCSE maths thing :P
16:09:50 <andythenorth> but I can't remember which one
16:10:03 <andythenorth> it's not nCr
16:11:41 <LordAro> n(n+1)/2
16:11:47 <LordAro> https://www.wolframalpha.com/input/?i=sum+k%2C+k%3D1+to+n
16:11:50 <LordAro> :>
16:12:09 <glx> not the worse IIRC
16:12:26 <LordAro> O(n^2)
16:12:36 <LordAro> so i wasn't entirely wrong
16:12:40 <andythenorth> it's slightly different but yes, thanks :)
16:12:47 <andythenorth> first vehicle doesn't check preceeding
16:12:58 <andythenorth> so 1 vehicle is 0 checks
16:13:13 <LordAro> so 0 to n-1 ?
16:13:35 <andythenorth> yup
16:13:49 <andythenorth> it will follow the same rough curve
16:14:08 <andythenorth> I have no idea how much impact var 61 check has
16:14:14 <andythenorth> or how often graphics are resolved
16:16:48 <DorpsGek_III> [OpenTTD/nml] glx22 updated pull request #78: Add: optimise switches https://git.io/Jed1S
16:19:05 <andythenorth> hmm
16:19:08 <andythenorth> I only want the ID
16:20:34 <Eddi|zuHause> <andythenorth> or how often graphics are resolved <-- last time i checked, it was effectively once per movement tick
16:20:54 <andythenorth> hmm
16:20:56 <andythenorth> I am torn
16:21:08 <andythenorth> I want to do a silly party trick with railcar graphics
16:21:27 <andythenorth> I'd like to do it without requiring any extension of newgrf vars, for bonus points
16:21:35 <andythenorth> I'm not sure it's wise though
16:21:49 <Eddi|zuHause> i'm also not sure if it's even skipped if the vehicle is not visible currently
16:23:22 <andythenorth> given that consist length is known, I can use a procedure to yield the number of vehicles matching a list of IDs, consecutive to current vehicle, towards the lead engine
16:24:04 <andythenorth> the code is easy to to generate for that
16:25:59 <andythenorth> eh maybe I just do it
16:26:06 <andythenorth> if it's silly, I can delete it
16:26:21 <andythenorth> if it's slow, someone will come along and make it not slow
16:26:22 <supermop_Home> probably best approach
16:26:33 <supermop_Home> good morning
16:26:35 <andythenorth> yo
16:26:41 <Eddi|zuHause> you could, maybe, actually do some testing instead of speculating on performance impact?
16:26:50 <andythenorth> yes
16:27:29 <andythenorth> I probably won't, because reasons
16:31:00 <supermop_Home> ugh i need to get more coffee
16:31:24 <supermop_Home> technically ive been working for 2 hours but basically nothing done
16:32:23 <DorpsGek_III> [OpenTTD/website] auge8472 requested changes for pull request #161: Fix: paddings in website footer https://git.io/Jfibw
16:34:22 <andythenorth> hmm I think I have to leave
16:34:24 *** andythenorth has left #openttd
16:39:04 <DorpsGek_III> [OpenTTD/website] James103 updated pull request #161: Fix: paddings in website footer https://git.io/Jfi7z
16:45:17 *** Progman has joined #openttd
17:25:03 *** gelignite has quit IRC
17:39:23 <supermop_Home> well now I've wasted another hour walking around the neighborhood
17:42:55 <DorpsGek_III> [OpenTTD/website] LordAro approved pull request #161: Fix: paddings in website footer https://git.io/Jfipf
17:48:12 <DorpsGek_III> [OpenTTD/website] James103 commented on pull request #161: Fix: paddings in website footer https://git.io/JfipO
17:49:04 <DorpsGek_III> [OpenTTD/website] LordAro commented on pull request #161: Fix: paddings in website footer https://git.io/Jfipn
18:02:56 <Wolf01> <supermop_Home> technically ive been working for 2 hours but basically nothing done <- I do that too, then I disconnect my brain and robot-work for the rest of time, coffee doesn't help at all
18:04:10 *** cHawk has quit IRC
18:12:54 *** andythenorth has joined #openttd
18:22:36 *** matt21347 has joined #openttd
18:33:35 *** virtualrandomnumber has quit IRC
18:54:08 *** Flygon has quit IRC
18:54:28 <andythenorth> it's nice that James has done a PR
19:03:23 *** Wormnest has quit IRC
19:05:16 <LordAro> andythenorth: after i prodded him to do so :p
19:05:25 <LordAro> used the web interface too
19:06:21 *** iSoSyS has joined #openttd
19:06:28 <andythenorth> "submit PR" > "submit issue"
19:06:38 <andythenorth> solution, not problem
19:07:36 *** virtualrandomnumber has joined #openttd
19:07:57 *** Tirili has joined #openttd
19:08:17 <LordAro> true
19:40:57 <milek7> bank send some documents through email, encrypted .zip
19:41:03 <milek7> send password through sms
19:41:12 <milek7> 8 digits
19:41:16 <milek7> lol, placebo security
19:42:35 <andythenorth> so re-implementing var 41 is about 256 switches
19:42:39 <andythenorth> probably fine?
19:45:56 *** cHawk has joined #openttd
19:56:17 <andythenorth> oh this will be lolz
19:56:55 <andythenorth> I use var 41 in 2 different ways
19:57:21 <andythenorth> and that means more like 768 switches in total
19:59:32 *** keoz has quit IRC
20:06:27 <FLHerne> andythenorth: This seems like the wrong approach
20:06:52 <andythenorth> we'll know when I've finished
20:12:39 <andythenorth> hmm currently it's broken :D
20:12:40 <andythenorth> oof
20:24:10 *** frosch123 has joined #openttd
20:25:13 <andythenorth> oof
20:25:20 <andythenorth> this is a lot more than 768 switches I think
20:25:30 <andythenorth> there must be a simplification I can devise :)
20:30:59 <andythenorth> hmm
20:31:12 <andythenorth> what happens if I try and use var 61 beyond the length of the consist?
20:32:58 <andythenorth> nothing bad *appears* to be happening
20:33:12 *** gelignite has joined #openttd
20:35:45 <frosch123> apparently it is zero, no error
20:36:24 <Eddi|zuHause> it's probably undefined behaviour
20:36:36 <andythenorth> I am working on something like var 41, but implemented in newgrf, using procedures and var 61 to check an ID
20:37:03 <andythenorth> it's probably not hard, just verbose
20:39:25 *** keoz has joined #openttd
20:39:28 <andythenorth> it's a lot simpler if I just assume I can walk backwards or forwards for 127 vehicles
20:39:41 <andythenorth> if I have to check consist length, the number of switches grows horribly
20:40:05 <Eddi|zuHause> "/* This seems to be the only variable that makes sense to access via var 61, but is not handled by VehicleGetVariable */" <-- s/but/that/ ?
20:40:57 <frosch123> are you turning into ln ?
20:42:20 <Eddi|zuHause> "If the offset is outside the vehicle chain, the result value will be 0." <-- so specs say that is safe
20:42:36 <Eddi|zuHause> and openttd seems to properly check for that
20:42:48 <Eddi|zuHause> "if (u == nullptr) return 0; // available, but zero"
20:43:16 <andythenorth> super
20:43:22 <andythenorth> thanks
20:44:26 <andythenorth> ha ha
20:44:34 <andythenorth> nml could include more pseduo vars
20:44:48 <andythenorth> not real vars, but procedures composing other vars
20:45:24 <Eddi|zuHause> that's called functions of second order. functions that take functions as parameters
20:45:45 <andythenorth> frosch123 was your proposal about vars for the entire consist for nml, or for openttd? I assumed openttd so it could be cached
20:46:07 <Eddi|zuHause> it should be fairly impossible to cache such things
20:47:40 <frosch123> for openttd
20:47:46 <Eddi|zuHause> new 6x variable: takes as parameter an operation (and, or, +, max, ...) and on a special register an action 2 reference that is called like a procedure, for every vehicle in the chain (starting from PARENT/SELF)
20:47:59 *** Wormnest has joined #openttd
20:48:23 <frosch123> Eddi|zuHause: don't waste time with return values and declarative languages
20:48:36 <frosch123> the real question is, what to do with temporary registers
20:48:56 <frosch123> is stuff guaranteed to execute in order, and temporary register can collect data
20:49:09 <frosch123> or are calls isolated, and can be parallelized/whatever
20:49:26 <Eddi|zuHause> intuitively, i'd say defined order
20:49:43 <frosch123> that's the 1998 answer
20:50:16 <Eddi|zuHause> if you want to do parallelization, why start in such a remote place?
20:50:39 <Eddi|zuHause> what kind of scaling issue are you trying to solve there?
20:58:18 <frosch123> i just want to imprint "map-reduce technology inside" on the cover
20:59:14 <andythenorth> it works :D https://github.com/andythenorth/iron-horse/blob/a7cac80630e76bb52a71643c5dc1560d5e9baec3/src/templates/procedures_alternative_var_41.pynml
21:00:34 <andythenorth> now I just need to do the rest of it
21:01:06 <andythenorth> and make the checked ID a list
21:01:13 <andythenorth> which can be a parameter
21:01:17 <andythenorth> such lolz
21:05:50 <andythenorth> hmm, procedure won't work
21:05:57 <andythenorth> I'll have to do this switch chain per vehicle :o
21:05:58 <Eddi|zuHause> frosch123: for independent temp registers to work properly you must make the underlying mechanics object-oriented
21:06:03 <andythenorth> ouch
21:06:27 <Eddi|zuHause> frosch123: so the call to the procedure gets a nested "environment" variable
21:06:42 <andythenorth> hmm I could use a stacked set of ternary
21:06:52 <frosch123> Eddi|zuHause: funny. it is already oo, but oo is completely unnecessary for independency
21:06:52 <andythenorth> compare yielded ID to any in the list
21:07:02 <andythenorth> I can template a repeating ternary, the result is ugly, but eh
21:07:23 <Eddi|zuHause> frosch123: you'd get a nested stack of such "environments"
21:07:50 <frosch123> don't reinvent the wheel
21:08:43 <frosch123> also, should we tweet about 1.10.2
21:08:57 <andythenorth> didn't we automate tweeting yet? :o
21:08:59 <frosch123> or is 1.10.2 too old for tweeting?
21:09:16 <Eddi|zuHause> then on each procedure call you'd have the choice of passing the environment as a reference (making side effects possible) or as a deep copy (making side effects impossible)
21:09:52 <Eddi|zuHause> frosch123: twitter is currently occupied
21:10:05 <andythenorth> did we reddit?
21:10:15 <frosch123> reddit did itself
21:10:17 <frosch123> they run servers
21:10:28 <frosch123> that's why the other game servers hate reddit
21:10:37 <Eddi|zuHause> frosch123: if you tweet anything other than support for (or against) police brutality and racism, you get cancelled.
21:12:26 <frosch123> maybe they can swap territory with hongkong
21:12:47 <frosch123> us racists move to hongkong, hongkong people move to the us
21:14:02 <andythenorth> I did a tweet once
21:15:50 <frosch123> andythenorth: did you automate it?
21:17:32 <andythenorth> I originally signed up to twitter so I could automate the count of unread emails I ahve
21:17:37 <andythenorth> never got around to that :P
21:18:08 <andythenorth> my account is andyfacts, and the fact was going to be email count, 3 or 4 times daily
21:20:50 <Eddi|zuHause> that should be a one-liner in crontab
21:22:11 <andythenorth> I ruined the idea by telling my mail client to mark all mail 'read' as soon as it arrives
21:25:30 <frosch123> does that count as "automatically read"?
21:28:10 <Eddi|zuHause> how does that prevent you from reading the same mail twice?
21:28:31 <andythenorth> I don't read any of them
21:29:10 <andythenorth> 'correctness by design'?
21:29:49 <andythenorth> so position_in_vehid_chain is now replicated in var 61
21:30:13 <andythenorth> num_vehs_in_vehid_chain means I have to count both ways and then subtract one from the other
21:30:26 <Eddi|zuHause> i have a suggestion for automatisation: delete them, and send an autoreply "this message was received and automatically deleted. no action has been taken"
21:30:27 <andythenorth> hmm, sum and subtract
21:30:33 <andythenorth> Eddi|zuHause I used to have that
21:30:40 <andythenorth> with my phone number in it
21:30:50 <andythenorth> I got phoned maybe 1 in 4000 emails?
21:33:06 <andythenorth> hmm can I OR a bunch of expressions?
21:33:14 <glx> wouldn't it be easier to implement a nml builtin for var61 ?
21:33:33 <andythenorth> glx...one might think so :)
21:35:34 <andythenorth> https://www.youtube.com/watch?v=4cDO3PEh_Hg
21:35:44 <andythenorth> tehachapi loop
21:35:56 <andythenorth> eastbound passing westbound
21:36:50 *** adikt has quit IRC
21:41:37 <Eddi|zuHause> actually, can you pass var 7E to var 61?
21:42:21 <Eddi|zuHause> you probably can't set the right parameter
21:43:02 <frosch123> you can't pass 7e. you can set 60+x parameters
21:43:16 *** iSoSyS has quit IRC
21:44:59 <andythenorth> procedure call on another vehicle? :o
21:45:02 <andythenorth> that would be nuts :)
21:45:46 <glx> 7E is not a vehicle var
21:48:03 <Eddi|zuHause> i haven't seen any code specifically excluding 7E, but i think i see why it doesn't work, it gets processed in a different place
21:52:42 <glx> I'm trying to understand how some nml house variables work, like relative_x or relative_y
21:55:01 <andythenorth> hmm can I pass any params to a 7E call?
21:55:14 <andythenorth> or just through temp registers?
21:55:17 <frosch123> andythenorth: all the storetemp
21:55:30 <glx> or check my last PR :)
21:55:34 <andythenorth> the syntax of switch() looks tempting to stick params in :)
21:55:55 <andythenorth> https://github.com/OpenTTD/nml/pull/155 ho ho
21:55:57 <andythenorth> timing glx :)
21:56:32 <glx> needs testing I think
21:57:52 <andythenorth> might be able to help with that :P
21:58:03 <andythenorth> need to make sure my code actually works first though
21:58:10 <andythenorth> I am a slow coder, even for simple things :P
21:58:30 <glx> because basic testing seems correct, but maybe some corner cases are not handled properly
21:59:14 <andythenorth> hmm the inability to check against lists is going to kill me here :)
22:00:19 <andythenorth> I'll have to generate one procedure call for every length of list
22:02:17 <andythenorth> this is fun
22:02:44 <andythenorth> procedures have opened up a new meta game
22:03:03 *** arikover has joined #openttd
22:06:47 <Eddi|zuHause> how far away is that from supporting var61 properly?
22:07:25 <glx> but yes native var61 support would be better
22:08:36 <Eddi|zuHause> need handling of these cases: "normal_var", "normal_var(offset)", "6x_var(param)", "6x_var(param, offset)"
22:10:25 <Eddi|zuHause> none of which can be properly distinguished in syntax analysis, must all be in semantical analysis
22:10:33 <andythenorth> hmm, I can chain procedures
22:10:37 <andythenorth> this game is quite good
22:10:53 <glx> yes procedures are standard switches
22:11:07 <andythenorth> can I bubble params?
22:11:42 <Eddi|zuHause> what's a bubble param?
22:12:02 <andythenorth> passing a param to a procedure, which passes it to another procedure
22:12:10 * andythenorth would expect that to work
22:12:25 <Eddi|zuHause> yes, just pass it in temp register
22:12:48 <Eddi|zuHause> and don't touch the temp register in the intermediate function
22:13:16 *** adikt has joined #openttd
22:13:29 <frosch123> Eddi|zuHause: catch up with the PR
22:13:41 *** Yexo has quit IRC
22:14:23 <frosch123> also, i still advocate for using a scope-like syntax for var61
22:15:05 <frosch123> vehicle(3).random_bits
22:15:15 <andythenorth> Eddi|zuHause that's the obvious solution, I want to try this though https://github.com/OpenTTD/nml/pull/155
22:15:32 <glx> scope seems easier to manage internally
22:15:50 <andythenorth> frosch123 I fail to see why we need such sugar-coating :P
22:15:51 <andythenorth> [STORE_TEMP(${-1 * counter}, 0x10F), var[0x61, 0, 0x0000FFFF, 0xC6]]
22:15:52 <andythenorth> is fine
22:16:06 <andythenorth> oh that contains templating
22:16:32 <andythenorth> but 'vehicle(${counter}).id' would less lolz
22:16:33 <Eddi|zuHause> frosch123: can nmlc optimize away vehicle(0)?
22:16:51 <andythenorth> the current version makes it really easy to find var 61 in my code :)
22:17:01 <andythenorth> it's very obvious visually
22:17:25 <glx> andythenorth: but then you need to shift-mask the result
22:17:42 <Eddi|zuHause> andythenorth: i'm not sure that's the right optimisation criterium :p
22:17:44 <glx> with native nml it's done for you
22:17:52 <andythenorth> native nml would be fine :)
22:18:15 <frosch123> andythenorth: how do you use "location_check" in firs?
22:18:19 <andythenorth> horribly
22:18:50 <andythenorth> I think it runs a stack of checks and yields allow or disallow
22:19:10 <andythenorth> is it a FIRS question, or an nml question?
22:19:10 <frosch123> i mean, do you use any var[0x80] magic there?
22:19:35 <andythenorth> no 0x80 according to firs.nml
22:19:41 <frosch123> https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Industry_location_permissibility_.2828.29 <- location_check is the most unorthodox callback
22:19:56 <frosch123> it redefines variables to mean somethnig completely different
22:20:44 <andythenorth> so it does
22:25:20 <frosch123> you use water_distance
22:25:51 <andythenorth> I might use 8D too
22:26:02 <glx> nml doc says "Since the industry isn't built yet, industry variables aren't available"
22:26:11 *** virtualrandomnumber1 has joined #openttd
22:26:17 <andythenorth> I think the more complicated stuff is in FIRS tile checks
22:26:33 *** virtualrandomnumber1 has quit IRC
22:26:46 <glx> but maybe nml doesn't enforce "don't use variables in this callback"
22:27:04 <andythenorth> https://github.com/andythenorth/firs/blob/master/src/templates/location_check_macros_industry.pynml
22:27:30 <frosch123> ah. ottd is not spec conform
22:27:37 <frosch123> it implements vars 40+x anyway :p
22:27:40 <andythenorth> water_distance , industry_distance, industry_count
22:27:43 <glx> haha
22:27:50 <andythenorth> industry_town_count
22:28:10 <andythenorth> hmm what's 0x86
22:28:12 <andythenorth> layout num
22:28:52 <frosch123> ah, one usecase :)
22:29:21 <frosch123> though ottd also implements 44
22:29:33 <glx> so yes according to the nml doc, your location check should be invalid
22:29:40 <andythenorth> lol
22:29:54 <frosch123> anyway, i was asking. because an old idea suggested scopes for callback-specific variables
22:30:00 <frosch123> in particular for location_check
22:30:41 <andythenorth> example? :)
22:30:42 *** Gustavo6046 has quit IRC
22:30:50 *** virtualrandomnumber has quit IRC
22:30:58 *** Gustavo6046 has joined #openttd
22:31:12 <glx> the main issue is the switch is handled before knowing where it's used
22:31:33 <Eddi|zuHause> what about different meanings of extra_callback_info1/2?
22:31:58 <frosch123> Eddi|zuHause: same idea
22:32:46 <frosch123> "recolour_callback.random_bits" instead of "getbits(extra_callback_info, 8, 8)"
22:33:04 <frosch123> pretty sure Hirundo was still around when that idea existed :p
22:34:04 <frosch123> glx: checking whether switches only use valid variables is a second step
22:34:16 <andythenorth> next we'll have things like town.population and engine.id :P
22:34:27 <andythenorth> madness!
22:34:30 * andythenorth BIAB
22:35:32 *** nielsm has quit IRC
22:36:06 <Eddi|zuHause> that would suggest mixing PARENT/SELF scope is possible in formulas
22:36:45 <Eddi|zuHause> which might be tricky to hide internally
22:37:40 <Eddi|zuHause> you might have to split the switch into two, and use temp registers
22:37:55 <frosch123> no, it's actually quite easy
22:38:04 <glx> well main switch with self access, and a generated procedure call for parent scope to set temp registers
22:38:24 <glx> or just a chain
22:38:25 <frosch123> all operators are consecutive
22:38:37 <frosch123> so you create a new action whenever the scope switches
22:38:46 <frosch123> all va2 can use the same id
22:39:00 <frosch123> the last one has the switch..case
22:39:10 <frosch123> the others chain to a single id
22:39:41 <Eddi|zuHause> and read "result of previos action2" variable?
22:40:35 <frosch123> is hopefully not supported by nml
22:41:01 <frosch123> otherwise i think it is already broken by other stuff
22:42:59 <frosch123> last_computed_result <- we should delete that :)
22:43:58 <glx> yeah this var is not needed when writing nml code
22:46:26 *** Smedles has quit IRC
22:46:42 <frosch123> it's not used by any grf on devzone
22:47:15 <glx> but it may have a use with procedures, to access the full 32bit value
22:47:37 <frosch123> didn't you implement that in nml?
22:47:40 *** Smedles has joined #openttd
22:47:40 <Eddi|zuHause> yeah, i meant use it internally
22:49:01 <Eddi|zuHause> procedure calls should automatically use it...
22:50:26 *** frosch123 has quit IRC
22:52:02 <glx> I think I added it for some time but later removed
22:53:07 *** cHawk- has joined #openttd
22:56:50 <glx> ah probably because there was some interferences with action3.create_proc_call_varaction2()
22:59:12 *** cHawk has quit IRC
23:00:13 <Eddi|zuHause> if it doesn't use it automatically, it must be possible to use explicitly
23:02:20 <andythenorth> hmm do I use ID 0
23:02:45 <andythenorth> yup, nvm
23:03:10 * andythenorth was hoping to rely on uninitialised temp storage for something
23:04:13 <andythenorth> iterating lists when there is no concept of a list :)
23:04:57 <andythenorth> ideally I'd put a termination value in a temp storage, but I don't know of any safe value to use that doesn't collide with a possible vehicle ID
23:05:13 <andythenorth> I'll have to set a list length in another storage instead
23:06:28 <andythenorth> this is fun :)
23:06:39 <glx> iterating a list without recursion is crazy
23:07:07 <andythenorth> it just means generating a lot of switches :P
23:07:12 <andythenorth> what could be crazy about that :P
23:07:22 <andythenorth> I mean, potentially it's 65k switches :)
23:07:39 <andythenorth> but in my case, probably less
23:07:41 <FLHerne> andythenorth: I think your templating blinds you to just how nuts FIRS' nml is
23:07:50 <FLHerne> Or Horse now
23:07:55 <andythenorth> FLHerne I try not to read FIRS nml
23:08:04 <andythenorth> a lot of it was automated conversion originally from nfo
23:08:18 <andythenorth> then it was used to test nml industries
23:08:38 <andythenorth> nobody should ever write nml if they can avoid it
23:08:49 <Eddi|zuHause> andythenorth: solution is easy, your switches iterate the list down to 0, and define the largest item by calling the correct switch
23:09:04 <glx> I remember why I opened #78 after seeing an iron horse nml paste
23:09:31 <andythenorth> I might have got rid of that case, it looked like a legacy thing btw glx
23:09:34 * andythenorth looks
23:10:07 <Eddi|zuHause> so you have list_item_0 as first switch, list_item_1 which calls list_item_0, list_item_2 which calls list_item_1, etc.
23:10:26 <Eddi|zuHause> and then for a list of length 20 you call list_item_19 from the main switch
23:11:50 <andythenorth> glx yes I proceduralised it, and fixed the bug - one of the duplicate cases was incorrect
23:12:11 <andythenorth> Eddi|zuHause yes, but how do I terminate?
23:12:56 <andythenorth> oh I see
23:13:02 <andythenorth> yes
23:13:45 <andythenorth> I have to decide how many IDs can be checked here
23:13:57 <andythenorth> checking all 65536 possible IDs is unnecessary
23:14:20 <glx> what are you checking exactly ?
23:15:42 <andythenorth> I'm replicating nml var position_in_vehid_chain, but checking arbitrary list of IDs, not just self ID
23:16:09 <glx> seems crazy :)
23:16:13 <andythenorth> and similar for position_in_vehid_chain_from_end and num_vehs_in_vehid_chain
23:16:31 <andythenorth> we discussed doing it in OpenTTD, but it seems way too hard
23:16:40 <andythenorth> much easier in the grf
23:16:53 <andythenorth> unfortunately it won't be cached
23:17:08 <andythenorth> and it's called in the graphics chain, for every vehicle, against every other vehicle in the consist
23:17:45 <glx> and the final use is ?
23:17:50 <andythenorth> stupidity
23:18:21 <andythenorth> there are some railcars that change their sprites depending on position in consist
23:18:43 <andythenorth> and I want to do powered and unpowered versions and get the same graphical result
23:18:54 <andythenorth> it's in no way necessary
23:19:20 <andythenorth> but then again, all those grf feature requests that say "I REALLY NEED THIS FOR MY GRF, IT'S ESSENTIAL"
23:19:22 <andythenorth> are lolz
23:19:50 <andythenorth> I'm doing this to see if I can
23:20:08 <glx> so the consist could be composed of basically only 2 or 3 IDS and enforced with "can attach to"
23:20:37 <andythenorth> it could but that's not the current state
23:20:46 <andythenorth> it could be anything currently
23:20:54 <andythenorth> oh, I'm not checking for other grfs yet
23:21:02 <andythenorth> have to check the grfid of every vehicle first :D
23:21:16 <glx> and if IDs are chosen wisely you can do all checks knowing only the first ID
23:21:17 <andythenorth> ha if we had vehicle perm storage I could at least cache this :)
23:21:33 <andythenorth> IDs are arbitrary in this grf
23:21:43 <andythenorth> they used to have meaning, but that's not maintainable
23:21:46 *** matt21347 has quit IRC
23:22:08 <andythenorth> probably I could do all this with livery over-ride
23:22:12 <andythenorth> but I never tried that
23:22:16 <andythenorth> frosch is against it :D
23:24:19 <andythenorth> I am kinda trolling myself
23:24:44 <andythenorth> and also hoping that a better solution is added with a new version of var 41, or a better way to use var 61 to the same result :)
23:31:33 *** Samu has quit IRC
23:37:18 *** sla_ro|master has quit IRC
23:37:28 *** Progman has quit IRC
23:51:39 <andythenorth> oh I crashed nml :)
23:51:53 <glx> that's easy
23:52:28 <andythenorth> probably bad syntax I wrote
23:52:51 <glx> maybe a bug too
23:57:34 *** Wolf01 has quit IRC
23:58:07 *** Speeder__ has joined #openttd