IRC logs for #openttd on OFTC at 2019-02-18
            
00:04:41 *** Wolf01 has quit IRC
00:26:00 <peter1138> Hmm, what happened? So quiet :(
00:26:06 <peter1138> Oh yeah, of course, IRC is dead.
00:26:44 *** nielsm has quit IRC
00:27:37 <milek7> i guess most people went to sleep
00:27:49 <peter1138> Weak.
00:41:26 <peter1138> (since C++20)
00:41:29 <peter1138> Damn, can't use that :(
00:47:36 <supermop_Home> IM DESIGNING A DONUT KIOSK
00:47:45 <peter1138> Oo
00:47:51 <supermop_Home> in autocad
00:47:55 <supermop_Home> so caps
00:48:17 <supermop_Home> rather I designed it, now just annotating some elevations
00:48:32 <supermop_Home> while it renders in rhino in the background
00:59:05 <supermop_Home> hmmm
00:59:32 <supermop_Home> 90 minutes into this rendering I see that the espresso machine does not have it's material applied
01:01:17 *** HerzogDeXtEr has quit IRC
01:02:01 *** tokai has joined #openttd
01:02:01 *** ChanServ sets mode: +v tokai
01:09:00 *** tokai|noir has quit IRC
01:18:07 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #7235: New non-rectangular sparse station catchment area https://git.io/fh5s1
01:32:40 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: New non-rectangular sparse station catchment area https://git.io/fh5HZ
01:44:42 <Samu> a
01:44:47 <peter1138> b
01:46:09 <peter1138> Yay, all checks passed.
02:04:57 <peter1138> Oh, that's why my "git pr" command no longer works... my git version got upgraded and it includes one, but it works differently.
02:06:14 <peter1138> Or something else.
02:07:26 <peter1138> Ah, git-extras was installed.
02:08:25 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5H2
02:23:57 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5HK
02:31:05 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5HD
02:35:13 *** snail_UES_ has joined #openttd
02:36:14 *** Thedarkb-X40 has joined #openttd
02:42:40 *** Wormnest has quit IRC
03:03:15 *** Thedarkb-X40 has quit IRC
03:26:13 *** Progman has quit IRC
03:26:39 <Samu> what have you guys done to zoom?
03:26:44 <Samu> it's so slow now
03:26:47 <Samu> https://imgur.com/sifVKTq
03:35:00 *** Samu has quit IRC
04:25:57 *** debdog has joined #openttd
04:29:19 *** D-HUND has quit IRC
04:56:59 *** glx has quit IRC
05:00:11 *** supermop_Home has quit IRC
07:26:38 *** cHawk has quit IRC
07:31:34 *** cHawk has joined #openttd
07:41:06 <peter1138> Nothing to do with having 15 AIs running...
07:49:23 *** snail_UES_ has quit IRC
07:57:12 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5dC
08:08:10 *** nielsm has joined #openttd
08:26:20 *** andythenorth has joined #openttd
08:27:07 <nielsm> morning
08:27:40 <nielsm> I had forgotten all about taking today and tomorrow off work, and had to be reminded by a colleague after turning up at the office
08:30:00 <peter1138> Oh no!
08:30:32 <peter1138> That's like being a kid and turning up to school on a Saturday.
08:37:28 <peter1138> Brave.
08:37:29 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7220: Change: Increase maximum number of orders from 64000 to ~16.7m. https://git.io/fhQLh
08:37:32 <peter1138> Foolish.
08:37:35 <peter1138> Both.
08:37:56 <peter1138> "If you wish, you can delete your fork of **OpenTTD/OpenTTD**"
08:38:03 <peter1138> Yeah, no, why the heck would I want to do that.
08:42:57 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5d7
08:54:18 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7194: Fix: Remove desert around lakes upon generation. https://git.io/fh5FO
08:54:24 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5F3
09:04:03 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5F8
09:04:54 <peter1138> Oh, the station part of an oil-rig produces cargo? Hmm.
09:05:17 <peter1138> Ah, no, the station part of an oil-rig tries to find a nearby station. Hmm.
09:05:41 <peter1138> Need a back trace to find the caller.
09:05:45 <peter1138> So need debug mode.
09:05:46 <peter1138> Yawn.
09:06:25 <DorpsGek_II> [OpenTTD/OpenTTD] GabdaZM commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5F0
09:08:56 <peter1138> nielsm, yeah, that test is very worthwhile.
09:09:12 <peter1138> Glad I didn't try it first, as I may not have bothered with the caching stuff.
09:10:20 <nielsm> heh
09:10:33 <nielsm> it sounds like it's actually faster now than originally?
09:10:56 <peter1138> I think it's about the same.
09:11:21 <peter1138> It no longer needs to search the map array for every cargo delivery.
09:14:14 <andythenorth> hmm Horse
09:14:22 <andythenorth> will it ever be done? o_O
09:16:15 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7194: Fix: Remove desert around lakes upon generation. https://git.io/fh5FP
09:16:46 <peter1138> I think my additional FindStationsAroundTiles() function that takes a nearby list is spurious.
09:17:23 <peter1138> That list has already been catchment checked, so no need to do any looping, just convert from std::set<Station *> to StationList.
09:20:23 <peter1138> In which case, I may not need to call it at all.
09:21:16 <andythenorth> oof been doing Horse 2 since August 2017
09:21:22 <andythenorth> it's probably 'done'
09:21:34 <andythenorth> apart from I haven't drawn all the trains :x
09:57:35 *** andythenorth has quit IRC
10:48:59 *** andythenorth has joined #openttd
11:14:13 <DorpsGek_II> [OpenTTD/OpenTTD] citymania-org commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5Aj
11:17:49 <_dp_> damn, now I have two github accounts thanks to azure thing
11:18:03 <peter1138> Har har
11:18:05 <_dp_> well, might as well switch to this one
11:18:32 <peter1138> Don't be a cunt though, that's my job.
11:19:13 <peter1138> You can suggest better algorithms without implying that what's been suggested is totally worthless.
11:20:09 <_dp_> it's not worthless, it would work fine for random town distribution
11:20:13 <peter1138> It should be obvious that not everybody studies this algorithm stuff, they just scratch an itch.
11:20:25 <_dp_> just what's the point of making several solutions for one problem?
11:20:55 <peter1138> And most people just scratching their itch won't know about the name of some random algorithm that does something efficiently.
11:21:34 <andythenorth> at least include [emoji] :P
11:21:39 <andythenorth> it takes the edge off it
11:21:52 <andythenorth> we have quite a lot of new contributors, and I want them to stay
11:21:56 <peter1138> As you do seem to know, this is rare skill, and it'be nice if in cases like this you could just suggest the algorithms to use without being sarcastic.
11:21:56 <_dp_> andythenorth, right, I totally forgot xD
11:27:04 <_dp_> peter1138, there are just too many spatial structures, you need a complete list of use cases to pick the best one
11:27:29 <_dp_> though k-d tree would probably work just fine for everything
11:28:00 <_dp_> good compromise between speed and simplicity
11:29:02 <andythenorth> bbl etc
11:29:03 *** andythenorth has quit IRC
11:29:23 <_dp_> but anyway finding some spatial library would be even better regardless of what structure it uses
11:48:11 <peter1138> _dp_, sure, but most people don't know *any* of them.
11:48:23 <peter1138> I never studied algorithms, and it shows.
11:48:49 <peter1138> Finding some spatial library is useful if you know you should be looking for a spatial library.
11:51:55 <peter1138> So I'm currently using an unordered_set to maintain a list of station catchment tiles.
11:52:02 <peter1138> What algorithms should I use instead? :p
11:53:53 <nielsm> bitmap with offset?
11:54:08 <nielsm> seeing it's most likely the catchment area is a rectangle-ish shape
11:54:32 <nielsm> i.e. most "set" bits are in a clump and most of the rest is clear
11:55:05 <Eddi|zuHause> storing a circumrectangle for early "not overlapping" tests?
11:55:12 <nielsm> for instance get the classic station rectangle bounds (orthogonal tile area), make a bitmap that size, and fill it in
11:57:20 <peter1138> Are you talking about when I am building the list or querying the list?
11:57:46 <peter1138> For querying we already know we are within this rect, otherwise we wouldn't be querying it.
11:57:59 <peter1138> Bitmap.
11:58:05 <peter1138> std::bitset?
11:58:15 <_dp_> peter1138, I kinda want to look for the library myself but have my hands full with citymania servers atm :(
11:58:19 <_dp_> Also want to find some solution for Tz0-Tz4 highlight as well
11:58:22 <_dp_> it's much harder as those damn things grow
11:58:42 <_dp_> to put all the large towns into a separate list/set and using same spatial tree for small ones will work I guess.
11:59:05 <DorpsGek_II> [OpenTTD/OpenTTD] GabdaZM commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5xo
11:59:20 <_dp_> a bit of a patchpack-quality solution though as it needs hardcoded threshold
12:02:08 <_dp_> peter1138, I haven't looked at your station patch yet, what are you trying to solve, find all stations around the industry?
12:02:40 <nielsm> I think so yes, find all candidate stations to have cargo supplied from industry
12:03:14 <peter1138> It's solved, just probably not using some fancy efficient algorithm, because I never studied algorithm.
12:04:28 <nielsm> wouldn't even a simple quadtree over towns, and one over stations, be useful in general, I wonder?
12:08:04 <peter1138> std::quadtree?
12:08:15 <peter1138> :(
12:08:18 <nielsm> I doubt that exists :)
12:09:01 <nielsm> it's just splitting two-dimensional space into four quadrants, and each quadrant containing multiple points are split into further quadrants
12:09:16 <nielsm> all equal splits
12:11:41 <_dp_> peter1138, and where is the bottleneck in your current implementation?
12:11:58 <_dp_> tile set is a reasonable thing, don't see yet why is it being slow
12:12:34 <peter1138> It's okay, I was just test it for all stations, which is a lot on a 4096^2 map.
12:13:39 <peter1138> That's improved by filtering on station catchment rect first, so the list of stations to test is much smaller.
12:13:46 <_dp_> peter1138, you mean max amount of stations? how much is that even?
12:13:59 <peter1138> There actually isn't a bottleneck at the moment.
12:14:09 <peter1138> But that doesn't mean things can't be improved.
12:14:38 <peter1138> Also there's a bit overhead (cpu and code-size wise) in maintaining nearby lists for towns and industries.
12:14:48 <peter1138> Dunno
12:15:11 <peter1138> https://fuzzle.org/~petern/ottd/wentbourne.sav
12:15:16 <peter1138> ^ this is my stress-test save.
12:15:35 <peter1138> Might be useful for testing station sign performance improvements too.
12:16:33 <peter1138> _dp_, I wanted to achieve non-rectangular catchments, so I evolved a solution that worked. I didn't think "hmm, i can use this algorithm" at any point.
12:21:35 <_dp_> peter1138, I shouldn't have opened that save on my laptop xD
12:21:39 <peter1138> Haha
12:21:50 <peter1138> It's 8 fps on my i7-8700k
12:22:29 <nielsm> it's rather heavy :P
12:23:34 <_dp_> and that's only 2k stations, when max is 0xFFFD it seems
12:23:54 <_dp_> @calc 0xFFFD * (64+20)**2
12:23:54 <DorpsGek> _dp_: 462400848
12:24:03 <peter1138> Ouch.
12:24:24 <peter1138> Wait, what's the (64+20)^2?
12:24:36 <_dp_> yeah, that's a lot of tiles... but I thought it would be worse tbh
12:24:45 <peter1138> Maximum catchment.
12:25:06 <peter1138> You probably can't fit that many on the map, though.
12:25:35 <_dp_> peter1138, there is more than enough space on 4k map :p
12:25:47 <_dp_> but yeah, it's getting unreasonable
12:26:02 <_dp_> @calc 5000 * (32+10)**2
12:26:02 <DorpsGek> _dp_: 8820000
12:26:24 <peter1138> 2^4096
12:26:30 <_dp_> not that bad
12:26:35 <peter1138> Wrong dimension :D
12:26:47 <peter1138> 16777216 tiles
12:27:00 <peter1138> Is somewhat less than 462400848
12:27:43 <_dp_> peter1138, yeah, but more than 0xFFFD stations
12:27:56 <_dp_> 462400848 is the max possible number of catchment tiles
12:28:01 <_dp_> that I got wrong btw
12:28:08 <_dp_> @calc 0xFFFD * (64+16*2)**2
12:28:08 <DorpsGek> _dp_: 603952128
12:28:26 <peter1138> Why 16*2?
12:28:49 <peter1138> Max catchment is 10, so 64+20 was correct.
12:28:51 <_dp_> damn, nwm, that was right
12:29:11 <_dp_> I thought it's 0x10 for some reason xD
12:30:15 <peter1138> :)
12:30:42 *** andythenorth has joined #openttd
12:43:38 <andythenorth> well
12:44:36 <peter1138> That's true.
12:46:12 <andythenorth> so I should redesign Horse to use vehicle variants? o_O
12:51:42 <peter1138> Yes.
12:51:46 <peter1138> No.
12:51:50 <peter1138> You're just procrastinating it.
12:52:14 <peter1138> Do you want vehicles to automatically change appears/specs over time?
12:52:19 <andythenorth> do I?
12:52:33 <peter1138> Do you want vehicles to be able to be repainted or upgraded over time?
12:52:45 <andythenorth> I already removed that from 2 newgrfs :)
12:52:51 <andythenorth> so nah
12:53:02 <andythenorth> auto-replace between variants, right?
12:53:08 <peter1138> Variants would require autoreplace to change their stuff.
12:53:09 <peter1138> Yes.
12:53:17 <peter1138> Basically they become independent.
12:53:22 <andythenorth> yeah, so they're different IDs so just use autoreplace
12:54:13 <peter1138> "Operation on non-blocking socket would block." Uhmm.. hmm..
12:54:15 <andythenorth> so....what happens if one variant is an engine and another is a wagon? o_O
12:54:40 *** WWacko1976-work has quit IRC
12:54:44 <peter1138> You wouldn't be able to autoreplace between them.
12:55:01 <andythenorth> will they appear in the same group?
12:55:05 <peter1138> Presumably.
12:55:06 <andythenorth> in the buy menu
12:55:24 <peter1138> Like it'd be a loading error.
12:55:30 <peter1138> *likely
12:58:14 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7242: Codechange: Improve performance of town name refresh on viewports https://git.io/fh5pj
13:03:25 <Eddi|zuHause> so, i spent some hours in these caves, haven't found any tungsten... do i need to go deeper or am i just unlucky?
13:08:00 <andythenorth> hmm
13:08:04 <andythenorth> FIRS Steeltown is broken
13:08:19 <peter1138> Oh no.
13:08:30 <andythenorth> oh yes
13:08:41 <andythenorth> time to start FIRS 4
13:08:47 <Eddi|zuHause> i did finally find an aluminium deposit for a whooping 2 aluminium
13:08:50 <andythenorth> and 64 cargos and stuff
13:09:07 <Eddi|zuHause> now i can build trailers for my tractor, or something else
13:11:58 <andythenorth> hmm
13:12:00 <andythenorth> cryo tankers?
13:12:18 <andythenorth> probably just use 'tank car' already :P
13:14:04 <andythenorth> the thing about changing FIRS
13:14:15 <andythenorth> it breaks my savegames really frequently :P
13:28:09 <andythenorth> so does a cryo plant increase production if ENSP are delivered?
13:28:14 <andythenorth> or is it fixed output? o_O
13:28:18 <DorpsGek_II> [OpenTTD/OpenTTD] citymania-org commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5ha
13:29:58 <peter1138> and?
13:30:46 <Eddi|zuHause> i think there's something
13:32:08 <andythenorth> cliffhanger
13:32:25 <Eddi|zuHause> legen... wait for it...
13:32:48 <andythenorth> hmm
13:33:06 <andythenorth> 64 cargos, 52 of them different subtypes of common metals? o_O
13:33:13 * andythenorth wonders
13:33:31 <peter1138> Hah
13:33:36 <nielsm> 20 grades of steel
13:34:00 <Eddi|zuHause> so essentially just random numbers? :p
13:34:11 <andythenorth> pig iron, cast iron, molten iron
13:34:23 <andythenorth> steel, stainless steel, specialty steel
13:34:30 <peter1138> Damascus steel
13:36:07 <Eddi|zuHause> i meant these quality numbers like "301"
13:36:40 <nielsm> hmm, I tried writing a k-d tree builder for towns, in a debug build it can construct 368 towns (wentbourne!!) in a little less than 4 ms
13:36:55 <nielsm> I should maybe try the same for stations
13:37:22 <nielsm> right now I'm not actually sorting the items across the dimension, just taking the first element and praying :P
13:38:14 <andythenorth> reynolds 301
13:38:49 <andythenorth> I gave away my Raleigh bike with a Reynolds 301 frame
13:38:50 <DorpsGek_II> [OpenTTD/OpenTTD] ldpl commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5hH
13:38:53 <andythenorth> it was crap
13:39:01 <andythenorth> now it sells on ebay for ££
13:40:33 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5h7
13:41:02 <nielsm> 2263 stations tree built in 30 ms
13:41:19 <nielsm> that's rather slow, wouldn't want to rebuild that all the time
13:41:40 <peter1138> Is it quick to add/remove individually, or does it need to rebuild?
13:42:03 <nielsm> "depends" :P
13:42:27 <nielsm> I haven't actually written a function to insert into the tree
13:42:40 <nielsm> or look up in it
13:43:29 <Eddi|zuHause> these tree structures are usually written for insert and lookup operations, not complete rebuilding
13:45:06 <nielsm> yeah I should probably aim to make a balanced tree initiall, even if the cost is higher
13:45:17 <nielsm> then maybe have a dumb insert without rebalancing'
13:45:47 <_dp_> peter1138, oops, didn't notice it was unfinished
13:45:53 <nielsm> I'm not sure how to rebalance a tree of this type
13:45:58 <_dp_> tbh I'm not sure where is it heading myself xD
13:50:49 <peter1138> Heh
13:51:10 <peter1138> Also, I really like the temporary tile highlight in my patch, would be good as a separate PR :D
13:52:37 <peter1138> https://fuzzle.org/~petern/ottd/towncatchment2.png < this one
13:55:25 <_dp_> peter1138, how does it choose town for red highlight?
13:55:53 <_dp_> but yeah, highlights are good, we need more of them :)
13:55:56 <peter1138> It can only showing the catchment of 1 town.
13:56:00 <peter1138> -ing
13:56:14 <_dp_> it's just they look a bit ugly like that
13:56:39 <peter1138> In what way?
13:57:29 <peter1138> Kinda hard to see when it has to be zoomed out to fit it all. And you nede to make things transparent.
13:58:05 <nielsm> https://0x0.st/ziTQ.png now it's slow!!
13:58:31 <peter1138> Hmm.
13:59:23 <peter1138> Caek time!
13:59:46 *** Gabda has joined #openttd
13:59:52 <Gabda> hi
14:00:13 <Gabda> question about poiners stored in vector
14:00:19 <nielsm> https://0x0.st/ziT1.png <-- looks much more balanced now
14:00:23 <Gabda> https://github.com/OpenTTD/OpenTTD/pull/7242/files#diff-06bd4ba3f3d3562bbd2bfab378786ca4R343
14:01:00 <Gabda> if more towns are added, and they get reallocated
14:01:10 <Gabda> would this vector break?
14:01:11 <nielsm> towns don't get reallocated
14:01:23 <nielsm> they're stored in a pool of fixed size
14:01:42 <nielsm> neither do stations, industries, vehicles
14:02:00 <Gabda> so I can store the memory addresses without problem?
14:02:04 <nielsm> yes
14:04:02 <Gabda> and should I?
14:04:17 <Gabda> or storing the indexes would be better?
14:06:11 <peter1138> Depends if you need the pointer or just the index.
14:06:59 <Eddi|zuHause> is looking up the pointer from the index really a troublesome operation?
14:07:10 <nielsm> it's not :)
14:07:18 <nielsm> storing the index will typically save memory
14:07:33 <peter1138> Save a tiny amout of memory.
14:07:46 <nielsm> 2 or 6 bytes depending on 32 or 64 bit
14:07:59 <nielsm> but depending on amount of data it can add up :P
14:08:18 <Eddi|zuHause> we're talking about maybe 3000 towns?
14:10:19 <peter1138> Actually how does it achieve this resizing? I see a ReallocT...
14:11:17 <nielsm> faster in release build :P https://0x0.st/ziTL.png
14:11:57 <peter1138> Oh, yes.
14:12:11 <peter1138> Not much point testing a debug build for performance, only correctness.
14:12:46 <Gabda> oh, you are building a kdtree?
14:12:55 <nielsm> yeah trying to make a generic thing
14:13:00 <nielsm> generic-ish
14:13:45 <Gabda> splitting by tile x-y or col-row?
14:13:56 <peter1138> Oh really.
14:13:58 <nielsm> tily x/y
14:14:30 <peter1138> The pool is just a lot of individual allocations, not a big block split up.
14:14:35 <nielsm> I suppose it could just as well split by screen coordinates
14:14:53 <peter1138> So the realloc is just for the part of the pool that stores the pointers to the actual items.
14:15:12 <peter1138> I always assumed it was an actual proper pool :
14:15:13 <peter1138> :p
14:15:38 <Gabda> i was thinking about is splitting by col-row would make the "circle" when searching a point touch less bounding rectangles
14:15:53 <Gabda> as a speciality of manhattan
14:16:44 <Gabda> is -> if
14:16:46 <nielsm> https://github.com/nielsmh/OpenTTD/commit/efa3f009afdfc74ef52c3276bcbf8f1f5734bd03
14:18:38 <peter1138> Can this be used to find stations near an industry?
14:18:43 <peter1138> Asking for a friend.
14:18:48 <nielsm> that would be one use case
14:19:28 <peter1138> Hmm, how do you get information from it?
14:19:39 <nielsm> right now you don't :P
14:19:48 <peter1138> Right, so I wasn't missing anything :)
14:22:12 <Gabda> tgi
14:22:24 <Gabda> this will be interesting :)
14:22:59 <Gabda> (I am writing from mobile, tgi was a random char seq.)
14:24:08 *** Flygon_ has quit IRC
14:26:58 <DorpsGek_II> [OpenTTD/OpenTTD] ldpl commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdeI
14:27:35 <Eddi|zuHause> between looking at the sky and looking at the ground, my fps drops to 1/4
14:31:37 <_dp_> totally random idea: turn Tile type into separate array for each field
14:31:40 <_dp_> coz CPU cache
14:33:39 * andythenorth wonders whether carbon black justifies a train :P
14:35:11 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdeW
14:35:30 <peter1138> _dp_, tile type?
14:35:36 <peter1138> You mean like it used to be?
14:35:43 <peter1138> _m8[t]
14:35:50 <andythenorth> apparently https://c8.alamy.com/comp/DB6ND9/hopper-cars-carrying-carbon-black-on-bnsf-freight-train-at-perry-oklahoma-DB6ND9.jpg
14:36:10 <andythenorth> also these are quite unique looking trucks http://cltautotrasporti.it/wp-content/uploads/2015/07/cb-03.jpg
14:38:13 <_dp_> peter1138, yeah
14:38:35 <peter1138> Doable. It was merged before the map accessors were created.
14:38:51 <peter1138> Worth benchmarking it.
14:41:23 <peter1138> nielsm, why uint16 for your node index/coordinates?
14:42:21 <nielsm> please don't ask
14:42:24 <peter1138> Oh.
14:42:48 <peter1138> Also, put T element first, for alignment reasons.
14:43:01 <peter1138> Not that it matters I suppose.
14:43:17 <peter1138> uint16 could probably be a template parameter.
14:46:29 <peter1138> _dp_, am I confusing "iterate" with some other meaning? I am not considering a "contains" test to be iterating, as it is a hash internally afaik.
14:48:42 *** andythenorth has quit IRC
14:50:58 <_dp_> peter1138, which "iterate" is you talking about?)
14:51:31 <peter1138> 2.
14:52:02 <peter1138> FindStationsAroundTiles doesn't iterate the set, at least not in my understanding of iterators.
14:52:28 <_dp_> peter1138, ctrl-f "iterate" only finds your last comment ;)
14:54:16 <nielsm> does this look right? :) https://0x0.st/ziTy.txt
14:54:35 <nielsm> so many sigils
14:55:13 <peter1138> Ah you said "loop"
14:55:17 <peter1138> catchment_tiles loop
14:55:48 <peter1138> I don't loop on the catchment tiles, but there is a test inside a loop, yeah.
14:57:20 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5s1
14:57:49 <peter1138> ^^
14:58:03 <peter1138> AddNearbyStations() is basically just converting from std::set to StationList :p
15:01:09 <_dp_> "So a loop of (catchment + area)**2 tiles" I meant the loop before your changes
15:01:42 <_dp_> also I'm talking about FindStationsAroundTiles, you nhir
15:01:48 <_dp_> still have w*h here
15:02:40 <Eddi|zuHause> i'm trying to follow your discussion, but neither of your statements make much sense
15:02:45 <peter1138> Yeah, 1*1 or 2*2 are the only occurrences.
15:03:04 <peter1138> Not 64x64 or anything like that.
15:03:23 <Eddi|zuHause> there are 2*1 houses
15:03:40 <_dp_> ah, "town->stations_near->catchment_tiles loop" yeah, ignore that one)
15:03:43 <peter1138> Houses are 1x1, each part produces individually on different tickets.
15:03:54 <_dp_> I meant stations_near loop there
15:03:59 <peter1138> The only thing which is 2x2 is... Company HQ.
15:04:13 <peter1138> stations_near is pretty tiny.
15:04:29 <_dp_> peter1138, don't industries also use FindStationsAroundTiles?
15:04:47 <peter1138> Not any more. I checked the flow and it's unnecessary.
15:04:52 <_dp_> peter1138, well, it depends on how many stations are there
15:05:03 <peter1138> Because i->stations_near already contains exactly the info which is needed.
15:05:35 <peter1138> We're talking low tens, not hundreds or thousands.
15:05:46 <peter1138> Hmm, this threading is getting confusing :)
15:06:03 <_dp_> xD
15:06:46 <peter1138> Basically for industries we can either just directly use stations_near, or convert it to a StationList when it's needed as input to some other function. Ideally I would fix everything to use the same type.
15:06:56 <_dp_> peter1138, well, we're comparing it to tens (max 20) tile search rows
15:07:16 <Eddi|zuHause> how do you get "max 20"?
15:07:20 <peter1138> For houses, I determined that it's always 1x1, so took the loop out.
15:07:23 <peter1138> _dp_, 20^2
15:07:27 <peter1138> So yeah, 400 tiles.
15:07:32 <peter1138> Eddi|zuHause, MAX_CATCHMENT is 10.
15:07:36 <peter1138> Actually it's 21x21
15:07:41 <peter1138> 441
15:08:01 <_dp_> peter1138, 20 rows, one row is one operation basically for cpu, I'm pretty sure of that
15:08:02 <nielsm> finally got it wrangled to compile...
15:08:14 <peter1138> Err...
15:08:18 <peter1138> What?
15:08:37 <peter1138> I don't think that's actually the case.
15:09:21 <_dp_> peter1138, vectorization+l1 cache
15:09:33 <_dp_> peter1138, compared to set lookup I'd bet on row search
15:09:35 <Eddi|zuHause> in what mythical data structure does checking one row (for what?) consist of one single instruction?
15:10:46 <_dp_> Eddi|zuHause, I don't mean literally one operation, but CPUs are very very very good at optimizing stuff like that
15:10:47 <peter1138> _dp_, for each tile, it is checking the tiletype, getting the station index, then getting the station, then checking if that station is valid, then checking against the station's real catchment (before it was MAX_CATCHMENT) ...
15:10:53 <peter1138> the doesn't sound like one operation to me.
15:11:06 <peter1138> I don't think it'll be optimizing that into a one-op row.
15:11:41 *** Progman has joined #openttd
15:11:53 <peter1138> (_settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED);
15:11:59 <peter1138> I could apply that optimization, woo.
15:14:22 <_dp_> peter1138, hmm, ok, mb I got too carried away thinking how fast it could be not how it actually is xD
15:14:35 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5s1
15:15:22 <peter1138> I wonder about std::bitset.
15:15:24 <_dp_> peter1138, checking station for each tile probably doesn't cache well indeed
15:15:36 <peter1138> And its' not just that op :-)
15:15:46 <peter1138> And you can't skip early once you have one, because you need them all.
15:16:02 <peter1138> (Although you can skip the distance tests when you've already included one)
15:16:06 <_dp_> peter1138, hm, or mb it does, since most checks lead to same station so it can cache
15:16:20 <_dp_> peter1138, also you can build list first and check stations later
15:16:28 <nielsm> hm what's the easiest way to get a plain string of a station name (for console printing)
15:16:40 <_dp_> bitset I've no idea how good is
15:16:52 <_dp_> kinda hard to screw up something this simple so should be ok xD
15:17:13 <Eddi|zuHause> so, how then is building a list of stations faster than taking the list of stations we already built before?
15:17:31 <peter1138> Ok, bitset is an issue.
15:17:40 <peter1138> bitsets are fixed size.
15:18:15 <peter1138> 7225 bits for each one.
15:18:21 <peter1138> I don't think that's even a memory optimization.
15:18:46 <Gabda> nielsm, I am interested in that as well
15:19:00 <peter1138> I'm getting confused.
15:19:09 <_dp_> peter1138, you mean it pre-allocates that much? can't it be changed?
15:19:20 <peter1138> It's std::vector<bool> that can be variable, and is also optimized especially for bools.
15:19:32 <peter1138> _dp_, yeah, std::bitset<size> is a template parameter.
15:19:39 <nielsm> Gabda: https://0x0.st/ziTx.txt
15:19:43 <peter1138> So std::vector<bool> is doable.
15:19:44 <nielsm> try that
15:20:05 <nielsm> hmm no
15:20:13 <nielsm> unless it prints in black on black
15:20:14 <_dp_> only thing I know about std::vector<bool> is that is a failure of an std container xD
15:20:21 <peter1138> Well then.
15:21:04 <_dp_> doesn't mean it works bad, just not a proper container :)
15:21:23 <nielsm> ah this works
15:21:25 <_dp_> coz you can't take & of an element
15:21:40 <nielsm> Gabda: https://0x0.st/ziT3.txt
15:21:55 <nielsm> https://0x0.st/ziTY.png
15:22:01 <nielsm> now to check if it's actually correct :D
15:22:28 <peter1138> So a 4x2 rail station would be ... 15 bytes, not at least 120.
15:22:51 <peter1138> Storing tileindex is pretty wasteful, certainly.
15:23:11 <nielsm> hmm no, it seems to do something wrong
15:23:22 *** sla_ro|master has joined #openttd
15:23:39 <peter1138> _dp_, it's useful discussion cos I found those optimizations.
15:23:44 <Gabda> the printing or the algorithm to find the nearest station?
15:23:49 <peter1138> And there's more to do.
15:24:48 <_dp_> I'd probably just make an uint8 * though for a bit map instead of fancy containers
15:25:16 *** kiwitree has joined #openttd
15:26:24 <_dp_> all you need is like i = y * w +x ; a[i>>3][i&7]
15:26:52 <_dp_> oops, a[i>>3]&(1<<(i&7)) :)
15:27:39 <peter1138> Hmm, it would need to assume MAX_CATCHMENT.
15:27:48 *** m3henry has joined #openttd
15:27:54 <m3henry> https://stackoverflow.com/questions/17794569/why-is-vectorbool-not-a-stl-container
15:27:57 <peter1138> (Or you can iterate the tiles twice)
15:28:04 <m3henry> Woo log stalking
15:28:07 <peter1138> Spies are lucking again.
15:28:12 <peter1138> LURKING
15:28:30 <m3henry> Sapping mah sentry?
15:29:01 <peter1138> I remember when TF2 was fun.
15:29:11 <peter1138> 10 years ago :/
15:29:19 <_dp_> peter1138, why MAX_CATCHMENT?
15:29:33 <Eddi|zuHause> <_dp_> oops, a[i>>3]&(1<<(i&7)) :) <- ans who the fuck will remember what that's meant to be in 6 years?
15:29:54 <_dp_> Eddi|zuHause, it's just a HasBit :p
15:29:56 <m3henry> sweet mary mother of god
15:30:03 *** sla_ro|master has quit IRC
15:30:37 <peter1138> Hmm, actually no need to scan the tiles, duh...
15:30:38 <Eddi|zuHause> _dp_: we already have a HasBit...
15:30:42 <peter1138> GetStationCatchment() would be fine.
15:31:37 <peter1138> Eddi|zuHause, HasBit(x[i >> 3], i & 7) isn't that much clearer.
15:31:57 <peter1138> (And is probably wrong)
15:32:39 <peter1138> HasBit(x[i / 8], i % 8) is kinda clearer in its intentions, but %...
15:32:40 <_dp_> fun part is doing range query on bitset xD
15:32:57 *** sla_ro|master has joined #openttd
15:33:17 <_dp_> peter1138, compilers are probably smart enough to optimize
15:33:28 <peter1138> --debug-level=3
15:33:47 <peter1138> So my next task is to make adding a new industry *not* wipe out all the caches.
15:33:52 <peter1138> It jus needs to add.
15:33:53 <Eddi|zuHause> peter1138: got to hope that the compiler knows to optimize / and % with power-of-two constant
15:33:54 <peter1138> *just
15:34:05 <peter1138> Eddi|zuHause, / 8 definitely, % 8 maybe not. maybe.
15:34:14 <_dp_> peter1138, well, benchmarking without optimization is not a good idea anyway)
15:34:17 <m3henry> Eddi: compilers have been doing that for a long long time, don't worry
15:34:23 <Eddi|zuHause> peter1138: i don't see how one would be more difficult than the other
15:34:36 <peter1138> Probably not.
15:34:54 <Eddi|zuHause> peter1138: and on CPU level, both are the same operation, usually
15:35:35 <m3henry> Compilers have been optimising non-power-of-two divides and multiplies for quite a while too
15:35:45 <peter1138> Of course, with a uint8 * i have to mess about with memory allocation of it.
15:35:46 <Eddi|zuHause> if your CPU has an integer-div operation, it usually outputs both div and mod at the same time
15:36:08 <peter1138> And if I extend the station size, I *have* to wipe it and rebuild. Currently we can just add a tileindex to the set.
15:36:15 <Eddi|zuHause> (however, the point here is to avoid the integer-div in the first place)
15:36:58 <nielsm> where is std::optional when you need it
15:36:58 <_dp_> peter1138, station constuction doesn't happen very often, it's totally fine to rebuild
15:37:03 <nielsm> (it's in c++17)
15:41:26 *** sla_ro|master has quit IRC
15:41:56 <m3henry> Eddi|zuHause: https://godbolt.org/z/KnxEl7
15:43:39 <Eddi|zuHause> m3henry: i'm pretty sure i read about that before, but the asm is pretty meaningless to me
15:44:10 <m3henry> The important thing to note is there is no idiv indtruction for the divide-by-constant
15:44:10 *** sla_ro|master has joined #openttd
15:45:59 <peter1138> https://godbolt.org/z/VioV4R < "n / 8" is different to "n >> 3"
15:46:48 <nielsm> because of negative numbers behavior it looks like
15:46:53 <Eddi|zuHause> there's weirdness with signed vs unsigned
15:46:56 <peter1138> ah of course
15:47:05 <m3henry> Did you mean https://godbolt.org/z/gwY6VT
15:47:13 <peter1138> Yes, same with uint
15:48:03 <peter1138> % 9 is nice ;)
15:48:21 <peter1138> % 7 is even longer.
15:49:27 *** sla_ro|master has quit IRC
15:49:50 <Eddi|zuHause> %257 is fun :)
15:50:06 *** sla_ro|master has joined #openttd
15:53:38 <peter1138> _dp_, and to be fair, it's what we already do anyway.
16:00:32 <_dp_> peter1138, you mean stating rect rebuilding? bitmap is a bit heavier but whatever, player actions are rare
16:01:26 <_dp_> peter1138, btw, have you considered separating non-rectangular area patch from nearest caches?
16:01:42 <_dp_> peter1138, bitmap should take care of all the performance differences anyway
16:02:34 <peter1138> I thought about it but I changed many algorithms since as they didn't make sense with the cache in place.
16:03:41 <peter1138> The first commit is without the caches, and works, but there's probably other bugs that've been fixed that haven't been taken care of.
16:04:04 <nielsm> okay, got the nearest item search working in the tree
16:04:12 <peter1138> It could probably be split if I include the station distance check, but the FOR_ALL_STATIONS was the killer.
16:04:20 <_dp_> peter1138, it would just make it much more straightforward
16:04:22 *** snail_UES_ has joined #openttd
16:04:33 <_dp_> peter1138, caches are quite questionable and need a lot of benchmarking
16:06:01 <peter1138> Without the caches I saw 5ms per world tick, instead of 2ms.
16:06:13 <peter1138> I suppose it isn't alot but it's still significant.
16:06:22 <peter1138> That is with the station distance check in place.
16:06:29 <_dp_> peter1138, that's with unordered_set, right?
16:06:46 <peter1138> Yes, but with the distance check so it doesn't check that much.
16:08:31 <peter1138> bHmm, it's not quite the original patch, as that made it a third catchment type option, which was downvoted :p
16:10:36 *** snail_UES_ has quit IRC
16:16:41 <peter1138> Without the caches, we're resorting to scanning 441 tiles again.
16:17:31 <_dp_> ha, new idea
16:17:31 <peter1138> 441 tiles, and some tests on those tiles, vs iterating a list with a few items in it.
16:17:56 <_dp_> for each tile keep a set of catching stations but DO NOT DUPLICATE sets, point to the same one
16:18:10 <_dp_> a bit hard to work with but super fast lookups
16:18:10 <peter1138> ?
16:18:13 <peter1138> For each tile do what?!
16:18:28 <peter1138> ...
16:18:34 <peter1138> I'm not storing a list of nearby stations for every tile.
16:18:49 <_dp_> make a set of stations that contain that tile in their area
16:19:17 <_dp_> many tiles have same sets so you only need to store a pointer to a set
16:19:27 <_dp_> and there are not many different sets
16:19:27 <peter1138> Store where?
16:20:03 <_dp_> make another map array
16:20:06 <peter1138> o_O
16:20:15 <_dp_> I know I was agains it but that was for highlights :p
16:20:16 <peter1138> Okay now I know you are taking the piss >:
16:22:00 <_dp_> well, it's still much less memory than bitmaps worst case :p
16:22:18 <_dp_> not sure if it actually eliminates the need for those bitmaps though
16:23:44 <peter1138> If you don't store catchment list then you need to rescan the station rect.
16:25:33 <peter1138> Also I've wasted most of the day talking about this, and I'm supposed to be working. :/
16:26:06 <Eddi|zuHause> i know that feeling
16:26:15 <_dp_> xD
16:26:20 <Gabda> I see you with your new map array idea :P
16:36:54 <nielsm> https://0x0.st/ziAN.jpg
16:36:56 <nielsm> yay
16:37:22 <peter1138> Now that might be useful.
16:38:25 <peter1138> Although a map scan might've been quicker? I dunno.
16:38:36 <peter1138> Needs a larger are :p
16:38:39 <peter1138> *area
16:39:19 *** Samu has joined #openttd
16:40:56 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdUW
16:42:32 <nielsm> https://github.com/OpenTTD/OpenTTD/compare/master...nielsmh:kdtree
16:43:00 <Samu> hi
16:44:13 *** drac_boy has joined #openttd
16:44:24 <drac_boy> hi there to anyone else with a sunny sky ;)
16:44:25 <drac_boy> heh
16:44:41 <nielsm> sun's about to set here so... maybe hi?
16:45:08 <drac_boy> heh evening then nielsm :)
16:47:21 <drac_boy> doing anything or just slow night for now?
16:48:39 <nielsm> writing a k-d tree data structure that might be useful for speeding up lookups of towns/stations by map coordinates
16:49:43 <drac_boy> ah..ok
16:51:11 <Samu> it's raining here
16:51:13 <Samu> finally
16:53:10 *** Wormnest has joined #openttd
16:53:42 * drac_boy is just haing a slight slow morning for now .. catching up with weekday emails beside working the spec in my grf
16:56:32 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdUQ
17:01:04 <Samu> who's english?
17:01:05 <Samu> static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Radius around river tiles without Desert Zone
17:01:50 <Samu> Radius around river tiles to unset Desert Zone
17:03:22 <Samu> Circular search radius to create non-desert around a river tile.
17:03:51 <peter1138> As opposed to a square radius?
17:04:02 <Samu> it's a circultar tile search
17:04:08 <Samu> circular
17:04:17 <Samu> ok i put tile
17:04:27 <Samu> static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Circular tile search radius to create non-desert around a river tile.
17:05:34 <Eddi|zuHause> in maximum or manhattan distance, circles are square
17:05:53 <Samu> I don't know, it's a CircularTileSearch
17:06:09 <Samu> i think it's square
17:07:57 <Samu> CircularTileSearch(&t, RIVER_OFFSET_DESERT_DISTANCE, RiverModifyDesertZone, NULL);
17:11:24 *** sla_ro|master has quit IRC
17:15:39 <Eddi|zuHause> i'm pretty sure CircularTileSearch uses maximum distance
17:16:19 <Samu> copy pasting title from one of peter1138 commits
17:17:23 <peter1138> Hah
17:17:29 <Samu> Codechange: Use const instead of magic number for circular tile search radius to create non-desert around a river tile.
17:18:18 <Eddi|zuHause> have i mentioned today yet that the game should use euclidean in more places, to be more intuitive?
17:18:28 <peter1138> Not today.
17:18:35 <peter1138> euclidean catchment size?
17:18:41 <Eddi|zuHause> for example
17:19:00 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7194: Fix: Remove desert around lakes upon generation. https://git.io/fhHqA
17:19:42 <Eddi|zuHause> (that, however, might actually break some people's savegames :p)
17:19:54 <Gabda> manhattan distances are nice
17:19:55 <peter1138> "break"
17:20:11 <Eddi|zuHause> s/savegames/networks/
17:20:14 <peter1138> Non-rectangular catchments is going to do that.
17:20:19 <Gabda> they deserve love as well :)
17:20:52 <drac_boy> :)
17:20:56 <Eddi|zuHause> well, theoretically it would, but most people won't notice :p
17:21:06 <peter1138> Yeah.
17:24:11 <nielsm> https://0x0.st/ziAG.png uhm... yeah, are you planning on making an IE 12 or what?
17:25:50 <Gabda> nielsm: in build, why do you start buildsubtree from begin+1, what happens to the very first element?
17:26:48 <nielsm> it gets discarded!
17:27:28 <drac_boy> nielsm or someone messed up with the numpad and entered wrong version? :)
17:27:35 <nielsm> bug from when I was building the tree differently
17:28:04 <nielsm> and funny you should mention it just now, because it was exactly the cause of the crash I was getting here
17:29:26 <Samu> I have questions about this https://github.com/OpenTTD/OpenTTD/pull/7234/files#diff-ebbc445f07842947d83d0f98b7fa5140R1050
17:29:29 *** m3henry has quit IRC
17:29:39 <Samu> must re-test
17:29:53 <Eddi|zuHause> drac_boy: more like it was looking for some library element and when it wasn't there it picked an overly suggestive error message
17:33:01 <Gabda> well, I am reading your code to learn new things
17:33:27 <Gabda> already saw some new and fine things
17:37:41 <drac_boy> sorry to ask but had to wonder - was italy the only one who actually built electric locomotives that had a very dysfunctional body style? (not a normal box w/wo nose that is)
17:43:40 <peter1138> Samu, so many questions...
17:44:45 <Eddi|zuHause> "vulkandriverquery: /home/pgriffais/src/Vulkan/base/vulkanexamplebase.cpp:823: void VulkanExampleBase::initVulkan(): Assertion `res == VK_SUCCESS' failed." <-- i think someone missed the point on what an assert should be
17:45:18 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdTH
17:49:03 <Samu> what I used to have was 3 checks, now it's down to just 1
17:49:57 <nielsm> well, I tried making actual use of the tree and initial smoke testing does not cause explosions! https://github.com/OpenTTD/OpenTTD/compare/master...nielsmh:kdtree
17:50:40 <Gabda> nielsm: in FindContained you could define p1 as {min(x1, x2), min(y1, y2)}, and p2 as max, so it would be foolproof
17:51:03 <nielsm> could, yes
17:59:58 <nielsm> Gabda I skimmed the paper you linked in a comment, it's not something I'm going to look into doing right away, would rather try to make a basic structure usable
18:01:19 <peter1138> nielsm, does that... work? :D
18:01:39 <nielsm> it seems like it works right now, yes
18:01:50 <nielsm> for getting nearest town
18:02:04 <peter1138> Need the tile highlight test that Gabda did
18:02:07 <Samu> if the station is mine and there's an industry without neutral station, will the cargo go to the industry
18:02:07 *** sla_ro|master has joined #openttd
18:02:09 <peter1138> If it works and is fast...
18:02:11 <peter1138> Then brilliant.
18:02:26 <Samu> how could you reduce 3 checks to just 1
18:02:30 <Samu> and still make it work
18:02:32 <Gabda> ok, it improves performance on big item counts only
18:02:55 <Samu> I must be really dumb
18:03:24 <drac_boy> samu or not dumb but just slower?
18:03:28 <drac_boy> I dunno
18:03:36 <Eddi|zuHause> Gabda: that's usually when you need performance the most :p
18:03:37 <peter1138> Samu, probably ;)
18:04:04 <Samu> if (ind->st != NULL && ind->st != st) continue;
18:04:11 <Gabda> i was thinking about making a kdtree as well, but dropped the idea, because I got scared of rebalancing it
18:04:36 <Gabda> but it is really nice to see your implementation
18:05:19 <nielsm> huh, I didn't realize SmallVector already had both Contains and Include that effectively implement a "stupid set"
18:05:26 <nielsm> (linear search membership test)
18:05:40 <Samu> if ind->st != NULL
18:05:54 <Samu> if the industry has neutral station
18:05:59 *** andythenorth has joined #openttd
18:06:01 <Gabda> Eddi: yes, but it can be a next step, as the current version is also a big improvement
18:06:39 <Samu> what if the industry doesn't have neutral station
18:07:08 <nielsm> then it does the normal thing
18:07:24 <Samu> what if the station I'm delivering at
18:07:27 <Samu> is a neutral station
18:07:44 <nielsm> actually, you're not reading it
18:08:13 <Eddi|zuHause> Gabda: i haven't looked at a k-d-tree specifically, but rebalance operations aren't really that scary, just a lot of recursing
18:08:22 <nielsm> if (ind->st != NULL && ind->st != st) <- if the industry has a neutral station AND that station is not this station
18:09:10 <Samu> what if the industry doesn't have a neutral station and I'm delivering at some other industry's neutral station?
18:09:43 <nielsm> then you look a station.cpp line 359
18:10:10 <nielsm> and discover that those industries are already separated out earlier
18:10:34 <Samu> ah
18:10:55 <drac_boy> hmm I guess italy does seem to be alone then
18:11:21 <andythenorth> yo
18:11:31 <supermop_work> HI ANDY
18:11:48 <andythenorth> is cat?
18:12:15 <andythenorth> hmm
18:12:22 <Gabda> Eddi: the kdtree I was thinking of had bounding boxes for every node which contained the boundig box of all the points in the node's subnodes
18:12:22 <andythenorth> I like how JGR gets the tailspin of OpenTTD bugs
18:12:24 <andythenorth> :|
18:12:35 <andythenorth> things that are fixed upstream, but not in JGRPP
18:12:51 <drac_boy> hi firs creator :)
18:12:52 <drac_boy> heh
18:13:06 <Gabda> but that can be done with recurssions, true
18:14:16 <andythenorth> so 'Hot Metal' or 'Molten Iron'?
18:14:35 *** HerzogDeXtEr has joined #openttd
18:14:36 <andythenorth> hot metal is the IRL term in steel industry, but it's not obvious in game
18:14:39 <Samu> so it works
18:14:40 <drac_boy> andy is it supposed to be pre-poured metal?
18:14:43 <Samu> oki
18:15:04 <andythenorth> https://st3.depositphotos.com/11171026/16639/i/1600/depositphotos_166393228-stock-photo-molten-iron-molten-metal-poured.jpg
18:15:17 <drac_boy> andy if it is I would had called it molten then
18:15:24 <drac_boy> oh..yeah I would say molten for sure :)
18:15:51 <drac_boy> as 'hot metal' could suggest blacksmithing/welding which isn't exactly "as that hot"
18:16:41 <drac_boy> any other cargo related questions you might have on mind now andy? :)
18:22:12 <nielsm> hmm looking at FindStationsAroundTiles (original version) and can't come up with any way to use my town k-d tree to improve it that will definitely be an improvement
18:23:07 <andythenorth> supermop_work: played any Horse? o_O
18:24:30 <nielsm> not that it matters, it's not a station tree I have here but a town tree
18:24:46 <nielsm> (nothing ever queries a tile area for towns, does it?)
18:25:31 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7158: Add: Client setting gui.start_spectator https://git.io/fhSk4
18:27:43 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick closed pull request #7204: Feature: Game setting to define how industries with neutral stations accept and supply cargo from/to surrounding stations. https://git.io/fhH19
18:28:33 <Eddi|zuHause> nielsm: could query town on station or industry placement, to get the closest town of the whole area instead of just the top tile
18:29:07 <nielsm> Eddi|zuHause, not looking for ideas for new things to do just yet :P
18:29:38 <Eddi|zuHause> nielsm: i'm an expert at derailing by feature request :p
18:31:08 <andythenorth> hmm
18:31:22 <andythenorth> so what supplies would a cryo plant need? If any? https://en.wikipedia.org/wiki/Industrial_gas#Gas_production_technology
18:31:37 <andythenorth> (air products cryo, not methane)
18:32:09 <drac_boy> well andy you could technically just feed it Chemical from the firs refinery?
18:32:18 <andythenorth> no refinery in this economy
18:32:29 <drac_boy> ah hm dunno then sorry :)
18:37:06 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick opened pull request #7243: Change: Decrease the min #opcodes https://git.io/fhdIq
18:37:06 <peter1138> Hi.,
18:37:39 <peter1138> Hmm, I should test subsidies.
18:38:25 <peter1138> Error: Assertion failed at line 3803 of /home/petern/Projects/OpenTTD/src/station_cmd.cpp: location.w == 1 && location.h == 1
18:38:28 <peter1138> Yay, it crashes ;D
18:38:46 <peter1138> Unfortunately, that was Wentbourne, after a few days.
18:39:05 <peter1138> If I try to run Wentbourne in a debug build, it'll take literal days...
18:39:53 <Eddi|zuHause> you could start with debug level 1?
18:40:07 <peter1138> No, backtraces are fairly useless.
18:40:17 <peter1138> I'm just going to grep for all callers first :-)
18:41:04 <Eddi|zuHause> also, you could make a savegame closer to the crash
18:41:20 <peter1138> Or make a smaller savegame.
18:41:52 <nielsm> it would be useful with some debug commands like "create a new subsidy right now"
18:42:38 <Eddi|zuHause> can a game script issue subsidies?
18:43:07 <peter1138> q
18:43:20 <peter1138> Whenever you see "q" I means I did ESC : q in the wrong window.
18:43:24 <peter1138> *it
18:44:10 <Eddi|zuHause> it usually says :q in those cases
18:44:52 <peter1138> irssi responds to ESC as well.
18:45:00 <peter1138> Arrrr
18:45:14 <peter1138> That's a few seconds per frame.
18:47:02 <peter1138> ...
18:47:23 <peter1138> I see, this is obvious and I'm surprised it hasn't happened before.
18:48:00 <peter1138> Top corner of an industry is a hole so i->location is not actually an industry tile...
18:48:08 <nielsm> https://0x0.st/zim1.png <- no crashes!
18:48:24 <peter1138> Good.
18:48:39 <peter1138> Using the kdtree to determine which signs to draw?
18:48:53 <peter1138> Or just adding stations
18:48:55 <nielsm> no, just which town is nearest
18:49:00 <peter1138> Ahh
18:49:01 <nielsm> when adding stations
18:49:18 <peter1138> Performance?
18:49:21 <nielsm> difference is this was a new generated world and I wrote an Insert function on the tree :P
18:49:26 <nielsm> not measured
18:49:26 <peter1138> :D
18:49:56 <drac_boy> anyway andy have fun figuring out cargos (I have a slight similar issue here too but meh) .. going off for today here
18:50:01 *** drac_boy has left #openttd
18:50:20 <nielsm> noooooo
18:50:32 <nielsm> I started the scenario editor and placed a single town and it asserted :(
18:50:41 <peter1138> Haha
18:50:48 <nielsm> I know what the issue is though
18:54:23 <nielsm> https://0x0.st/zimj.png <- created by building some random towns in the editor
18:56:11 <nielsm> https://0x0.st/zime.png <- and then I clicked "build many random towns" which will do a full tree rebuild afterwards
18:58:32 <nielsm> pushed that
18:59:00 <Eddi|zuHause> push it real good
18:59:23 <Eddi|zuHause> (anyone even remember that song?)
18:59:39 <andythenorth> time to move newgrfs to github?
19:00:50 <peter1138> Yes please
19:03:00 *** synchris has joined #openttd
19:03:09 *** sla_ro|master has quit IRC
19:04:05 <andythenorth> means I might be able to do FIRS 4 without breaking FIRS 3, which needs maintenance releases
19:06:26 <andythenorth> planetmaker: can we teach bundles to git?
19:06:56 <nielsm> stations are more interesting than towns, because stations are created and removed all the time!
19:08:52 <Eddi|zuHause> andythenorth: i think you should first create the github repo, and then ask that question again :)
19:09:12 <andythenorth> well then I might end up stuck with a github repo, and no way back to hg
19:09:16 <andythenorth> and no bundles
19:09:50 <Eddi|zuHause> andythenorth: i'm fairly certain that the answer is "yes" but the answer will be meaningless to you unless you can say "ok, do it right now"
19:10:54 <peter1138> nielsm, as long as add/remove is fast... I guess it's not? :(
19:11:22 <peter1138> Hmm, those pretzel pieces were a bit stale...
19:12:35 <andythenorth> this is heresy, but I prefer redmine's repo view to github's
19:12:49 <andythenorth> github doesn't show many commits per page, and it's really non-compact
19:12:53 <nielsm> peter1138, Insert is log(n)
19:13:13 <nielsm> but can cause the tree to become imbalanced if enough items are inserted in a poorly chosen order
19:14:05 <nielsm> Remove is not implemented yet, but can require rebuilding a partial tree, so worst case is O(n*log(n)^2)
19:15:10 <peter1138> How slow is rebuild?
19:16:34 <peter1138> Oh you just said :p
19:20:02 <nielsm> might be slower actually, since I'm sorting and re-sorting elements a lot
19:20:19 *** Gabda has quit IRC
19:20:27 <_dp_> nielsm, with how rare player actions are you can probably get away even with a full tree rebuild
19:21:58 *** m3henry has joined #openttd
19:22:13 <_dp_> though I'm not sure if there is any benefit for having a tree for stations
19:22:21 *** Wolf01 has joined #openttd
19:22:34 <Wolf01> o/
19:24:07 <m3henry> o/
19:25:41 <peter1138> Right, now to compare Wentbourne side-by-side.
19:25:49 <peter1138> master vs non-rect-catchment
19:26:06 <Wolf01> So, I had my head in astroneer for the entire day today... I'm playing it too much
19:26:22 <Wolf01> I couldn't concentrate at work
19:26:57 <peter1138> Waiting for the average ms to creep up for World ticks.
19:27:14 <peter1138> Slightly issue with the framerate display, it takes ages to get there are very low rates.
19:27:43 <Wolf01> It should be time based, instead of quantity based
19:27:58 <peter1138> Okay.
19:28:03 <peter1138> _dp_, all this worrying...
19:28:20 <peter1138> I'm seeing a 0.1ms performance increase with my patch.
19:28:25 <Wolf01> :o
19:28:37 <peter1138> So non-rect catchments is faster than master.
19:28:53 <peter1138> Wolf01, not a lot, but that's per tick.
19:29:03 <peter1138> Actually it's 0.13ms.
19:29:12 <peter1138> 3.9ms per second.
19:29:19 <_dp_> peter1138, wait, 0.1 from master, not just unsorted_set?
19:29:32 <peter1138> Er, or would be, except I'm nowhere near 33 fps.
19:29:55 <peter1138> _dp_, er...
19:30:02 <peter1138> non-rect 1.76ms
19:30:06 <peter1138> master 1.9ms
19:30:21 <peter1138> Using unordered_set and all my other optimizations.
19:30:34 <Wolf01> So freenode is telling me to upgrade mirc
19:30:42 <_dp_> peter1138, ah, I thought you did bitmaps
19:31:08 <peter1138> No, I looked, but it requires significant processing at the "IsTileInCatchment()" stage.
19:32:37 <_dp_> peter1138, for caches you probably need a test with a lot of town growth as well
19:32:38 <peter1138> Need to convert the TileIndex in x & y components, then subtract the bitmap offsets, then bounds check both min/max, and then finally do the bitmap lookup.
19:33:12 *** Gja has joined #openttd
19:33:20 <peter1138> And then, in the rare cases I *do* iterator the catchment tiles, I'll need to write an iterator.
19:33:34 <Wolf01> Upgrading mirc...
19:33:39 <Wolf01> BBL
19:33:42 *** Wolf01 has quit IRC
19:33:45 <peter1138> So "just use a bitmap" is kinda... sure, doable but not easy.
19:36:12 <peter1138> For town growth I am actually iterating the map array to find stations, in case any station is a new one.
19:36:23 <_dp_> peter1138, dunno, sounds like just a bit tile coords math to me
19:36:36 <peter1138> _dp_, how so?
19:36:48 <peter1138> coordinate maths against what?
19:36:50 *** Wolf01 has joined #openttd
19:36:59 <Wolf01> Upgraded mirc
19:37:03 <peter1138> Oh you mean the bitmap thing.
19:37:19 <_dp_> peter1138, i mean just a simple conversion from global xy to bitmap xy and back
19:37:40 <peter1138> None of which is necessary with the current unordered_set.
19:38:32 <peter1138> So if nielsm can make a k-d tree station list then I can use that instead of scanning the map, maybe.
19:38:45 <_dp_> peter1138, you mean performance cost or development?
19:38:45 <peter1138> Although that needs to take into account station size, not just its top corner xy.
19:38:53 <peter1138> _dp_, development cost.
19:39:04 <_dp_> peter1138, performance-wise unordered set does heavier math under the hood
19:40:07 <nielsm> funny line, DEBUG(sl, 0, "Unknown savegame type, trying to load it as the buggy format");
19:40:20 <nielsm> "the buggy format" is presumably well known?
19:40:48 <peter1138> I could just use a vector...
19:41:11 <andythenorth> PR count will soon overtake issue count :D
19:41:16 <andythenorth> 78 vs 53
19:42:27 <peter1138> andythenorth, you can fix that.
19:42:38 <peter1138> andythenorth, approve PRs, or create more issues.
19:42:57 <Wolf01> The target is to lower the issues to 0, so PRs can overtake them autimagically
19:43:05 <Wolf01> *automagically
19:43:22 <andythenorth> stalebot
19:43:52 <Wolf01> Or merge all PRs and issues will decuplicate
19:44:37 <_dp_> yeah, stalebot is unrivaled bugfixer :p
19:45:16 *** gelignite has joined #openttd
19:47:40 *** glx has joined #openttd
19:47:40 *** ChanServ sets mode: +v glx
19:50:10 *** andythenorth has quit IRC
19:59:19 *** kiwitree has quit IRC
20:08:41 *** Gabda has joined #openttd
20:09:46 <supermop_work> Eddi|zuHause: of course i remember
20:23:06 *** Smedles has quit IRC
20:26:23 <Wolf01> https://steamcommunity.com/profiles/76561198028113296/screenshot/934964517263047548 Eddi|zuHause I found the wolframite!
20:27:39 *** sim-al2 has joined #openttd
20:29:12 *** Smedles has joined #openttd
20:32:53 *** frosch123 has joined #openttd
20:39:40 *** sim-al2 has quit IRC
20:41:24 *** Supercheese has joined #openttd
20:54:23 *** Supercheese has quit IRC
20:56:11 *** Supercheese has joined #openttd
21:06:26 *** Wormnest has quit IRC
21:09:05 <peter1138> hi
21:11:59 <supermop_work> hi
21:13:06 <peter1138> Mmm, beef fillet steak
21:15:43 <peter1138> Yeah so was there an AI that made subsidies?
21:15:47 <peter1138> Er.. GS
21:15:56 *** andythenorth has joined #openttd
21:16:01 <peter1138> andythenorth would know.
21:16:20 <andythenorth> yo
21:16:25 <andythenorth> I reckon no
21:16:30 <andythenorth> what was the question?
21:16:38 <nielsm> well, there is an api to create subsidies
21:16:38 <nielsm> static bool Create(CargoID cargo_type, SubsidyParticipantType from_type, uint16 from_id, SubsidyParticipantType to_type, uint16 to_id);
21:16:41 <peter1138> Was there a GS that made subsidies :D
21:16:45 <nielsm> in ScriptSubsidy
21:16:53 <glx> maybe some goal scripts
21:17:10 <andythenorth> oof NFI sorry
21:18:42 <andythenorth> one day I make a GS maybe
21:18:44 <andythenorth> although...
21:18:48 <andythenorth> maybe not
21:18:50 <peter1138> Your name is in the credits of one.
21:19:02 <andythenorth> yeah, that wasn't really me, I just playtested
21:19:19 <andythenorth> GS involves way too much handling of state etc for me
21:19:30 <andythenorth> it's a lot of stuff to think about that I am not good at
21:19:51 <andythenorth> all the saveload stuff etc is complex
21:21:23 <peter1138> Ok... UFO landed on my only raod vehicle, while it was stopped int he depot.
21:21:43 <andythenorth> ouch
21:21:50 <andythenorth> NewDisasters
21:22:17 <peter1138> Palette animation on to make fast-forward bareable.
21:22:31 <andythenorth> eh?
21:24:33 <Gabda> I've read back on the IRC messages about my town name refresh PR
21:26:15 <andythenorth> if I move FIRS to github
21:26:17 <andythenorth> and then I die
21:26:34 <andythenorth> ....
21:26:44 <andythenorth> coop is bus-proof
21:26:58 <Gabda> and now I don't know if I should continue it, or wait till the k-d tree implementation will be generic enough to shave off a few more percentage from the refresh time
21:27:06 * andythenorth suspects it's probably fine, except for me, but I'll be dead
21:28:33 <peter1138> Hmm, still no subsidies.
21:28:48 <peter1138> Maybe I've broken it?
21:30:03 <peter1138> No, I've only changed the code that detects if cargo is subsidized, but I'm not seeing any offers.
21:30:57 <peter1138> Oh.
21:31:06 <nielsm> hmm, I wonder if a k-d tree can be used to extract items in order of distance to a point?
21:31:16 <peter1138> Passenger subsidies are disabled if cargodist is enable!
21:31:23 <nielsm> i.e. not just get nearest items, but get X nearest items
21:31:26 <andythenorth> eh wat?
21:31:35 <andythenorth> too much things
21:31:47 <peter1138> Why would that be the case?
21:32:15 <peter1138> OTOH, I should be seeing cargo subsidies too.
21:33:08 <peter1138> Why!
21:33:40 <nielsm> https://github.com/OpenTTD/OpenTTD/blob/349cbee6e90a7a7257a2872755540d5555f6ee90/src/station_cmd.cpp#L3087-L3088
21:33:49 *** synchris has quit IRC
21:33:51 <peter1138> (svn r25882) -Change [FS#5766]: Don't offer subsidies for auto-distributed cargo.
21:34:30 <andythenorth> oof
21:35:17 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on issue #5766: (Re)consider subsidies should work under cargo-dist https://git.io/fhdmU
21:35:52 <peter1138> Yup, cargo dist off ... get a subsidy.
21:36:29 <andythenorth> on the one hand I really like cargodist, and it was an achievement for fonso to get it done and in trunk
21:36:36 <andythenorth> on the other hand cargodist is pretty lame
21:38:45 <peter1138> Ok, subsidy works :D
21:39:19 <glx> it should work with cargodist if source and destination are correct
21:39:28 <peter1138> No, it's specifically disabled.
21:39:38 <glx> I know it is
21:39:44 <peter1138> Oh.
21:40:05 <peter1138> Yeah, you just can't control src & dst very much.
21:40:20 <peter1138> Short of not creating links. Easier for cargo, I guess.
21:40:43 <Gabda> nielsm, I don't think you can
21:41:02 <andythenorth> I don't really get the problem
21:41:17 <andythenorth> if there's a subsidy A->B, build a route A->B
21:41:36 <andythenorth> cdist will then route cargo A->B
21:41:52 <andythenorth> most of the 'problems' of cdist are because it's counter-intuitive
21:42:05 <glx> cdist may also do A->C->D->B
21:42:08 <andythenorth> no
21:42:16 <andythenorth> I said build a route A->B
21:42:22 <andythenorth> two nodes
21:42:33 <andythenorth> :D
21:42:41 <Gabda> <nielsm> (nothing ever queries a tile area for towns, does it?) <- IsCloseToTown does
21:42:52 <andythenorth> cdist works exactly as advertised, and is mostly not broken
21:43:00 <andythenorth> it's just not really useful
21:43:10 <andythenorth> it's a high cost way to avoid automated transfers
21:43:15 <andythenorth> enable / avoid /s
21:44:15 <nielsm> hmm FindStationsAroundTiles is actually a bit strange, in that if I were to change it to look for station signs, it would also have to depend on the max station spread
21:44:27 <nielsm> and that may have decreased since a station was built
21:44:44 <nielsm> (not that it usually will, but it could potentially have)
21:45:26 <m3henry> Man this line is awkward to grok:
21:45:26 <m3henry> this->buf = *this->blocks.Append() = CallocT<byte>(CHUNK);
21:46:59 <peter1138> :D
21:47:26 <nielsm> cute
21:47:30 <peter1138> It's allocating CHUNK bytes of memory, and storing the pointer to it in this->blocks and this->buf
21:47:35 <m3henry> Yeah
21:47:47 <m3henry> Just readign it as such takes time
21:48:59 <_dp_> nielsm, iirc k-d trees can do k-nearest neighbor query but if you want to do it for all the points simply sorting would be faster
21:49:27 <peter1138> Okay, I just remembered I can't iterate catchment_tiles this way here :-(
21:50:28 *** Gja has quit IRC
21:53:37 <glx> hmm cargo packets have source, and I think there's a way to know if the cargo did a direct travel
21:54:50 <peter1138> Does it need to be direct?
21:57:56 <andythenorth> oof github import of FIRS failed :P
21:58:09 <andythenorth> doesn't say why :P
21:58:39 *** Gabda has quit IRC
22:00:33 <andythenorth> this is why I frigging hate mercurial
22:00:35 <andythenorth> (bin35) firs$ hg up v4-test
22:00:36 <andythenorth> abort: uncommitted changes
22:00:37 <andythenorth> (commit or update --clean to discard changes)
22:00:37 <andythenorth> (bin35) firs$ hg st
22:00:42 <andythenorth> no changes
22:01:01 <andythenorth> it really doesn't understand branches at all
22:04:00 <andythenorth> frosch123: how did you complete the nml -> github clone?
22:06:01 *** Wormnest has joined #openttd
22:06:35 <glx> git init, git add, git commit ?
22:07:21 <peter1138> Quite.
22:07:21 <LordAro> but muh history
22:13:11 <glx> https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git <-- seems easy
22:16:51 <andythenorth> sometimes the github importer works, and sometimes not
22:17:00 <andythenorth> I was able to import nml, frosch wasn't :|
22:17:22 <dwfreed> andythenorth: yeah, mercurial's behavior wrt branches is... weird
22:32:54 *** gelignite has quit IRC
22:44:36 *** snail_UES_ has joined #openttd
22:44:57 <andythenorth> oof GH import failed again
22:45:05 <andythenorth> meh
22:45:36 <peter1138> Did you expect something different?
22:46:25 <andythenorth> I wondered if it was timing out upstream or downstream
22:46:46 <andythenorth> 'try again' is valid in most computing situations :P
22:48:09 <frosch123> andythenorth: i have a local hg-fast-export
22:48:18 <andythenorth> ok
22:48:21 <andythenorth> I'll do the same
22:48:26 <frosch123> shall i clone something
22:48:53 <frosch123> it's already setup, so it's like 5 minutes
22:49:08 <andythenorth> if you don't mind
22:49:11 <andythenorth> I want to try moving FIRS
22:50:04 <Samu> I'm gonna assume my AI is now ready
22:50:17 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdY3
22:52:41 <frosch123> do you have a foobar email or gh account?
22:52:56 *** drac_boy has joined #openttd
22:53:02 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYs
22:53:05 <drac_boy> hi there world ;)
22:53:17 <frosch123> hm, oh, there is no foobar
22:53:22 <frosch123> i thought i read that
22:55:49 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYG
22:56:12 <DorpsGek_II> [OpenTTD/OpenTTD] michicc approved pull request #7237: Codechange: Move some common code after adding/removing tiles to a station to its own function. https://git.io/fhdYZ
22:56:44 <DorpsGek_II> [OpenTTD/OpenTTD] michicc approved pull request #7230: Fix #7226: No ship track due to "forbid 90 deg turns"-> Do not call pathfinders. https://git.io/fhdYn
22:57:23 <DorpsGek_II> [OpenTTD/OpenTTD] michicc merged pull request #7230: Fix #7226: No ship track due to "forbid 90 deg turns"-> Do not call pathfinders. https://git.io/fh7Pg
22:57:29 <DorpsGek_II> [OpenTTD/OpenTTD] michicc closed issue #7226: NPF: Ship: Assertion failure when ship encounters shore https://git.io/fh7CV
22:57:47 <DorpsGek_II> [OpenTTD/OpenTTD] michicc merged pull request #7237: Codechange: Move some common code after adding/removing tiles to a station to its own function. https://git.io/fh54N
22:58:44 <peter1138> BitmapTileArea+Iterator...
22:58:54 <peter1138> I'd be surprised if this works.
22:59:38 * peter1138 tests performance.
22:59:49 <peter1138> Hmm, well...
22:59:54 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYC
23:00:08 <Samu> uploaded v8, plz test https://bananas.openttd.org/en/
23:00:14 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYl
23:00:19 <peter1138> _dp_, it works.
23:00:25 <peter1138> _dp_, slightly ... quicker ...
23:00:36 <peter1138> I think. I might be misremembering.
23:00:58 <peter1138> master 1.9ms
23:01:09 <peter1138> std::unordered_set 1.76ms
23:01:16 <peter1138> bitmaptilearea 1.44ms
23:01:44 <Samu> question, which vehicle set do I need to play FIRS?
23:01:58 <Samu> my ships couldn't transport engineering supplies
23:02:43 <peter1138> It's going to annoy m3henry, because it uses SmallVector :/
23:02:53 <frosch123> firs import requires git fsck :p
23:03:01 <andythenorth> ?
23:03:13 <drac_boy> samu basically nearly anything except the vanilla trains
23:03:17 <andythenorth> is the repo inconsistent?
23:04:06 <drac_boy> although I can't recall if newships.grf would be generic enough (its older than firs afaik) to still accept every single firs cargos now that you mention it
23:04:32 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYB
23:04:37 <frosch123> there are 4 eints commits with: nulInCommit: NUL byte in the commit object body
23:04:55 <_dp_> peter1138, that's not a bad improvement actually
23:05:18 <Samu> https://github.com/OpenTTD/OpenTTD/pull/7230 wow why was it merged just like that?
23:05:23 <_dp_> peter1138, also you're measuring tick time, it's unclear how much of that is even related to stations
23:05:42 <peter1138> _dp_, when it jumped to 40ms, I knew it was me.
23:05:49 <nielsm> bah, before I managed to get the station kdtree into a wrong state where it contained station ids that were invalid, now I'm not sure what I did for that
23:06:13 <_dp_> peter1138, yeah, on increasing side it's more clear)
23:06:15 <Samu> you're blatantly making opf do worse, :p
23:07:11 <_dp_> peter1138, but for decreasing it's hard to tell where 0 actually is, 0.5ms may be 25% improvement or mb 99% for all we know
23:07:29 <Samu> I need to see what happened to removal of 90 degrees
23:07:35 <Samu> was it really removed or not?
23:07:38 <peter1138> Yes, I'm aware. I'm happy with it reducing. I haven't checked memory usage.
23:08:01 <peter1138> It's less than master, that's pretty important.
23:08:12 <nielsm> ah okay, reproduced the crash now
23:08:42 <nielsm> now, where are dead station signs removed...
23:09:43 <drac_boy> just curious what any of you think of geared steam locomotives in general? (low speed high tractive cheap locomotive early in)
23:09:56 <drac_boy> I know they didn't have a lot of buyers outside north america at times but still .. a game is just a game :)
23:10:24 <Samu> must investigate
23:10:40 <andythenorth> drac_boy: for ottd?
23:11:02 <drac_boy> yeah
23:11:13 <andythenorth> TE is almost irrelevant in most ottd gameplay situations
23:11:30 <andythenorth> it only makes a difference in very specific situations
23:11:57 <DorpsGek_II> [OpenTTD/OpenTTD] michicc requested changes for pull request #7028: Feature: Option to group vehicle list by shared orders https://git.io/fhdYo
23:12:03 <andythenorth> so geared locomotives are basically just slow, wiht no upside
23:12:09 <andythenorth> with *
23:12:20 <glx> nielsm: somewhere in the gameloop
23:12:38 <DorpsGek_II> [OpenTTD/OpenTTD] michicc commented on pull request #7028: Feature: Option to group vehicle list by shared orders https://git.io/fhdYK
23:12:43 <DorpsGek_II> [OpenTTD/OpenTTD] michicc commented on pull request #7028: Feature: Option to group vehicle list by shared orders https://git.io/fhdY6
23:14:35 <nielsm> glx found it, station_cmd.cpp StationHandleBigTick
23:14:46 <glx> yes that's it :)
23:15:54 <drac_boy> andy well last I checked te does matter unless I guess you're the type who loves to make up 4-loco 40-wagon trains on supermaps which in that case ignore me then ;) 27kph for 700hp/40kn versus 50kph for 550hp/70kn on same train
23:16:55 <glx> and you can probably use its return value in OnTick_Station()
23:19:03 <drac_boy> samu actually I think squid/fish should be capable firs/ecs-ready ships too .. if that ever helps?
23:20:17 <peter1138> _dp_, I'm surprised I managed to get it working. I even inherited from the existing tilearea+iterator.
23:21:17 <Samu> I'm refering about this last merge
23:21:43 <andythenorth> drac_boy: TE is irrelevant unless train speed drops below some level
23:21:49 <andythenorth> I tested it a lot recently https://dev.openttdcoop.org/attachments/download/9254/TE_vs_HP-speed-factor-1b.png
23:22:06 <Samu> it's making opf do even worse than it already is
23:22:07 <andythenorth> HP is significant, TE is not
23:22:20 <drac_boy> andy well I guess I don't know why the first train refused to hit 50kph then :)
23:22:22 <frosch123> well... what does git call the "commit object body"?
23:22:47 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5s1
23:23:05 <andythenorth> frosch123: I'll google
23:23:15 <frosch123> i only found the git source code
23:23:37 <Samu> now opf ships reverse, believing they can do a 90 degree after the reverse, but on the next tile, the track is not given to it
23:23:45 <Samu> they are stuck
23:23:47 <drac_boy> samu not sure .. you asked which sjips can be used with firs .. I responded to that
23:23:52 <drac_boy> ships*
23:24:02 <andythenorth> frosch123: no answers :( https://stackoverflow.com/questions/42807257/github-wont-accept-this-old-commit-how-do-i-fix-it
23:24:04 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdY7
23:24:06 <Samu> ah, thanks, I'm about something else now
23:24:15 <drac_boy> np
23:24:23 <Samu> they're stuck in a reverse loop
23:24:51 <andythenorth> oof google gets me one SO result, a spanish mercural RSS feed thing, and a 403
23:24:53 <andythenorth> :(
23:25:32 <andythenorth> drac_boy: sounds like you have one of the cases where TE does apply
23:25:38 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdYF
23:25:39 <andythenorth> not enough HP / ton
23:25:47 <Samu> how do I contest a merge? :o
23:25:55 <andythenorth> contest?
23:26:13 <Samu> j0anjosep merge
23:26:22 <andythenorth> there's no concept of 'contest'
23:26:26 <andythenorth> you can complain on the PR
23:26:33 <andythenorth> and see what response you get
23:26:37 <Samu> https://github.com/OpenTTD/OpenTTD/commit/6ca637b8c149efe2cb8ccffccbfd98530f633d58
23:26:42 <peter1138> Samu, why did you not comment on PR?
23:26:49 <andythenorth> you think it's buggy?
23:26:56 <drac_boy> andy again .. the second train had less hp but it could hit the speed limit due to te .. but anyway seem we're not on the same maps so never mind :)
23:27:07 <peter1138> You should have commented on the PR with your thoughts at the time, not complain later.
23:27:11 <Samu> you were telling me 90 degrees were to be removed for ships
23:27:16 <Samu> then it wasn't
23:27:52 <nielsm> peter1138, I pushed some code that does k-d trees with stations too, now: https://github.com/OpenTTD/OpenTTD/compare/master...nielsmh:kdtree
23:28:06 <Samu> now this is merged, I'm testing it right now, and opf ships are locked in a reverse-loop
23:28:14 <peter1138> Samu, no, we were saying it's possible.
23:28:25 <andythenorth> frosch123: don't suppose we can just drop the offending commits?
23:28:30 <peter1138> Samu, this is why you should always comment on the PRs, not just chat in IRC where it is not recorded.
23:28:54 <glx> and you can test the PRs before they are merged too
23:28:58 <drac_boy> hmm just finally looked now .. the irregular airport catchment does seem interesting
23:29:10 <peter1138> Samu, anyway, if you want to "contest" a PR, you know exactly what to do.
23:29:13 <peter1138> Open a new issue!
23:29:19 <Samu> but why would I bother, everytime I talk about opf, you complain about it being obsolete
23:29:22 <frosch123> andythenorth: fixed it :)
23:29:26 <andythenorth> yay
23:29:33 <peter1138> Samu, that doesn't mean we want to break.
23:30:33 * drac_boy wonders what else coals can be used for beside steelmills/powerplants
23:30:59 <andythenorth> https://en.wikipedia.org/wiki/Coal_liquefaction
23:31:03 <andythenorth> also town gas
23:31:07 <andythenorth> lime kilns
23:31:13 <andythenorth> coke ovens
23:31:15 <m3henry> Append is turning out to be the largest commit of this PR
23:32:03 <andythenorth> brick kiln, cement kiln
23:32:14 <andythenorth> domestic fuel
23:32:30 <nielsm> boy scout camps!
23:32:33 <drac_boy> hmm coal bricks .. thats a new one to me .. will have to check ty
23:32:47 <nielsm> not bricks made from coal, bricks fired with coal
23:33:33 <Samu> there is a right way to do 90 degs for opf
23:33:43 <Samu> i had it done, but it was rejected
23:34:06 * andythenorth is confused
23:34:20 <peter1138> _dp_, nice benefit, it's now safe to iterate catchment_tiles as the order is guaranteed.
23:34:35 <andythenorth> why are we implementing 90 degs for opf?
23:34:58 *** snail_UES_ has quit IRC
23:35:01 <nielsm> why was the 90 deg turns setting ever made apply to anything other than trains?
23:35:02 <peter1138> Hmm, so...
23:35:06 <Samu> then j0anjosep comes in, makes 90 degs be checked before the pathfinder, which breaks opf, and it gets accepted :(
23:35:14 <nielsm> it was only supposed to ever be about trains
23:35:28 <Samu> I'm sad
23:35:31 <peter1138> debug visualizations are really useful.
23:35:31 <drac_boy> hm anyway I'll let you talk about stations and pathfinders .. going off for a while here
23:35:31 <frosch123> why? ships turned just as sharp
23:35:36 *** drac_boy has left #openttd
23:35:49 <DorpsGek_II> [OpenTTD/OpenTTD] michicc requested changes for pull request #7176: Fix #6633: Cargo monitor industry delivery now accounts for which IndustryID the cargo was delivered to https://git.io/fhdOY
23:35:55 <peter1138> Made it much easier to verify that station catchment works.
23:36:30 <frosch123> though now they turn in place? i read something like that
23:36:40 <peter1138> Yeah that's a thing.
23:36:51 <Samu> gonna create an issue
23:36:57 <peter1138> Samu, finally.
23:37:39 <glx> next time you could try the PR before it's merged ;)
23:37:51 <frosch123> andythenorth: my upload is too small, push will take 30 minutes or so :p
23:38:15 <DorpsGek_II> [OpenTTD/OpenTTD] michicc commented on pull request #7176: Fix #6633: Cargo monitor industry delivery now accounts for which IndustryID the cargo was delivered to https://git.io/fhdOZ
23:38:28 <glx> especially when you know what could fail
23:38:29 <peter1138> Prozone 13 catchment areas, oh boy.
23:38:51 <LordAro> oh, you're definitely going to break all ottdc games :p
23:39:18 <andythenorth> frosch123: is the process repeatable? o_O
23:39:24 <nielsm> peter1138, prozone 13 is the one with synchronised oil trains?
23:39:27 <frosch123> yes
23:39:37 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdOC
23:39:48 <frosch123> i repeated it 5 times with various author mappings
23:39:55 <andythenorth> I should set up to do it locally then, I have 6 or so repos to convert :)
23:40:01 <andythenorth> maybe not right now though :)
23:40:29 <frosch123> hmm, do you mean "repeatable" or "incrementable"?
23:40:49 <andythenorth> I mean can I follow instructions and get it done?
23:40:58 <andythenorth> unless you or someone else would do it for me :P
23:40:59 <frosch123> i always convert the whole repo, no idea whether it can also do incremental updates
23:41:20 <frosch123> andythenorth: up to know i used the package from debian stable
23:41:39 <frosch123> but now i patched the script to filter out NUL in commit messages
23:41:39 <peter1138> Ah, Resize doesn't clear :-)
23:41:50 <frosch123> which eints apparently produces sometimes/somewhen
23:42:06 <glx> I think the instructions in https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git should work too
23:42:25 <glx> as it seems frosch123 is using the indicated tool
23:42:54 <frosch123> yes, hg-fast-export
23:43:32 <frosch123> most work is creating the author mapping file, but since there are only finite authors on devzone, and they are mostly the same for the repos, i should have most
23:44:18 <andythenorth> can we wrap a shell script around it? :P
23:44:33 <andythenorth> might be a lot to move in future
23:44:44 <glx> author thing is somehow manual
23:44:57 <frosch123> i could probably run it on devzone
23:45:00 <frosch123> better bandwidth :p
23:45:16 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick opened issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOR
23:45:59 <peter1138> Samu, add a reference to the offending commit/PR as well.
23:46:48 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOz
23:47:49 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOg
23:49:08 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOw
23:50:47 <Eddi|zuHause> why is the tractor called a rough terrain vehicle, when it gets stuck on every tiny bump?
23:51:51 <DorpsGek_II> [OpenTTD/OpenTTD] J0anJosep commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOK
23:52:13 <andythenorth> frosch123: devzone sounds like a nice idea :)
23:52:15 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN updated pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fh5s1
23:52:17 * andythenorth must to bed
23:54:13 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7235: Change: Non-rectangular sparse station catchment area https://git.io/fhdOi
23:55:34 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOX
23:56:06 <peter1138> andythenorth, not again.
23:56:26 <peter1138> Broken savegame - Invalid chunk size
23:57:04 <peter1138> I should add a button to allow broken savegames to be deleted easily :p
23:57:07 <peter1138> I have so many.
23:57:13 <DorpsGek_II> [OpenTTD/OpenTTD] glx22 commented on issue #7244: OPF ships locked in a reverse-loop https://git.io/fhdOM