IRC logs for #openttd on OFTC at 2024-02-14
            
00:00:50 <xarick> 20.3 GB ram for debugging this savegame
00:01:06 <xarick> and I thought I'd be fine with 32 GB RAM
00:02:29 <xarick> can someone here try to identify the cause of this surge in demand, if it's possible to make it not use that much memory while debugging?
00:03:34 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207114879446548500/image.png?ex=65de7856&is=65cc0356&hm=0c9772140f1bcc777708d1ff83a9748053c894ef5d64519ed3c22eedbd12bca5&
00:03:34 <xarick> anyway, got what I was looking for
00:04:27 <xarick> I'm surprised no limits have been reached yet
00:04:49 <xarick> only 30k stations, impressive management for AAAHogEx
00:22:46 <DorpsGek> [OpenTTD/OpenTTD] github-advanced-security[bot] commented on pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1879171877
00:35:59 *** sims_doc has quit IRC (Quit: User went offline on Discord a while ago)
00:46:41 <_glx_> vehicle and cargopackets most likely
00:53:41 <_glx_> AIs seem to use around 8GB
03:08:40 *** D-HUND has joined #openttd
03:12:16 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:15:56 *** gnu_jj has joined #openttd
03:19:05 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:19:10 *** Wormnest has quit IRC (Quit: Leaving)
03:29:50 <johnfranklin> https://cdn.discordapp.com/attachments/1008473233844097104/1207166786324144158/IMG_3305.jpg?ex=65dea8ad&is=65cc33ad&hm=cf1c4d52f7b995c6f7ce3047e349b276f829239aad9647e05197bcf92a181bae&
03:29:50 <johnfranklin> Such book
03:31:12 <wensimehrp> Pain
04:26:51 *** blikjeham[m] has quit IRC (Quit: Client limit exceeded: 20000)
06:00:29 *** keikoz has joined #openttd
06:25:50 *** D-HUND is now known as debdog
06:31:04 *** Taco has quit IRC (Remote host closed the connection)
07:56:52 *** gelignite has joined #openttd
07:57:30 *** keikoz has quit IRC (Ping timeout: 480 seconds)
08:10:49 *** _pruple has joined #openttd
08:10:49 <_pruple> Butch sock
08:37:32 *** georgevb has joined #openttd
08:37:32 <georgevb> https://newgrf-specs.tt-wiki.net/wiki/NML:Railtypes
08:37:32 <georgevb> > town_zone town zone Town zone of the tile. (Only available for level crossings and depots.)
08:37:32 <georgevb> Would it be hard to make town_zones available for all the other rail objects?
08:37:32 <georgevb> I would like to have different snow graphics in and outside the towns.
08:37:32 <georgevb> Also there is an old issue with removing fenses in snow and desert. It would be nice to allow GRFs to control that (and draw fenses above the snow line)
09:14:01 <andythenorth> meh Horse compile takes > 30 seconds
09:14:08 <andythenorth> how do I make it faster?]
09:14:14 *** keikoz has joined #openttd
09:14:22 <LordAro> knowing where it's slow would be a good start
09:14:43 <andythenorth> [RENDER GRAPHICS] iron-horse - complete 6.81s
09:14:44 <andythenorth> etc
09:15:11 <andythenorth> it's a makefile that calls various render / compile steps, which are partially orthogonal
09:15:41 <andythenorth> some of the current performance is achieved with make -j
09:16:20 <andythenorth> individual steps are timed, but the total time is less than their individual times, due to the parellelisation
09:17:56 <andythenorth> I can piss around with the steps I control, but nmlc remains the bulk of the time ๐Ÿ˜„
09:17:56 <andythenorth> `../../pypy3/bin/nmlc -l generated/lang/iron-horse --verbosity=4 15.67s user 1.66s system 98% cpu 17.584 total`
09:18:38 <andythenorth> parsing 7.5s, preprocessing 5.7s
09:20:36 <_jgr_> Probably the easiest way is to make it shorter
09:20:58 <_jgr_> I'd imagine that because of the templates there is a lot of duplication
09:22:39 <andythenorth> at one point, on an older mac, it was taking around 1m 20s in the worst cases
09:22:57 <andythenorth> the speed increases were multifactor
09:23:43 <andythenorth> - faster mac
09:23:43 <andythenorth> - nmlc performance improvements
09:23:43 <andythenorth> - consolidate repeating nml switch chains to single procedures
09:23:43 <andythenorth> - use pypy3
09:27:14 <andythenorth> hmm there's a new pypy3
09:28:38 <reldred> I'm currently compiling opengfx2. Don't complain about your compile times ๐Ÿ˜›
09:38:04 <xarick> https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1879171877
09:38:04 <xarick> which const?
09:39:21 <andythenorth> oops, failed to rebase this to current nml master ๐Ÿ™‚ https://github.com/OpenTTD/nml/pull/309
09:39:58 <reldred> straight to jail
09:40:11 <andythenorth> kinda wrote nml that depends on it ๐Ÿ™‚
09:40:14 <andythenorth> oops
09:42:41 <peter1138[d]> xarick: The one it says.
09:43:24 <andythenorth> the new pypy3 is twice as slow as the old one
09:43:28 <andythenorth> not ideal ๐Ÿ™‚
09:43:51 <reldred> yay python!
09:47:45 *** thelounge345 has quit IRC (Quit: The Lounge - https://thelounge.chat)
09:50:58 *** thelounge345 has joined #openttd
09:55:51 <andythenorth> 'oops'
09:56:07 <andythenorth> I was testing with x86 pypy, on ARM
09:56:08 <andythenorth> ๐Ÿ˜›
09:56:54 <LordAro> that'll do it
09:57:06 <andythenorth> it did ๐Ÿ™‚
09:59:56 <peter1138[d]> If only Apple could decide which CPU type they're running on today.
10:01:09 <peter1138[d]> Monday it's 68000, the next it's PowerPC, then it's x86-64 and by Thursday they've switched to ARM...
10:02:45 <andythenorth> RISC or CISC eh
10:02:54 <andythenorth> how about co-processors? ๐Ÿ˜›
10:07:03 <andythenorth> wow
10:07:17 <andythenorth> `../../py312/bin/nmlc -l generated/lang/iron-horse --verbosity=4 72.49s user 1.79s system 99% cpu 1:14.88 total`
10:07:17 <andythenorth> `../../pypy3/bin/nmlc -l generated/lang/iron-horse --verbosity=4 15.30s user 1.59s system 98% cpu 17.169 total`
10:07:22 <andythenorth> glad I use pypy ๐Ÿ˜›
10:08:28 <xarick> okay, I'm gonna guess it's the const on the left side
10:13:01 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087
10:13:16 <peter1138[d]> xarick: No need to guess. What to you think a "return type" is?
10:17:15 <andythenorth> wonder if CodePilot could port nmlc parser to rust
10:18:22 <andythenorth> also if I could stop nmlc validating all of the sprites, it would cut 1.5s from every compile
10:18:22 <andythenorth> https://github.com/OpenTTD/nml/pull/254
10:18:39 <andythenorth> but my PR is 'weird' (my own choice of words)
10:18:56 <andythenorth> 5% saving just by eliminating something pointless
10:28:43 *** gelignite has quit IRC (Quit: Stay safe!)
10:43:19 <peter1138[d]> Me: does nothing
10:43:19 <peter1138[d]> Teams: hey, sign in again.
10:43:45 <peter1138[d]> Teams: We're sorryโ€”we've run into an issue.
10:44:22 *** D-HUND has joined #openttd
10:46:26 <reldred> Teams: hey use he new version!
10:48:54 <peter1138[d]> I love the way it loads up, shows all my contacts and the last conversation I was... but shows a modal panel on top saying my login session is invalid.
10:49:14 <peter1138[d]> If my session is invalid, why the heck are you disclosing all that other stuff?
11:04:00 <merni> Teams is pretty crappy
11:04:18 <merni> But I feel the android app is actually a lot better
11:06:27 <peter1138[d]> Not very useful other than chatting though, and I don't really want to chat with colleagues.
11:08:23 <merni> makes sense
11:08:32 <merni> It's just a lot less glacially slow
11:20:43 <xarick> ``` /** Bitmask of airport flags. */
11:20:43 <xarick> enum Flags {
11:20:43 <xarick> AIRPLANES = 0x1, ///< Can planes land on this airport type?
11:20:43 <xarick> HELICOPTERS = 0x2, ///< Can helicopters land on this airport type?
11:20:43 <xarick> ALL = AIRPLANES | HELICOPTERS, ///< Mask to check for both planes and helicopters.
11:20:44 <xarick> SHORT_STRIP = 0x4, ///< This airport has a short landing strip, dangerous for fast aircraft.
11:20:44 <xarick> };```
11:20:46 <xarick> Hmm, how do I translate this to AIAirport code
11:24:33 <_glx_> Like it's done in any other class
11:26:28 <xarick> 3 bool functions?
11:26:55 <xarick> plane + airport type function?
11:27:22 <johnfranklin> Microsoft is somehow sh*t, but others are just worse
11:28:00 <xarick> CanAircraftLandOnAirport
11:28:51 <xarick> 0 - no, not at all, 1 - yes, safely, 2 - yes, but unsafe
11:33:47 <peter1138[d]> That seems a big rigid.
11:34:38 <_glx_> Just define constants in the class
11:36:14 <_glx_> But a CanUse bool should be a good start too
12:10:42 *** thelounge345 has quit IRC (Ping timeout: 480 seconds)
12:28:17 <xarick> I think I'm going with just 1 function
13:27:42 *** Flygon has quit IRC (Read error: Connection reset by peer)
13:31:30 *** gelignite has joined #openttd
13:40:26 <peter1138[d]> Oh, that's why the house is cold.
13:40:36 <peter1138[d]> I let the dogs out earlier and they didn't close the door behind them...
13:44:27 *** nielsm has joined #openttd
13:44:49 *** gelignite has quit IRC (Quit: Stay safe!)
13:51:46 <andythenorth> skill issues
14:05:45 <peter1138[d]> I'm doing an Audax on Saturday. Shall I do it properly?
14:08:44 <DorpsGek> [OpenTTD/nml] PeterN commented on pull request #309: Change: Use extended Action1s https://github.com/OpenTTD/nml/pull/309#issuecomment-1943840438
14:17:09 *** D-HUND has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
14:17:49 <_glx_> so we use <http://squirrel-lang.org/doc/squirrel2.html#sq_setparamscheck> but only with >0 nparam, seems it should be simple to detect default params and use <0 nparam
14:18:25 <_glx_> the only issue is there's no check for upper limit in this case
14:18:52 <_glx_> because squirrel also supports `...`
14:19:54 <LordAro> peter1138[d]: define "properly"
14:19:57 <LordAro> also hype
14:20:07 <peter1138[d]> Filling in the brevet card...
14:20:19 <LordAro> of course!
14:20:23 <peter1138[d]> Kinda have to otherwise you haven't done it!
14:20:31 <LordAro> quite
14:20:39 <LordAro> a 200?
14:20:43 <peter1138[d]> Yes
14:20:54 <peter1138[d]> Going to be a stuggle, I'm unfit ๐Ÿ˜ฎ
14:20:59 <LordAro> nah, you'll do fine :D
14:21:03 <LordAro> not a race :p
14:21:07 <peter1138[d]> Hahahahahahaa
14:21:25 <peter1138[d]> Question from another guy doing it... "will we need lights"
14:21:30 <peter1138[d]> Yes. Yes you will.
14:21:42 <LordAro> Decent chance at this time of year
14:21:48 <LordAro> unless you're very quick
14:34:05 <DorpsGek> [OpenTTD/nml] glx22 commented on pull request #309: Change: Use extended Action1s https://github.com/OpenTTD/nml/pull/309#issuecomment-1943914759
14:34:17 *** Ox7C5 has joined #openttd
14:50:31 <LordAro> peter1138[d]: you got a good group doing it then?
14:50:45 <LordAro> or perhaps, "group"
14:51:22 <peter1138[d]> Few of us doing it as it starts here.
14:55:21 <DorpsGek> [OpenTTD/team] ignaciop opened issue #507: [es_ES] Translator access request https://github.com/OpenTTD/team/issues/507
14:57:54 <DorpsGek> [OpenTTD/team] glx22 commented on issue #507: [es_ES] Translator access request https://github.com/OpenTTD/team/issues/507
15:06:56 *** matheusvhs has joined #openttd
15:06:56 <matheusvhs> Can you add an option on the new game screen about the amount of money we are going to start with, please?
15:09:07 <matheusvhs> Like, on the new game screen, there is an option for you to choose the amount like: 50k, 100k, 200k, 300k
15:14:12 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick opened pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088
15:16:44 <_glx_> matheusvhs: there's "maximum initial loan" settings, and also "infinite money" now
15:36:15 <LordAro> the amount of actual money you get to start with is fixed
15:41:53 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207351012113907762/image.png?ex=65df5440&is=65ccdf40&hm=fbfff0ea29c5f661373545a534ce1f1d15612124f14069a05a1e52729b6ef301&
15:41:53 <xarick> seriously?
15:42:07 <xarick> it's handled before the switch
15:42:24 <LordAro> compilers are extremely clever
15:42:26 <LordAro> until they're not
15:42:35 <LordAro> and static analysis is actually quite hard
15:42:36 <jfs> add a default case for it then
15:42:43 <LordAro> default: NOT_REACHED();
15:43:01 <xarick> okay, but that NOT_REACHED() will never trigger
15:43:07 <LordAro> that's the point
15:43:16 <xarick> fine
15:43:59 <talltyler> Right, itโ€™s intended to never be reached, and shout at you if you make a mistake and it is somehow reached ๐Ÿ™‚
15:44:12 <talltyler> Like an assert
15:44:47 <LordAro> often you can rely on the compiler to shout at you, but there are times where it's not possible, like here
15:44:53 <xarick> it wasn't supposed to crash openttd though
15:46:03 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088
15:50:50 <talltyler> It wonโ€™t crash OpenTTD because youโ€™ve already handled the case before the switch
15:51:11 <talltyler> You could also remove that and handle it within the switch with a default case that returns -1.
15:51:28 <talltyler> Which actually might be a simpler option here.
15:52:29 <xarick> wow, i agree, brb changing
15:53:05 <xarick> hmm maybe not
15:53:14 <xarick> if someone invents a new aircraft type
15:53:20 <xarick> that's going to return -1
15:53:29 <xarick> oh whatever
15:53:50 <xarick> still gonna return -1 before entering the switch
15:54:16 <xarick> I'm unsure what to do
15:55:27 <xarick> think I'm leaving NOT_REACHED() for now
15:55:34 <xarick> see if it will complain
15:57:52 <talltyler> I think the odds of someone inventing a new aircraft type are minimal ๐Ÿ˜‰
15:58:04 <talltyler> And they would just have to update this as part of their PR.
15:59:53 <talltyler> Not your work, but in what order are the script changelogs? It looks like partially alphabetic and partially random ๐Ÿ˜›
16:00:14 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1880672392
16:00:22 <peter1138[d]> you can do case PT_INVALID: return -1
16:00:35 <truebrain> talltyler: Wait there is an order?+
16:00:36 <peter1138[d]> Then it another planetype is ever introduced, that switch block won't handle it.
16:01:50 <talltyler> Maybe there isnโ€™t an order, but it looks partially alphabetic
16:01:54 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1880687941
16:02:22 <talltyler> I wonder something similar every time I add a new #include and then stick it wherever feels right
16:02:25 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1880689172
16:05:19 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087#pullrequestreview-1880695693
16:08:02 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #12085: Add: [Script] GetAirportNumHelipads https://github.com/OpenTTD/OpenTTD/pull/12085#pullrequestreview-1880701684
16:08:58 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087
16:11:09 <peter1138[d]> ScriptAirport is a bit of a mess, it's a mix of airport instances and airport prototypes and no obvious indication of what's what.
16:11:50 <peter1138[d]> I guess they're all like this ๐Ÿ˜ฎ
16:11:53 <talltyler> That old GetNumHangers() is such a strange implementation. Pass any tile of the airportโ€ฆ? Really?
16:12:11 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #12084: Add: [Script] GetAirportNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084#pullrequestreview-1880710755
16:14:29 <peter1138[d]> talltyler: Should be replaced with `GetAirportNumHangars(GetAirportType(tile))`
16:15:10 <peter1138[d]> (With a validity check)
16:18:18 <xarick> hmm
16:19:14 <peter1138[d]> Should -> Could
16:19:40 <xarick> maybe
16:20:06 <xarick> reworking a function to work differently
16:20:12 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088#pullrequestreview-1880713341
16:20:24 <xarick> hmm, i guess it's gonna be ok
16:25:04 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088
16:25:58 <xarick> how do you deprecate a function but still make it compatible
16:26:05 <xarick> never tried doing that
16:27:06 <_glx_> in compat files
16:29:20 <_glx_> AISign.GetMaxSignID in compat_0.7 is a nice example
16:31:50 <xarick> I see
16:32:14 <xarick> I worry it's gonna cause confusion
16:32:38 <xarick> but probably not, since the old name is gone when using the most recent API version
16:34:08 <_glx_> 1.1 removed HasNext in all lists too
16:34:25 <xarick> how would I deal with EnforceDeityOrCompanyModeValid(-1);
16:35:08 <_glx_> which function do you want to deprecate ?
16:35:10 <xarick> compat files have no access to generate the error
16:35:19 <xarick> /* static */ SQInteger ScriptAirport::GetNumHangars(TileIndex tile)
16:35:35 <_glx_> just call the new one from it
16:36:19 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088#pullrequestreview-1880763846
16:44:13 *** wpiwpi has joined #openttd
16:44:13 <wpiwpi> when should the 14.0 translations be finished at the latest?
16:45:00 <wpiwpi> (asking as a translator)
16:46:07 <_glx_> before april I'd say
17:05:55 <xarick> I'm confused, what do I do?
17:06:40 <xarick> GetNumHangars with AirportType instead?
17:07:01 <xarick> or GetAirportNumHangars with AirportType and delete GetNumHangars with TileIndex?
17:14:21 <xarick> conversion will be complicated
17:15:43 *** HerzogDeXtEr has joined #openttd
17:17:04 <xarick> GetHangarOfAirport is also affected
17:21:26 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12089: Fix: NewGRF roadstops were ignored if only in default class. https://github.com/OpenTTD/OpenTTD/pull/12089
17:25:45 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #12089: Fix: NewGRF roadstops were ignored if only in default class. https://github.com/OpenTTD/OpenTTD/pull/12089#pullrequestreview-1880866422
17:29:16 <_glx_> conversion is the easy part
17:29:40 <xarick> hmm it uses any tile of the station
17:30:43 <_glx_> yes and you have ScriptAirport::GetAirportType to translate tile to type
17:31:26 <xarick> oh, i see, nvm
17:31:33 <_glx_> so the conversion is really simple
17:33:39 <xarick> I think I'm gonna modernize GetHangarOfAirport while I'm at it
17:36:31 <xarick> too much work
17:38:29 <peter1138[d]> Haha
17:39:03 <LordAro> literally 3 minutes
17:44:23 *** Wormnest has joined #openttd
17:48:55 <xarick> neither GetAirportType or GetAirportNumHangars check for ownership
17:49:33 <xarick> the conversion is missing something
17:50:25 <xarick> ```/* 14 replaced GetNumHangars with GetAirportNumHangars */
17:50:25 <xarick> AIAirport.GetNumHangars <- function(tile)
17:50:25 <xarick> {
17:50:25 <xarick> return AIAirport.GetAirportNumHangars(AIAirport.GetAirportType(tile));
17:50:25 <xarick> }```
17:50:39 <xarick> and the GetLastError is gone
17:50:55 <xarick> feels wrong
18:03:36 <peter1138[d]> That isn't what I meant at all. Best to leave it as it was.
18:13:54 <xarick> can't use IsAirportTile either, that one requires the specified tile to really be airport
18:17:51 <_glx_> IsAirportTile is used to check tile type, it can't require anything
18:24:23 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12090: Change: Switch road stop window between 6 or 2 orientations depending on road stop type. https://github.com/OpenTTD/OpenTTD/pull/12090
18:29:35 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick dismissed a review for pull request #12084: Add: [Script] GetAirportNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084#pullrequestreview-1880710755
18:29:38 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12084: Add: [Script] GetAirportNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084
18:37:10 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/ac5eaecd1573b0032e67219e9a03cbbce4608d8b
18:37:11 <DorpsGek> - Update: Translations from eints (by translators)
18:41:08 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick commented on pull request #12083: Add: [Script] Hangar index parameter to ScriptAirport::GetHangarOfAirport https://github.com/OpenTTD/OpenTTD/pull/12083#issuecomment-1944393306
18:41:38 <xarick> just putting all the stuff we discussed into the PRs
18:41:49 *** gelignite has joined #openttd
18:43:10 *** Wolf01 has joined #openttd
18:45:10 *** thelounge345 has joined #openttd
18:49:00 <xarick> not sure about adding a function to get airport type name
18:49:23 <peter1138[d]> Type name isn't very relevant.
18:51:00 <xarick> it's just numbers and bools otherwise
18:51:12 <xarick> well, okay
18:52:09 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #12084: Add: [Script] GetAirportNumHangars; Remove: [Script] GetNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084#pullrequestreview-1881023528
18:52:41 <_glx_> Let the functions do their own checks
18:53:45 <peter1138[d]> Numbers and bools is all you want.
18:55:13 *** thelounge345 has quit IRC (Quit: The Lounge - https://thelounge.chat)
18:57:56 <_glx_> Hmm actually it's probably not even needed to check for AT_INVALID, GetAirportNumHangar should handle it
18:59:09 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207400658949636106/image.png?ex=65df827d&is=65cd0d7d&hm=8df51b22ae3c0e9573ba2dc717e7bcb7fa2023ca8a6d985489c9a1c14dada386&
18:59:09 <xarick> without names it's quite difficult
19:00:21 <xarick> AirportType 9 was skipped?
19:21:19 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12089: Fix: NewGRF roadstops were ignored if only in default class. https://github.com/OpenTTD/OpenTTD/pull/12089
19:22:41 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #12091: Cleanup: Remove declaration of non-existent function. https://github.com/OpenTTD/OpenTTD/pull/12091
19:24:34 <peter1138[d]> Hmm, what's the cost of a fairly long-lived lambda with captures...
19:25:51 <peter1138[d]> And is it valid for the lambda to be called after the capture has gone out of scope?
19:26:18 <frosch123> depends whether you capture by value or by reference
19:30:00 <frosch123> https://cdn.discordapp.com/attachments/1008473233844097104/1207408420668575754/image.png?ex=65df89b8&is=65cd14b8&hm=f4e2d35a5ceb09e78df8bbcd50e59ac63760a8621448e21c86ceac6bd41a6622&
19:30:00 <frosch123> i recommend https://cppinsights.io/ to understand lambdas. e.g:
19:30:31 <peter1138[d]> Huh, that's neat.
19:30:47 <peter1138[d]> No longer looks like complete magic like that ๐Ÿ™‚
19:37:44 <DorpsGek> [OpenTTD/OpenTTD] JGRennison opened issue #12092: [Bug]: Incorrect x-axis in cargo payment graph window https://github.com/OpenTTD/OpenTTD/issues/12092
19:48:33 <xarick> I was thinking Airport orientation, but I guess there's no point...
20:19:19 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #12091: Cleanup: Remove declaration of non-existent function. https://github.com/OpenTTD/OpenTTD/pull/12091#pullrequestreview-1881228799
20:28:07 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12091: Cleanup: Remove declaration of non-existent function. https://github.com/OpenTTD/OpenTTD/pull/12091
20:37:01 *** gelignite has quit IRC (Quit: Stay safe!)
20:38:36 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #12085: Add: [Script] GetAirportNumHelipads https://github.com/OpenTTD/OpenTTD/pull/12085
21:01:56 <xarick> conflicts:)
21:02:33 <_glx_> yeah all your PRs touch the same file ๐Ÿ™‚
21:08:10 <xarick> it's gonna be a bit of back and forth I see
21:08:48 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088
21:09:01 *** Ox7C5 has quit IRC (Quit: Lost terminal)
21:16:53 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12084: Add: [Script] GetAirportNumHangars; Remove: [Script] GetNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084
21:19:14 <DorpsGek> [OpenTTD/nml] glx22 updated pull request #309: Change: Use extended Action1s https://github.com/OpenTTD/nml/pull/309
21:19:17 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #12084: Add: [Script] GetAirportNumHangars; Remove: [Script] GetNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084#issuecomment-1944626912
21:21:38 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #11993: Feature: Support more number formats than just the 'Western' one https://github.com/OpenTTD/OpenTTD/pull/11993
21:23:48 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12087: Add: [Script] GetAirportNumTerminals https://github.com/OpenTTD/OpenTTD/pull/12087
21:25:52 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:26:37 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12083: Add: [Script] Hangar index parameter to ScriptAirport::GetHangarOfAirport https://github.com/OpenTTD/OpenTTD/pull/12083
21:26:42 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #12088: Add: [Script] CanPlaneUseAirport https://github.com/OpenTTD/OpenTTD/pull/12088#issuecomment-1944648891
21:35:32 *** Flygon has joined #openttd
21:36:46 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #12090: Change: Switch road stop window between 6 or 2 orientations depending on road stop type. https://github.com/OpenTTD/OpenTTD/pull/12090#pullrequestreview-1881331406
21:38:38 <xarick> oh, glx is right! I am blind
21:39:28 <xarick> ScriptStation::HasStationType is called from GetAirportType
21:39:30 <_glx_> oh and I agree with peter, you can keep GetNumHangars
21:40:02 <_glx_> just make it do the same as what you did in squirrel compat
21:40:03 <peter1138[d]> Can I make a suggestion here.
21:40:15 <xarick> which has a IsValidStation to test the preconditions and owner
21:40:58 <peter1138[d]> A load of Airport-related API calls can easily be in one single PR.
21:41:45 <_glx_> (issue with that is he often puts too much in PR)
21:41:51 <peter1138[d]> But also, we need to make sure the design is sound and not just a bunch of random calls that need to be changed in the future.
21:43:14 <jfs> what if it was instead like, GetAirportSchematic() which then returns an object with various fields describing the airport, instead of having to ask for things one by one
21:43:59 <xarick> my use case for GetNumHangars, let me post...
21:44:24 <jfs> nobody's questioning that it's useful
21:44:41 <jfs> the thing being questioned is the specific implementation and delivery
21:44:49 <_glx_> hmm passing objects to squirrel from C is not straight forward
21:45:25 <jfs> do objects in Squirrel have to be of a predefined class?
21:46:02 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207442654112260127/message.txt?ex=65dfa999&is=65cd3499&hm=0a96ff4ad99c3413a88398cf7b1c54f69fabd3ec3a727cab9c59b616e7632eba&
21:46:02 <xarick> this is how cumbersome it is to make sure the heliport is not picked
21:46:07 <_glx_> you need to define the class yes, then create an instance
21:46:10 <jfs> (in Lua you can just make a table and throw some fields into it)
21:46:22 <jfs> that is kind of annoying
21:46:30 <_glx_> class are tables ๐Ÿ˜‰
21:47:34 <_glx_> it's possible to just return a table, but then the function needs to be low level, with stack management
21:48:18 <xarick> also there's the peculiar case of helidepot
21:48:24 <xarick> the north corner
21:48:26 <xarick> is a depot
21:48:48 <xarick> adding orders to a vehicle and using the tile of the airport, makes an order to the hangar
21:49:12 <_glx_> helidepot is just a hangar anyway
21:49:24 <jfs> it's also a station
21:49:42 <peter1138[d]> aircraft are a bit annoying with depot orders tbh.
21:49:48 <peter1138[d]> But that's not exactly related ๐Ÿ™‚
21:51:04 <xarick> my to do list is... adding some function similar to GetAirportTile, but to be used as tile of the station for orders
21:51:10 <_glx_> heldepot doesn't have any terminal so useless as a station
21:51:21 <xarick> and maybe a AIAirportType_List
21:53:51 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #12090: Change: Switch road stop window between 6 or 2 orientations depending on road stop type. https://github.com/OpenTTD/OpenTTD/pull/12090
21:54:10 <peter1138[d]> Urgh, do I need an EAV table or is that too anti-pattern?
21:55:00 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:59:21 <peter1138[d]> Maybe I can cheat with a json field...
22:00:09 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12084: Add: [Script] GetAirportNumHangars; Remove: [Script] GetNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084
22:04:39 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler approved pull request #12090: Change: Switch road stop window between 6 or 2 orientations depending on road stop type. https://github.com/OpenTTD/OpenTTD/pull/12090#pullrequestreview-1881390742
22:05:09 <xarick> hmm peter, even if I simplify GetNumHangars it's still going to need compatibility files.
22:05:26 <_glx_> why ?
22:05:58 <xarick> I'm not sure about peter's request.
22:07:26 *** Wormnest has joined #openttd
22:07:34 <xarick> I don't remove GetNumHangars, and I don't add a new function, instead I simplify the existing GetNumHangars as if it was the new function?
22:08:20 <_glx_> no, you add the new function which accept AirportType, and you use this new function in the old one which still accept tile
22:08:45 <xarick> ah!
22:08:55 <xarick> so I keep both?
22:09:07 <_glx_> yes, they both have their use
22:09:12 <xarick> ok
22:09:33 <_glx_> AirportType before build, and tile version can be useful once built
22:10:46 <xarick> but still, how do I avoid touching 27 compat files?
22:11:02 <_glx_> the old function don't change
22:11:23 <_glx_> only it's content, not the result or the parameter
22:11:23 <xarick> oh, nvm i'm dumb
22:11:29 <xarick> I see now
22:11:37 <xarick> ok, let me do it
22:13:35 <peter1138[d]> You were massively overcomplicating it ๐Ÿ˜„
22:13:43 <_glx_> as always ๐Ÿ™‚
22:21:29 <xarick> `/* static */ SQInteger ScriptAirport::GetNumHangars(TileIndex tile)
22:21:29 <xarick> {
22:21:29 <xarick> return GetAirportNumHangars(GetAirportType(tile));
22:21:29 <xarick> }`
22:21:50 <xarick> just that? no preconditions
22:22:12 <_glx_> called functions will check
22:22:38 <xarick> how would I describe in the hpp?
22:28:36 <xarick> technically, it was getting the num of hangars from the station->airport
22:28:46 <xarick> now it gets from the spec
22:28:46 <_glx_> actually the main question regarding the old code is why checking ownership to query number of hangars
22:30:20 <xarick> because it's the expected behaviour for AI companies, you only work with your owned stations
22:31:01 <_glx_> in this case you can check tile ownership first
22:31:16 <_glx_> instead of checking station ownership
22:32:47 <peter1138[d]> Tbh the function isn't that complex anyway, so it might be simplest to just leave it as it is.
22:35:57 <xarick> GetAirportType calls HasStationType which calls IsValidStation which checks for station ownership. In case of neutral owner, GetAirportNumHangars calls IsAirportInformationAvailable, oilrigs aren't available.
22:36:35 <_glx_> yeah, and maybe have ```
22:36:35 <_glx_> GSAirport.GetAirportNumHangars(GSAirport.GetAirportType(tile));
22:36:35 <_glx_> GSAirport.GetNumHangars(tile);
22:36:35 <_glx_> ``` next to each other in regression
22:36:41 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:36:57 <_glx_> just to be sure the result is the same
22:37:41 <xarick> ok
22:48:14 <xarick> owww.... snap
22:48:18 <xarick> I know now!
22:48:27 <xarick> if the airport expires
22:48:55 <xarick> Getting number of hangars of an expired airport
22:49:41 <_glx_> so the tile version should still use the station
22:49:47 <xarick> yes
22:50:16 <xarick> dang, this was gonna be a terrible mistake
22:51:10 <xarick> unless IsAirportInformationAvailable somewhat lists it?
22:52:34 <xarick> AirportSpec::Get(type)->enabled
22:52:38 <xarick> gonna test this
22:53:24 <_glx_> bool AirportSpec::IsAvailable() const
22:53:24 <_glx_> {
22:53:24 <_glx_> if (!this->enabled) return false;
22:53:24 <_glx_> if (TimerGameCalendar::year < this->min_year) return false;
22:53:24 <_glx_> if (_settings_game.station.never_expire_airports) return true;
22:53:26 <_glx_> return TimerGameCalendar::year <= this->max_year;
22:53:26 <_glx_> }
22:53:29 <_glx_> no need to test ๐Ÿ™‚
22:54:02 <_glx_> that's what is called in IsAirportInformationAvailable
22:55:44 <xarick> no, that's for IsValidAirportType
23:00:03 <_glx_> ah yes, so it's fine, .enabled can only change on newgrf load
23:05:45 <xarick> > * @pre not sure what to write here
23:16:18 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:17:05 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #12084: Add: [Script] GetAirportNumHangars; Remove: [Script] GetNumHangars https://github.com/OpenTTD/OpenTTD/pull/12084
23:17:22 <xarick> oh, need to edit pr
23:19:46 <xarick> done
23:25:01 <xarick> something is eating my drive space
23:25:08 <xarick> visual studio most likely
23:34:48 <xarick> 200 GB eaten by something...
23:34:52 <xarick> seriously
23:35:06 <xarick> makes 1 TB SSD look small
23:43:23 <wensimehrp> https://cdn.discordapp.com/attachments/1008473233844097104/1207472186881871952/image.png?ex=65dfc51b&is=65cd501b&hm=0e2207c6a35bb6bced03e74e223dc4420cabad7618c0f68f43d335fcf230073a&
23:43:23 <wensimehrp> windows detected strange dpi again...
23:43:56 *** tokai|noir has joined #openttd
23:43:57 *** ChanServ sets mode: +v tokai|noir
23:44:35 <Eddi|zuHause> what should we be seeing there?
23:45:24 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207472694426079293/image.png?ex=65dfc594&is=65cd5094&hm=9561ac9e469231d360ab87792eb72a5ace6f6c4e39873a3335970f310c7a5e52&
23:45:24 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1207472694656761896/Unnamed_1981-06-30.png?ex=65dfc594&is=65cd5094&hm=69c1a1a04dcc5a9cac0047f8acab4e5c60a33389d53dcb368f96fbb000f3c744&
23:45:24 <xarick> meanwhile...
23:49:48 <xarick> bed, cyas goodnight!
23:50:41 *** tokai has quit IRC (Ping timeout: 480 seconds)
23:54:44 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:57:46 *** redjimi has joined #openttd
23:57:46 <redjimi> xarick: Here's a (irony?) blast from the past: Transport Tycoon first appeared in 1994, and computers of that era had disk capacities of around 300 - 500 MB.