IRC logs for #openttd on OFTC at 2024-02-14
โด go to previous day
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> 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: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:12:16 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:19:05 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:19:10 *** Wormnest has quit IRC (Quit: Leaving)
04:26:51 *** blikjeham[m] has quit IRC (Quit: Client limit exceeded: 20000)
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:37:32 *** georgevb has joined #openttd
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:22 <LordAro> knowing where it's slow would be a good start
09:14:43 <andythenorth> [RENDER GRAPHICS] iron-horse - complete 6.81s
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> - nmlc performance improvements
09:23:43 <andythenorth> - consolidate repeating nml switch chains to single procedures
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:40:11 <andythenorth> kinda wrote nml that depends on it ๐
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:50:58 *** thelounge345 has joined #openttd
09:56:07 <andythenorth> I was testing with x86 pypy, on ARM
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:54 <andythenorth> how about co-processors? ๐
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: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: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: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: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:32 <merni> It's just a lot less glacially slow
11:20:43 <xarick> ``` /** Bitmask of airport 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: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: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:49 *** gelignite has quit IRC (Quit: Stay safe!)
14:05:45 <peter1138[d]> I'm doing an Audax on Saturday. Shall I do it properly?
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:20:07 <peter1138[d]> Filling in the brevet card...
14:20:23 <peter1138[d]> Kinda have to otherwise you haven't done it!
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: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:50:31 <LordAro> peter1138[d]: you got a good group doing it then?
14:51:22 <peter1138[d]> Few of us doing it as it starts here.
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: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:42:07 <xarick> it's handled before the switch
15:42:24 <LordAro> compilers are extremely clever
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: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: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: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:14 <xarick> if someone invents a new aircraft type
15:53:20 <xarick> that's going to return -1
15:53:50 <xarick> still gonna return -1 before entering the switch
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: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:02:22 <talltyler> I wonder something similar every time I add a new #include and then stick it wherever feels right
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:14:29 <peter1138[d]> talltyler: Should be replaced with `GetAirportNumHangars(GetAirportType(tile))`
16:15:10 <peter1138[d]> (With a validity check)
16:20:06 <xarick> reworking a function to work differently
16:20:24 <xarick> hmm, i guess it's gonna be ok
16:25:58 <xarick> how do you deprecate a function but still make it compatible
16:26:05 <xarick> never tried doing that
16:29:20 <_glx_> AISign.GetMaxSignID in compat_0.7 is a nice example
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:44:13 <wpiwpi> when should the 14.0 translations be finished at the latest?
16:45:00 <wpiwpi> (asking as a translator)
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: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: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: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> return AIAirport.GetAirportNumHangars(AIAirport.GetAirportType(tile));
17:50:39 <xarick> and the GetLastError is gone
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:37:11 <DorpsGek> - Update: Translations from eints (by translators)
18:41:38 <xarick> just putting all the stuff we discussed into the PRs
18:41:49 *** gelignite 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:52:41 <_glx_> Let the functions do their own checks
18:53:45 <peter1138[d]> Numbers and bools is all you want.
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> without names it's quite difficult
19:00:21 <xarick> AirportType 9 was skipped?
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:31 <peter1138[d]> Huh, that's neat.
19:30:47 <peter1138[d]> No longer looks like complete magic like that ๐
19:48:33 <xarick> I was thinking Airport orientation, but I guess there's no point...
20:37:01 *** gelignite has quit IRC (Quit: Stay safe!)
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:09:01 *** Ox7C5 has quit IRC (Quit: Lost terminal)
21:25:52 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
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> 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: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: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: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: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:05:09 <xarick> hmm peter, even if I simplify GetNumHangars it's still going to need compatibility files.
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:09:07 <_glx_> yes, they both have their use
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:13:35 <peter1138[d]> You were massively overcomplicating it ๐
22:21:29 <xarick> `/* static */ SQInteger ScriptAirport::GetNumHangars(TileIndex tile)
22:21:29 <xarick> return GetAirportNumHangars(GetAirportType(tile));
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: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: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:53:24 <_glx_> bool AirportSpec::IsAvailable() const
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: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: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:35:06 <xarick> makes 1 TB SSD look small
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: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.
continue to next day โต