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

Powered by YARRSTE version: svn-trunk