IRC logs for #openttd on OFTC at 2021-12-12
⏴ go to previous day
00:20:36 <DorpsGek> [OpenTTD/OpenTTD] pelya updated pull request #9739: Copy server invite code to the clipboard automatically https://git.io/JDtdD
00:21:23 <DorpsGek> [OpenTTD/OpenTTD] pelya commented on pull request #9739: Copy server invite code to the clipboard automatically https://git.io/JDZdA
00:47:15 *** gelignite has quit IRC (Quit: Stay safe!)
03:26:34 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:34:55 *** Wormnest has quit IRC (Quit: Leaving)
05:25:38 *** D-HUND is now known as debdog
07:22:03 *** sla_ro|master has joined #openttd
07:30:29 *** _aD has quit IRC (Ping timeout: 480 seconds)
08:24:54 *** andythenorth has joined #openttd
08:46:54 *** gelignite has joined #openttd
08:47:54 *** WormnestAndroid has quit IRC (Remote host closed the connection)
09:15:36 <TrueBrain> so ... what to return on an Industry callback when it is not the callback I expect .. should that never happen, or is it likely to happen ..
09:17:47 <TrueBrain> guess for now I just add the trick of: return 0x8000 if 0C was 00 (as that should have returned an Action2, not a VarAction2), and return Action2 in other cases (as that should have returned a 0x8000 ..
09:22:09 <TrueBrain> "Makes sense? " <- fact that the NewGRF specs ask that, says it all, doesn't it? :)
09:22:31 <TrueBrain> so to sensible make use of the industry callback, I really need to learn how to use registers .. I guess :P
09:26:18 <andythenorth> frosch has views on the correct handling of failed callbacks
09:26:59 * andythenorth googles for frosch
09:29:26 <andythenorth> ha 'makes sense?' must have been me
09:30:10 <andythenorth> TrueBrain registers! Are good!
09:32:12 <nielsm> looks like there might be a bug with the apple touch bar support
09:35:38 <TrueBrain> I am always surprised that I change a tons of lines, and it still works \o/ :D
09:41:10 <andythenorth> I still have a touchbar mac here in a cupboard
09:41:32 <andythenorth> I could test if needed, but it's breakfast time right now :)
09:45:06 <TrueBrain> right, Action2 done, VarAction2 done .. now for VarAction2Adv :)
09:47:38 <TrueBrain> which mostly means understanding what ever the fuck this was I did weeks ago :D
09:52:01 <andythenorth> that is my every newgrf coding experience :P
09:52:06 <andythenorth> usually in my own python, but eh
09:53:14 <TrueBrain> ah, type is only set once .. right, that confused me a bit ..
09:53:23 <TrueBrain> so a whole varaction2adv is either for primary or related object
09:54:36 <TrueBrain> there even is a note about that
09:54:43 <TrueBrain> as they are proud they added var1C to fix that issue
09:54:43 <andythenorth> use temp or permanent registers for other scopes
09:55:08 <andythenorth> ha ha I forgot about that
09:55:23 <TrueBrain> that makes automation a tiny bit more difficult .. hmm .. lets see ..
09:56:07 <andythenorth> I don't think I ever intentionally use 1C, but maybe nml internals use it
09:56:23 <andythenorth> seems weird having a specific dedicated var for a general case handled by registers
09:56:40 <TrueBrain> it can make certain cases a lot easier, I guess
09:56:51 <andythenorth> I guess 'yield previous result' is common in programming or something
09:56:53 <TrueBrain> registers requires you to assigning meaning to registers
10:18:40 <TrueBrain> so my current code has a "distance-to-town" .. but I cannot find it back in the docs anymore :D
10:19:20 <TrueBrain> so why does it read 0x89 :P
10:19:23 <TrueBrain> smells like a bug :D
10:20:52 <TrueBrain> I don't think this actually ever worked the way I intended :P
10:21:53 <TrueBrain> owh, it does ... this variable is only available for this callback
10:22:02 <TrueBrain> which .. reuses a well known number (89) which confused the fuck out of me
10:23:23 <TrueBrain> NML doesn't have support for that? Hmm
10:24:24 <TrueBrain> can't find anything mentioning the variables for cb28 in NML .. but I could suck in searching
10:24:47 <TrueBrain> by the looks also the only callback that does this :D
10:33:07 *** nielsm has quit IRC (Ping timeout: 480 seconds)
11:46:13 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
12:30:25 *** frosch123 has joined #openttd
12:33:52 <FLHerne> it was slightly in the way, but seems worth it
12:37:48 <TrueBrain> you had a xmas party?!
12:39:58 <frosch123> yes, cb28 is an abomination
12:46:45 *** Markk has quit IRC (Ping timeout: 480 seconds)
12:46:45 *** Markk_ is now known as Markk
12:46:47 <frosch123> i guess it makes sense to treat the variable that are actually available for cb28 similar to variable 10 and 18
12:59:09 <TrueBrain> VarAction2OperatorVariable::Variable(Variable::Global::Number(v.parse::<u32>().unwrap()).into())
12:59:13 <TrueBrain> VarAction2OperatorVariable::Variable(Variable::IndustryCb28::DistanceToTown.into())
12:59:18 <TrueBrain> not ideal yet, but will have to do for now
13:06:35 <andythenorth> lol S3 upload still painfully slow
13:06:49 <andythenorth> I wonder if the low-price tier rate limits ingress or something
13:07:36 <andythenorth> 30MB of grf goes to bananas in a couple of seconds; 15MB of html docs (thousands of small files) takes 5-10 minutes to upload on S3
13:09:03 <TrueBrain> small files .. yeah ..
13:09:55 <andythenorth> I'm only using the browser client, not a desktop s3 client, maybe it limits number of concurrent http uploads or something
13:12:56 <TrueBrain> okay ... I think I can now produce an varaction2advanced based on dynamic input .. lets see how bad it broke :P
13:13:43 <TrueBrain> didn't break, but also didn't work :D
13:19:10 <TrueBrain> it helps if you also write the chain to the GRF
13:22:49 <TrueBrain> the bottom switch-case was nearly fully generated by CoPilot .. only the shift/mask sometimes was wrong .. the rest it all figured out based on the comments earlier
13:24:41 <frosch123> "allow(dead_code)" <- ruby is funny :)
13:25:01 <TrueBrain> yeah .. pedantic is the linter for sure
13:25:01 <frosch123> shares letters, but is different :p
13:28:09 <frosch123> i should learn some basic rust. i cannot just guess the meaning :)
13:29:10 <TrueBrain> most likely you can mostly :P
13:29:19 <TrueBrain> but don't take my work as "he knows how to write Rust" :P
13:30:12 <TrueBrain> so now all that is left for me to fix is this weird first sprite ... am I going to special case it, or .. hmm
13:30:16 <frosch123> considerering i can guess from the names what the code is supposed to do, i understand very little of what it actually does
13:30:48 <frosch123> so, in this case there is a huge discrepancy between "what i should understand" and "what i do understand" :)
13:30:57 <frosch123> it would be less obvious if it was not newgrf stuff
13:31:01 <TrueBrain> :D Well, that is how I feel when it comes to NewGRF :P
13:33:05 <FLHerne> TrueBrain: is truegrf going to also become a version of grfcodec rewritten in Rust?
13:33:22 <TrueBrain> it does not never will understand NFO
13:33:47 <FLHerne> well, NFO is mostly just grf with handy mnemonics
13:33:59 <TrueBrain> "handy" depends on the observer :P
13:35:02 <frosch123> the silly thing is, so far every grf generator started from scratch. we never managed to create some grf library used by multiple things
13:35:19 <TrueBrain> complexity is way too high to do so
13:35:29 <TrueBrain> everyone who could, doesn't want to
13:35:38 <TrueBrain> everyone who does, doesn't know how to :)
13:36:52 <TrueBrain> right, done translating binary blobs into Rust structures
13:37:03 <TrueBrain> that should make it a lot easier to extend stuff :)
13:37:18 <TrueBrain> also the code become a lot more readable :D
13:38:10 <frosch123> it's also that every project picks a very different language :) grf2html->pascal, nml->python, yagl->c++, truegrf->rust
13:39:03 <TrueBrain> Pascal, hihi, haven't heard about that in years :)
13:39:04 <frosch123> it's similar for the admin port. every admin port user writes a library, but remain the only user of it
13:39:08 <TrueBrain> I started with Pascal ...
13:39:20 <frosch123> it was my last pascal project :)
13:40:15 <TrueBrain> I almost wrote TrueGRF compiler in Javascript :P
13:40:24 <TrueBrain> but .. I dismissed that stupid idea pretty quick :)
13:41:53 <TrueBrain> right .. now I am done with the rust stuff .. I am afraid I have to switch my attention to React stuff ... not looking forward to that :P
13:44:24 <TrueBrain> pretty happy with how the Rust part is looking now. I dare say I somewhat start to understand NewGRF now. At least I see the structure behind it :)
13:44:50 <TrueBrain> (after all, if you can autogenerate a varaction2advanced, you at least understand how that interconnects :P)
13:46:12 <TrueBrain> hmm .. when/where in-game is Cargo Prop 1B shown ..
13:46:15 <TrueBrain> "short cargo" hmm ..
13:48:12 <TrueBrain> Total Cargo, is the most obvious place, I guess
13:50:19 <frosch123> SCC_CARGO_LONG vs SCC_CARGO_SHORT vs SCC_CARGO_TINY, which is which :)
13:51:34 <frosch123> looks like it is mostly to avoid repetiion
13:52:04 <frosch123> if there is only one amount, it is usally the _LONG one. if there are multiple, one is _LONG and the rest is abbreviated
13:53:44 <TrueBrain> now to find the ID of STR_PASSENGERS :D
13:54:24 <andythenorth> I deliberately chose not to make a generic python grf generator
13:54:33 <andythenorth> I don't want to support users :P
13:54:59 <andythenorth> we do have m4nfo though
13:55:36 <frosch123> andythenorth: m4nfo, nforenum and grfcodec are no high-level languages
13:55:55 * andythenorth could say things about m4nfo
13:56:11 <andythenorth> it avoids bloat by not being a high-level language
13:56:19 <TrueBrain> frosch123: that doesn't give me the id! :P
13:56:38 <andythenorth> I seriously considered python -> m4nfo for speed, when nmlc was still super slow
13:56:50 <andythenorth> now nmlc is just 'slow', at least on pypy
13:57:21 * andythenorth considers python -> Truegrf :P
13:58:47 <TrueBrain> TrueGRF is JSON, so good luck with that :P
13:59:12 <TrueBrain> I was just looking for that :D
14:01:15 *** sla_ro|master has quit IRC ()
14:12:08 <TrueBrain> hmm .. string system .. how am I going to deal with that ..
14:13:22 <TrueBrain> especially the {P} stuff ..
14:19:43 <TrueBrain> andythenorth: your cargo all uses SIGNED_WORD .. why not COMMA?
14:21:12 <TrueBrain> not sure how that matters?
14:21:19 <TrueBrain> I was looking at original strings, they all use COMMA
14:21:30 <glx> text stack size is limited IIRC
14:21:35 <TrueBrain> so that makes me wonder :)
14:21:42 <frosch123> TrueBrain: don't compare newgrf strings with ottd strings
14:22:26 <frosch123> ottd string parameters are uint64[N], with one 64bit integer per parameter. newgrf textstack is a binary blob, which is read in u8, u16, u32, u64 units
14:22:44 <TrueBrain> I ... yeah, okay, we will see when this crashes :D
14:22:59 <frosch123> though in case of the cargo strings, it's possible that ottd converts the newgrf codes into ottd codes, and COMMA just works
14:23:49 <frosch123> basically, it also matters whether the string has a fixed "signature" where ottd fills in the numbers, or whether it is a pure newgrf string and the newgrf fills the parameters
14:24:20 *** WormnestAndroid has joined #openttd
14:29:46 <TrueBrain> hmm .. VOLUME and WEIGHT are giving me a hard time :P
14:30:02 <TrueBrain> Rust doesn't allow me to replace strings outside of the ASCII set :P
14:30:10 <TrueBrain> so 9a isn't valid :P
14:30:23 <frosch123> there are valid utf-8 sequences for all of them
14:30:37 <frosch123> all in the utf-8 user range
14:30:47 <TrueBrain> and that part I can't get to work :D
14:31:22 <frosch123> did you forget the utf-8 prefix? þ
14:34:34 <TrueBrain> {VOLUME} replaced with \u{e087} .. but that is not doing what I expect :P
14:34:49 <TrueBrain> the 87 part seems to work, but there is also an e0 in front of it now :D
14:35:06 <TrueBrain> like I will ever understand unicode, lolz
14:35:20 <frosch123> yes, you have to prefix your string with a "\u{00de}"
14:36:03 <frosch123> by default string use TTD 8bit encoding, by prefixing them with U+DE you switch to utf-8 mode
14:36:47 <frosch123> you should always do that, since TTD 8bit encoding also differs from latin1 in various areas
14:37:29 <TrueBrain> why can I refit passengers in an oil tanker?
14:37:33 <TrueBrain> does anyone care to explain? :P
14:37:53 <frosch123> you messed up cargo classes :)
14:38:01 <frosch123> set passengers to liquid or something
14:38:21 <frosch123> you played too much with soylent industries newgrf
14:39:11 <TrueBrain> weirdly, it is only saying that with "available trains"
14:39:17 <TrueBrain> when I actually build it, I cannot refit it to passengers
14:40:10 <TrueBrain> anyway: parsed_string = parsed_string.replace("{WEIGHT}", "\u{e09a}\x0d");
14:40:23 <frosch123> ah, you set the passenger-string for the chemical cargo :)
14:40:47 <TrueBrain> passenger-string .. hmm ..
14:40:57 <TrueBrain> what does that mean ..
14:41:13 <frosch123> cargo name is "chemicals", amount string is "{...} of passengers"
14:41:23 <frosch123> possibly it is the default or something :p
14:41:41 <TrueBrain> it is nothing I generated at least
14:41:45 <TrueBrain> so what default would that be ..
14:41:55 <frosch123> passengers is first cargo :)
14:42:16 <TrueBrain> something I can change in my GRF rendering?
14:42:44 <frosch123> cargo property 1B and 1C?
14:42:52 <TrueBrain> and also working properly
14:43:03 <TrueBrain> as seen by the screenshot, you cannot actually refit it to passengers
14:43:08 <TrueBrain> it only tells me so in the available train window
14:43:25 <TrueBrain> everywhere else from what I can tell it is correctly called chemicals
14:44:14 <frosch123> hmm, both strings use CARGO_LONG, so yes that is weird
14:44:34 <TrueBrain> bug in OpenTTD? or bug in my GRF? Now that is the question :D
14:45:30 <frosch123> it looks good with firs
14:46:17 <TrueBrain> anyway, for now, a preset list of units .. and if you use Tonnes, it uses {WEIGHT}, with Litres, it uses {VOLUME}. For everything else it uses {SIGNED_WORD}, and it prefixes the "long name" for you
14:46:29 <TrueBrain> pretty sure there are cases this won't work, but for now, I am happy with it
14:47:07 <TrueBrain> btw, coal work fine. But I guess that is because I recycled the existing label
14:47:15 <TrueBrain> it is only for oil tankers, I guess because I do not have an oil
14:47:44 <TrueBrain> once refitted I cannot switch back to passengers
14:48:20 <TrueBrain> this is a moment I would like to be able to produce NFO :P
14:52:14 <TrueBrain> ugh, {P} support is too much work for now :P
14:55:30 *** virtualrandomnumber has joined #openttd
14:55:50 *** virtualrandomnumber has quit IRC ()
15:08:27 <TrueBrain> frosch123: seems it is only a problem for that wagon. If I change my cargo class to Bulk, the coal wagon shows correctly that it can contain Chemicals and Coal .. hmm
15:09:29 <frosch123> what did you do to OIL_
15:09:34 <frosch123> did you redefine it somehow?
15:10:22 <TrueBrain> Prop08 was set to 0xff, and Prop17 was set to '\0\0\0\0'
15:10:42 <TrueBrain> so OIL_ no longer exists in the game, if I understand the specs correctly :P
15:11:43 <frosch123> this default-wagon-refitting stuff is new in 12.0, so may be buggy :)
15:11:50 <frosch123> so i'll try your newgrf in a while
15:12:00 <TrueBrain> if you wouldn't mind, I would appreciate that
15:12:08 <TrueBrain> can't tell if it is a bug in OpenTTD or my GRF .. both are possible :)
15:12:19 <TrueBrain> latter is more likely :P
15:13:14 <TrueBrain> hihi, you currently can't change a label of a cargo, as that means an industry points to a cargo that no longer exists
15:13:45 <TrueBrain> so many UX problems coming my way now! \o/
15:21:13 *** Wormnest has joined #openttd
15:32:14 <glx> ok, I think I found the ideal place to delay start scripts on load
15:32:43 <glx> no I need to handle the saved data
15:48:07 <frosch123> TrueBrain: bug in ottd :)
15:48:27 <frosch123> someone ported FindLastBit to uint64, but kept FindFirstBit with uint32
15:48:41 <frosch123> so it fails if a wagon is only refittable to cargos >= 32
15:49:19 <TrueBrain> Nasty bug :D nice find!
15:50:49 <frosch123> it's also the only usage of FindFirstBit in ottd, where it matters :p
15:52:19 <DorpsGek> [OpenTTD/OpenTTD] codetwice opened issue #9743: [Crash]: OpenTTD crashes on startup (MacBook Pro 2020, M1) https://git.io/JDCuI
15:56:36 <TrueBrain> So TrueGRF has shown its worth already! :p
15:57:55 <peter1138> I blame the idiot who increased the cargo types limit.
15:58:53 <frosch123> FindLastBit was changed apparently to fix some issue with the graphs
16:02:05 <glx> wow macos report with exploitable call stacks it seems
16:03:59 <DorpsGek> [OpenTTD/OpenTTD] frosch123 opened pull request #9744: Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was wrong. https://git.io/JDCgB
16:04:20 <glx> usually in macos crash.log the call trace was useless
16:05:13 <peter1138> Oh, different meaning of exploitable...
16:05:35 <glx> so #9743 seems related to touchbar
16:06:54 <glx> ah it's the followup of forum thread
16:09:20 <glx> oh of course, it's not our crash.log, but the one generated by apple
16:17:23 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #9744: Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was wrong. https://git.io/JDCVR
16:26:22 <TrueBrain> So long passengers in oil wagons
16:35:45 <DorpsGek> [OpenTTD/OpenTTD] frosch123 merged pull request #9744: Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was wrong. https://git.io/JDCgB
16:36:04 *** tokai|noir has joined #openttd
16:36:04 *** ChanServ sets mode: +v tokai|noir
16:43:02 *** tokai has quit IRC (Ping timeout: 480 seconds)
16:59:07 *** sla_ro|master has joined #openttd
17:00:14 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:51:49 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
17:52:07 *** WormnestAndroid has joined #openttd
18:30:12 *** jottyfan has joined #openttd
18:57:27 *** jottyfan has quit IRC (Quit: jottyfan)
19:52:33 <TrueBrain> it is bad if React annoys you more than NewGRF specs :P
19:52:36 <TrueBrain> but, lots of updates!
19:53:52 <TrueBrain> all my Rust rework also decreased the Rust size from ~2MB to 300KB
19:57:18 <DorpsGek> [OpenTTD/OpenTTD] nielsmh dismissed a review for pull request #9739: Copy server invite code to the clipboard automatically https://git.io/JDOiw
20:01:02 <DorpsGek> [OpenTTD/OpenTTD] nielsmh commented on issue #9743: [Crash]: OpenTTD crashes on startup (MacBook Pro 2020, M1) https://git.io/JDCuI
20:11:53 <dP> hm, is there any way to make syntax like this return an expression in python?
20:11:54 <dP> TEMP[128] = (cmp(tile_slope, 30) & 1) * 18
20:12:37 <dP> kinda wanted to use it for grf stuff but looks like python really doesn't like to return stuff in assignment
20:12:41 <dP> even with 3.8 walrus operator
20:14:52 <dP> i.e. allow something like this: grf.va2(feature=Object, code=[TEMP[128] = (cmp(tile_slope, 30) & 1) * 18])
20:16:15 <nielsm> yeah I think python only allows assignment to be a statement, not an operator
20:16:34 <frosch123> TrueBrain: 2MB what? binary size?
20:16:54 <TrueBrain> so TrueGRF loads faster now :P
20:16:58 <frosch123> did you stop linking some library?
20:17:34 <TrueBrain> mostly did some pruning .. the image library also supported stuff like gif, jpeg, ..
20:19:27 <frosch123> poor gif :) once the only image format grfcodec knew, now not supported by truegrf
20:20:01 <Rubidium> did grfcodec start with gif?
20:20:36 <frosch123> i think grfcodec gained png when nml already existed
20:20:52 <TrueBrain> hmm .. I was using a JSON graph tree to make custom placements work .. guess I could better use an RPN for it ... JSON trees are nasty to parse :P
20:21:29 <frosch123> oops, sorry... grfcodec never supported gif
20:22:33 <TrueBrain> doesn't OpenTTD still allow BMP screenshots? :P
20:22:56 <glx> it even used to default to it recently because bug
20:24:01 <Rubidium> nml before png in grfcodec seems right though
20:24:35 <glx> png was added before 32bpp or not ?
20:25:23 <frosch123> proper 32bpp was in 2010
20:25:27 <frosch123> nml is from 2009 or so
20:25:35 <frosch123> *proper 32bpp was in 2012
20:25:54 <TrueBrain> wait, we have proper 32bpp?
20:26:02 <TrueBrain> I reject that concept
20:26:14 <frosch123> compared to truelight 32bpp :p
20:27:31 <TrueBrain> still think it was a stupid idea to add 32bpp to OpenTTD .. but that new western set does look sweet
20:28:45 <TrueBrain> daylength is active, yes
20:32:45 <TrueBrain> I miss a good solution for tile editor :P
20:32:58 <TrueBrain> really done with React, so that is the first real problem :)
20:33:26 <frosch123> can't help you there
20:33:39 <TrueBrain> the one thing I regret about starting TrueGRF .....
20:34:26 <glx> at least my station stuff seem to work fine
20:34:43 <glx> and look great in western screenshots
20:35:59 <frosch123> does the western stuff use nml with stations?
20:36:51 <glx> yes bad_brett did some testing with it
20:37:48 <TrueBrain> trying to trick people to open Discord are we? :P
20:38:05 <glx> ok link to the image instead
20:41:26 <TrueBrain> I love how the station label doesn't fit there :P
20:41:42 <glx> and that's using layout magic to update depending on station size
20:44:02 <glx> ok now I can read script saved data in a temp list (and immediatly discarded because not stored anywhere to be used later)
20:45:27 *** glx is now known as Guest8310
20:52:07 *** Guest8310 has quit IRC (Ping timeout: 480 seconds)
20:58:30 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:04:53 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
21:09:10 *** WormnestAndroid has joined #openttd
21:15:02 *** frosch123 has quit IRC (Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn)
21:32:19 *** Wormnest has joined #openttd
21:47:20 *** gelignite has quit IRC (Quit: Stay safe!)
22:04:26 <andythenorth> lol when will 'toggle palette' be removed from newgrf window? :)
22:06:59 <Rubidium> just after we just load the NML, I guess
22:15:06 <andythenorth> could be in 'parameters' :P
22:22:33 *** andythenorth has quit IRC (Quit: andythenorth)
22:23:01 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:28:10 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:57:41 <peter1138> Ctrl-alt-meta-win-double-middle-click
23:13:01 *** sla_ro|master has quit IRC ()
23:13:46 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
23:55:31 <DorpsGek> [OpenTTD/OpenTTD] LC-Zorg commented on pull request #9739: Copy server invite code to the clipboard automatically https://git.io/JDWXc
23:58:26 *** jedavies has quit IRC (Remote host closed the connection)
23:58:38 *** jedavies has joined #openttd
continue to next day ⏵