IRC logs for #openttd on OFTC at 2019-03-27
            
00:00:01 <peter1138> Ok.
00:00:08 <peter1138> Then we don't care.
00:00:14 <Samu> orly?
00:00:15 <Samu> ok
00:00:16 <peter1138> debug == not optimized.
00:01:23 <Eddi|zuHause> drac_boy: the "standard" scheme always allowed for extensions
00:02:03 <peter1138> If there's a performance regression in release build, then we can discuss it.
00:02:20 <Samu> do I create a PR? I guess not
00:02:26 <Samu> will leave it to m3henry
00:02:51 <peter1138> 22:45 <@LordAro> Samu: you can pull request that change, if you like
00:03:57 *** Gustavo6046 has joined #openttd
00:04:06 <Samu> it will be fixed in another manner, from what I could gather, so pointless
00:04:40 <LordAro> eventually, yes
00:04:45 <LordAro> but that might take some time
00:04:55 <peter1138> LordAro, better do it ourselves... this one's being awkward.
00:05:00 <LordAro> as ever
00:05:10 <peter1138> But I'm going to bed.
00:07:01 *** Wolf01 has quit IRC
00:10:29 *** Gustavo6046 has quit IRC
00:15:30 *** Gustavo6046 has joined #openttd
00:28:48 *** m3henry has quit IRC
00:58:23 <Samu> im doing a small experiment
00:58:45 <Samu> AIs in 1.8.0 seem to fastforward faster
00:58:51 <Samu> than in 1.9.0-RC2
00:58:55 <Samu> at least my AI
00:59:19 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro opened pull request #7422: Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap https://git.io/fjUin
01:00:24 <drac_boy> sorry was a little busy .. but hmm .. I guess that makes sense but I still don't see why he shouldn't just use the letter N instead .. oh well its his own grf so meh :)
01:14:31 <drac_boy> anyway night here
01:14:34 *** drac_boy has left #openttd
01:19:15 *** Flygon has joined #openttd
01:29:44 *** tokai|noir has joined #openttd
01:29:44 *** ChanServ sets mode: +v tokai|noir
01:36:27 *** tokai has quit IRC
01:38:47 *** Smedles has quit IRC
01:40:13 *** Smedles has joined #openttd
01:41:04 *** Wormnest has joined #openttd
01:41:37 <Samu> who would have though
01:42:01 <Samu> ScriptTile::GetCargoProduction is the slowest function of all that valuator
01:42:09 <Samu> the most important one, the one that actually matters
01:42:15 <Samu> pff :(
01:44:04 <Samu> Orthogonal tile area intersects...
01:49:06 *** Smedles has quit IRC
01:49:22 *** Smedles has joined #openttd
02:06:50 *** Supercheese has quit IRC
02:07:21 *** HerzogDeXtEr has quit IRC
02:08:07 <utack> does anyone know if there are grf's with animals? all i could find was the opengrf farm https://i.imgur.com/gTSqdW4.png
02:08:57 <Eddi|zuHause> there defintely were animals, in FIRS, maybe also ECS
02:09:22 <Eddi|zuHause> also, ISR stations
02:09:37 <Samu> OthogonalTileArea::Intersects is slow, plz buff
02:09:45 <Samu> :p
02:11:00 <utack> found something here too http://george.zernebok.net/newgrf/downloads.html#decs
02:11:05 <utack> thank you Eddi|zuHause i will see!
02:12:07 *** Thedarkb-X40 has joined #openttd
02:13:15 <Samu> maybe I shouldn't use intercontinental airports :|
02:14:26 <utack> Eddi|zuHause you were right, there is a duck and a chicken at least :)
02:16:17 <utack> and cows
02:23:35 <Samu> this area intersection is ... intersecting with industries tile area
02:23:38 <Samu> for all industries... omg
02:23:45 <Samu> no wonder it's slow
02:24:02 <Samu> and I'm making airports in towns, even
02:24:17 <Samu> but it has to loop over all industries, for some reason
02:25:06 <Samu> line 529 station_cmd.cpp
02:26:46 <Samu> so, if I create a map with no industries, I am expecting this to be faster, let me try
02:36:57 <Samu> tested
02:37:11 <Samu> went from 66% to 2%
02:37:14 <Samu> lol
02:37:33 <Samu> GetNearestTown is now the new 66%
02:44:02 <Samu> wasn't kdtree implemented?
02:45:22 *** Wormnest has quit IRC
02:55:34 <Samu> who was the kdtree implementer?
03:02:47 *** Thedarkb-X40 has quit IRC
03:13:31 *** Supercheese has joined #openttd
04:17:39 *** Supercheese has quit IRC
04:18:01 *** Supercheese has joined #openttd
05:00:34 *** D-HUND has joined #openttd
05:03:57 *** debdog has quit IRC
05:38:36 <DorpsGek_II> [OpenTTD/OpenTTD] glx22 opened pull request #7423: Fix: MSVC warnings https://git.io/fjU12
05:40:53 *** Saqeram[m] has joined #openttd
05:55:16 *** Maarten has quit IRC
05:55:20 *** Maarten has joined #openttd
06:01:43 *** glx has quit IRC
06:06:33 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick opened pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU1d
06:09:18 <cHawk> longtime lurker, early player of Transport Tycoon for dos. OpenTTD has done an amazing job. I love you guys!
06:10:39 <Samu> Im off to bed, good night
06:10:45 *** Samu has quit IRC
06:57:35 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7422: Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap https://git.io/fjUMz
07:03:42 <peter1138> Hmm
07:04:02 <peter1138> Queued. I'm sure it's not.
07:10:43 <peter1138> 01:25 < Samu> line 529 station_cmd.cpp
07:11:35 <peter1138> hmmmmm
07:18:10 <peter1138> Hmm, do we have non-square airports?
07:19:18 <peter1138> I guess so.
07:31:52 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7422: Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap https://git.io/fjUin
07:31:58 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN closed issue #7421: Can't dereference value-initialized vector iterator https://git.io/fjUKS
07:58:29 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7417: Group hierarchy improvements (by 3298) https://git.io/fjUDv
07:58:51 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN closed issue #6189: Vehicle Groups: parent group should count total number of vehicles in subgroups https://git.io/fjUDJ
07:58:52 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN closed issue #5977: Vehicle Groups: improve error message when group hierarchy fails https://git.io/fjUDU
07:58:54 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7417: Group hierarchy improvements (by 3298) https://git.io/fjU3n
07:58:56 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN closed issue #6053: Vehicle Groups: packing and unpacking subgroups https://git.io/fjUDT
07:59:53 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUDk
08:26:08 *** Supercheese has quit IRC
08:26:37 <DorpsGek_II> [OpenTTD/OpenTTD] planetmaker opened issue #7425: Crash report https://git.io/fjUDO
08:33:59 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on issue #7425: Crash report https://git.io/fjUDs
08:41:00 *** kiwitree has joined #openttd
08:50:26 *** andythenorth has joined #openttd
08:53:22 <peter1138> Hi
08:53:28 <planetmaker> moin
08:54:37 <andythenorth> yo
08:55:01 <andythenorth> is it lunch time?
08:57:04 <planetmaker> drive time or trip time... see ya Friday :)
08:58:21 <peter1138> Noooo
08:58:44 <andythenorth> coffee time
09:01:11 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN requested changes for pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUDz
09:04:16 *** HerzogDeXtEr has joined #openttd
09:09:01 <LordAro> mrng
09:12:07 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro commented on issue #7425: Crash report https://git.io/fjUDy
09:12:08 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro closed issue #7425: Crash report https://git.io/fjUDO
09:19:55 *** HerzogDeXtEr has quit IRC
09:35:47 <DorpsGek_II> [OpenTTD/OpenTTD] JGRennison commented on issue #6618: Incorrect size bounds checks in vehicle viewport hash scan in ViewportAddVehicles https://git.io/fjUyI
09:53:39 <DorpsGek_II> [OpenTTD/OpenTTD] JGRennison commented on pull request #7366: Add: List recently executed commands in crashlog output. https://git.io/fjUy2
11:07:44 *** andythenorth has quit IRC
11:32:30 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7409: Some Industry vars missing from #6867 https://git.io/fjU9S
11:44:25 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7409: Some Industry vars missing from #6867 https://git.io/fjJSs
12:00:57 *** kiwitree has quit IRC
12:10:08 *** gelignite has joined #openttd
12:48:37 *** Laedek has quit IRC
13:07:12 *** sla_ro|master has joined #openttd
13:30:40 *** Samu has joined #openttd
13:30:44 <Samu> hi
13:31:44 <Samu> peter1138, you awake?
13:33:45 <Samu> I found the big reason why my AI was stutterfesting
13:34:00 <Samu> it's on line 529 station_cmd.cpp
13:34:20 <Samu> FOR_ALL_INDUSTRIES
13:34:21 <Samu> :(
13:35:24 <Samu> the 2nd big reason was getting Airport Noise
13:35:39 <Samu> and I created a PR for that, the kdtree thing
13:36:16 <peter1138> Yes, I responded to that.
13:36:44 <Samu> can you take a look on cargo production around industries for me? :p
13:36:52 <peter1138> Not right now, no.
13:36:57 <Samu> :)
13:40:03 *** gelignite has quit IRC
13:52:32 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU7y
13:53:29 <Samu> maybe I should assert
13:53:44 <Samu> assert(t == NULL); ?
13:53:47 <Samu> oops
13:53:51 <Samu> assert(t != NULL);
13:54:40 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU7H
13:55:28 <Samu> uhm, okay, I failed at explaining
13:59:57 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU5L
14:06:37 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU5R
14:07:07 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU5E
14:17:32 <Samu> how do I make heliports so noisy so noisy that I can't place them in the smallest town ever?
14:17:39 <Samu> for testing
14:20:04 <Samu> i meant the biggest town ever
14:21:27 <Samu> ugh, looks like I can't assert, grr
14:23:05 <Samu> let's test mindist + 1
14:27:37 <Samu> assert(AirportGetNearestTownForAllTowns(as, it) == AirportGetNearestTownKdTree(as, it));
14:30:27 <Samu> 65535 ought to be enough noise
14:33:18 <Samu> too much noise
14:34:27 <Samu> damn towns always have a min noise of 3
14:34:42 <Samu> heliports always getting away with i
14:34:43 <Samu> t
14:36:06 <Samu> peter1138, I'm testing this atm https://paste.openttdcoop.org/pmxvuic0n
14:36:32 <Samu> for some reason, I can't assert(t != NULL);
14:36:57 <Samu> so i made it into a continue
14:41:42 <Samu> I notice const AirportSpec *as isn't used anymore
14:59:05 <peter1138> I... hadn't noticed that either :p
15:00:34 <Samu> well, it didn't assert anymore, so...
15:00:37 <Samu> gonna post
15:03:36 <Samu> oh, as to why it prefers town with lowest index
15:03:51 <Samu> it's so that it could match assert(AirportGetNearestTownForAllTowns(as, it) == AirportGetNearestTownKdTree(as, it));
15:04:00 <Samu> but that's a bad comment
15:04:05 <Samu> what would I say?
15:04:15 <peter1138> I know why it prefers lowest index.
15:04:33 <peter1138> Do you know why it prefers lowest index?
15:05:49 <Samu> because the old method also preferred it
15:05:52 <Samu> lol i dunno
15:06:00 <peter1138> Why did the old method prefer it?
15:07:07 <Samu> because it was iterating from the lowest index to highest index?
15:11:08 <peter1138> Right.
15:11:53 <peter1138> So focus your behaviour comment on that, not some meaningless "assert foo == bar"
15:18:36 *** Pikka has joined #openttd
15:19:23 <Pikka> aww, simyoulater didn't appreciate my "iron vole" title
15:21:06 <peter1138> Hmm?
15:21:49 *** Flygon has quit IRC
15:24:02 <peter1138> Oh the split-topic thing.
15:25:14 *** andythenorth has joined #openttd
15:25:17 <Pikka> yes
15:25:35 <peter1138> andy is north
15:25:50 <Pikka> and an ironmonger
15:28:46 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7380: Feature: Multi-tile docks. https://git.io/fjUFy
15:33:17 *** andythenorth has quit IRC
15:33:48 <Samu> i dont know how to comment this
15:34:42 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU1d
15:35:00 <peter1138> Let's see what monstrosity you came up with.
15:35:34 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUFp
15:37:34 *** Wormnest has joined #openttd
15:43:55 <peter1138> Oh. You know what...
15:43:59 <peter1138> Noise level isn't saved anyway.
15:44:09 <peter1138> So you really don't need to replicate that behaviour.
15:45:27 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUbs
15:47:18 <Samu> im trying to figure out why t can be NULL at times
15:57:00 <Samu> ah, i understand
15:57:05 <Samu> lol i'm stupid
15:59:03 <Samu> that threshold
16:01:37 <Samu> does the iterator really need to be copied?
16:04:57 <Eddi|zuHause> if i want to introduce the dreaded R-word to the discussion: sometimes a big city's demands for airports should allow to override the noise level requirement for a small nearby town
16:05:43 <peter1138> Samu, currently yes, because it's used again.
16:05:59 <Samu> ok
16:07:03 <peter1138> Eddi|zuHause, sure, but this change is meant to be just an optimization, not a feature change.
16:07:22 <Eddi|zuHause> when did that ever stop me? :p
16:08:15 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU1d
16:08:43 <Samu> the function changed
16:08:58 <Samu> it was already described after all that it would prefer the lowest index
16:09:02 <Samu> now it doesn't
16:09:17 <peter1138> Hmm, I didn't notice that comment :p
16:09:23 <peter1138> Well, maybe you should keep the behaviour.
16:09:32 <Samu> oh ... :)
16:09:39 <peter1138> Just drop that last commit.
16:09:54 <Samu> still need to remove the @param as
16:09:59 <peter1138> And yeah, if it already says "town with lower index is returned" then don't worry about the comment.
16:10:02 <peter1138> Yeah.
16:10:26 <peter1138> What's the performance benefit you saw?
16:10:34 <peter1138> (Hard figures, not relative, please)
16:12:22 <Samu> with industries and valuators.... about 15 ms avg
16:12:36 <Samu> with industries... about 8 ms
16:12:55 <Samu> without industries... 2 ms
16:13:24 <Samu> without industries and that fix in the code... 1 ms
16:13:30 <Samu> sometimes less
16:14:44 <Samu> FOR_ALL_INDUSTRIES is my next target
16:16:07 <peter1138> Uh, what?
16:16:24 <peter1138> I mean the performance benefit of that chance.
16:16:26 <Samu> I tested using my own AI
16:16:39 <peter1138> *change
16:16:53 <Samu> went from 2 ms to 1ms
16:16:56 <Samu> a bit less
16:16:59 <Samu> than 1
16:17:16 <Samu> no hard figure i guess
16:17:24 <Samu> will try with TIC TOC thing, maybe?
16:18:03 <peter1138> With 12000 towns or so?
16:18:14 <Samu> yes
16:18:17 <Samu> 4096x4096 map
16:18:23 <Samu> and 20480 industries
16:18:36 <peter1138> Industries don't affect AirportGetNearestTown
16:19:01 <Samu> oh, right
16:19:07 <Samu> forgot you don't care about that
16:19:34 <LordAro> there's no way measurements of <5ms are stable enough to draw any conclusions from
16:19:40 <Samu> Get Cargo Production around tiles iterates over all industries, the main stutter cause
16:19:47 <LordAro> unless you're measuring them hundreds (or better, thousands) of times
16:20:39 <peter1138> LordAro, indeed.
16:20:50 <peter1138> Samu, I can improve that easily, if you want to wait.
16:21:09 <Samu> I wait
16:21:13 <_dp_> is there a way to make mouse feel the same in fullscreen as in windowed with sdl driver?
16:21:27 <_dp_> I used SDL_MOUSE_RELATIVE=0 but it seems broken now :(
16:21:51 <peter1138> Does it not?
16:22:31 <peter1138> Samu, update that existing PR and I've got another (minor) improvement to PR.
16:22:55 <Samu> speaking of mouse, yesterday I had a weird mass popups about an assert related to mouse cursor
16:23:31 <Samu> it felt like I was visiting a broken site
16:23:32 <peter1138> I never bothered optimising GetProductionAroundTiles because it was a GUI-only thing, but I guess as the AI uses it as well, that matters.
16:23:46 <Samu> couldn't reproduce it
16:24:10 <Samu> always poping up error windows
16:24:30 <Samu> had to kill visual studio in the task manager
16:28:19 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU1d
16:31:10 <Samu> now, measuring
16:31:13 <Samu> hmm
16:31:21 <Samu> TIC TOC, lets see
16:46:06 <Samu> i fail at using tic toc
16:56:38 <peter1138> Yeah? Don't bother :p
17:00:20 <Samu> hah, it's actually slower on smaller maps
17:00:27 <Samu> oh gosh :(
17:03:13 *** crem1 has joined #openttd
17:04:23 <Samu> https://imgur.com/XxHWxXC
17:04:32 <Samu> ok here's a good "test"
17:04:43 <Samu> 4096x4096, about 12k towns, no industries
17:04:53 <Samu> and no valuators on thos
17:04:57 *** crem has quit IRC
17:04:59 <Samu> those*
17:05:10 <Samu> 250000 ops
17:07:26 <peter1138> Slower on smaller maps often means "unnoticable is still unnoticable"
17:14:11 <Samu> voronoi would be faster, right?
17:16:10 <peter1138> Well, how much slower are you talking?
17:24:00 *** synchris has joined #openttd
17:25:41 *** Progman has joined #openttd
17:29:25 *** nielsm has joined #openttd
17:32:48 <Samu> brb, let me put a small map
17:32:59 <Samu> 64 x 64 or so?
17:33:03 <Samu> 128 x 128?
17:37:17 <Samu> gonna try the average 256 x 256 or 256 x 512
17:38:59 <Samu> yep... it's slower :(
17:39:55 <Samu> https://imgur.com/DHb0RNI
17:40:14 <Samu> rip kdtree
17:42:01 <peter1138> Yeah but doing what?
17:42:32 <Samu> 256 x 256
17:43:43 <Samu> https://imgur.com/uVbxC9o 512x512
17:43:45 <Samu> also slower
17:44:40 <nielsm> slower doing what?
17:45:05 <Samu> iterating over ... uhm,, wait, i better upload v10
17:46:22 <peter1138> Yes. That's just a map size. What are you actually DOING.
17:46:44 <Samu> sec
17:47:03 <_dp_> communicating with Samu is slower than ever for sure xD
17:47:18 <peter1138> It's bizarre isn't it?
17:50:03 <Samu> https://github.com/SamuXarick/LuDiAI-AfterFix/blob/master/WrightAI.nut#L880
17:50:13 <Samu> from line 880 to 1008
17:50:48 <Samu> line 912 is the slowest
17:50:54 <Samu> if there are industries
17:52:18 <Samu> then line 955 or line 956, it's one of them, is the 2nd lowest, the case we're testing here
17:52:27 <Samu> 2nd slowest*
17:53:00 <Samu> there are no industries on these tests, i'm testing on maps without them
17:55:27 <Samu> owell
17:56:06 <Samu> up to below 2048x2048 the kdtree is slower, past 2048x2048, it is faster
17:56:10 <Samu> t.t
17:56:13 <Samu> rip PR
17:56:17 <Eddi|zuHause> <_dp_> is there a way to make mouse feel the same in fullscreen as in windowed with sdl driver? <-- what do you mean?
17:56:19 <peter1138> That doesn't make sense.
17:56:42 <peter1138> Map size is not particularly relevant, but number of towns is.
17:56:46 *** Supercheese has joined #openttd
17:56:52 <Samu> ah, you want the number
17:57:01 <Samu> @calc 12k / 4
17:57:01 <DorpsGek> Samu: Error: invalid syntax (<string>, line 1)
17:57:05 <Samu> @calc 12 / 4
17:57:05 <DorpsGek> Samu: 3
17:57:08 <Samu> 3k towns
17:57:46 <_dp_> Eddi|zuHause, when I switch to fullscreen mouse gets much slower, feels very awkward :(
17:58:07 <Eddi|zuHause> slower as in acceleration?
17:58:16 <Eddi|zuHause> or drawing of the pointer is choppy?
17:58:18 <Eddi|zuHause> or what?
17:58:30 <_dp_> Eddi|zuHause, moves slower
17:58:48 <Samu> https://imgur.com/ArJdueq 2048x2048
17:58:54 <Samu> so much PR for nothing
17:59:23 <Eddi|zuHause> _dp_: what OS?
17:59:28 <_dp_> Eddi|zuHause, linux
18:00:02 <_dp_> Eddi|zuHause, SDL_MOUSE_RELATIVE=0 helps but it seems to interfere with gnome somehow
18:00:06 <Samu> and then the glorious 4096x4096 result with the most relevant gains
18:00:09 <Eddi|zuHause> resolution change?
18:00:36 <Samu> https://imgur.com/XxHWxXC
18:03:05 <Samu> i really should stop testing stuff in 4k maps first
18:03:15 <Samu> it was the first thing I did
18:03:49 <_dp_> Eddi|zuHause, same on any resolution
18:03:57 <_dp_> Eddi|zuHause, it's a gnome issue I guess
18:04:19 <Eddi|zuHause> yeah, i'd look in gnome settings
18:04:20 <_dp_> Eddi|zuHause, seems to intercept mouse events as if there is top panel and dock
18:04:50 <Eddi|zuHause> i don't use gnome, so i can't help you there
18:06:40 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUhE
18:07:49 *** HerzogDeXtEr has joined #openttd
18:08:11 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjUhz
18:15:22 <Samu> you mean the borders nielsm ?
18:16:35 <nielsm> I mean instead of calculating nearest town to 100 tiles and taking the lowest distance, just calculate nearest town the the one single tile in the center of the airport area
18:16:42 <nielsm> it's 100 times less work
18:16:58 <nielsm> (assuming a 10x10 tile airport size)
18:18:14 <Samu> i was thinking about something similar, but for the perimeter tiles
18:18:15 <Eddi|zuHause> that would allow large airports in a lot more places, i think
18:18:19 <Samu> not the centre
18:18:27 <_dp_> ok, installing nvidia drivers fixed the mouse issue
18:18:34 <_dp_> I forgot it's using nouveau by default
18:18:49 <nielsm> yeah searching just the corner tiles of the tile area bounding box could be another option perhaps?
18:19:03 <Samu> no, corners nop
18:19:27 <Eddi|zuHause> non-rectangular areas might not have a "corner"?
18:19:35 <nielsm> but at least the interior tile should not be relevant, unless you're demolishing an entire town centre and replacing the entire town with airport
18:19:56 <nielsm> Eddi|zuHause: hence why I said tile area _bounding box_
18:20:38 <Eddi|zuHause> that sounds like a step backwards
18:20:41 <_dp_> or it didn't... weird, seemed fine at first :p
18:20:44 <_dp_> :(
18:22:03 <Eddi|zuHause> _dp_: just a random thing: does enabling/disabling "full animation" change anything?
18:22:42 <nielsm> unless there's really weirdly shaped airports like this anywhere? https://0x0.st/zKI9.png
18:22:58 <_dp_> Eddi|zuHause, no
18:23:56 <Eddi|zuHause> nielsm: if we ever get around to adding state machines, i would expact such things to appear
18:25:36 <Eddi|zuHause> nielsm: but i'd be primarily worried about things like diagonal airports, where the "bounding box corners" are really far away from the actual airport
18:27:23 <Eddi|zuHause> nielsm: i know we joked a lot about "vision" lately, but that's exactly the point where you need a vision to not introduce these arbitrary limitations
18:30:29 <nielsm> otherwise, keep the original algorithm, but limit the number of towns considered to those inside a bounding box of candidates
18:30:54 <nielsm> isn't there a strict limit to the distance to town sign where airport noise is considered?
18:31:19 <Eddi|zuHause> not that i know of
18:31:39 <_dp_> Eddi|zuHause, weird stuff, sometimes it's broken sometimes it's fine, and sometimes it switches to wrong resolution %)
18:34:42 <peter1138> Samu, so, are you using a debug build by any chance?
18:35:08 <Samu> no, those tests were on release x64
18:39:09 <Samu> there is a DiagonalTileIterator in the code
18:41:58 <peter1138> Urgh, regression fail :/
18:42:16 *** glx has joined #openttd
18:42:16 *** ChanServ sets mode: +v glx
18:42:16 <peter1138> Now, is that because my test it wrong now, or wrong before?
18:42:30 <_dp_> btw, getting closest town for each tile in area can be done significantly faster than just querying k-d tree for each tile independently
18:44:37 *** supermop_work has joined #openttd
18:49:39 <Eddi|zuHause> yeah, i imagine if you know the bucket for one tile, you can quickly check if the neighbouring tile is in the same bucket
18:50:00 <peter1138> Ok, regression fails because it was wrong before :p
18:50:45 <Eddi|zuHause> "just because you've done something for years, doesn't mean you've been doing it correctly"
18:51:26 <peter1138> That means this codechange: becomes a fix:
18:56:12 *** andythenorth has joined #openttd
19:05:04 <Eddi|zuHause> nielsm: btw, can you have a look at https://github.com/OpenTTD/OpenTTD/pull/7051 how to incorporate the last commit into the signs kdtree?
19:05:18 *** supermop_work_ has joined #openttd
19:06:34 <nielsm> Eddi|zuHause: basically the same pattern as the other four types of viewport signs
19:08:08 <Eddi|zuHause> nielsm: since it's not actually my patch, i was a bit lost on trying to decipher that stuff
19:10:44 <Samu> im experimenting the perimeter stuff
19:10:46 <Samu> if (IsInsideMM(TileX(cur_tile), TileX(it), TileX(it + delta_x) + 1) || IsInsideMM(TileY(cur_tile), TileY(it), TileY(it + delta_y) + 1)) {
19:10:57 <Samu> don't know if this is the correct checking
19:11:11 *** supermop_work__ has joined #openttd
19:12:17 *** supermop_work has quit IRC
19:12:43 *** supermop_work has joined #openttd
19:14:00 <Samu> how do i get the max X and max Y allowed?
19:14:09 <Samu> must not go over it
19:18:12 *** supermop_work_ has quit IRC
19:18:43 <Samu> TileX(min(it + delta_x, MapMaxX())) + 1)
19:18:49 <Samu> great :)
19:20:12 *** supermop_work__ has quit IRC
19:21:07 <peter1138> I have a Samu problem.
19:21:14 <Samu> hum? :(
19:21:16 <peter1138> I can't come up with a nice concise commit message.
19:21:30 <LordAro> Fix: The things
19:21:45 <Samu> oh you're asking to a terrible person for that
19:22:39 *** supermop_work_ has joined #openttd
19:23:08 *** Pikka has quit IRC
19:25:16 <peter1138> Funny though.
19:25:25 <peter1138> This is a fix from your comment last night.
19:25:51 <peter1138> 01:25 < Samu> line 529 station_cmd.cpp
19:26:08 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN opened pull request #7426: Fix: Incorrect display of industry production around tiles. https://git.io/fjUj9
19:26:40 *** supermop_work__ has joined #openttd
19:27:51 *** supermop_work has quit IRC
19:29:37 *** supermop_work has joined #openttd
19:31:30 <peter1138> Samu, so that might be quicker.
19:32:08 <DorpsGek_II> [OpenTTD/OpenTTD] stale[bot] commented on issue #7042: Use intrinsics for bit twiddling? https://git.io/fjUjx
19:33:12 *** supermop_work_ has quit IRC
19:33:46 <peter1138> But it should also be correct now.
19:33:52 <peter1138> Hence the regression change.
19:34:12 <Samu> im terrible math
19:34:58 *** andythenorth has quit IRC
19:35:44 *** frosch123 has joined #openttd
19:36:56 *** supermop_work__ has quit IRC
19:37:11 <Samu> IsInsideMM(TileY(cur_tile), TileY(it), min(TileY(it) + delta_y, MapMaxY()) + 1)
19:38:41 *** supermop_work has quit IRC
19:38:47 <Samu> TileY(it) + delta_y VERSUS MapMaxY()
19:38:54 <Samu> it gets the minimum of both
19:39:20 <Samu> then adds +1 because IsInsideMM is [ , )
19:39:25 *** supermop_work has joined #openttd
19:45:59 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN opened pull request #7427: Codechange: Distance between town and airport has already just been found, so use it. https://git.io/fjTeL
19:46:03 <peter1138> ^^ PR no. 2
19:46:14 <peter1138> Er, well, No 7427, I guess.
19:46:25 <peter1138> 18:46, I ought to get ready for trail biking.
19:46:53 <peter1138> Samu, please test #7426 and #7427 (preferably together...)
19:47:46 <Samu> ok
19:49:06 <nielsm> btw my tip for testing multiple patches together: make a new branch from master, then merge (don't bother with rebase) both to-test branches into that branch
19:49:17 <nielsm> makes for the easiest cleanup afterwards
19:50:07 <Samu> my IsInsideMM test is not working damn it :p
19:50:08 <glx> cherry-pick works too if there's one commit per PR :)
19:50:24 <peter1138> *nod*
19:50:31 <Samu> i'm so terribad, and all I want is the perimeter tiles
19:50:39 <peter1138> Also, maybe other people here can test and review those two PRs? :-)
19:50:59 <Samu> apparently, I'm getting all tiles
19:51:11 <Samu> the test is useless like that lol
19:52:09 <peter1138> You need the dimensions of the tilearea.
19:52:41 <Samu> AirportSpec is back in action
19:53:54 *** supermop_work_ has joined #openttd
19:53:57 <peter1138> You need the start tile, and the x & y, and then add 1 to TileX(tile) and subtract... 2 (probably) from x.
19:54:00 <peter1138> Same for Y.
19:54:29 <peter1138> AirportPerimeterTileIterator? :p
19:54:37 <Samu> yes, I want that
19:55:35 <Samu> the start tile is it
19:55:52 <peter1138> You can get that from the iterator (before you use it)
19:55:53 <Samu> or at least I assume all airport tables start tile is 0, 0
19:55:57 *** gelignite has joined #openttd
19:56:12 <peter1138> But you should be predetermining these before the loop.
19:56:27 <peter1138> I don't see why layouts would not start at 0, 0
19:56:52 <glx> would be highly unlogical to not start at 0,0
19:57:17 <peter1138> Hmm, well, I guess I better go.
19:57:35 <peter1138> I gave Samu 10 minutes to quickly test my two PRs for performance but he didn't bother cos he's stuck. I love it.
19:57:45 <Eddi|zuHause> can layouts have negative coordinates?
19:58:02 <Eddi|zuHause> because 0,0 might not be part of the layout for diagonal stuff
19:58:16 <Samu> i will test later, visual studio doesn't let me change branch atm, and yeah I'm stuck
19:58:41 <Eddi|zuHause> (i think we had that discussion a few weeks ago with industries)
19:58:52 <Samu> yes
19:59:01 <Samu> oil rigs
19:59:04 <Samu> for example
19:59:42 <peter1138> Eddi|zuHause, andy complained it was not centered, so I made it centered, then he said it wasn't actually any better.
20:00:06 <glx> in the spec "Offsets counted from the northernmost tile of the airport, specifying the position of the current tile. Both are taken as signed integers, but cannot go negative except the special case mentioned below."
20:00:16 <glx> and negative is only for clearance checks
20:00:52 *** supermop_work has quit IRC
20:01:09 *** supermop_work has joined #openttd
20:02:21 <Eddi|zuHause> the problem with diagonal airports will be that the (0,0) origin point will be quite far from the actually built airport
20:02:45 <Eddi|zuHause> (and i'm assuming that also will be a problem with the station sign)
20:03:30 <Eddi|zuHause> so i think it would be beneficial to allow moving the origin point away from (0,0)
20:04:20 <Eddi|zuHause> industries have the additional problem that you don't see the layout size
20:05:43 <peter1138> Well, it's possibly to offset the origin but at the point where Samu is, it would already have been applied.
20:05:58 <Eddi|zuHause> also, andy's industry problem might have been overlapping with the water class issue
20:06:03 *** supermop_work_ has quit IRC
20:14:41 *** supermop_work_ has joined #openttd
20:15:36 *** Laedek has joined #openttd
20:17:07 *** supermop_work__ has joined #openttd
20:17:44 <Samu> https://paste.openttdcoop.org/pwumtlbr3 testing if this works
20:18:26 <Samu> i hope that is the perimeter
20:22:06 *** supermop_work has quit IRC
20:23:23 <Samu> wow, it's faster indeed
20:23:30 <Samu> now I hope it's also correct
20:24:37 *** supermop_work_ has quit IRC
20:25:13 *** m3henry has joined #openttd
20:25:32 <m3henry> ls
20:27:31 <Samu> grr, i'm forced to commit damn it
20:32:44 <Samu> assert(kdtree == forall);
20:32:46 <Samu> testing
20:40:21 <Samu> no asserts so far, so im gonna assume it's "working"
20:40:44 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjU1d
20:42:13 *** supermop_work has joined #openttd
20:47:34 *** supermop_work_ has joined #openttd
20:49:48 *** supermop_work__ has quit IRC
20:55:18 *** supermop_work has quit IRC
21:02:51 *** rocky11384497 has quit IRC
21:03:15 *** andythenorth has joined #openttd
21:03:41 <Samu> about 7426, I thought that was a feature
21:05:51 <Samu> a change like that will surely affect competitive servers
21:05:54 <Samu> but ok
21:06:44 *** andythenorth has quit IRC
21:10:03 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown https://git.io/fjTvy
21:10:26 <Samu> there was a gain
21:12:15 *** andythenorth has joined #openttd
21:13:46 <andythenorth> yo
21:14:08 *** andythenorth has quit IRC
21:14:16 *** supermop_work has joined #openttd
21:14:57 <Samu> hi
21:21:17 *** supermop_work_ has quit IRC
21:37:22 *** supermop_work_ has joined #openttd
21:44:21 *** supermop_work has quit IRC
21:54:32 *** synchris has quit IRC
22:01:11 *** rocky11384497 has joined #openttd
22:14:21 *** gelignite has quit IRC
22:20:44 <Samu> #7246 results in about 1/4 of the time
22:21:04 <Samu> was averaging 800 ms, now it's about 220
22:28:38 *** supermop_work has joined #openttd
22:30:21 *** stormcone has joined #openttd
22:30:47 *** supermop_work has quit IRC
22:30:50 <stormcone> hi
22:30:53 <Samu> hi
22:31:27 <Samu> #7247 results aren't noticeable... seems to be equal to master
22:32:18 <Samu> 230 ms vs 230 ms
22:32:30 <Samu> let me recheck what my AI do
22:32:51 <stormcone> I am trying to update my personal openttd "patch pack" after the SmallVector replacement, but i have some problem with the SmallMap's Erase function
22:35:11 <stormcone> I am that familiar with C++, but now I am at the point where I would like to know whether is the function working as it is intended?
22:35:46 <Eddi|zuHause> can you be more specific?
22:36:06 *** supermop_work_ has quit IRC
22:37:47 <stormcone> I have a SmallMap, from I trying to delete an element like: map.Erase(key);
22:37:53 <frosch123> there are two methods. one which takes a "Pair*"-iterator, one which takes a key value
22:38:19 <stormcone> but I get a quite long compiling error
22:38:40 <LordAro> can't help you without a) the code b) the error
22:38:47 <frosch123> hmm, oh, i agree, that ERase is weird
22:38:57 <frosch123> it says it takes a key, but acutally it uses a value-pair
22:39:33 <LordAro> Eddi|zuHause: i've activated the centre node :>
22:39:39 <stormcone> i think the main problem from the error log is: error: no match for ‘operator==’
22:39:50 <stormcone> (operand types are ‘SmallPair<Vehicle*, bool>’ and ‘Vehicle* const’)
22:39:51 <Eddi|zuHause> LordAro: i haven't tried yet since last time...
22:40:00 <stormcone> { return *__it == _M_value; }
22:40:15 <LordAro> Eddi|zuHause: i tried after managing to create a portable oxygenator
22:40:21 <Eddi|zuHause> LordAro: i was testing a theory involving the glowing orbs you find around, but wasn't getting anywhere with it
22:40:32 <LordAro> and finding that they're completely useless as they drain *all* the power
22:40:38 <frosch123> Erase(const T &key) must be unused in ottd code. it does something different than before, and it kind of makes no sense :p
22:40:42 *** andythenorth has joined #openttd
22:41:01 <stormcone> so I rewrite it for myself, but I wanted to be sure, whether that the code in the repo is correct or not
22:41:14 <LordAro> stormcone: if it's a map of your own creation, i'd recommend just switching to use std::map instead :)
22:41:16 <Samu> peter1138, I think you made a mistake here: mindist = UINT_MAX - add; // prevent overflow
22:41:34 <Eddi|zuHause> LordAro: i wasn't at that point yet. it was either looking around on the planet for another piece of processed scrap, or flying to another planet to get iron
22:41:53 <Samu> you want to reuse mindist, but you start all over instead
22:41:54 <stormcone> no, it's not mine
22:42:15 <LordAro> stormcone: maybe you should try converting it anyway :p
22:42:29 <LordAro> unless m3henry gets there first
22:42:46 <frosch123> so, delete Erase?
22:43:05 <frosch123> it compares a pair with a key, which never compiles, so the function must be unused
22:43:54 <LordAro> Eddi|zuHause: mm, i think i'm a bit ahead of you then :)
22:43:55 <Eddi|zuHause> "delete erase" is a strange phrase... it might be one of those recursions that destroy the universe :p
22:44:19 <Eddi|zuHause> LordAro: it's not like i'm progressing fast at 6fps anyway
22:44:24 <LordAro> Eddi|zuHause: ono
22:44:32 <stormcone> i modified it, so now uses it's own find() to find a pair, and then using the erase(pair) function to actually delete the item
22:44:33 <Samu> or i dunno what i'm looking at t.t
22:45:13 <frosch123> that also works :)
22:46:18 <stormcone> okay, so should i make a pr about it? or what are you planning to do with that function? :)
22:46:31 <LordAro> frosch123: confirmed, no compile issues if i remove the function
22:47:10 <LordAro> stormcone: PR fixing it would be lovely. long term SmallMap will be removed in favour of std::{unordered_,}map, but not sure how long that will be
22:47:44 <stormcone> ok, i will do it
22:48:05 <frosch123> LordAro: "long term" would mean "flat_map" :p
22:49:35 <LordAro> frosch123: you're thinking longer term than me :p
22:50:08 <LordAro> depends what sort of performance is required for the particular usages, i imagine :p
22:51:05 <Samu> about my perimeter check, what happens if the town is inside the perimeter
22:51:52 <Samu> and another town is just next door to one of the sides
22:52:07 <Samu> it would get the wrong town, right?
22:54:31 <Eddi|zuHause> Make The Map Round Again
22:55:11 <DorpsGek_II> [OpenTTD/OpenTTD] stormcone opened pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly https://git.io/fjTUY
22:56:24 *** sla_ro|master has quit IRC
22:56:29 <stormcone> btw thank you for the help :)
23:04:10 *** andythenorth has quit IRC
23:05:39 <Eddi|zuHause> i'm not sure i understood the difference between the old and the new code
23:07:05 <Samu> TownID ScriptAirport::GetNearestTown
23:07:45 <Samu> AIs could be dumb enough to call this in a place where a town is inside the box
23:07:56 <Samu> openttd code doesn't seem to do this though
23:08:01 <Samu> but AIs... could
23:09:25 *** frosch123 has quit IRC
23:09:34 <Samu> RIP perimeter check
23:12:07 *** nielsm has quit IRC
23:19:17 <peter1138> Hi
23:20:56 <Samu> i thought kdtree was fast
23:21:00 <Samu> :(
23:21:05 <Samu> bring back voronoi
23:24:15 <Samu> https://paste.openttdcoop.org/piojqoyk3 so my main.nut now does this only
23:28:00 <peter1138> Sounds useful
23:28:44 <Samu> AIAirport.GetNearestTown(AIBase.RandRange(alltiles), AIAirport.AT_INTERCON);
23:28:49 <Samu> less bias
23:31:43 <peter1138> Ah yes, 7427 is barely noticable, but does eliminate a pointless loop.
23:31:47 <Samu> wow microsoft edge doing popups about microsoft services... :(
23:31:55 <peter1138> Just not as expensive as I was thinking.
23:32:11 <peter1138> 7426... 1/4 the time? Interesting.
23:33:09 <peter1138> 20:05 < Samu> a change like that will surely affect competitive servers
23:33:36 <Samu> yeah, those that run against the clock
23:33:40 <peter1138> Which bit did you think was a feature?
23:34:07 <peter1138> It was wrong since the new station catchment rules.
23:34:10 <Samu> 1 tile difference is all that matters for a station getting 1 or 2 coal mines
23:34:13 <_dp_> wait a sec, what change? :)
23:34:24 <Samu> faster start vs slower start
23:34:35 <_dp_> start of what?
23:34:43 <Samu> start of your company
23:35:10 <Samu> getting rich faster
23:35:12 <Samu> lel
23:35:41 <_dp_> as long as it doesn't lag who cares
23:35:57 <peter1138> Samu, the change was already made
23:36:07 <Samu> oh no :(
23:36:24 <peter1138> this bit of code is only used for displaying in the ui (and by AIs to find produced cargo)
23:36:57 <Samu> is this in 1.9?
23:37:01 <peter1138> So this function would have said a station at a tile could receive cargo from an industry, but actually it won't
23:37:04 <peter1138> no
23:37:38 <peter1138> But I think you misunderstand it :-)
23:40:39 <_dp_> is this all about non-rect catchment?
23:40:44 <peter1138> Yup
23:40:59 <_dp_> %)
23:41:06 <_dp_> how is it even relevant to company start
23:42:12 <peter1138> I don't know what Samu is talking about :-)
23:42:16 <_dp_> well, I guess if you start with pax and your rv station extensions now get sligtly less area for your train station...
23:42:26 <_dp_> but I'm switching all to 4 tile catchment anyway
23:43:08 <peter1138> http://fuzzle.org/~petern/ottd/catchment5.png < master
23:43:19 <peter1138> http://fuzzle.org/~petern/ottd/catchment6.png < #7426
23:43:23 <Samu> https://imgur.com/QoLDjd6 <-> https://paste.openttdcoop.org/pizf1oyp4
23:43:37 <peter1138> _dp_, modified catchment off? nice.
23:44:22 <_dp_> peter1138, yeah, realistic catchment or whatever is it called
23:44:37 <m3henry> I think I give up on Nuking SimpleTinyEnum, too many use cases need the loose typing
23:44:43 <_dp_> having them different was kinda silly anyway on competitive servers
23:45:09 <peter1138> non-rect catchment makes it less "useful" anyway
23:45:58 <_dp_> peter1138, you mean need more extending stations now?
23:46:16 <_dp_> peter1138, for 7 tile stations doesn't matter :p
23:47:20 <Samu> now i need to assert stuff
23:47:21 <Samu> brb
23:48:09 *** rocky11384497 has quit IRC
23:48:32 *** rocky11384497 has joined #openttd
23:53:57 <Samu> waiting for an assert, afk
23:54:42 <Samu> perhaps i should test more than just Intercontinental
23:54:51 <Samu> nevermind, it just asserted
23:54:53 <Samu> :(
23:55:04 <Samu> ---------------------------
23:55:04 <Samu> Error!
23:55:04 <Samu> ---------------------------
23:55:04 <Samu> Assertion failed at line 2257 of d:\openttd\openttd github\openttd\src\station_cmd.cpp: forall == kdtree
23:55:04 <Samu> ---------------------------
23:55:06 <Samu> OK
23:55:07 <Samu> ---------------------------
23:55:09 <Samu> ouch
23:55:35 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7426: Fix: Incorrect display of industry production around tiles. https://git.io/fjTkL
23:56:48 <m3henry> Of course, I cant use std::unique_ptr, as `#include <memory>` gets lost, probably due to some macro clash
23:56:56 <m3henry> woop woop
23:57:20 <Samu> i wasn't meant to copy paste this much
23:58:09 <LordAro> m3henry: ...well you should probably resolve that...
23:59:26 <Samu> testing without perimeter now, brb