IRC logs for #openttd on OFTC at 2023-03-25
β΄ go to previous day
00:55:24 *** Thrillville109 has joined #openttd
00:55:24 <Thrillville109> How do I add TTO's music
01:11:40 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
01:21:55 <Thrillville109> nvm I figured it out
01:24:09 *** Wormnest has quit IRC (Quit: Leaving)
01:24:15 <debdog> hmm, the link seems outdated anyway
01:46:17 *** Etua has quit IRC (Ping timeout: 480 seconds)
02:13:34 *** rightnut has quit IRC (Read error: Connection timed out)
02:14:39 *** rightnut has joined #openttd
03:09:59 *** WormnestAndroid has joined #openttd
03:24:21 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:33:54 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
04:38:58 *** WormnestAndroid has joined #openttd
06:12:05 *** bryjen has quit IRC (Quit: Leaving)
06:17:04 <pickpacket> Is it possible to compile the game into a single binary on linux? Kinnda need to do that today π
06:38:40 *** D-HUND is now known as debdog
06:52:30 <andythenorth> Eddi|zuHause: - use of pypy for nmlc
06:52:30 <andythenorth> - faster python 3 elsewhere in the compile
06:52:30 <andythenorth> - procedures in nml
06:52:30 <andythenorth> - elimination of duplicate code for < 8/8 sprites when reversed
06:52:30 <andythenorth> - rebuilt makefile so that -j flag can be used reliably
07:11:17 <Eddi|zuHause> the largest part of CETS compile was always just reading in and parsing the file, which lead to splitting up the file into multiple smaller parts
07:21:11 <andythenorth> the nml step for Horse has about 5s of parsing / pre-processing
07:21:30 <andythenorth> output to nfo is about 1s
07:21:53 <andythenorth> the grfcodec step is about 2s
07:23:02 <Eddi|zuHause> see, the grfcodec step of CETS is already like 1 minute
07:23:10 <andythenorth> graphics generation is about 5s, and probably has significant inefficiencies in it
07:23:35 <andythenorth> the Horse compile is nearly acceptable
07:23:47 <andythenorth> if 16s could be 10s, that would be excellent
07:23:53 <andythenorth> but finding the remaining 6s might be...hard
07:23:57 <Eddi|zuHause> the whole compile was like 5 minutes
07:24:15 <andythenorth> that's unworkable π
07:24:25 <andythenorth> slow cycle times impede progress
07:26:05 <Eddi|zuHause> note that i didn't do any of the points you listed up there, except maybe you could argue the -j flag with the partial compiles
07:27:37 <andythenorth> I would be happier if nml was capable of partial compiles
07:27:46 <andythenorth> but I'm not sure it's worth the work
07:28:23 <andythenorth> do you have a currently working CETS compile?
07:28:43 <Eddi|zuHause> haven't tried in ages, but i don't see why it would stop working
07:29:50 <andythenorth> for every case I tried, pypy3 was significantly faster for nml
07:30:00 <andythenorth> as much as 4-5x improvement
07:30:10 <Eddi|zuHause> it still needs a patched nml for actionC support
07:31:11 <andythenorth> I venv a pypy3 and just build nml with that
07:31:16 <andythenorth> I have local patches
07:39:22 <Eddi|zuHause> setting up compile environments always puts me off... too many steps to get to the actually creative part
07:53:41 <andythenorth> I rebuilt pypy3 environment last night to get latest version
07:53:55 <andythenorth> I had to download the binary
07:54:05 <andythenorth> then a shell script that installs pip
07:54:39 <andythenorth> took me about 10 minutes, quite boring
07:56:45 <Eddi|zuHause> see, and that can easily get to 1-2 hours if you aren't familiar with the steps involved
08:31:52 *** Speedy` has quit IRC (Read error: No route to host)
08:36:29 *** Speedyn has joined #openttd
08:36:38 *** Speedy` has joined #openttd
08:44:41 *** Speedyn has quit IRC (Quit: leaving)
09:18:02 *** Lemuria has joined #openttd
09:18:02 <Lemuria> is it possible for a newgrf to add livery refits to the locomotives of a DIFFERENT newgrf?
09:18:54 <Brickblock1> not easily you have to redo all callbacks
09:19:38 <Lemuria> Assuming I have the sprites already done
09:19:48 <Brickblock1> you need the old sprites too
09:20:13 <Lemuria> Do I just copy the NML from the original newgrf's loco and define it as a completely separate loco then?
09:20:18 <JGR> It makes more sense to just provide a complete vehicle with your extra stuff in your own GRF
09:20:54 <Brickblock1> Lemuria: basically but you use `engine_override("GRFID")` somewhere is your code
09:21:18 <Lemuria> so I should just override the definitions?
09:21:44 <Lemuria> got it, thanks for the data, now i can finally move 1 step closer to having snim iron ore trains from mauritania once i find the time to do a little spriting
09:27:25 *** sla_ro|master has joined #openttd
09:34:57 <andythenorth> what is a livery refit?
09:40:00 <Lemuria> andythenorth: where you can change the livery with refits like in rukts
09:40:18 <andythenorth> I had forgotten that
09:47:33 <Lemuria> And what software do you use for spriting, is GIMP good enough or is there something much better
09:58:12 <EmperorJake> GIMP does everything I need
09:59:02 <Lemuria> I'll stick with gimp, also I finally found the palette file by searching so it's time to do some good ol' spriting
10:05:56 <Lemuria> P.S. what does the green color represent, is it primary or secondary
10:07:08 <Lemuria> so blue is primary and green is secondary?
10:08:11 <andythenorth> what is that sprite? A GE?
10:08:20 <Lemuria> im modifying the sd70ace right now
10:24:36 *** HerzogDeXtEr has joined #openttd
10:34:24 <Lemuria> where do the `template_2cc_engines_general` calls come from, is there even a template or something
10:34:50 <Lemuria> oh well then, time to read the tutorial for once
10:38:52 <andythenorth> what compile are you using?
10:45:58 <EmperorJake> Lemuria: That's probably the template that tells the code where/what size the sprites are
10:46:42 <Lemuria> and where does the template come from
10:46:58 <Lemuria> andythenorth: not sure yet i'm just copying code from the nars addon src
10:51:37 <EmperorJake> Lemuria: Should be defined near the top of the nml or in its own pnml file
10:55:17 <Lemuria> anyways, Discord channel #add-on-development
11:17:49 *** sla_ro|master has quit IRC ()
11:43:52 *** nielsm has quit IRC (Ping timeout: 480 seconds)
12:41:01 *** Etua has quit IRC (Quit: Etua)
13:21:06 <Lemuria> petern: so you're saying livery-based refits are no longer best practice?
13:21:27 <glx[d]> they are not needed anymore
13:21:28 <petern> Might be nice if variants can parent off another newgrf's engine.
13:21:41 <Lemuria> petern: yeah, would be awesome
13:22:18 <EmperorJake> I use a hybrid model for JP+ engines: liveries for liveries, variants for variants
13:22:20 <petern> I think it's possible with the newgrf override, but then you are completely sharing the 'nanespace'
13:22:38 <Lemuria> so i might have to make the lemurian sd70ace completely different and just have my liveries be variants of that lemurian sd70ace yes?
13:22:52 <ag> Kinda like how Pikka gives updates to the original Lockheed Constellation in AV8
13:24:25 <EmperorJake> Stats can change with livery refits too, but I removed those in favour of variants
13:27:21 <TallTyler> EmperorJake: Why not nest two-deep, physical changes > liveries?
13:31:13 <Fairy> variants all the way down
13:31:16 <Brickblock1> EmperorJake: The next best way
13:31:59 <Brickblock1> TallTyler: aren't you limited by ids for articulated engines?
13:34:49 <EmperorJake> I tried nesting, it's annoying because it uses 5 lines for 3 variants so I decided against it
13:34:49 <TallTyler> I believe the vehicle ID limit is massive, either 64,000 or 65,535. I donβt remember exactly from the discussion when variants were being implemented
13:36:03 <EmperorJake> and I like repainting locomotives so I'm keeping the livery refits anyway
13:36:44 <andythenorth> nesting will be combinatorially horrible π
13:36:45 <Brickblock1> TallTyler: seams I got confused by `For NML 0.2 and lower the vehicle ID of the articulated part must be in the range 0 .. 127.`
13:36:54 <andythenorth> also 'build a random engine' is the most important missing button
13:37:45 <EmperorJake> Random group liveries would be nice too
13:41:34 <ag> andythenorth: Dall-e addon maybe?/jk
13:59:42 <petern> Brickblock1: That's still 16384 IDs, it's not a problematic limit.
14:07:41 <andythenorth> 16384 object IDs when? π
14:28:38 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
14:40:55 <frosch> it is, limit for "dns labels" is 63 char
15:19:35 *** Wormnest has joined #openttd
15:21:10 *** sla_ro|master has joined #openttd
15:34:40 <petern> Can I eat all the things now?
15:51:59 <andythenorth> can I have another coffee?
15:52:37 <andythenorth> how are we versioning multiple artefacts from a monorepo?
15:52:38 <Lemuria> petern: just wait for the food train to arrive at your house
15:53:05 <Lemuria> anyways im glad i managed to finish a set of fictional livery sprites, must feel very good
15:55:31 <petern> Coffee at 15:55, good plan.
15:55:47 <Lemuria> well, unless you're doing a night shift
15:55:48 <andythenorth> have only had 2 so far today
15:56:12 <andythenorth> new coffee meta: 1 in the morning, 3 in the afternoon
15:57:35 <petern> I had 1 in the morning and 2 this afternoon. Close.
15:59:39 <andythenorth> grf name in the tag?
16:00:40 <andythenorth> seems people use / tags
16:02:33 *** WormnestAndroid has joined #openttd
16:06:15 <andythenorth> would need to refactor release workflow π
16:07:26 <glx[d]> you miss a flag for mkdir I think
16:09:08 <andythenorth> the dir name in the shell example is using the tag name
16:09:18 <andythenorth> I'd need to string split it π
16:10:11 <glx[d]> with -p it will create parent dir as needed
16:14:27 <andythenorth> monorepos are a headache π
17:05:47 <andythenorth> `def monorepo():
17:05:47 <andythenorth> return get_tag_exact_match().split("/")[1]
17:24:40 *** ChanServ sets mode: +v tokai
17:26:02 <andythenorth> ok GPT gave me a solution
17:26:08 <andythenorth> I had to argue with it for a long time
17:26:21 <andythenorth> it kept teaching me about semver and writing a release.txt
17:31:21 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
17:33:47 <Eddi|zuHause> "person who knows how to talk to an AI to give sane results" might be a new job
17:35:12 <Eddi|zuHause> get_tag_exact_match().split("/")[1] <-- shouldn't there be functions in "os" for that?
17:47:04 <andythenorth> it's splitting a tag name string that happens to have / in it by convention
17:47:37 <andythenorth> os.path.split might not be the solution there π
17:52:14 <LordAro> Eddi|zuHause: wouldn't work on windows
17:53:14 <andythenorth> monorepo tagging is not widely written about, or I'm googling the wrong things
17:53:33 <andythenorth> most of the references are "everyone just does foo/x.y.z"
17:53:33 <Eddi|zuHause> not sure what that means
17:53:41 <LordAro> Eddi|zuHause: os.path stuff only uses backslashes on windows, iirc
17:54:02 <Eddi|zuHause> LordAro: i got that, that's not what i'm talking about
17:54:37 <Eddi|zuHause> LordAro: i meant "why split the tag"?
17:54:40 <andythenorth> actually, what does git return for a tag in the form "foo/x.y.z" on windows?
17:55:03 <andythenorth> as the dir structure is actually tags/foo/x.y.z on the filesystem
17:56:41 <andythenorth> GPT says windows will return "foo/x.y.z"
17:57:28 <LordAro> "as the dir structure is actually ..." what?
17:57:36 <LordAro> git tags are just names
17:57:42 <LordAro> you're thinking of svn
18:00:51 <andythenorth> it seems there are some advanced uses in the monorepo case, for release workflows
18:01:06 <andythenorth> but it's all a new world to me π
18:02:04 <andythenorth> wonder if git tag can filter on patterns
18:03:08 <andythenorth> `git tag --list "horse-test/*"`
18:11:29 <petern> I was going to make a PR on Tuesday but...
18:24:16 <dP> horse has some really weird pax options though
18:29:21 <dP> auto coach train is show as stopped in the depot but it can be reversed
18:30:05 <dP> and reversing removes it from the depot but it's still stopped
18:31:18 <dP> andythenorth: why didn't you just use start-stop callback for auto coaches?
18:31:38 <dP> you seem to be setting 0 max speed and that bugs out the game
18:41:59 <DorpsGek> - Update: Translations from eints (by translators)
18:54:04 <TallTyler> I'm working on resolving CodeQL trivial switch warnings by changing to return-early `if` statements, and...what the heck is this?
19:05:30 <frosch> why are you working on that?
19:05:42 <frosch> turning that into an "if" does not make the code better
19:05:52 <frosch> and whoever adds a new widget next, will have to readd the switch
19:06:24 <frosch> warnings are a suggestion, but depending on context you do not have to follow them
19:09:16 <andythenorth> dP: We what now? Reversed how? Itβs articulated π
19:10:58 <TallTyler> frosch: A trivial switch warning is blocking #10519, so #10537
19:12:09 <frosch> since when is codeql check mandatory?
19:13:00 <TallTyler> Rubidium suggested as much in #10519 π€·
19:13:47 <TallTyler> The specific suggestion to change to return-early ifs was made in #10537
19:15:36 <TallTyler> I would love to not have to make these changes, I'm just following suggestions of people much more senior than I π
19:16:26 <nielsm> there isn't a way to put some comment in the code to tell CodeQL to silence a specific warning somewhere?
19:16:40 <frosch> codeql does the checks based on the knowledge it has. all/most widget methods get a "widget" id passed, because we do not do proper oo-gui stuff
19:17:25 <frosch> as a result all widget-handlers have a switch-case, because the cases are usually not related (and would be separate methods in any modern gui framework)
19:18:07 <frosch> code should reflect intention. it does not make sense to work around warnings, just because the code-checker does not know the intention of the code
19:18:20 <dP> andythenorth: idk, there is reverse button and it does smth
19:18:20 <LordAro> i agree, disable the trivial switch check rather than anything else
19:18:44 <LordAro> possibly with a cursory review of them to fix any "genuine" issues
19:19:11 <dP> andythenorth: also wth with wagon balance? smaller, older(I presume) wagons are better
19:19:49 <andythenorth> dP: Oh that reverse. If that doesnβt work, I claim OpenTTD bugβ¦
19:19:55 <dP> though weight ration is a bit worse but don't think it's significant...
19:21:12 <TallTyler> I think the second should be a second case, although that would trigger the "too long switch case" warning π
19:22:42 <frosch> TallTyler: in other gui frameworks, every switch-case would be a separate function. so if you really want to, one could split the method into separate functions, and just call them from the switch
19:22:59 <TallTyler> I was in the process of that when you asked me why I was changing things π
19:23:33 <frosch> i assumed you were converting switches into "if"s
19:23:37 <TallTyler> Although I was having `this->` issues
19:23:42 <TallTyler> Well, I was doing that too
19:24:08 <frosch> "this->" is some weird ottd thing, i never saw that somewhere else
19:24:39 <frosch> no idea who came up with that
19:25:04 <frosch> maybe kudr... now that i think about it, there are some tricks you can do with "this->" in templates :;p
19:25:10 <andythenorth> dP: what breaks?
19:29:47 <TallTyler> That example is the only truly sketchy thing I found in my review. The rest are widgets, hotkeys, and some random mix of other stuff
19:30:20 <dP> andythenorth: idk, logic? :p I'd assume newer and larger vehicles to be better
19:30:46 <andythenorth> Nah I mean the autocoach thing
19:31:16 <dP> if you make a train with just autocoaches and run it game bugs out
19:31:33 <andythenorth> Seems like more articulated vehicle bugs
19:31:58 <dP> it probably has max speed 0
19:32:50 <TallTyler> That, and I still don't know why this uses GB()
19:34:40 <frosch> TallTyler: line 2042 says, there is "type" in the other bits
19:34:55 <frosch> i guess it's something special with NWID_MATRIX
19:35:16 <frosch> it probably puts the "cell" into the upper bits
19:35:44 <andythenorth> It has power 10hp no?
19:36:51 <dP> well, maybe it's not enough to rly move
19:37:27 <dP> either way it's pretty broken :p
19:37:33 <dP> should probably have start-stop callback
19:37:49 <dP> if they're not supposed to be run without an engine
19:37:53 <LordAro> frosch: what makes "this->" some weird ottd thing?
19:38:28 <frosch> that we always use "this->foobar" to read a member variable "foobar"
19:39:09 <frosch> in some cases we even have local variables with the same name, and use "this" to work around the shadowing
19:39:23 <LordAro> makes things immediately unambiguous
19:39:25 <dP> I also use this-> for ages, though I may have picked that up from openttd
19:39:46 <frosch> any other project i saw uses prefixes for members, "_" or "m" or something
19:40:11 <frosch> i only know "this->" from ottd π
19:40:27 <frosch> but, ok, python and all the script languages do it similar
19:40:44 <frosch> and c++ now also has that explicit-this thingie, i forgot its name
19:42:52 <dP> how long will it take c++ to become python? xD
19:43:19 <frosch> c++ is a multi-paradigm language, that means it want to become both python and rust π
19:44:22 <JGR> I'd never heard of that, but if it means not having endlessly duplicate for const/non-const, I'm all for it
19:45:03 <frosch> it's c++23, so you have to wait 5 years until ottd uses it
19:45:06 <dP> frosch: well, feels like it already become perl :p
19:45:35 <frosch> no, at no point was c++ as awful as perl
19:46:04 <JGR> perl doesn't have to be bad
19:46:06 <frosch> perl is a category of its own
19:46:51 <dP> idk, openttd command templates are among the least readable code I've even seen
19:47:01 <dP> and that includes perl and og basic without functions
19:47:55 <TallTyler> frosch: Rookie question, how do I fix the `this->` calls within the new function which does the work previously contained in the switch case? It needs to refer to that original window which calls it, not itself.
19:48:35 <frosch> make your function a member function, no free function
19:49:17 <TallTyler> How would it be called within the switch case, then?
19:49:46 <andythenorth> I never used start-stop cb, isnβt it just for enforcing realism?
19:50:31 <dP> well, in this case it would just be enforcing sanity π
19:51:22 <frosch> ah, "DrawWidget" is "const"
19:51:28 <frosch> also put that after your method
19:51:34 <andythenorth> Is hp/ton a var yet? π
19:51:49 <TallTyler> Ah, that fixed it, thanks
19:52:16 <frosch> the "const" after the method refers to "this"
19:52:39 <frosch> by default "this" has type "BuildRailWaypointWindow *", but with that "const" it will become "const BuildRailWaypointWindow *"
19:53:02 <dP> ok, I think I'll settle on this selection for now
19:53:08 <dP> and make everything else hidden by default
19:54:36 <andythenorth> Just recompile and nerf all the others
19:54:47 <andythenorth> Compile will be like 1s
19:55:26 <dP> I don't want to be making a fork
19:56:15 <dP> also want to try this hiding solution as it seems like a good idea
19:56:22 <frosch> the polish train set has been forked twice now (3 sets in total), so horse has some time to catch up to beomce the most-forked vehicle set
19:56:27 <dP> whoever wants other stuff can always enable
19:56:39 <dP> but it doesn't get in the way at the start of the game
19:57:39 <dP> I kinda forked NUTS three times already xD
20:13:18 <audigexJon> frosch: BRSet/BRTrains/BritSet/BROS/BRSet would like a word
20:14:14 <audigexJon> And there was another fork along the way that I donβt think ever got a separate name
20:17:36 <andythenorth> FIRS: most forks
20:17:51 <frosch> ok, the brits win π
20:18:18 <andythenorth> Grf property: vehicle hidden by default?
20:18:45 <andythenorth> dP: I could hide them all in a variant? π€ͺ
20:19:10 <andythenorth> βCitymania parameterβ
20:21:50 <dP> nah, that's kinda pointless
20:22:00 <dP> I'll need a parameter for every game mode xD
20:22:09 <dP> better just solve it on my side
20:22:54 <andythenorth> We need monkey patching for grf
20:23:37 <dP> I need monkey patching with GS xD
20:23:54 <andythenorth> You can monkey patch GS :p
20:23:55 <dP> configuring servers by making newgrfs is also not the best solution xD
20:27:03 <dP> best universal, best pax and best mail
20:27:12 <dP> with large versions for better weight ratio
20:29:57 <dP> and better cargo density I guess xD
20:30:58 <andythenorth> dP: Wagon speed limits off?
20:33:57 <dP> andythenorth: oh, that's a thing π
20:42:01 <dP> ok, everything makes a lot more sense with speed limits π
20:42:11 <dP> I'll keep them off though π€£
20:43:15 <Kuhnovic> I have a very specific question. Does anyone know why the yapf ship pathfollow caches paths except for the last 16 tiles? There must be a reason for this but I can't figure it out. Or maybe somebody can tell me who the pathfinding guru is so I can contact them...
21:09:46 <frosch> Kuhnovic: isn't there some load balancing to reach different docking tiles?
21:11:57 <Kuhnovic> frosch: The cost calculation does indeed take the occupancy of docking tiles into account, maybe that is the reason indeed...
21:12:47 <Kuhnovic> Seems a little excessive to run relatively expensive pathfinder calls for that, but it does look nice when ships spread themselves out a bit
21:14:32 <frosch> it's the same for all vehicles. on short distance it checks road/rail/station/signal/level-crossing occupation, on long distances it ignores them (since they would change anyway until the vehicle reached their location)
21:18:08 <frosch> i also recall some magic with buoys. while ships head for their location, they assume "destination reached" already a few tiles away from them
21:18:48 *** bryjen has quit IRC (Quit: Leaving)
21:19:46 <Kuhnovic> Yes buoys do that indeed, I saw that logic. It seems pretty sensible though, real ships try not to go through buoys if at all possible π
22:08:51 <glx[d]> actually in the description I only talk about `require()` but libraries are loaded via `import()` whiwh I guess had the same issue
22:41:12 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:11:16 *** nielsm has quit IRC (Ping timeout: 480 seconds)
23:30:03 *** Eddi|zuHause has quit IRC (Remote host closed the connection)
23:30:44 *** Eddi|zuHause has joined #openttd
23:48:08 *** sla_ro|master has quit IRC ()
continue to next day β΅