IRC logs for #openttd on OFTC at 2024-12-07
⏴ go to previous day
02:33:09 *** tokai|noir has joined #openttd
02:33:09 *** ChanServ sets mode: +v tokai|noir
02:40:01 *** tokai has quit IRC (Ping timeout: 480 seconds)
02:47:27 *** gelignite is now known as Guest2301
02:47:30 *** gelignite has joined #openttd
02:54:49 *** Guest2301 has quit IRC (Ping timeout: 480 seconds)
03:15:54 *** gnu_jj_ has joined #openttd
03:19:01 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
03:23:38 *** gelignite has quit IRC (Quit: Stay safe!)
03:51:10 *** godbed_ has joined #openttd
03:54:29 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:54:34 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
04:45:20 <DorpsGek> - Update: Translations from eints (by translators)
09:16:08 *** tokai|noir has quit IRC (Quit: c('~' )o)
09:36:24 <peter1138> There is nothing special here, but it's using _glx_ idea of using encoded strings.
09:36:53 *** gelignite has joined #openttd
09:37:46 <peter1138> There are some places that store parameters where I don't think this will work, but also many where it will.
09:41:57 *** kuka_lie has joined #openttd
09:45:08 *** mindlesstux has joined #openttd
10:11:06 <peter1138> Also, yay, I broke the mingw build.
10:18:52 <wensimehrp> somebody would need to update eints 😉
10:19:32 <peter1138> Oh, because I added {SPACE}
10:22:50 <peter1138> Okay, I'm sorry but I have absolutely no idea what needs to be updated with Eints.
10:23:45 <peter1138> Although #169 gives me a clue.
11:24:49 <xarick> i dont understand the error pointed out by codeql
11:57:55 <_glx_> Nice eints needs some cleanup before #201
11:58:26 <xarick> `std::ranges::find(rainforest_tiles, tile) == rainforest_tiles.end();`
12:00:08 <xarick> oh but this works: `std::find(rainforest_tiles.begin(), rainforest_tiles.end(), tile) == rainforest_tiles.end();` I'm confused
12:01:13 <_jgr_> The error message says what the problem is, Tile and TileIndex are different types
12:02:40 <dwfreed> you're attempting to scan a vector of TileIndex for a Tile; std::find can do conversions where there are operators that allow it, std::ranges::find does no such conversions
12:03:43 <peter1138> _glx_: I could've just changed my editor settings to not strip trailing whitespace...
12:04:14 <peter1138> And everyone else who ever touches the language files...
12:05:14 <xarick> oh, because I am using const auto tile : Map::Iterate(), I see
12:07:25 <xarick> TileIndex and Tile errors are not easy at all to decipher
12:21:15 *** virtualrandomnumber has joined #openttd
12:21:57 *** virtualrandomnumber has quit IRC ()
12:21:57 <LordAro> oh hey, GenWorldStatus has an unused next_update member
12:22:08 <LordAro> might just reuse that for some added debugging...
12:24:26 <peter1138> Just spew printf()s everywhere.
12:25:05 <LordAro> but the timing of each stage has to come from somewhere
12:27:42 <peter1138> Just TicToc every instruction.
12:27:57 <LordAro> i've got callgrind for that
12:28:01 <peter1138> Then you can sum up all the 0µs
12:29:57 <LordAro> (4k tropic map, industries&rivers off, towns minimal)
12:31:35 <peter1138> Well, I need a faster computer then.
12:32:06 <peter1138> But yes. The amount of effort here is somewhat disproportionate...
12:32:21 <xarick> `if (height == desert_tropic_line && type != MP_WATER) rainforest_tiles.push_back(tile);`
12:32:32 <xarick> otherwise it can add the same tile twice
12:33:01 <peter1138> Instant map generation right?
12:33:21 <LordAro> tbf, if i just comment out the rainforest generation it's only 0.5s
12:33:45 <LordAro> whether or not saving up to 3.5s is worth it on the other hand...
12:36:20 <reldred> peter1138: Then you’ll have no excuse not to do a map preview window on new game 😛
12:37:56 <peter1138> I mean, the main reason that isn't possible is because it isn't instant, so... yes?
12:38:03 <peter1138> (But it's not going to be instant)
12:38:22 *** bohaska_ has joined #openttd
12:47:52 <reldred> Not with that attitude it isn’t
12:49:37 <peter1138> LordAro: You should've benchmarked it with a full debug build.
12:50:10 <LordAro> you raise an excellent point
12:59:43 <mnhebi> What sort of tomfoolery is this? breakfast at afternoon?
13:02:52 <peter1138> This is not going to plan...
13:20:39 <peter1138> Oh, I think these strings are already broken.
13:24:04 <peter1138> I guess we previously changed things around and that broke saved strings?
13:36:45 <xarick> is it supposed to build openttd?
13:37:05 <xarick> i thought it would start from one of the compiled builds
13:40:56 <xarick> 26 minutes spent building openttd
13:41:39 <xarick> it only started analyzing now
13:43:46 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
13:47:04 *** gelignite has quit IRC (Quit: Stay safe!)
13:54:38 <xarick> pass! alright, ready for review
14:33:55 <andythenorth> hmm, what do I need to do to make grfs again? 😛
14:43:35 <merni> write nml code then put it through nmlc
15:19:43 <peter1138> Hmm, could I and should I StrongType a std::string?
15:23:05 <peter1138> Oh, I guess a simple struct would work.
15:24:39 <xarick> I'm moving on to GenerateTrees
15:25:25 <xarick> arctic trees are slow and I wanna find out why
15:30:16 <xarick> first step: find out the worst possible case scenario
15:46:36 <xarick> okay i hit the jackpot for worst times
15:46:42 <andythenorth> merni: I’ve self-owned with unshippable nml 😛
15:46:57 <andythenorth> Maybe I should branch more
15:47:30 <xarick> the higher the map height, the slower it generates trees
15:47:41 <xarick> also 100% snow coverage for greater effect
15:48:57 <xarick> zzzz, be back in 30 minutes lol
15:54:04 <andythenorth> Is that for Badger Strings? 😛
15:54:15 <andythenorth> Or are you side questing?
15:54:57 <peter1138> This is side-quest of 'make strings safe again'
15:55:21 <andythenorth> I would *never* side quest
15:55:39 <peter1138> Nearly up to 500 stashes.
15:55:55 <andythenorth> This is why Road Hog NRT edition is so complete
15:56:11 <andythenorth> Do you name your stashes?
15:57:56 <peter1138> Too many extra characters needed.
15:58:29 <peter1138> I suspect many of these are already merged.
16:02:02 <xarick> [2024-12-07 16:01:38] dbg: [misc:0] [GenerateTrees] 941755249 us [avg: 941755249.0 us]
16:02:21 <xarick> feels like industries all over again
16:10:58 *** SigHunter has joined #openttd
16:17:57 <xarick> /* The higher we get, the more trees we plant */
16:25:18 <peter1138> I thought this said something else for a moment...
16:27:53 <andythenorth> No umlaut on FIRS
16:31:57 <xarick> this is really a big number, considering it's inside 3 loops
16:44:04 *** gelignite has joined #openttd
16:58:52 <xarick> oh i see, this is spamming GetTileZ
16:59:25 <xarick> does it really need this much height precision?
17:00:29 <squirejames> andythenorth: FÏRS is the Scandy version 😛
17:01:23 <belajalilija> I think Icelandic uses í
17:01:31 <belajalilija> Not Scandinavian, but still
17:02:00 <squirejames> Or that little o (an overring? I think?)
17:02:00 <squirejames> Anyways, language jokes for all
17:06:15 <andythenorth> I wanted to do more FIRS 😛
17:07:49 <belajalilija> andythenorth: Aye is a bit windy outside
17:10:30 <andythenorth> peter1138: Sounds like FIRS GS 😛
17:13:21 <johnfranklin> Iceland is not Icelandic 😛
17:13:44 <squirejames> SHÅRK, Norwegian Boat set
17:14:18 <squirejames> 😄 we're ridiculous
17:18:52 <johnfranklin> Is Iceland (supermarket) cheap enough?
17:51:41 <xarick> very evenly distributed
17:51:47 <xarick> but this is debug build
17:53:13 <truebrain> How pedantic, that capitalisation has to be equal 😛
18:09:59 <xarick> this logic makes little sense
18:10:10 <xarick> or I don't understand the purpose
18:11:22 <xarick> trees are placed in a rectangular fashion but the height difference between the first tree placed and the others can't be higher than 2
18:11:52 <xarick> why's that for? if then in the next iterations the base tree can get higher?
18:12:56 <peter1138> So the trees follow the hills.
18:14:19 <xarick> it's a costly operation though
18:16:00 <LordAro> sure, but int main() { return 0; } would make for a boring game
18:20:35 <xarick> 919509766 us meh... barelly an improvement
18:31:55 <peter1138> Why do you keep measuring such long timespans in microseconds?
18:32:35 <peter1138> And that is 15 minutes. What is taking 15 minutes?
18:39:37 <peter1138> So from 920 seconds to 860 seconds.
18:39:52 <peter1138> If you are benchmarking Debug... don't.
18:40:38 <xarick> map height manual set to 255, snow coverage 100%, very rough, variety set to none, 1% water
18:41:06 <LordAro> you're not wrong, 4k alpinist alpine map does take a while
18:41:15 <LordAro> have you considered using a smaller map size for testing purposes?
18:42:20 <LordAro> waiting 15 minutes to see if anything's faster is madness
18:42:44 <LordAro> i've played around with desert/rainforest generation a bit, haven't managed to make it meaningfully faster
18:42:52 <LordAro> well, not without breaking it
18:43:40 <xarick> end result after ~14 minutes, you can barelly tell the rectangular shape
18:46:35 <LordAro> hang on, are you always running this within the VS debugger?
18:48:05 <xarick> no, I build with visual studio, then i use a shortcut to run with this:
18:48:05 <xarick> "E:\OpenTTD Visual Studio\SamuXarick\OpenTTD\out\install\x64-Release\openttd.exe" -d -g -G 1
18:48:14 <LordAro> well that's something
18:49:47 <xarick> the value of j being ht * 2 * 3
18:50:01 <xarick> tile height 255 at the worst
18:50:49 <xarick> hmm, is it possible to cram 1500 trees in a 16x16 area?
18:51:04 <xarick> or am I misunderstanding this
18:52:54 <xarick> I'm gonna adjust the value of j to a min
18:53:47 <xarick> it can't plant trees on trees
18:58:00 *** Wormnest has joined #openttd
19:09:16 <Heiki> Successfully updated string 'STR_LIST_SEPARATOR' Sat Dec 7 19:08:52 2024
19:16:15 *** Flygon has quit IRC (Read error: Connection reset by peer)
19:48:19 <peter1138> Great, thanks for confirming 🙂
19:49:48 <andythenorth> maybe I should stop watching Le Bureau
19:50:16 <andythenorth> I'm on season 4, and it relies a lot on subtitles, so I can't watch TV and make grf at the same time
20:18:25 <xarick> so i get more trees with j capped than without
20:19:45 <squirejames> peter1138: The Fast and the FIRious.
20:19:45 <squirejames> 2 Fast, 2 FIRious
20:20:42 <xarick> let me try with a more "realistic" 4096x4096 map
20:29:51 <xarick> once again... i get more trees with a lower j
20:30:00 <xarick> someone overestimated the number of tries
20:31:29 <andythenorth> I should back out the FIRS and Horse cargo class changes eh 🙂
20:31:36 <andythenorth> those are unforced errors
20:33:03 <xarick> maximum range from first tree location means at maximum 16 * 16 = 256 tiles
20:40:33 <xarick> 256 tiles * 1000 tries * 255 max height * 2 * 3 above snow line * 256000 tries scaled by map size * 4 times =
20:42:52 <xarick> does it really need 1000 tries to find a place for a tree in a 16*16 area 😦
20:45:21 <xarick> and then, reinforce the area j more times with trees, that's height dependant, goes from 6 to 1530
20:56:14 <LordAro> peter1138: why does param_end need to exist? can't whatever uses it just use config->param.size() ?
20:56:39 <LordAro> or this->param or whatever
20:56:49 <peter1138> There are two sets of parameters.
20:57:04 <peter1138> GRFConfig is a vector, and is what is used when setting things up.
20:57:12 <peter1138> GRFConfig's params...
20:57:52 <peter1138> GRFFile's params is still a fixed size array, and so still needs the number of parameters set.
20:58:33 <LordAro> why is it a fixed size array? :p
21:01:38 *** kuka_lie has quit IRC (Quit: leaving)
21:06:02 <peter1138> Oh, commit before compile...
21:17:02 <peter1138> Seems to work though.
21:26:09 <_glx_> trying to improve output
21:39:38 <xarick> quick test - I'm surprised out of 1000 attempts, only 531 passed the `abs(x) + abs(y) > 16` condition
21:50:19 <_glx_> before and after (using a modified openttd to trigger some warnings)
21:55:12 <andythenorth> more helpful eh 🙂
21:56:09 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:01:40 <peter1138> SmallMapWindow has a switch which is... not really a switch.
22:01:55 <peter1138> Every case uses `[[fallthrough]]`
22:05:23 *** ChanServ sets mode: +v tokai
22:10:59 <xarick> [2024-12-07 22:09:35] dbg: [misc:0] num_tree_tiles = 14191355
22:10:59 <xarick> [2024-12-07 22:09:35] dbg: [misc:0] [GenerateTrees] 59762210 us [avg: 59762210.0 us]
22:11:13 <xarick> let me test the worst case
22:12:52 <xarick> [2024-12-07 22:12:38] dbg: [misc:0] num_tree_tiles = 15007417
22:12:52 <xarick> [2024-12-07 22:12:38] dbg: [misc:0] [GenerateTrees] 61573526 us [avg: 61573526.0 us]
22:13:33 <xarick> ... and I still don't think this method is that good
22:14:49 <xarick> first it creates a diagonal tile area, then creates a vector of available tiles which can still accept trees, then it selects a random tile from the resulting vector and places a tree
22:15:32 <xarick> if no tiles are available, it returns false, forcing the j countdown to break immediately
22:21:54 <andythenorth> definitely naptime
22:32:57 <xarick> diagonal tile iterator is a little bit heavy
22:38:55 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
22:52:24 <xarick> there has to be a better approach
23:03:19 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:03:19 *** tokai|noir has joined #openttd
23:03:19 *** ChanServ sets mode: +v tokai|noir
23:04:15 <_jgr_> The iterator increment is done as an indirect vtable call, so it's not surprising that it's more expensive
23:04:52 <_jgr_> Still, the tree part of map generation is not that significant in the big scheme of things
23:08:46 <_jgr_> You could just use DiagonalTileIterator directly
23:10:09 *** tokai has quit IRC (Ping timeout: 480 seconds)
23:11:32 <_jgr_> If you're going to the trouble of creating this temporary vector it would seem useful to preserve it across all the calls to PlaceTreeAtSameHeight from the loop at its call site
23:17:11 <peter1138> Pretty sure you don't need to be faffing with unique_ptr there.
23:34:38 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:36:00 <_glx_> this crash report was for you _jgr_
23:36:21 *** Wormnest has joined #openttd
23:40:33 *** joehtosis has joined #openttd
23:40:33 <joehtosis> _glx_: I posted to the corrected url you sent, thanks for the heads up.
23:51:06 *** Etua has quit IRC (Ping timeout: 480 seconds)
continue to next day ⏵