IRC logs for #openttd on OFTC at 2025-10-23
⏴ go to previous day
00:13:35 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
00:13:36 *** WormnestAndroid has joined #openttd
01:29:51 *** loco_low has joined #openttd
01:58:19 *** tokai|noir has joined #openttd
01:58:19 *** ChanServ sets mode: +v tokai|noir
02:05:26 *** tokai has quit IRC (Ping timeout: 480 seconds)
02:08:30 *** Wormnest has quit IRC (Quit: Leaving)
02:14:04 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:52:50 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
03:52:52 *** WormnestAndroid has joined #openttd
03:52:55 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
03:53:11 *** WormnestAndroid has joined #openttd
03:58:32 *** Zathras_11 has joined #openttd
03:58:41 *** Zathras_1 has joined #openttd
04:02:01 *** Zathras_4 has quit IRC (Ping timeout: 480 seconds)
04:02:06 *** Zathras has quit IRC (Ping timeout: 480 seconds)
04:29:25 *** felix has quit IRC (Remote host closed the connection)
06:26:34 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
06:26:46 *** WormnestAndroid has joined #openttd
07:14:57 *** Flygon has quit IRC (Read error: Connection reset by peer)
07:47:00 *** kaibaneddy has joined #openttd
08:26:53 *** gelignite has joined #openttd
08:43:56 <ahyangyi> If something cannot be uninstalled, it is ununinstallable?
08:58:23 <xarick> the vast majority, like 99% of the code don't use { x, y, z }
09:02:34 <xarick> I still wonder if the overhead is caused by TileIndex being a strongtype
09:26:33 <xarick> std::max has a few more than I expected
09:39:37 <xarick> lots of gui related std::max
09:45:31 <xarick> `size.height = std::max<uint>({size.height, (uint)GetCharacterHeight(FS_NORMAL), GetScaledSpriteSize(SPR_WARNING_SIGN).height, GetScaledSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetScaledSpriteSize(SPR_FLAG_VEH_RUNNING).height}) + padding.height;`
09:48:54 *** loco_low has quit IRC (Remote host closed the connection)
09:48:54 *** wensimehrp has quit IRC (Remote host closed the connection)
09:48:54 *** locosage has quit IRC (Remote host closed the connection)
09:48:54 *** vikkeri05 has quit IRC (Remote host closed the connection)
09:48:54 *** kaibaneddy has quit IRC (Remote host closed the connection)
09:48:54 *** michi_cc has quit IRC (Remote host closed the connection)
09:48:54 *** jfkuayue has quit IRC (Remote host closed the connection)
09:48:54 *** mnhebi has quit IRC (Remote host closed the connection)
09:48:54 *** _glx_ has quit IRC (Remote host closed the connection)
09:48:54 *** DorpsGek_vi has quit IRC (Remote host closed the connection)
09:48:54 *** belajalilija has quit IRC (Remote host closed the connection)
09:48:54 *** audigex has quit IRC (Remote host closed the connection)
09:48:54 *** _zephyris has quit IRC (Remote host closed the connection)
09:48:54 *** tabytac has quit IRC (Remote host closed the connection)
09:48:54 *** alfagamma7 has quit IRC (Remote host closed the connection)
09:48:54 *** rovstam has quit IRC (Remote host closed the connection)
09:48:54 *** emperorjake has quit IRC (Remote host closed the connection)
09:48:54 *** notluke2578 has quit IRC (Remote host closed the connection)
09:48:54 *** aderom has quit IRC (Remote host closed the connection)
09:48:54 *** xarick has quit IRC (Remote host closed the connection)
09:48:54 *** kaji_kaede has quit IRC (Remote host closed the connection)
09:48:54 *** wither9781 has quit IRC (Remote host closed the connection)
09:48:54 *** _auxilian has quit IRC (Remote host closed the connection)
09:48:54 *** rito12_51026 has quit IRC (Remote host closed the connection)
09:48:54 *** tony_pixel has quit IRC (Remote host closed the connection)
09:48:54 *** _jgr_ has quit IRC (Remote host closed the connection)
09:48:54 *** ahyangyi has quit IRC (Remote host closed the connection)
09:48:54 *** sam_chug has quit IRC (Remote host closed the connection)
09:48:54 *** reldred has quit IRC (Remote host closed the connection)
09:48:54 *** forgenet has quit IRC (Remote host closed the connection)
09:48:54 *** andythenorth has quit IRC (Remote host closed the connection)
09:48:54 *** brickblock19280 has quit IRC (Remote host closed the connection)
09:48:54 *** fairyflossy has quit IRC (Remote host closed the connection)
09:48:54 *** mmtunligit has quit IRC (Remote host closed the connection)
09:48:54 *** yiffgirl has quit IRC (Remote host closed the connection)
09:48:54 *** davidxn has quit IRC (Remote host closed the connection)
09:48:54 *** masteroktagon has quit IRC (Remote host closed the connection)
09:48:54 *** talltyler has quit IRC (Remote host closed the connection)
09:48:54 *** happpy6024 has quit IRC (Remote host closed the connection)
09:48:54 *** vondpc has quit IRC (Remote host closed the connection)
09:48:54 *** kuhnovic has quit IRC (Remote host closed the connection)
09:49:12 *** DorpsGek_vi has joined #openttd
09:51:21 <peter1138> Step 1: Don't optimise it if it doesn't need optimizing./
09:51:48 <mnhebi> So, if its not broken, don't fix it?
09:52:10 <peter1138> Step 2: You're a not a great judge of what looks ugly.
09:52:23 <xarick> `size.height = std::max<uint>(size.height, std::max<uint>((uint)GetCharacterHeight(FS_NORMAL), std::max<uint>(GetScaledSpriteSize(SPR_WARNING_SIGN).height, std::max<uint>(GetScaledSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetScaledSpriteSize(SPR_FLAG_VEH_RUNNING).height)))) + padding.height;`
09:53:40 <xarick> there were some bppanim stuff too
09:53:57 <xarick> maybe the game becomes more responsive 😛 i wanna test
09:54:07 <peter1138> The simplest way to improve the readability of that line is to put each item in the initializer on a new line.
09:55:26 <peter1138> As usual, you have no idea what or why you are doing it.
09:57:57 <xarick> how often is this called
09:58:37 <xarick> 32bpp_optimized, 32bpp_simple, 32bpp_sse2 all have this
09:58:59 <peter1138> Identity a problem before you try to fix a problem.
10:09:07 <xarick> holy crap this is accessed a lot
10:10:28 <xarick> vehicle sprites, mouse cursor sprite, truefont sprite
10:10:35 <xarick> so, it's everything that's being displayed?
10:11:40 <peter1138> Identity a problem before you try to fix a problem.
10:12:48 <xarick> a tree is born, this is called, very interesting
10:23:31 *** ahyangyi has joined #openttd
10:23:31 <ahyangyi> xarick: It seems on my machine none of these are called by default
10:23:43 <ahyangyi> the 40bpp one is called instead
10:27:11 <xarick> I'm unsure how to properly measure this
10:40:23 <xarick> 🙂 let's see what happens
10:43:01 <xarick> oops, this is called way more often than I thought
10:48:44 <xarick> okay, undoing my stuff
10:53:45 <xarick> yeah, these are all gui + bpp
10:53:56 <xarick> expect one in terraform.cpp
10:54:06 <xarick> that's also tile heights related
10:59:41 <xarick> that compute tile slope right after... hmm... an opportunity to use the look up table of corner height diffs 🙂
11:07:43 <xarick> this could call the GetTileSlopeGivenHeight directly
11:08:50 <xarick> I guess it doesn't because it needs the z_max
11:31:05 <xarick> didn't i have a terraform script already?
11:41:55 *** gelignite has joined #openttd
12:32:15 *** talltyler has joined #openttd
12:32:15 <talltyler> Re: Opening a bug report, I meant the player would open a bug report. Not that we should open a bug report for the regression in behavior of merging the PR. 🙂
12:42:40 <xarick> tile_to_new_height.find is slow
12:50:14 <xarick> ah no, i need to know its location 🙁
12:58:24 <xarick> std::map could become an std::unordered_map now
13:00:48 <peter1138> talltyler, right, that was not clear to m.e
13:01:04 <peter1138> std::map may be used instead of std::unordered_map if the order actually matters.
13:01:21 <talltyler> Yeah, words are hard today 🙂
13:01:34 <peter1138> For things that are done by a server and all clients, order often does matter.
13:05:42 <xarick> it's only checking if a TileIndex already exists
13:05:56 <xarick> and extracting its mapped height
13:06:59 <xarick> oh, i see there's more 🙁
13:08:23 <xarick> I think the order doesn't matter much here
13:09:49 <peter1138> As it forcibly does it with no other conditions, seems likely.
13:15:22 <xarick> is this gonna force 2 searchs?
13:15:40 <xarick> const_iterator approach might be faster?
13:19:33 <peter1138> `auto it = ts.tile_to_new_height.find(t); if (ts == ts.tile_to_new_height.end()) continue; MarkTile...(t, 0, it->second);`
13:20:12 <peter1138> And use `auto`, not this long-winded const
13:20:23 <peter1138> ....::const_iterator stuff.
13:20:49 <LordAro> peter1138: but what if auto does the wrong thing?!?1?one
13:29:15 <peter1138> Oh, wait, was the question about changing it to use contains() and the indexer, instead of find()?
13:29:21 <peter1138> Yeah, don't do that.
13:29:30 <peter1138> Please try learning some C/C++.
13:30:55 <xarick> but still trying std::unordered_map
13:37:14 <ahyangyi> LordAro: Using auto for iterators is one of the more obvious cases though
13:38:19 <peter1138> My approach now is auto for iterators, or anything that requires a complex templated type. And don't use auto if it's simple enough.
13:38:42 <peter1138> Structured binding also needs auto of course.
13:40:24 <peter1138> Shame you can do structured binding as a function parameter though.
13:42:43 <xarick> not sure i can do something about dirty_tiles
13:43:01 <xarick> order is required but only after the tiles are all added
13:43:09 <xarick> before that, order doesn't matter
13:53:25 <xarick> STR_ERROR_TERRAFORM_LIMIT_REACHED comes a bit too late
14:10:00 <xarick> DoCommands are sent twice 🙁
14:10:12 <xarick> repeats the whole stuff again
14:21:24 *** mmtunligit has joined #openttd
14:21:24 <mmtunligit> I'm trying to find the x coordinate of an already existing window, i see that LocalGetWindowPlacement does that (and more) for a new window, would I be able to use it for an existing one as well? or is there something I'm missing
14:32:09 <xarick> something is preventing the GS to raisetile
14:32:29 <xarick> and whatever is preventing it is the cause of the huge overhead I experience
14:33:11 *** Wormnest has joined #openttd
14:33:29 <xarick> i must be doing this check in the wrong place
14:47:43 <xarick> terraform limit reached
14:48:14 <xarick> okay, uhm... so this thing is getting in the way of my tests
14:59:25 <xarick> it's sqvm.cpp that's spamming the command
14:59:37 <xarick> it's not the command itself that takes a lot of time
14:59:42 <xarick> it's the spamming of it
15:00:03 <xarick> sqvm treats it as only 1 Ops
15:08:04 *** rito12_51026 has joined #openttd
15:08:04 <rito12_51026> talltyler: I'm not sure if that is the threshold you were talking about
15:08:28 *** DJGummikuh has joined #openttd
15:09:48 <xarick> okay, this is a problem for glx to solve :=)
15:10:13 <DJGummikuh> I touched OpenTTD after a very long time and seem to have forgotten how trains work. I have a very simple T crossing and for some reason it's causing constant jams because the signalling doesn't work the way I remember it
15:10:22 <mmtunligit> never mind, i figured out my problem!
15:16:13 <xarick> nevermind. this is a problem for me to solve in my script
15:16:37 <xarick> Sleep will fix this stall
15:19:16 <xarick> I wasn't letting the sqvm go to sleep 🙂
15:20:02 <xarick> and the ops cost was negligible for that kind of bombardment on CmdTerraform
15:45:21 <LordAro> can't really help otherwise at least without a screenshot
15:48:39 <mmtunligit> so i just tried to push my changes and got this message, but i already fetched and rebased from upstream, what am i doing wrong?
15:48:49 <mmtunligit> should i be force pushing instead?
15:52:00 <LordAro> mmtunligit: git prevents you from overwriting commits by default
15:52:26 <LordAro> push --force-with-lease is a safer version, prevents from totally trampling commits you might not have noticed
15:52:46 <peter1138> But it's longer to type.
15:52:55 <LordAro> which is why i have a pushf alias :)
15:55:06 <mmtunligit> ok so thats a step in the right directin but it still isnt working
15:56:08 <LordAro> probably due to prior rebasing/pulling/merging
15:56:28 <LordAro> if you're happy there's no changes on the remote (github) that will be missed, then push --force
15:57:10 <mmtunligit> ah ok ill check, though i think itll be fine
15:57:49 <LordAro> (at this point i would always specify `origin branch-name`, just to be sure that you're not about to overwrite anything else)
15:59:30 <mmtunligit> so, ```git push --force --set-upstream origin align-terraform-toolbar```?
15:59:52 <LordAro> --set-upstream should generally be unnecessary (except for the first time, perhaps?), but yes
16:01:14 <mmtunligit> yeah, condributing says to use set upstream the first time, and then not bother afterwards
16:01:44 <mmtunligit> so then finally, ```git push --force origin align-terraform-toolbar```
16:07:48 <mmtunligit> huh, i dont remember adding "window_type.h" to the includes of airport_gui.cpp whats up with that
16:08:07 <LordAro> editor doing magic things?
16:09:55 <mmtunligit> that was the file i figured out how to make it work in, it probably has something to do with that, i ran into a segfault while testing
16:11:39 <mmtunligit> yeah gonna fix that, it works without it so it doesnt need to be there
16:16:26 <peter1138> Heh, the auto-include might be useful if it didn't put everything before stdafx.h
16:18:12 <peter1138> (It plagued me for a while until I figured out how to turn that off.)
16:19:04 <mmtunligit> mine put it in the middle of the includes which was neat, though the time i wish it had actually added an include automatically it didnt lol
16:19:46 <mmtunligit> clang said there was a fix availible (which was adding the include) but didnt do anything about it
16:26:52 <xarick> question about c->terraform_limit
16:27:07 <xarick> how long does it take to replenish
16:29:00 *** locosage has joined #openttd
16:29:00 <locosage> check terraform_per_64k_frames
16:40:59 *** tony_pixel has joined #openttd
16:40:59 <tony_pixel> What's with these microoptimizations anyway?
16:41:04 <xarick> wanted height level is 27, started at 255, it's at 211 now
16:43:01 <xarick> 390 ms to compute an error
16:47:21 <xarick> std::min, std::max again
16:52:15 <xarick> just std::min in this case
17:13:38 <xarick> a bit of optimization: 250 ms to compute the same error
17:16:01 <xarick> let me check 15.0-beta3
17:27:46 <xarick> this is the official build downloaded from openttd.org
18:51:06 <xarick> oops, maybe the std::max changes are not desirable
18:52:29 <xarick> updated to not include them
18:52:59 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:53:00 *** WormnestAndroid has joined #openttd
18:55:26 <xarick> on 2nd thought... master's version of GetTileSlopeGivenHeight also calculates the max... eh, I have my own optimized version which doesn't require to do it. 😐
19:04:18 *** Zathras_4 has joined #openttd
19:28:16 *** Flygon has quit IRC (Remote host closed the connection)
19:28:40 <mmtunligit> hmm, wondering if my most recent commit message shouldve been "Fix:" instead of "Change:" i saw it is changing how the thing was placed (because it does) but only in such a way as to fix unintended behvaior
19:28:50 <mmtunligit> is there a way to edit a commit message?
19:30:53 <mmtunligit> ok yeah im gonna xhange that
19:37:17 <xarick> 375 ms with std::map, 370 ms with std::unordered_map... size of container is probably in the 65k items
19:38:28 <xarick> not much of an improvement. then again, the whole terraform does much other stuff as well
19:40:21 <peter1138> How much are your NewGRFs worth?
19:44:43 <cu-kai> my response to this remains: lmfao
19:45:24 <xarick> oops, it's not 65k items in the container
19:45:50 <xarick> this stupid self-refreshing c->terraform_limit dictates the size of that container
19:46:25 *** andythenorth has joined #openttd
19:46:25 <andythenorth> mine are worth 7
19:47:15 <xarick> or maybe it is 65k? grr, need to test
19:53:58 <mmtunligit> noticed another extraneous IDE-added include, grrrr
19:55:38 <xarick> oopsie, it's only 4141, why did i come up with 65k...
19:57:35 <mmtunligit> xarick: isnt that a power of 2?
19:58:54 <xarick> GB(c->terraform_limit, 16, 16) is 4096
19:59:23 <xarick> some comment mislead me to thinking it was 65536 tiles
20:00:10 <peter1138> "Invalid email for web commit" thanks Github.
20:04:05 <peter1138> What does "* 65536" mean?
20:07:18 <xarick> it's 4096 multiplied for 65536
20:07:56 <xarick> like confusing the heck out of me
20:09:54 <peter1138> Sometimnes it's a way to do fixed-point maths
20:15:13 <xarick> well, then for 4141 items, 375 ms becomes 370 ms
20:23:15 <xarick> IsTunnelInWay takes 97% of the time
20:23:45 <xarick> the other 3% is for the rest of the terraform logic
20:25:26 <xarick> gonna test the opposite
20:25:43 <xarick> no tunnels in the way anymore
20:31:40 <xarick> uhm, i can no longer change map height in the editor?
20:32:36 <xarick> ah, i can, my bad, didn't look well enough
20:34:31 <xarick> wow, night and day difference
20:34:59 <xarick> it's the TunnelInWay check that slows terraform to a crawl...
20:38:59 <xarick> well, there's nothing else to see here, it's not the containers slowing stuff
20:39:34 <xarick> it's not even terraform algorithm itself slowing down
20:39:42 <xarick> its the tunnel in the way check
20:45:57 <xarick> IsBridgeAbove is a simple map check
20:46:07 <xarick> why couldn't the same be done for tunnels
20:49:32 <xarick> oh bridges also end up doing that tilediff delta on every tile, but only if the map array says so there's a bridge
21:07:26 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:14:56 *** jfkuayue has joined #openttd
21:14:56 <jfkuayue> Why would the train NOT crash when its head is into its tail?
21:19:20 <dwfreed> this came up previously, as I recall this is a compatibility from TTD
21:19:56 <dwfreed> I do not remember if it is configurable
21:26:28 *** davidxn has joined #openttd
21:26:28 <davidxn> It isn't configurable and I remember there's a really good reason why it was done that way but I can't remember what it is
21:28:28 <davidxn> xarick: I think it's because it's the number of tiles in a standard TTDeluxe map (256x256), a lot of the landscaping stuff uses it as a reference to scale up and down according to map size
21:29:49 <peter1138> A train crashing into itself doesn't serve any purpose.
21:34:31 *** DJGummikuh has quit IRC (Quit: Lost terminal)
21:35:39 *** gelignite has joined #openttd
21:40:54 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:45:59 <locosage> omg, I just realized that despite having all these useless industry graphs vanilla still lacks cargo filter on delivery and income
21:47:08 <andythenorth> they will upvote that a lot
21:47:56 <andythenorth> classic dP mic drop grenade throw
21:48:15 <locosage> bet it had that for like a decade
21:48:29 <andythenorth> reddit recommends jgrpp
21:48:37 <andythenorth> reddit screenshots suggest it plays vanilla with zbase
21:48:55 <_jgr_> reddit is not really a unified voice about anything
21:49:06 <andythenorth> you think it's humans, not just a random word generator?
21:49:11 <mmtunligit> they're pretty unified about being inssuferable
21:49:55 <andythenorth> reddit simulator
22:15:25 <xarick> _jgr_: do you have a branch for IsBridgeAbove but for tunnels, using map array?
22:16:21 <xarick> I'm inventing an IsTunnelBelow...
22:16:37 <xarick> but if it was already done, I'll just copy from somewhere
22:22:25 <_jgr_> If you mean IsTunnelInWay, then I have an index of tunnels which is checked instead of scanning the map, yes
22:24:04 <_jgr_> This is not going to be something you can quickly drop in though
22:24:30 <xarick> oh, that was my other implementation idea
22:52:49 <xarick> `t.m8() = GB(t.m8(), 14, 1) << 14;`
22:52:49 <xarick> I want to maintain the current value of bit 14 and set all others to 0. Is this the correct method?
22:57:43 <xarick> wow... that's... weird
continue to next day ⏵