IRC logs for #openttd on OFTC at 2025-10-26
⏴ go to previous day
00:16:35 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
00:19:43 *** WormnestAndroid has joined #openttd
01:36:39 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
01:41:50 *** WormnestAndroid has joined #openttd
01:58:47 *** ChanServ sets mode: +v tokai
02:05:36 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
02:14:30 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
02:14:38 *** WormnestAndroid has joined #openttd
02:24:20 *** Wormnest has joined #openttd
04:05:44 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:38:08 <DorpsGek> - Update: Translations from eints (by translators)
04:45:44 *** Zathras_11 has joined #openttd
04:49:06 *** Zathras has quit IRC (Ping timeout: 480 seconds)
05:26:30 <rito12_51026> Why the translation update was an hour earlier than usually?
06:01:33 <Rubidium> rito12_51026: because you changed your clock
06:02:50 <Rubidium> today and yesterday's were both at 4:38 UTC
06:03:07 <reldred> i am now in a DST free zone
06:06:07 <rito12_51026> oh, I've forgotten about DST
07:28:01 <andythenorth> newgrf wiki suggests I shouldn't be using anim_speed callback
07:28:45 <andythenorth> I am running out of tile IDs. Currently industries use between 1 and 3 tiles, to set action 0 props like `animation_speed`
07:29:01 <andythenorth> I was considering consolidating them and using callbacks to control the animation
07:29:07 <andythenorth> but that seems unwise
08:00:14 <jfkuayue> UTC knocked the door.
09:27:35 *** argoneus7 has joined #openttd
09:38:57 *** gelignite has joined #openttd
09:59:35 <xarick> 82 minutes and 44 seconds to flatten a 4096x4096 from height 1 to 0 in master
10:00:35 <xarick> 56 seconds on my tunnel below stuff
10:01:14 <kuhnovic> As in why on earth would you even do that
10:02:04 <xarick> i tortured myself to get this measured 🙁
10:06:00 <andythenorth> If we just want to flood fill the map, surely there are efficient ways to do that much faster than 56 seconds?
10:06:34 <xarick> visual studio doesn't let me analize cpu statistics of over 60 minutes 🙁
10:06:36 <kuhnovic> You tortured your machine. You could have taken a nap.
10:15:20 <xarick> it's always GetTileZ....
10:18:06 <xarick> PR#13067 would help for msvc compiler
10:22:40 *** SigHunter_ has joined #openttd
10:22:43 <xarick> anyone has any idea what is this? it's about std::min, but what exactly is it, and why it's slow
10:24:10 *** SigHunter has quit IRC (Read error: No route to host)
10:26:59 <_jgr_> The comments on that PR already go into this in detail
10:27:44 <_jgr_> Briefly, it's because MSVC uses a vectorised implementation in this case
10:33:51 <xarick> looking for minmax stuff in stackoverflow
10:41:00 <xarick> i can't find anything about std_minmax_disp
10:51:51 <xarick> _USE_STD_VECTOR_ALGORITHMS 1
10:52:00 <xarick> how do I disable this?
10:56:10 <xarick> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\xutility
10:58:34 <xarick> I'm so tempted to change this 1 to 0
10:59:42 <xarick> it's not letting me save this file 🙁
11:07:25 <peter1138> You're not meant to edit it, no.
11:08:10 <xarick> is there a correct way to disable this?
11:31:31 <peter1138> You're not meant to disable this.
11:36:33 *** exceptik has joined #openttd
11:36:33 <exceptik> are you even sure its the min function that is slowing down, and not the tile height calls?
11:47:23 <xarick> TileHeight calls are fine
11:51:56 <exceptik> i just don't see std min being THAT slow, even for a 4-way
11:52:25 <xarick> it's compounded by IsTunnelInWayDir
11:55:51 <xarick> it's the exponential number of calls to it that makes it innefficient
11:57:28 <xarick> 256x256 is too small for a test case
11:58:37 <xarick> erm... 1024x1024 I guess
12:10:26 <xarick> it's the vectorized stuff
12:17:00 <xarick> flattening 1024x1024 - master vectorized std::min: 34,917 s
12:17:00 <xarick> flattening 1024x1024 - master multiple std::mins: 16,753 s
12:17:00 <xarick> flattening 1024x1024 - tunnel below markers: 3,564 s
12:20:30 <xarick> if i merge all my optimizations stuff together
12:22:23 <michi_cc> At least on Release? Otherwise the numbers don't mean anything anyway.
12:23:34 <xarick> it's on RelWithDebInfo but with DisabledAsserts
12:23:45 <xarick> manually configured them to disabled
12:25:01 <xarick> Release doesn't let visual studio track function names
12:28:35 <xarick> my optimizations mash up: 3,576 s
12:31:20 <xarick> that's std::map to std::unordered_map... looks like it's not always faster
13:17:11 <xarick> static TerraformerState is faster
13:18:27 <xarick> how do I automatically clear a struct on exit?
13:19:11 <xarick> on exiting the function
13:19:24 <xarick> dunno how to explain it
13:43:11 *** kuka_lie has joined #openttd
14:17:20 <LordAro> i don't see anything wrong with the question
14:18:16 <xarick> manual clearing is gonna suck because there's many return points...
14:19:07 <LordAro> as long as you actually learn something from what you're doing, sure
14:32:51 <_glx_> for me if you expect to clear everytime then `static` is useless
14:36:45 <xarick> i think the overhead is the initialization of those vectors
14:37:47 <_glx_> there's also the option to clear when entering the function
14:38:14 <xarick> yes, but I think that could hog memory if the previous terraform used lots of tiles
14:46:12 <Rubidium> though isn't keeping the memory allocated the whole reason why you want to use clear instead of making a new one?
14:49:41 <xarick> CmdLevelLand calls CmdTerraformLand one tile at a time, TerraformerState is constantly recreated, and they only have 4 tiles in them
14:52:34 <xarick> but there's also the other extreme case, lowering a tile in the middle of a big hole
14:53:09 <xarick> CmdTerraformLand is only called one, but there will be 4000+ tiles in the TerraformerState, though it's only initialized once
14:53:59 <xarick> I want it to be cleared on returning from the function
14:54:56 <xarick> only the next terraform command would be clearing them. Until then, there's 4000 tiles standing in memory doing nothing
14:59:55 <xarick> ``` static TerraformerState ts;
14:59:55 <xarick> TerraformerStateGuard tsguard{ts};```
14:59:55 <xarick> this is good, albeit a bit funky
15:00:13 <xarick> wish everything could be done with a single structure
15:00:38 *** Webster has joined #openttd
15:02:01 *** WormnestAndroid has quit IRC (Read error: No route to host)
15:24:58 <xarick> what are alternatives for std::map and std::unordered_map?
15:26:12 <xarick> gonna see if i can do something about TerraformAddDirtyTileAround
15:34:02 *** Smedles has joined #openttd
15:50:26 <andythenorth> Are we short of memory?
15:51:03 *** WormnestAndroid has joined #openttd
15:58:37 <peter1138> A set is not a map.
16:23:06 <andythenorth> How much memory for 65536 industry tile IDs? 👀
16:24:01 <xarick> tested FlatSet, it's slow 🙁
16:24:23 <xarick> std::set continues to beat it on every case I test
16:32:36 <peter1138> andythenorth, I still think we can somehow make industry tile IDs be per industry.
16:33:00 <peter1138> But I think the spec was deliberately designed in a way that makes that not feasible.
16:33:08 <peter1138> The whole "subtitute" bullshit.
16:35:32 <Borg> _jgr_: I went a little crazy with Routing Restrictions.. and implemented and-if along or-if :)
16:36:13 <peter1138> Subsequent changes to things like cargoes mean the ability to remove industry sets and have a fallback take its place is pretty much pointless.
17:19:54 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
17:21:25 *** WormnestAndroid has joined #openttd
17:45:56 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
17:47:35 <xarick> I'm trying to do stupid stuff
17:48:29 <xarick> would ts->dirty_tiles.contains(tile) be faster than comparing the sizes of before and after?
17:49:24 <xarick> oops ts->dirty_tiles_lookup.contains(tile)
17:50:00 <xarick> does .insert return a bool if it's inserted?
17:51:01 *** WormnestAndroid has joined #openttd
17:51:28 <xarick> that check is wrong even lol
17:53:06 <_jgr_> xarick: `insert` generally returns a result which tells you this
17:59:53 <xarick> oh, it returns a std::pair with the value and a bool
18:14:09 <xarick> for some reason, this is still faster
18:18:37 <Borg> _jgr_: also, I think its better to use pf_yapf_pbs_back_signal_penalty for use in Add penalty, I use it in my patch and just put 3 values out there multipled by 1,2,3 + custom :)
18:18:53 <Borg> its more meangfull than small, normal, big :)
18:21:44 <peter1138> 2770 packages can be upgraded.
18:22:21 <_jgr_> Borg: 1500 seems a bit large for a base value?
18:24:38 <_jgr_> In any case it is awkward to change the values now, as it'd mess up existing save games
18:28:55 <Borg> _jgr_: how come? Values of WIDGET arent stored in safe.. and Add penalty value is (I hope) copied to the RR itself?
18:29:05 <Borg> I actually rewrote that part in my patch... so I forgot
18:29:20 <Borg> anyway. lets see whats the default penalty for pbs_back_signal
18:29:40 <Borg> yapf.rail_pbs_signal_back_penalty = 1500
18:29:49 <Borg> actually. its seems this is the default
19:01:00 <xarick> flattening a 4k map was 56 seconds yesterday. today is 45 seconds
19:02:33 *** gelignite has quit IRC (Remote host closed the connection)
19:02:48 *** gelignite has joined #openttd
19:49:59 *** gelignite is now known as Guest29962
19:49:59 *** Guest29962 has quit IRC (Read error: Connection reset by peer)
19:50:03 *** gelignite has joined #openttd
19:52:50 <dwfreed> I love screenshots of text that can clearly be copied and pasted
19:56:09 <xarick> 1. Flatten a big map in scenario editor: containers have 4 items each, then they're cleared. repeat n number of times for each tile terraformed.
19:56:09 <xarick> 2. Lower a big hole till terraform limit is reached: containers exceed 4096 items each. called once.
19:57:04 <xarick> std::set and std::map are ideal for test 1
19:57:31 <xarick> std:: vector + std::unordered_set + vector sort and std::unordered_map are ideal for test 2
19:59:56 <xarick> test all combinations of course
20:21:56 *** Borg has quit IRC (Quit: leaving)
20:25:01 <peter1138> Sometimes a bit of dirt gets in just the 'right' place in my trackball and it stops being able to track :o
20:29:18 <andythenorth> peter1138: Sack off the fallbacks, break old grfs?
20:29:18 <andythenorth> Set a flag on “new” tiles?
20:29:56 <peter1138> As far as I know, the fallbacks are only used if you change your NewGRFs.
20:37:15 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
20:37:22 *** WormnestAndroid has joined #openttd
20:45:24 <andythenorth> Seems like a good idea…20 years sgo
21:00:14 <andythenorth> Changing grfs or removing grfs might have been a goal
21:00:39 <andythenorth> Probably a thread in a german forum or something
21:01:42 <peter1138> It was desirable to not crash TTDPatch which only had 1 NewGRF configuration.
21:02:25 <andythenorth> I wonder if I can reuse tiles across multiple industries
21:02:40 <andythenorth> And lookup industry ID in varact2
21:13:46 <peter1138> Reuse tiles if they are actually the same tile.
21:14:17 <xarick> tileindex hash is horrible to look at
21:22:31 *** SigHunter has joined #openttd
21:28:55 <andythenorth> peter1138: “What’s a tile anyway?”
21:29:25 <andythenorth> It’s the action 0 props, so animation speed, a few flags…
21:31:40 <andythenorth> it would be simpler to just have per industry tiles though 🙂
21:33:25 <peter1138> Urgh, 21 archviles at once is kinda impossible.
21:35:43 <xarick> anyway, both tests are unreasonable
21:36:26 <xarick> test 2 is much much harder to setup
21:37:33 <xarick> it's just an imaginative of 1000 AIs all trying to dig a hole and receiving the terraform limit reach error, which is .... meh
21:38:14 <xarick> test 1 is easier to setup
21:38:40 <xarick> just enter scenario editor and level land entire map
21:39:22 <xarick> test 1 is also that one that takes 82 minutes to complete in master
21:39:47 <xarick> not due to containers... but due to tunnel in way inneficiencies
21:41:36 *** Zathras_4 has joined #openttd
21:43:26 <xarick> in short: leave the containers alone!
21:44:50 <andythenorth> peter1138: Do you have 21 BFGs at once?
21:44:56 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:45:12 <andythenorth> “Multiple rocket launcher”
21:45:12 <peter1138> Only a regular BFG.
21:52:15 *** keoz has quit IRC (Ping timeout: 480 seconds)
22:30:44 <xarick> can I generate 1 town now without crashing?
22:31:16 *** kuka_lie has quit IRC (Quit: Lost terminal)
22:45:10 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:56:57 <xarick> nop, crash still occurs
23:11:49 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day ⏵