Config
Log for #openttd on 15th January 2022:
Times are UTC Toggle Colours
10:34:21  <TrueBrain> lol @ newgrf specs .. so every time varaction2advanced is: signed / unsigned .. except for the last one
10:34:25  <TrueBrain> there it is unsigned / signed
10:34:30  <TrueBrain> because sanity is overrated :D :D :D
10:34:34  <TrueBrain> happy I caught that in time
10:40:04  <Eddi|zuHause> mathematically, "if (a) then b else c" can be translated into a*b+(not a)*c. but you lose the short evaluation. and the boolean value of a has to be normalized into 0/1 instead of 0/not 0
10:40:25  <TrueBrain> I did consider it :P
10:40:34  <TrueBrain> but the fact you evaluate both branches ..... would give weird results :D
10:42:00  <Eddi|zuHause> well, then translating it into a switch is the only option
10:42:17  <TrueBrain> but that wasn't my question ;)
10:42:37  <TrueBrain> I was hoping there was an opcode to skip varaction2advanced entries :D
10:43:20  <Eddi|zuHause> there was never a need for that, because a switch already does that :)
10:43:42  <TrueBrain> it sure does; but many of those switch cases don't need to branch, and a lot of administration around them :)
10:46:11  <Eddi|zuHause> that's only weird because you view it from an angle nobody else did before :)
10:46:20  <TrueBrain> doesn't make it weird ;)
10:46:27  <TrueBrain> NML had the same issue btw :P
10:46:37  <TrueBrain> but .. I am just asking the questions. NewGRF has some funky things
10:46:53  <TrueBrain> so sometimes where I think: this surely isn't possible, someone comes and says: yeah, you can do that like this
10:47:21  <Eddi|zuHause> i don't remember NML having an if operator
10:47:33  <Eddi|zuHause> at least i never tried using one
10:47:53  <Eddi|zuHause> there's an if block, but that's action 7/9
10:49:25  <TrueBrain> w00p, constant comparisons work :D (so "10 11 1 2 <" resolves into 10)
10:51:17  <Eddi|zuHause> that syntax creeps me out...
10:51:27  <TrueBrain> poor you :)
10:51:56  <Eddi|zuHause> how is anyone supposed to work out which operand goes in which position, if you're not using that daily?
10:52:31  <TrueBrain> learning something new, yeah, I know, sounds horrible :P
10:52:56  <Eddi|zuHause> that's not the point
10:54:18  <Eddi|zuHause> i mean from a "try to understand what you wrote 5 years ago" perspective, this is barely any better than brainfuck
11:01:38  <TrueBrain> feels a bit like you worry that minified Javascript is not maintainable :P
11:05:11  <LordAro> or indeed machine code
11:05:39  <LordAro> or wait, that's not nfo
11:05:46  <LordAro> that's your rpn thing
11:05:46  <TrueBrain> :D
11:05:52  <TrueBrain> tomato tomato
11:27:41  <TrueBrain> wow, my brain hurts from attempting to create switches out of if-statements :P
12:17:27  *** WormnestAndroid has joined #openttd
12:25:31  *** Kitrana1 has joined #openttd
12:31:04  *** Kitrana has quit IRC
12:50:29  <peter1138> varactions, because creating your own bytecode when hacking into x86 assembly is the best
12:51:34  *** frosch123 has joined #openttd
13:08:23  <frosch123> that dosgameclub guy put some effort into creating explain-ottd-code videos... quite some unusual format
13:08:53  <TrueBrain> peter1138: haha :D Nicely worded ;)
13:11:45  <andythenorth> hmm
13:11:51  <andythenorth> multiple GS in one map
13:12:28  * andythenorth wonders if all GS authors could be persuaded to write them as callable modules
13:12:52  <andythenorth> then you just choose the modules you want in settings for FIRS GS
13:14:15  <Eddi|zuHause> peter1138: are you suggesting injecting x86 code would have been the better option? :p
13:29:29  <TrueBrain> I wonder if limiting if-in-if-in-if-.. depth to like 10 would be an issue :P
13:33:27  * andythenorth explores GS cargo monitor
13:33:42  <andythenorth> I want to run the same industry production calculation in both GS and grf
13:33:48  <andythenorth> curious if they will diverge
13:34:54  <andythenorth> so I need to trigger every 256 ticks
13:35:07  <_dp_> probably not a good idea, GS isn't particularly consistent
13:35:25  <andythenorth> hmm GS has no ticks concept
13:35:30  <andythenorth> I'll have to do it on date
13:35:51  <andythenorth> how many ticks per day?
13:36:00  <andythenorth> 74?
13:36:08  <andythenorth> @calc 256/74
13:36:08  <DorpsGek> andythenorth: 3.4594594594594597
13:36:13  <andythenorth> meh that's not an integer
13:40:03  <TrueBrain> right ... "store left value in register", "run compare body", "if 0 go to else-body / if 1 go to if-body", "run either if/else body", "load left value from register", "do operator with 'last computed result'" ...
13:40:11  <TrueBrain> I cannot imagine anyone writing sane ifs in NML :P
13:41:28  <andythenorth> stacked ternary
13:42:29  <TrueBrain> either way, that is for an if in the right-hand-side ... now to figure out if I can do this on the left-hand-side too .. but that is more complex :P
13:43:01  <TrueBrain> I think I need to solve this differently :)
13:45:40  <frosch123> TrueBrain: imagine an open cargo wagon with different graphics for 60 cargo types
13:45:47  <frosch123> that needs a long switch/if-cascade
13:48:15  <TrueBrain> These setids are a pain in the ass :p
13:49:28  <andythenorth> who would do that though frosch123? :P
13:52:07  <frosch123> https://github.com/V453000/NUTS/blob/master/src-includes/rail_freight_wagons_1_graphics.nml#L1578 <- 71 cases :p
13:52:23  <frosch123> it lacks support for the newest industry sets
13:52:33  <TrueBrain> yeah, but switches can be solved :) If-in-if on different info is a bit harder ;)
13:53:56  <TrueBrain> well, guess every if inside an if only needs 1 more setid .. so the limit would be ~200
13:53:58  <frosch123> andythenorth: another problem with supporting 256 cargos. vehicle va2 cannot switch on so many cargo types
13:53:59  <TrueBrain> that should be fine :P
13:54:53  <andythenorth> frosch123 sharding? :P
13:55:13  * andythenorth oof lost in GS<->grf ideas again
13:56:53  <TrueBrain> meh, using procedures is a bit better, but still a bit clunky ... "store left value in register", "call procedure", "restore left value from register", "use 1C to do math operation with" (for a right-hand-side if-statement)
13:57:03  <TrueBrain> this 15bit result bla is bla :P
13:57:39  <TrueBrain> but for a left-hand-side it becomes a lot easier in that case: "call procedure", "rst 1C", ...
13:58:29  <TrueBrain> can a procedure switch to another chain btw?
13:58:42  <TrueBrain> I assume it can :P
13:59:37  <TrueBrain> as that would mean the procedure could have the compare-body, and based on the result switch to the if or else body, returning the value of the procedure
14:02:23  <frosch123> yes, you can recurse into other switches at procedures as you like
14:03:26  <TrueBrain> good :)
14:04:04  <TrueBrain> so annoying that order of operations is important in life :P
14:06:39  <andythenorth> so do we think GS can reliably walk all the towns on the map at month end?
14:06:47  * andythenorth has no idea about GS performance
14:06:57  <TrueBrain> GS is limited in amount of opcodes it can execute per tick
14:07:11  <TrueBrain> so there is no (like: zero) guarantee about anything happening in any in-game amount of time
14:07:22  <andythenorth> but if we allow some leeway about what 'month end' means
14:07:24  <TrueBrain> depends both on user configuration and size of the thing you are iterating
14:07:29  <andythenorth> this isn't strict 'real-time system'
14:07:45  <TrueBrain> so say, 10000 towns has another performance than 10 towns
14:07:54  <TrueBrain> and a user that sets opcodes to 10 has other performance than one that uses 10000
14:08:19  <andythenorth> I guess it's only verifiable empirically
14:08:24  <andythenorth> well
14:08:27  <andythenorth> yolo
14:15:55  <TrueBrain> I have no clue how you want to do that if a user can change those values, but sure :P
14:16:21  <TrueBrain> but "works for me" is a valid statement :D
14:17:09  <frosch123> gs can change settings, so they can increase their opcode limit :p
14:17:22  <TrueBrain> lol
14:17:27  <frosch123> not sure whether the limit actually applies to GS, or only AI
14:18:21  <TrueBrain> it is one of those settings that was more meant for: so we can tune it
14:18:26  <TrueBrain> more than: anyone should be able to change it
14:18:29  <TrueBrain> like pf-stuff :P
14:19:21  <frosch123> pf-stuff is great, whenever someone complanis about pf not working like they want in their weird track layout, yuo can just sent them down the parameter rabbit hole
14:23:05  <TrueBrain> right ... now to find a way for my code parts to talk to each other ...
14:23:12  <TrueBrain> I didn't want things like "setid" in the RPN parser
14:23:26  <TrueBrain> but ... yeah ... tricky to communicate internally :D
14:25:35  <TrueBrain> but in fun news, except for if-bodies, a whole function is generated in a single chain :D
14:34:53  *** glx has joined #openttd
14:34:53  *** ChanServ sets mode: +v glx
14:58:04  <supermop_Home> hello
15:00:54  <TrueBrain> hi!
15:07:55  <supermop_Home> hows it going
15:08:29  <TrueBrain> slowly getting FIRS economy working in TrueGRF :P
15:08:42  <supermop_Home> nice
15:09:27  <supermop_Home> apparently i can just reuse the same template for replacing basically all of the house sprites, except the statue
15:30:44  <TrueBrain> debugging NFO ... lovely .... I don't want to do this :P
15:37:42  <glx> it's not the easiest thing to debug
15:38:09  <TrueBrain> I think my procedure call fails .. but how do I know .. hmm
15:48:03  <TrueBrain> owh, lol, wrongly reusing of setids .. lovely :D
15:52:49  <supermop_Home> 4000 should be enough to cover even a very large map, but maybe not a 4096x4096... https://uhpress.hawaii.edu/title/place-names-of-hawaii-revised-and-expanded-edition/
15:53:25  <supermop_Home> i guess i'll need to learn enough orthographic rules to write some kind of generator
15:56:54  <TrueBrain> IT ACTUALLY WORKS! \o/ :D
15:56:59  <TrueBrain> I have function if-statements in RPN now :)
15:57:04  <TrueBrain> functional
15:57:06  <supermop_Home> yay
15:57:24  <TrueBrain> now .... to not use the stupid 15bit result, but rather the 32bit ... means inserting some more operators :D
16:04:49  <TrueBrain> @calc 2 ** 18
16:04:50  <DorpsGek> TrueBrain: 262144
16:05:16  <TrueBrain> now that works fine too :) w00p
16:06:00  <TrueBrain> if-in-if works too :) With the lowest amount of setids used :)
16:08:06  <TrueBrain> now to support functions in the cases .. lets see if that is possible :D
16:09:06  <TrueBrain> "just works"
16:09:06  <TrueBrain> hihi :)
16:10:20  <TrueBrain> that means the example from Lumberjack Industries can now be done .. :D :) :D
16:10:28  <TrueBrain> right .. next pickle ... variables .. but that is for another day :)
16:13:19  <TrueBrain> https://github.com/TrueBrain/TrueGRF/compare/dev?expand=1 <- 714 lines of code to parse the RPN and counting :)
16:13:48  *** Wormnest has joined #openttd
16:14:17  <andythenorth> \o/
16:15:30  <TrueBrain> I really like it only jumps to another setid if it really has to (read: branching) .. otherwise it just creates 1 single (very low) action2 chain :D
16:15:42  <TrueBrain> it uses temporary registers to glue stuff together if it needs to :P
16:16:10  <TrueBrain> very low = very long
16:16:11  <TrueBrain> I need dinner
16:16:33  <frosch123> when you can replicate firs, you can compare how many setids and registers you need with how many nml needs :p
16:16:48  <TrueBrain> ha! That is a nice idea :)
16:18:22  <TrueBrain> in general, might be good to compare the NML result of FIRS with my result .. just to see if nothing extremely weird happened :P
16:21:47  <TrueBrain> but yeah, you can make 254 if-in-if statements before things go wrong .. should be fine, not? :)
16:22:57  <TrueBrain> hmm, no, infinite if-in-if
16:22:58  <frosch123> https://github.com/OpenTTD/OpenGFX/runs/4754568847?check_suite_focus=true#step:7:194 <- nml prints some statistics
16:23:05  <frosch123> i do not have them for firs at the moment :)
16:23:12  <TrueBrain> the problem happens with if-else-in-if-else-in-if-else  ...
16:23:47  <TrueBrain> NML only supports up to 127 action2 chains?
16:24:14  <frosch123> you mean registers?
16:24:21  <TrueBrain> yeah
16:24:23  <TrueBrain> sorry, typing hard
16:24:28  <frosch123> 00-7F are for the user LOAD/STORE_TEMP
16:24:33  <frosch123> 80-FF are used by nml expressions
16:24:37  <TrueBrain> ah, it claimed a set, gotcha
16:24:55  <TrueBrain> TrueGRF just needs a few for stack
16:25:05  <TrueBrain> I don't realistic every expect that to exceed 10 :P
16:25:14  <frosch123> so i guess firs-nml cheats by storing some values in user-allocated register
16:25:26  <frosch123> but at the same time nml cannot optimise whatever the user entered there :p
16:26:01  <TrueBrain> (in case of "1 var 1 + +", the right-hand-side is complex, and is generated as "var", "+1", "store-in-register", "1", "+register")
16:26:32  <TrueBrain> so if people go insane in a single statement with these kind of complex rhs structures .. I need a bit of registers for that :D
16:27:00  <TrueBrain> nor sure how NML does that, but claiming 128 seems excessive :P
16:27:58  <frosch123> nml cannot reorder switches
16:28:19  <frosch123> so it suffers
16:28:23  <frosch123> with whatever the user does
16:28:30  <TrueBrain> poor NML :P
16:28:47  <frosch123> if user defines 100 spritesets at the start of the file, and uses them at the end of the file, that occupies 100 ids throughout the file
16:29:14  <TrueBrain> TrueGRF does not have that issue :P I control when actual content is generated :)
16:29:48  <frosch123> yes, truegrf is more high-level in that regard :)
16:30:15  <TrueBrain> https://github.com/TrueBrain/TrueGRF/blob/dev/truegrf-rs/src/grf/mod.rs#L178 <- the only place so far I waste a setid because I am too lazy to fix it properly
16:30:16  <frosch123> that's why the nml statistics print the source location where the maximum was reached
16:30:24  <frosch123> hoping the user identfies what they did bad
16:30:30  <TrueBrain> that is really smart, printing where it came from :)
16:30:43  <frosch123> with pynml it's really useless though :p
16:31:02  <TrueBrain> and poo, reading back that comment I just linked .. I need to reword that :D
16:31:07  <frosch123> issue at line 156284 of generated nml :p
16:31:13  <TrueBrain> haha :D
16:31:33  <TrueBrain> NML gives absolute freedom, and as such the user has to resolve a lot of things
16:31:38  <TrueBrain> that is the result of that choice, I guess :)
16:31:51  <TrueBrain> TrueGRF limits the user a lot, and as such, can do a lot of things for the human :)
16:32:36  <DorpsGek> [OpenTTD/nml] glx22 opened pull request #247: Add: Translate ternary operator into varact2 if needed https://github.com/OpenTTD/nml/pull/247
16:33:02  <frosch123> haha, sounds like the opposite of what truegrf does :p
16:34:00  <TrueBrain> we will see :)
16:35:07  <TrueBrain> yeah, had to double-check, but if you do 255 "if () {} else { if () { } else { if () { } else { ...", it breaks
16:35:14  <TrueBrain> but  I am pretty sure sanity has been lost long before that :P
16:35:50  <TrueBrain> "if () { if () { if () { if () { ..." has no limit
16:36:54  <TrueBrain> maybe I should revert them, as it is more likely people cascade if-else, I guess (as you pointed out earlier)
16:37:30  <TrueBrain> owh, no, I am wrong ... I already flipped them. So yeah, flip the examples, and that is what is going on
16:37:32  <TrueBrain> I am fine with that :P
16:38:15  <TrueBrain> https://github.com/TrueBrain/TrueGRF/blob/a371da458bb0bc72f393d8ef57bf4fd88da47e50/truegrf-rs/src/grf/actions/action2/rpn.rs#L465 <- I might have copied that from NML :P Really didn't want to do my own math :D
16:39:17  <glx> oh yes the crazy NFO compare
16:39:45  <TrueBrain> as I do not allow compares to be used for getting 0 / 1 back, I might also move things to the switch statement, now I come to think of it
16:50:42  *** sla_ro|master has joined #openttd
17:11:52  *** Flygon has quit IRC
18:13:08  *** Wormnest has quit IRC
18:16:57  *** WormnestAndroid has quit IRC
18:38:02  *** Wormnest has joined #openttd
18:49:03  <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/15c919156865e82bae8ca3568a97e48ffae71a17
18:49:04  <DorpsGek>   - Update: Translations from eints (by translators)
19:04:12  *** WormnestAndroid has joined #openttd
19:08:16  <andythenorth>  hmm
19:08:22  <andythenorth> if towns had a regional capital
19:08:27  <andythenorth> electricity would be less silly
19:38:22  *** jottyfan has quit IRC
19:49:13  <wiscii> latest firefox update 96.0 forces google search
19:49:32  <wiscii> because firefox really care about your privacy ......
19:50:16  <wiscii> just as google shut down free access to their app portal
19:53:26  <wiscii> i know about the "Trans Siberian Railway" but isn't there a Chinese route as well ?
19:54:03  <wiscii> China to Europe ?
19:54:58  <wiscii> ah, Sino-Euro ..
19:55:33  *** Gustavo6046 has joined #openttd
19:57:34  <wiscii> ah-so , the end-to-end Sino-Euro trip is around 15~18 days, ~35 days there and back - Around 10 trips per year
19:58:06  <wiscii> My most profitable goods line makes 1million per delivery and makes 4 deliveries per year
20:14:13  <DorpsGek> [OpenTTD/OpenTTD] nchappe updated pull request #9760: Feature: [Linkgraph] Show a tooltip with statistics when hovering a link https://github.com/OpenTTD/OpenTTD/pull/9760
20:17:51  <TrueBrain> frosch123: are there things that would break if I make all variables signed? :P
20:18:10  <TrueBrain> tracking signed/unsigned is such a nag
20:21:48  <frosch123> not sure, signedness is so weird when multiple fields are bitstuffed into one 32bit or 15bit thing
20:22:50  <frosch123> so when you extract 3 bits from some larger variable, you certainly do not want to sign-extend those
20:23:07  <TrueBrain> I went the NML route, and TrueGRF doesn't show the bitstuffed fields itself
20:23:16  <TrueBrain> for example, it says "x" and "y", which are in a single variable
20:23:25  <TrueBrain> so I kinda take that away, I think ..
20:23:34  <TrueBrain> unless there are callback return values which need them stuffed again
20:23:35  <frosch123> nml does that for variables, but not for cb results
20:23:56  <frosch123> there are plenty of cb results with "stringid | flag1 | flag2"
20:24:06  <frosch123> where stringid is some 12bit value
20:24:13  <frosch123> (yeah, 12 :p)
20:24:29  <TrueBrain> I already did "result:inputs[]", to not bother users with this stuff .. guess I might as well for those callback results
20:24:47  <TrueBrain> so given that, what else breaks if it is signed only ..
20:25:00  <TrueBrain> hard to see :D
20:25:52  <frosch123> most individual things do not exceed 31 bits, though there are "32 random bits" thingies sometimes
20:26:04  <frosch123> but then you usually also pick some of them, instead of all
20:26:20  <TrueBrain> it would simplify it a lot if just everything is signed, and kinda works how you expect
20:26:30  <TrueBrain> maybe I should just try it signed first, and see if we run into something
20:26:36  <TrueBrain> can always add a "unsigned" keyword :P
20:35:54  <glx> ok I wasn't expecting nml#247 CI to fail this way
20:36:40  <TrueBrain> how did it fail?
20:36:44  <TrueBrain> it now sounds like it did boom :P
20:37:04  <glx> python 3.5 and 3.6 not available on macos
20:37:09  <TrueBrain> lolz
20:37:29  <TrueBrain> I wouldn't have seen that coming either :D
20:41:54  <glx> https://github.com/actions/virtual-environments/issues/4744 <-- oh I should take care of this one too
20:42:50  <glx> https://github.com/actions/virtual-environments/issues/4060 <-- I guess this one just hit me actually
20:43:28  <glx> workflow ran macos-11 indeed
20:43:52  <glx> and this image just doesn't have 3.5 nor 3.6
20:57:56  <TrueBrain> guess it is time to burn 3.5 with fire :P
21:00:06  <DorpsGek> [OpenTTD/nml] glx22 opened pull request #248: Update: [Actions] python versions for regression test https://github.com/OpenTTD/nml/pull/248
21:01:14  <glx> I need to try to remember why nml workflows are forced to windows-2016, because this image will disappear in march
21:06:03  <wiscii> github explicitly told everybody to use windows-latest
21:06:34  <glx> yes we know, that's why I need to remember why it's not the case
21:07:00  <DorpsGek> [OpenTTD/nml] glx22 updated pull request #248: Update: [Actions] python versions for regression test https://github.com/OpenTTD/nml/pull/248
21:16:37  *** gelignite has joined #openttd
21:22:52  <_dp_> wow, first desync since 12.0
21:23:58  <LordAro> oh no
21:26:08  <Gustavo6046> hm?
21:26:10  <Gustavo6046> what happened?
21:33:24  <wiscii> sounds like flying foo hit spinning bah! :)
21:36:33  <TrueBrain> w00p, persistent registers work \o/ :D
21:36:49  <TrueBrain> code needs a bit of a cleanup :D
21:36:57  *** _aD has joined #openttd
21:40:57  <DorpsGek> [OpenTTD/nml] glx22 updated pull request #248: Update: [Actions] python versions for regression test https://github.com/OpenTTD/nml/pull/248
21:42:41  <glx> hmm and there's a new error reported by codeQL
21:43:33  *** WormnestAndroid has quit IRC
21:43:50  *** WormnestAndroid has joined #openttd
21:50:20  *** frosch123 has quit IRC
21:52:13  <glx> https://github.com/OpenTTD/nml/security/code-scanning/128?query=ref%3Arefs%2Fpull%2F248%2Fmerge+ref%3Arefs%2Fpull%2F248%2Fhead <-- regex are fun, but I hate this one
21:57:34  <Gustavo6046> what the heck is that regex
21:57:40  <Gustavo6046> oh
21:58:03  <glx> https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html <-- it should match that
21:58:17  <Gustavo6046> exponential backtracking... really? I don't see any lookbehinds
21:59:27  <glx> not explicitely, but python engine seems to do it
22:01:03  <Gustavo6046> :/
22:01:12  <Gustavo6046> I mean, the Python re engine is dumb
22:12:37  *** Wormnest has quit IRC
22:17:48  *** WormnestAndroid has quit IRC
22:18:01  *** WormnestAndroid has joined #openttd
22:18:38  *** andythenorth_ has joined #openttd
22:20:41  *** andythenorth has quit IRC
22:20:51  <_dp_> is there a way to know what's the latest netsave.sav now?
22:21:02  <_dp_> want to ask player to send it but there are multiple now
22:26:35  *** geli has joined #openttd
22:33:53  <glx> file date probably
22:36:56  <_dp_> I'm just gonna give up, he's not responding anymore
22:37:20  <_dp_> judging by how slow and awful he plays I blame android :p
22:40:33  *** Wormnest has joined #openttd
22:40:47  <wiscii> it's saturday night and your client is on android, probably has a girlfriend too xP
23:04:18  *** andythenorth_ has quit IRC
23:20:47  *** LouWestin_ is now known as LouWestin
23:37:20  *** gelignite has quit IRC

Powered by YARRSTE version: svn-trunk