Back to Home / #openttd / 2019 / 03 / Prev Day | Next Day
#openttd IRC Logs for 2019-03-27

---Logopened Wed Mar 27 00:00:30 2019
00:00-!-D-HUND [~debdog@2a00:79c0:620:3500:7a24:afff:fe8a:d04d] has joined #openttd
00:00-!-D-HUND is "Wowbagger" on #bitlbee #openttd
00:03-!-debdog [~debdog@2a00:79c0:670:e800:7a24:afff:fe8a:d04d] has quit [Ping timeout: 480 seconds]
00:38<DorpsGek_II>[OpenTTD/OpenTTD] glx22 opened pull request #7423: Fix: MSVC warnings
00:40-!-Saqeram[m] [~saqeramma@2001:470:1af1:101::352b] has joined #openttd
00:40-!-Saqeram[m] is "" on #openttd
00:55-!-Maarten [~maarten@2600:1700:7fd0:6e98:20c:29ff:fea0:abb6] has quit [Quit: Erection reset by beer]
00:55-!-Maarten [~maarten@2600:1700:7fd0:6e98:20c:29ff:fea0:abb6] has joined #openttd
00:55-!-Maarten is "maarten" on #openttd #oftc #moocows @#maarten
01:01-!-glx [] has quit []
01:06<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick opened pull request #7424: Add: Kdtree for AirportGetNearestTown
01:09<cHawk>longtime lurker, early player of Transport Tycoon for dos. OpenTTD has done an amazing job. I love you guys!
01:10<Samu>Im off to bed, good night
01:10-!-Samu [] has quit [Quit: Leaving]
01:57<DorpsGek_II>[OpenTTD/OpenTTD] PeterN approved pull request #7422: Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap
02:04<@peter1138>Queued. I'm sure it's not.
02:10<@peter1138>01:25 < Samu> line 529 station_cmd.cpp
02:18<@peter1138>Hmm, do we have non-square airports?
02:19<@peter1138>I guess so.
02:31<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7422: Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap
02:31<DorpsGek_II>[OpenTTD/OpenTTD] PeterN closed issue #7421: Can't dereference value-initialized vector iterator
02:58<DorpsGek_II>[OpenTTD/OpenTTD] PeterN approved pull request #7417: Group hierarchy improvements (by 3298)
02:58<DorpsGek_II>[OpenTTD/OpenTTD] PeterN closed issue #6189: Vehicle Groups: parent group should count total number of vehicles in subgroups
02:58<DorpsGek_II>[OpenTTD/OpenTTD] PeterN closed issue #5977: Vehicle Groups: improve error message when group hierarchy fails
02:58<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7417: Group hierarchy improvements (by 3298)
02:58<DorpsGek_II>[OpenTTD/OpenTTD] PeterN closed issue #6053: Vehicle Groups: packing and unpacking subgroups
02:59<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
03:26-!-Supercheese [] has quit [Quit: Valete omnes]
03:26<DorpsGek_II>[OpenTTD/OpenTTD] planetmaker opened issue #7425: Crash report
03:33<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on issue #7425: Crash report
03:41-!-kiwitree [] has joined #openttd
03:41-!-kiwitree is "kiwitree" on #openttd
03:50-!-andythenorth [] has joined #openttd
03:50-!-andythenorth is "andythenorth" on #openttd
03:55<andythenorth>is it lunch time?
03:57<@planetmaker>drive time or trip time... see ya Friday :)
03:58<andythenorth>coffee time
04:01<DorpsGek_II>[OpenTTD/OpenTTD] PeterN requested changes for pull request #7424: Add: Kdtree for AirportGetNearestTown
04:04-!-HerzogDeXtEr [] has joined #openttd
04:04-!-HerzogDeXtEr is "purple" on #openttd
04:12<DorpsGek_II>[OpenTTD/OpenTTD] LordAro commented on issue #7425: Crash report
04:12<DorpsGek_II>[OpenTTD/OpenTTD] LordAro closed issue #7425: Crash report
04:19-!-HerzogDeXtEr [] has quit [Read error: Connection reset by peer]
04:35<DorpsGek_II>[OpenTTD/OpenTTD] JGRennison commented on issue #6618: Incorrect size bounds checks in vehicle viewport hash scan in ViewportAddVehicles
04:53<DorpsGek_II>[OpenTTD/OpenTTD] JGRennison commented on pull request #7366: Add: List recently executed commands in crashlog output.
06:07-!-andythenorth [] has quit [Quit: andythenorth]
06:32<DorpsGek_II>[OpenTTD/OpenTTD] PeterN approved pull request #7409: Some Industry vars missing from #6867
06:44<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7409: Some Industry vars missing from #6867
07:00-!-kiwitree [] has quit []
07:10-!-gelignite [] has joined #openttd
07:10-!-gelignite is "gelignite" on #openttd
07:48-!-Laedek [~quassel@] has quit [Read error: Connection reset by peer]
08:07-!-sla_ro|master [slamaster@] has joined #openttd
08:07-!-sla_ro|master is "slamaster" on #sla #openttd
08:30-!-Samu [] has joined #openttd
08:30-!-Samu is "realname" on #openttd
08:31<Samu>peter1138, you awake?
08:33<Samu>I found the big reason why my AI was stutterfesting
08:34<Samu>it's on line 529 station_cmd.cpp
08:34<Samu> :(
08:35<Samu>the 2nd big reason was getting Airport Noise
08:35<Samu>and I created a PR for that, the kdtree thing
08:36<@peter1138>Yes, I responded to that.
08:36<Samu>can you take a look on cargo production around industries for me? :p
08:36<@peter1138>Not right now, no.
08:40-!-gelignite [] has quit [Quit: Good fight, good night!]
08:52<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
08:53<Samu>maybe I should assert
08:53<Samu>assert(t == NULL); ?
08:53<Samu>assert(t != NULL);
08:54<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
08:55<Samu>uhm, okay, I failed at explaining
08:59<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
09:06<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
09:07<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
09:17<Samu>how do I make heliports so noisy so noisy that I can't place them in the smallest town ever?
09:17<Samu>for testing
09:20<Samu>i meant the biggest town ever
09:21<Samu>ugh, looks like I can't assert, grr
09:23<Samu>let's test mindist + 1
09:27<Samu>assert(AirportGetNearestTownForAllTowns(as, it) == AirportGetNearestTownKdTree(as, it));
09:30<Samu>65535 ought to be enough noise
09:33<Samu>too much noise
09:34<Samu>damn towns always have a min noise of 3
09:34<Samu>heliports always getting away with i
09:36<Samu>peter1138, I'm testing this atm
09:36<Samu>for some reason, I can't assert(t != NULL);
09:36<Samu>so i made it into a continue
09:41<Samu>I notice const AirportSpec *as isn't used anymore
09:59<@peter1138>I... hadn't noticed that either :p
10:00<Samu>well, it didn't assert anymore, so...
10:00<Samu>gonna post
10:03<Samu>oh, as to why it prefers town with lowest index
10:03<Samu>it's so that it could match assert(AirportGetNearestTownForAllTowns(as, it) == AirportGetNearestTownKdTree(as, it));
10:04<Samu>but that's a bad comment
10:04<Samu>what would I say?
10:04<@peter1138>I know why it prefers lowest index.
10:04<@peter1138>Do you know why it prefers lowest index?
10:05<Samu>because the old method also preferred it
10:05<Samu>lol i dunno
10:06<@peter1138>Why did the old method prefer it?
10:07<Samu>because it was iterating from the lowest index to highest index?
10:11<@peter1138>So focus your behaviour comment on that, not some meaningless "assert foo == bar"
10:18-!-Pikka [~Albert@] has joined #openttd
10:18-!-Pikka is "realname" on #openttd
10:19<Pikka>aww, simyoulater didn't appreciate my "iron vole" title
10:21-!-Flygon [] has quit [Quit: A toaster's basically a soldering iron designed to toast bread]
10:24<@peter1138>Oh the split-topic thing.
10:25-!-andythenorth [] has joined #openttd
10:25-!-andythenorth is "andythenorth" on #openttd
10:25<@peter1138>andy is north
10:25<Pikka>and an ironmonger
10:28<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7380: Feature: Multi-tile docks.
10:33-!-andythenorth [] has quit [Ping timeout: 480 seconds]
10:33<Samu>i dont know how to comment this
10:34<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown
10:35<@peter1138>Let's see what monstrosity you came up with.
10:35<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
10:37-!-Wormnest [~Wormnest@] has joined #openttd
10:37-!-Wormnest is "Wormnest" on #openttd
10:43<@peter1138>Oh. You know what...
10:44<@peter1138>Noise level isn't saved anyway.
10:44<@peter1138>So you really don't need to replicate that behaviour.
10:45<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
10:47<Samu>im trying to figure out why t can be NULL at times
10:57<Samu>ah, i understand
10:57<Samu>lol i'm stupid
10:59<Samu>that threshold
11:01<Samu>does the iterator really need to be copied?
11:04<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
11:05<@peter1138>Samu, currently yes, because it's used again.
11:07<@peter1138>Eddi|zuHause, sure, but this change is meant to be just an optimization, not a feature change.
11:07<Eddi|zuHause>when did that ever stop me? :p
11:08<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown
11:08<Samu>the function changed
11:08<Samu>it was already described after all that it would prefer the lowest index
11:09<Samu>now it doesn't
11:09<@peter1138>Hmm, I didn't notice that comment :p
11:09<@peter1138>Well, maybe you should keep the behaviour.
11:09<Samu>oh ... :)
11:09<@peter1138>Just drop that last commit.
11:09<Samu>still need to remove the @param as
11:09<@peter1138>And yeah, if it already says "town with lower index is returned" then don't worry about the comment.
11:10<@peter1138>What's the performance benefit you saw?
11:10<@peter1138>(Hard figures, not relative, please)
11:12<Samu>with industries and valuators.... about 15 ms avg
11:12<Samu>with industries... about 8 ms
11:12<Samu>without industries... 2 ms
11:13<Samu>without industries and that fix in the code... 1 ms
11:13<Samu>sometimes less
11:14<Samu>FOR_ALL_INDUSTRIES is my next target
11:16<@peter1138>Uh, what?
11:16<@peter1138>I mean the performance benefit of that chance.
11:16<Samu>I tested using my own AI
11:16<Samu>went from 2 ms to 1ms
11:16<Samu>a bit less
11:16<Samu>than 1
11:17<Samu>no hard figure i guess
11:17<Samu>will try with TIC TOC thing, maybe?
11:18<@peter1138>With 12000 towns or so?
11:18<Samu>4096x4096 map
11:18<Samu>and 20480 industries
11:18<@peter1138>Industries don't affect AirportGetNearestTown
11:19<Samu>oh, right
11:19<Samu>forgot you don't care about that
11:19<@LordAro>there's no way measurements of <5ms are stable enough to draw any conclusions from
11:19<Samu>Get Cargo Production around tiles iterates over all industries, the main stutter cause
11:19<@LordAro>unless you're measuring them hundreds (or better, thousands) of times
11:20<@peter1138>LordAro, indeed.
11:20<@peter1138>Samu, I can improve that easily, if you want to wait.
11:21<Samu>I wait
11:21<_dp_>is there a way to make mouse feel the same in fullscreen as in windowed with sdl driver?
11:21<_dp_>I used SDL_MOUSE_RELATIVE=0 but it seems broken now :(
11:21<@peter1138>Does it not?
11:22<@peter1138>Samu, update that existing PR and I've got another (minor) improvement to PR.
11:22<Samu>speaking of mouse, yesterday I had a weird mass popups about an assert related to mouse cursor
11:23<Samu>it felt like I was visiting a broken site
11:23<@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.
11:23<Samu>couldn't reproduce it
11:24<Samu>always poping up error windows
11:24<Samu>had to kill visual studio in the task manager
11:28<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown
11:31<Samu>now, measuring
11:31<Samu>TIC TOC, lets see
11:46<Samu>i fail at using tic toc
11:56<@peter1138>Yeah? Don't bother :p
12:00<Samu>hah, it's actually slower on smaller maps
12:00<Samu>oh gosh :(
12:03-!-crem1 [~crem@2a02:168:520c:0:201:c0ff:fe08:8328] has joined #openttd
12:03-!-crem1 is "crem" on #openttd
12:04<Samu>ok here's a good "test"
12:04<Samu>4096x4096, about 12k towns, no industries
12:04<Samu>and no valuators on thos
12:04-!-crem [~crem@2a02:168:520c:0:201:c0ff:fe08:8328] has quit [Ping timeout: 480 seconds]
12:05<Samu>250000 ops
12:07<@peter1138>Slower on smaller maps often means "unnoticable is still unnoticable"
12:14<Samu>voronoi would be faster, right?
12:16<@peter1138>Well, how much slower are you talking?
12:24-!-synchris [~synchris@] has joined #openttd
12:24-!-synchris is "Synesios Christou" on #openttd
12:25-!-Progman [] has joined #openttd
12:25-!-Progman is "Peter Henschel" on #openttd
12:29-!-nielsm [] has joined #openttd
12:29-!-nielsm is "Niels Martin Hansen" on #openttd
12:32<Samu>brb, let me put a small map
12:32<Samu>64 x 64 or so?
12:33<Samu>128 x 128?
12:37<Samu>gonna try the average 256 x 256 or 256 x 512
12:38<Samu>yep... it's slower :(
12:40<Samu>rip kdtree
12:42<@peter1138>Yeah but doing what?
12:42<Samu>256 x 256
12:43<Samu> 512x512
12:43<Samu>also slower
12:44<nielsm>slower doing what?
12:45<Samu>iterating over ... uhm,, wait, i better upload v10
12:46<@peter1138>Yes. That's just a map size. What are you actually DOING.
12:47<_dp_>communicating with Samu is slower than ever for sure xD
12:47<@peter1138>It's bizarre isn't it?
12:50<Samu>from line 880 to 1008
12:50<Samu>line 912 is the slowest
12:50<Samu>if there are industries
12:52<Samu>then line 955 or line 956, it's one of them, is the 2nd lowest, the case we're testing here
12:52<Samu>2nd slowest*
12:53<Samu>there are no industries on these tests, i'm testing on maps without them
12:56<Samu>up to below 2048x2048 the kdtree is slower, past 2048x2048, it is faster
12:56<Samu>rip PR
12:56<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?
12:56<@peter1138>That doesn't make sense.
12:56<@peter1138>Map size is not particularly relevant, but number of towns is.
12:56-!-Supercheese [] has joined #openttd
12:56-!-Supercheese is "Supercheese" on #openttd
12:56<Samu>ah, you want the number
12:57<Samu>@calc 12k / 4
12:57<@DorpsGek>Samu: Error: invalid syntax (<string>, line 1)
12:57<Samu>@calc 12 / 4
12:57<@DorpsGek>Samu: 3
12:57<Samu>3k towns
12:57<_dp_>Eddi|zuHause, when I switch to fullscreen mouse gets much slower, feels very awkward :(
12:58<Eddi|zuHause>slower as in acceleration?
12:58<Eddi|zuHause>or drawing of the pointer is choppy?
12:58<Eddi|zuHause>or what?
12:58<_dp_>Eddi|zuHause, moves slower
12:58<Samu> 2048x2048
12:58<Samu>so much PR for nothing
12:59<Eddi|zuHause>_dp_: what OS?
12:59<_dp_>Eddi|zuHause, linux
13:00<_dp_>Eddi|zuHause, SDL_MOUSE_RELATIVE=0 helps but it seems to interfere with gnome somehow
13:00<Samu>and then the glorious 4096x4096 result with the most relevant gains
13:00<Eddi|zuHause>resolution change?
13:03<Samu>i really should stop testing stuff in 4k maps first
13:03<Samu>it was the first thing I did
13:03<_dp_>Eddi|zuHause, same on any resolution
13:03<_dp_>Eddi|zuHause, it's a gnome issue I guess
13:04<Eddi|zuHause>yeah, i'd look in gnome settings
13:04<_dp_>Eddi|zuHause, seems to intercept mouse events as if there is top panel and dock
13:04<Eddi|zuHause>i don't use gnome, so i can't help you there
13:06<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
13:07-!-HerzogDeXtEr [] has joined #openttd
13:07-!-HerzogDeXtEr is "purple" on #openttd
13:08<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
13:15<Samu>you mean the borders nielsm ?
13:16<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
13:16<nielsm>it's 100 times less work
13:16<nielsm>(assuming a 10x10 tile airport size)
13:18<Samu>i was thinking about something similar, but for the perimeter tiles
13:18<Eddi|zuHause>that would allow large airports in a lot more places, i think
13:18<Samu>not the centre
13:18<_dp_>ok, installing nvidia drivers fixed the mouse issue
13:18<_dp_>I forgot it's using nouveau by default
13:18<nielsm>yeah searching just the corner tiles of the tile area bounding box could be another option perhaps?
13:19<Samu>no, corners nop
13:19<Eddi|zuHause>non-rectangular areas might not have a "corner"?
13:19<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
13:19<nielsm>Eddi|zuHause: hence why I said tile area _bounding box_
13:20<Eddi|zuHause>that sounds like a step backwards
13:20<_dp_>or it didn't... weird, seemed fine at first :p
13:22<Eddi|zuHause>_dp_: just a random thing: does enabling/disabling "full animation" change anything?
13:22<nielsm>unless there's really weirdly shaped airports like this anywhere?
13:22<_dp_>Eddi|zuHause, no
13:23<Eddi|zuHause>nielsm: if we ever get around to adding state machines, i would expact such things to appear
13:25<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
13:27<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
13:30<nielsm>otherwise, keep the original algorithm, but limit the number of towns considered to those inside a bounding box of candidates
13:30<nielsm>isn't there a strict limit to the distance to town sign where airport noise is considered?
13:31<Eddi|zuHause>not that i know of
13:31<_dp_>Eddi|zuHause, weird stuff, sometimes it's broken sometimes it's fine, and sometimes it switches to wrong resolution %)
13:34<@peter1138>Samu, so, are you using a debug build by any chance?
13:35<Samu>no, those tests were on release x64
13:39<Samu>there is a DiagonalTileIterator in the code
13:41<@peter1138>Urgh, regression fail :/
13:42-!-glx [] has joined #openttd
13:42-!-mode/#openttd [+v glx] by ChanServ
13:42-!-glx is "Loïc GUILLOUX" on #openttd.noai #openttd.notice +#openttd
13:42<@peter1138>Now, is that because my test it wrong now, or wrong before?
13:42<_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
13:44-!-supermop_work [~supermopw@] has joined #openttd
13:44-!-supermop_work is "A CIRC user" on #openttd
13:49<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
13:50<@peter1138>Ok, regression fails because it was wrong before :p
13:50<Eddi|zuHause>"just because you've done something for years, doesn't mean you've been doing it correctly"
13:51<@peter1138>That means this codechange: becomes a fix:
13:56-!-andythenorth [] has joined #openttd
13:56-!-andythenorth is "andythenorth" on #openttd
14:05<Eddi|zuHause>nielsm: btw, can you have a look at how to incorporate the last commit into the signs kdtree?
14:05-!-supermop_work_ [~supermopw@] has joined #openttd
14:05-!-supermop_work_ is "A CIRC user" on #openttd
14:06<nielsm>Eddi|zuHause: basically the same pattern as the other four types of viewport signs
14:08<Eddi|zuHause>nielsm: since it's not actually my patch, i was a bit lost on trying to decipher that stuff
14:10<Samu>im experimenting the perimeter stuff
14:10<Samu>if (IsInsideMM(TileX(cur_tile), TileX(it), TileX(it + delta_x) + 1) || IsInsideMM(TileY(cur_tile), TileY(it), TileY(it + delta_y) + 1)) {
14:10<Samu>don't know if this is the correct checking
14:11-!-supermop_work__ [~supermopw@] has joined #openttd
14:11-!-supermop_work__ is "A CIRC user" on #openttd
14:12-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
14:12-!-supermop_work [~supermopw@] has joined #openttd
14:12-!-supermop_work is "A CIRC user" on #openttd
14:14<Samu>how do i get the max X and max Y allowed?
14:14<Samu>must not go over it
14:18-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:18<Samu>TileX(min(it + delta_x, MapMaxX())) + 1)
14:18<Samu>great :)
14:20-!-supermop_work__ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:21<@peter1138>I have a Samu problem.
14:21<Samu>hum? :(
14:21<@peter1138>I can't come up with a nice concise commit message.
14:21<@LordAro>Fix: The things
14:21<Samu>oh you're asking to a terrible person for that
14:22-!-supermop_work_ [~supermopw@] has joined #openttd
14:22-!-supermop_work_ is "A CIRC user" on #openttd
14:23-!-Pikka [~Albert@] has quit [Quit: Leaving]
14:25<@peter1138>Funny though.
14:25<@peter1138>This is a fix from your comment last night.
14:25<@peter1138>01:25 < Samu> line 529 station_cmd.cpp
14:26<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7426: Fix: Incorrect display of industry production around tiles.
14:26-!-supermop_work__ [~supermopw@] has joined #openttd
14:26-!-supermop_work__ is "A CIRC user" on #openttd
14:27-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
14:29-!-supermop_work [~supermopw@] has joined #openttd
14:29-!-supermop_work is "A CIRC user" on #openttd
14:31<@peter1138>Samu, so that might be quicker.
14:32<DorpsGek_II>[OpenTTD/OpenTTD] stale[bot] commented on issue #7042: Use intrinsics for bit twiddling?
14:33-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:33<@peter1138>But it should also be correct now.
14:33<@peter1138>Hence the regression change.
14:34<Samu>im terrible math
14:34-!-andythenorth [] has quit [Quit: andythenorth]
14:35-!-frosch123 [] has joined #openttd
14:35-!-frosch123 is "frosch" on #openttd
14:36-!-supermop_work__ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:37<Samu>IsInsideMM(TileY(cur_tile), TileY(it), min(TileY(it) + delta_y, MapMaxY()) + 1)
14:38-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
14:38<Samu>TileY(it) + delta_y VERSUS MapMaxY()
14:38<Samu>it gets the minimum of both
14:39<Samu>then adds +1 because IsInsideMM is [ , )
14:39-!-supermop_work [~supermopw@] has joined #openttd
14:39-!-supermop_work is "A CIRC user" on #openttd
14:45<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7427: Codechange: Distance between town and airport has already just been found, so use it.
14:46<@peter1138>^^ PR no. 2
14:46<@peter1138>Er, well, No 7427, I guess.
14:46<@peter1138>18:46, I ought to get ready for trail biking.
14:46<@peter1138>Samu, please test #7426 and #7427 (preferably together...)
14:49<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
14:49<nielsm>makes for the easiest cleanup afterwards
14:50<Samu>my IsInsideMM test is not working damn it :p
14:50<+glx>cherry-pick works too if there's one commit per PR :)
14:50<Samu>i'm so terribad, and all I want is the perimeter tiles
14:50<@peter1138>Also, maybe other people here can test and review those two PRs? :-)
14:50<Samu>apparently, I'm getting all tiles
14:51<Samu>the test is useless like that lol
14:52<@peter1138>You need the dimensions of the tilearea.
14:52<Samu>AirportSpec is back in action
14:53-!-supermop_work_ [~supermopw@] has joined #openttd
14:53-!-supermop_work_ is "A CIRC user" on #openttd
14:53<@peter1138>You need the start tile, and the x & y, and then add 1 to TileX(tile) and subtract... 2 (probably) from x.
14:54<@peter1138>Same for Y.
14:54<@peter1138>AirportPerimeterTileIterator? :p
14:54<Samu>yes, I want that
14:55<Samu>the start tile is it
14:55<@peter1138>You can get that from the iterator (before you use it)
14:55<Samu>or at least I assume all airport tables start tile is 0, 0
14:55-!-gelignite [] has joined #openttd
14:55-!-gelignite is "gelignite" on #openttd
14:56<@peter1138>But you should be predetermining these before the loop.
14:56<@peter1138>I don't see why layouts would not start at 0, 0
14:56<+glx>would be highly unlogical to not start at 0,0
14:57<@peter1138>Hmm, well, I guess I better go.
14:57<@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.
14:57<Eddi|zuHause>can layouts have negative coordinates?
14:58<Eddi|zuHause>because 0,0 might not be part of the layout for diagonal stuff
14:58<Samu>i will test later, visual studio doesn't let me change branch atm, and yeah I'm stuck
14:58<Eddi|zuHause>(i think we had that discussion a few weeks ago with industries)
14:59<Samu>oil rigs
14:59<Samu>for example
14:59<@peter1138>Eddi|zuHause, andy complained it was not centered, so I made it centered, then he said it wasn't actually any better.
15:00<+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."
15:00<+glx>and negative is only for clearance checks
15:00-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
15:01-!-supermop_work [~supermopw@] has joined #openttd
15:01-!-supermop_work is "A CIRC user" on #openttd
15:02<Eddi|zuHause>the problem with diagonal airports will be that the (0,0) origin point will be quite far from the actually built airport
15:02<Eddi|zuHause>(and i'm assuming that also will be a problem with the station sign)
15:03<Eddi|zuHause>so i think it would be beneficial to allow moving the origin point away from (0,0)
15:04<Eddi|zuHause>industries have the additional problem that you don't see the layout size
15:05<@peter1138>Well, it's possibly to offset the origin but at the point where Samu is, it would already have been applied.
15:05<Eddi|zuHause>also, andy's industry problem might have been overlapping with the water class issue
15:06-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
15:14-!-supermop_work_ [~supermopw@] has joined #openttd
15:14-!-supermop_work_ is "A CIRC user" on #openttd
15:15-!-Laedek [~quassel@] has joined #openttd
15:15-!-Laedek is "Laedek" on #openttd
15:17-!-supermop_work__ [~supermopw@] has joined #openttd
15:17-!-supermop_work__ is "A CIRC user" on #openttd
15:17<Samu> testing if this works
15:18<Samu>i hope that is the perimeter
15:22-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
15:23<Samu>wow, it's faster indeed
15:23<Samu>now I hope it's also correct
15:24-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
15:25-!-m3henry [] has joined #openttd
15:25-!-m3henry is "realname" on #openttd
15:27<Samu>grr, i'm forced to commit damn it
15:32<Samu>assert(kdtree == forall);
15:40<Samu>no asserts so far, so im gonna assume it's "working"
15:40<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7424: Add: Kdtree for AirportGetNearestTown
15:42-!-supermop_work [~supermopw@] has joined #openttd
15:42-!-supermop_work is "A CIRC user" on #openttd
15:47-!-supermop_work_ [~supermopw@] has joined #openttd
15:47-!-supermop_work_ is "A CIRC user" on #openttd
15:49-!-supermop_work__ [~supermopw@] has quit [Ping timeout: 480 seconds]
15:55-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
16:02-!-rocky11384497 [~rocky1138@] has quit [Ping timeout: 480 seconds]
16:03-!-andythenorth [] has joined #openttd
16:03-!-andythenorth is "andythenorth" on #openttd
16:03<Samu>about 7426, I thought that was a feature
16:05<Samu>a change like that will surely affect competitive servers
16:05<Samu>but ok
16:06-!-andythenorth [] has quit []
16:10<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7424: Add: Kdtree for AirportGetNearestTown
16:10<Samu>there was a gain
16:12-!-andythenorth [] has joined #openttd
16:12-!-andythenorth is "andythenorth" on #openttd
16:14-!-andythenorth [] has quit []
16:14-!-supermop_work [~supermopw@] has joined #openttd
16:14-!-supermop_work is "A CIRC user" on #openttd
16:21-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
16:37-!-supermop_work_ [~supermopw@] has joined #openttd
16:37-!-supermop_work_ is "A CIRC user" on #openttd
16:44-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
16:54-!-synchris [~synchris@] has quit [Quit: yeeha!]
17:01-!-rocky11384497 [~rocky1138@] has joined #openttd
17:01-!-rocky11384497 is "Your Mom" on #openttd
17:14-!-gelignite [] has quit [Quit: Good fight, good night!]
17:20<Samu>#7246 results in about 1/4 of the time
17:21<Samu>was averaging 800 ms, now it's about 220
17:28-!-supermop_work [~supermopw@] has joined #openttd
17:28-!-supermop_work is "A CIRC user" on #openttd
17:30-!-stormcone [] has joined #openttd
17:30-!-stormcone is "Stormcone" on #openttd
17:30-!-supermop_work [~supermopw@] has quit [Remote host closed the connection]
17:31<Samu>#7247 results aren't noticeable... seems to be equal to master
17:32<Samu>230 ms vs 230 ms
17:32<Samu>let me recheck what my AI do
17:32<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
17:35<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?
17:35<Eddi|zuHause>can you be more specific?
17:36-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
17:37<stormcone>I have a SmallMap, from I trying to delete an element like: map.Erase(key);
17:37<frosch123>there are two methods. one which takes a "Pair*"-iterator, one which takes a key value
17:38<stormcone>but I get a quite long compiling error
17:38<@LordAro>can't help you without a) the code b) the error
17:38<frosch123>hmm, oh, i agree, that ERase is weird
17:38<frosch123>it says it takes a key, but acutally it uses a value-pair
17:39<@LordAro>Eddi|zuHause: i've activated the centre node :>
17:39<stormcone>i think the main problem from the error log is: error: no match for ‘operator==’
17:39<stormcone>(operand types are ‘SmallPair<Vehicle*, bool>’ and ‘Vehicle* const’)
17:39<Eddi|zuHause>LordAro: i haven't tried yet since last time...
17:40<stormcone>{ return *__it == _M_value; }
17:40<@LordAro>Eddi|zuHause: i tried after managing to create a portable oxygenator
17:40<Eddi|zuHause>LordAro: i was testing a theory involving the glowing orbs you find around, but wasn't getting anywhere with it
17:40<@LordAro>and finding that they're completely useless as they drain *all* the power
17:40<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
17:40-!-andythenorth [] has joined #openttd
17:40-!-andythenorth is "andythenorth" on #openttd
17:41<stormcone>so I rewrite it for myself, but I wanted to be sure, whether that the code in the repo is correct or not
17:41<@LordAro>stormcone: if it's a map of your own creation, i'd recommend just switching to use std::map instead :)
17:41<Samu>peter1138, I think you made a mistake here: mindist = UINT_MAX - add; // prevent overflow
17:41<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
17:41<Samu>you want to reuse mindist, but you start all over instead
17:41<stormcone>no, it's not mine
17:42<@LordAro>stormcone: maybe you should try converting it anyway :p
17:42<@LordAro>unless m3henry gets there first
17:42<frosch123>so, delete Erase?
17:43<frosch123>it compares a pair with a key, which never compiles, so the function must be unused
17:43<@LordAro>Eddi|zuHause: mm, i think i'm a bit ahead of you then :)
17:43<Eddi|zuHause>"delete erase" is a strange phrase... it might be one of those recursions that destroy the universe :p
17:44<Eddi|zuHause>LordAro: it's not like i'm progressing fast at 6fps anyway
17:44<@LordAro>Eddi|zuHause: ono
17:44<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
17:44<Samu>or i dunno what i'm looking at t.t
17:45<frosch123>that also works :)
17:46<stormcone>okay, so should i make a pr about it? or what are you planning to do with that function? :)
17:46<@LordAro>frosch123: confirmed, no compile issues if i remove the function
17:47<@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
17:47<stormcone>ok, i will do it
17:48<frosch123>LordAro: "long term" would mean "flat_map" :p
17:49<@LordAro>frosch123: you're thinking longer term than me :p
17:50<@LordAro>depends what sort of performance is required for the particular usages, i imagine :p
17:51<Samu>about my perimeter check, what happens if the town is inside the perimeter
17:51<Samu>and another town is just next door to one of the sides
17:52<Samu>it would get the wrong town, right?
17:54<Eddi|zuHause>Make The Map Round Again
17:55<DorpsGek_II>[OpenTTD/OpenTTD] stormcone opened pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
17:56-!-sla_ro|master [slamaster@] has quit []
17:56<stormcone>btw thank you for the help :)
18:04-!-andythenorth [] has quit [Quit: andythenorth]
18:05<Eddi|zuHause>i'm not sure i understood the difference between the old and the new code
18:07<Samu>TownID ScriptAirport::GetNearestTown
18:07<Samu>AIs could be dumb enough to call this in a place where a town is inside the box
18:07<Samu>openttd code doesn't seem to do this though
18:08<Samu>but AIs... could
18:09-!-frosch123 [] has quit [Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn]
18:09<Samu>RIP perimeter check
18:12-!-nielsm [] has quit [Ping timeout: 480 seconds]
18:20<Samu>i thought kdtree was fast
18:21<Samu>bring back voronoi
18:24<Samu> so my main.nut now does this only
18:28<@peter1138>Sounds useful
18:28<Samu>AIAirport.GetNearestTown(AIBase.RandRange(alltiles), AIAirport.AT_INTERCON);
18:28<Samu>less bias
18:31<@peter1138>Ah yes, 7427 is barely noticable, but does eliminate a pointless loop.
18:31<Samu>wow microsoft edge doing popups about microsoft services... :(
18:31<@peter1138>Just not as expensive as I was thinking.
18:32<@peter1138>7426... 1/4 the time? Interesting.
18:33<@peter1138>20:05 < Samu> a change like that will surely affect competitive servers
18:33<Samu>yeah, those that run against the clock
18:33<@peter1138>Which bit did you think was a feature?
18:34<@peter1138>It was wrong since the new station catchment rules.
18:34<Samu>1 tile difference is all that matters for a station getting 1 or 2 coal mines
18:34<_dp_>wait a sec, what change? :)
18:34<Samu>faster start vs slower start
18:34<_dp_>start of what?
18:34<Samu>start of your company
18:35<Samu>getting rich faster
18:35<_dp_>as long as it doesn't lag who cares
18:35<@peter1138>Samu, the change was already made
18:36<Samu>oh no :(
18:36<@peter1138>this bit of code is only used for displaying in the ui (and by AIs to find produced cargo)
18:36<Samu>is this in 1.9?
18:37<@peter1138>So this function would have said a station at a tile could receive cargo from an industry, but actually it won't
18:37<@peter1138>But I think you misunderstand it :-)
18:40<_dp_>is this all about non-rect catchment?
18:41<_dp_>how is it even relevant to company start
18:42<@peter1138>I don't know what Samu is talking about :-)
18:42<_dp_>well, I guess if you start with pax and your rv station extensions now get sligtly less area for your train station...
18:42<_dp_>but I'm switching all to 4 tile catchment anyway
18:43<@peter1138> < master
18:43<@peter1138> < #7426
18:43<Samu> <->
18:43<@peter1138>_dp_, modified catchment off? nice.
18:44<_dp_>peter1138, yeah, realistic catchment or whatever is it called
18:44<m3henry>I think I give up on Nuking SimpleTinyEnum, too many use cases need the loose typing
18:44<_dp_>having them different was kinda silly anyway on competitive servers
18:45<@peter1138>non-rect catchment makes it less "useful" anyway
18:45<_dp_>peter1138, you mean need more extending stations now?
18:46<_dp_>peter1138, for 7 tile stations doesn't matter :p
18:47<Samu>now i need to assert stuff
18:48-!-rocky11384497 [~rocky1138@] has quit [Quit: Ping timeout (120 seconds)]
18:48-!-rocky11384497 [~rocky1138@] has joined #openttd
18:48-!-rocky11384497 is "Your Mom" on #openttd
18:53<Samu>waiting for an assert, afk
18:54<Samu>perhaps i should test more than just Intercontinental
18:54<Samu>nevermind, it just asserted
18:55<Samu>Assertion failed at line 2257 of d:\openttd\openttd github\openttd\src\station_cmd.cpp: forall == kdtree
18:55<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7426: Fix: Incorrect display of industry production around tiles.
18:56<m3henry>Of course, I cant use std::unique_ptr, as `#include <memory>` gets lost, probably due to some macro clash
18:56<m3henry>woop woop
18:57<Samu>i wasn't meant to copy paste this much
18:58<@LordAro>m3henry: ...well you should probably resolve that...
18:59<Samu>testing without perimeter now, brb
19:00<Samu>wow also asserts
19:00<Samu>this makes me sad
19:00<@LordAro>Samu: maybe you should try to understand the code, rather than just adding asserts wherever you feel like
19:02<_dp_>LordAro, well, adding asserts is part of understanding code sometimes :p
19:02<_dp_>probably shouldn't spam about it though
19:03-!-Progman [] has quit [Remote host closed the connection]
19:04<DorpsGek_II>[OpenTTD/OpenTTD] michicc approved pull request #7423: Fix: MSVC warnings
19:05<DorpsGek_II>[OpenTTD/OpenTTD] michicc approved pull request #7426: Fix: Incorrect display of industry production around tiles.
19:09<Samu>i have no idea how kdtree works, I just trusted it
19:09<DorpsGek_II>[OpenTTD/OpenTTD] glx22 merged pull request #7423: Fix: MSVC warnings
19:09<m3henry>LordAro: Easier said than done :v
19:10<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7426: Fix: Incorrect display of industry production around tiles.
19:10<DorpsGek_II>[OpenTTD/OpenTTD] LordAro commented on pull request #7423: Fix: MSVC warnings
19:10<@LordAro>gah, 30s too late
19:10<@LordAro>and it's wrong anyway
19:12<+glx>hehe IIRC x - base converts to signed
19:13<@LordAro>glx: i was reading the type signatures of base & size, not x
19:14<Samu>@calc 43 + 2
19:14<@DorpsGek>Samu: 45
19:14<Samu>@calc 40 + 11
19:14<@DorpsGek>Samu: 51
19:14<@LordAro>Samu: i rather hope you didn't need a calculator for those
19:15<ST2>he was only making sure :D
19:15<@peter1138>assert(40 + 11 == 51)
19:15<DorpsGek_II>[OpenTTD/OpenTTD] michicc updated pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
19:16<+michi_cc>stormcone: Have a look at my update for #7428?
19:18<Samu>interesting find
19:19<Samu>ForAll is giving the wrong town
19:19<Samu>Kdtree is correct
19:22<Samu>i really need to make sure
19:23<Samu>question, is tile 958 on a 64x64 map inside or outside the map?
19:23<Samu>when i zoom to it, it seems to be one in the border, but could be wrong
19:24<+glx>@calc 958/64
19:24<@DorpsGek>glx: 14.96875
19:24<+glx>@calc 14*64
19:24<@DorpsGek>glx: 896
19:24<stormcone>michi_cc: i had look at it, but as i said earlier i am not that familiar with c++, so if you say that is better in that way, i probably will agree with you :)
19:24<+glx>@calc 958-896
19:24<@DorpsGek>glx: 62
19:25<Samu>x = 62, y = 13?
19:25<+michi_cc>stormcone: I just noticed that Contains() const was wrong and I couldn't be bothered to create another PR.
19:25<Samu>erm y = 14
19:26<+glx>yes not counting the void tiles
19:27<+glx>but if you want to be sure I think you can draw tilehighlight on the tile
19:28<Samu>it's inside
19:28<Samu>just scrolled to 957 and 959
19:29<stormcone>michi_cc: i don't mind it, should i modify something in the PR's title?
19:29<+glx>oh and there's landscape info tool
19:29<+glx>should show coords of the clicked tile
19:30<+michi_cc>No need, but maybe somebody like m3henry can take a quick look.
19:30<+michi_cc>glx: Seen ?
19:30<Samu>town 1: x = 19, y = 12
19:31<Samu>town 2: x = 22, y = 35
19:31<Samu>it: x = 62, y = 14
19:31<+glx>oh old mingw doesn't work
19:31<Samu>the Y lenght of the airport is intercontinental, 11 tiles
19:32<Samu>14 + 11 - 1 = 24
19:33<Samu>@calc 62-19 + 14-2
19:33<@DorpsGek>Samu: 55
19:34<Samu>@calc 62-19 + 14-12
19:34<@DorpsGek>Samu: 45
19:34<Samu>@calc 62-22 + 35-14
19:34<@DorpsGek>Samu: 61
19:35<Samu>@calc 62-22 + 35-24
19:35<@DorpsGek>Samu: 51
19:35<Samu>@calc 62-19 + 24-12
19:35<@DorpsGek>Samu: 55
19:35<DorpsGek_II>[OpenTTD/OpenTTD] M3Henry commented on pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
19:35<Samu>town 1 is the closest
19:36-!-m3henry [] has quit [Quit: Leaving]
19:37<Samu>forall is giving the wrong town
19:37<Samu>kdtree is correct
19:37<Samu>who would have thought
19:38<Samu>what to do now?
19:39<+glx>michi_cc: I redirected him to MSYS2, which works fine, MSYS is outdated and doesn't feel maintained
19:39<@LordAro>oh hey, it's that wiki page that i wrote
19:39<+glx>the MSYS2 page ?
19:40<@LordAro>ooh, that still lists --without-freetype
19:40<Samu>how do I report a bug like this?
19:40-!-HerzogDeXtEr [] has quit [Read error: Connection reset by peer]
19:40<+glx>I followed it when I installed MSYS2 :)
19:41<+glx>yeah wiki pages tends to be created, but not updated later ;)
19:45<DorpsGek_II>[OpenTTD/OpenTTD] michicc commented on pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
19:47<+michi_cc>LordAro: Review/approve #7428? I should as I have a commit in it (even if GH lets me as it is not my PR).
19:57<@LordAro>michi_cc: not sure i understand why your commit is necessary
19:58<+michi_cc>The const overload of Find returns a std::vector<Pair>::const_iterator, the const overload of End does not.
19:58<+michi_cc>end (small e) OTOH does.
19:59<Samu>this is really funny... they're both wrong!
20:00<Samu>the tile iterator is iterating over the other side of the map
20:01<Samu>tile 959 is the void tile on the bottom left
20:01<Samu>tile 960 is the void tile on the top right
20:04<DorpsGek_II>[OpenTTD/OpenTTD] LordAro approved pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
20:04<DorpsGek_II>[OpenTTD/OpenTTD] LordAro merged pull request #7428: Fix #7165: SmallMap::Erase(key) does not work correctly
20:06<+michi_cc>LordAro: Thanks.
20:06<Samu>HERE'S the problem
20:06<Samu>tile 958 is out there at the bottom left side of the screen
20:07<Samu>the airport we're trying to build is intercontinental
20:08<Samu>FOR_ALL_TOWNS method says the closest town is Nahill
20:08<Samu>Kdtree method says the closest town is Little Drentfield
20:08<Samu>and they're both wrong
20:08<Samu>at naked eye, I can clearly see it's Brinnington
20:09<+glx>fix it then :)
20:09<Samu>yeah... it's the iterator
20:09<Samu>it's passing invalid tiles as valid :(
20:11<_dp_>Samu, Little Drenfield and Brinnington are about the same distance
20:12<_dp_>Samu, naked eye doesn't work well with manhattan distances on isometric projection :p
20:12<Samu>it's close to the bare land at the right side
20:13<Samu>the rigth most bareland, the y width of intercontinental
20:14<@peter1138>It's AirportTileTableIterator in this instance, right?
20:15<Samu>tile 960 is being passed as valid, and that already a tile on the top right side
20:15<Samu>not sure, how do I check that?
20:16<@peter1138>By following the code :p
20:16<@peter1138>It's an unplaced airport, so yes.
20:16<_dp_>ah, it's airport iterator missing boundary check
20:17<_dp_>was wondering how did you manage to get FOR_ALL wrong xD
20:17<+glx>missing MP_VOID checks somewhere probably
20:18<@peter1138>I'm thinking it probably shouldn't need to bounds check.
20:18<@peter1138>At least, not within the iterator itself.
20:18<@peter1138>Should be before it.
20:19<@peter1138>It makes no sense to iterate for something that is not possible to build.
20:19<Samu>i was so focused on two towns, i missed the 3rd town, which was right in front of my eyes...
20:19<_dp_>peter1138, idk, I see none
20:19<@peter1138>See none what?
20:20<+glx>I think there's a check on click, when you actually try to build
20:20<Samu>AIs can check there
20:20<Samu>that's how I found this
20:20<@peter1138>Yeah, src/scrfipt/api/script_airport.cpp
20:20<_dp_>peter1138, no checks
20:20<Samu>AIAirport.GetNearestTown(958, AIAirport.AT_INTERCON);
20:21<@peter1138>Yeah, but no checks where?
20:21<_dp_>good question :)
20:21<+glx>I guess the AI should first check if it can build an airport before checking for the nearest town
20:22<@peter1138>Well, I mean, where were you looking for checks?
20:24<_dp_>peter1138, in GetNearestTown
20:25<_dp_>techically yes, can probably be solved if checked if can build first
20:25<_dp_>still not good that you can make gs do some nonsense
20:26<+glx>indeed before trying to get the town the script function should probably check for valid airport location
20:26-!-Flygon [] has joined #openttd
20:26-!-Flygon is "Flygon" on #openttd
20:27<_dp_>is there a way to check tho?
20:27<Samu>this function is already heavy, you're gonna make it heavier?
20:27<_dp_>except trying to build one and getting an error
20:28<@peter1138>Samu, doing it before any loop means it will be a very lightweight function.
20:28<+glx>airport size is maybe accessible (not checked), if it is the check is easy
20:28<Samu>just at the borders
20:28<stormcone>maybe build rail station also needs some checks, there were a report in JGR's patch pack about AI that were trying to build a station outside of the map
20:28<Samu>but when the map is big...
20:29<@peter1138>Samu, what's better, slightly more checks (which are not going to slow anything down) or pointlessly doing lots of checks which are wrong?
20:29-!-tokai [] has joined #openttd
20:29-!-tokai is "Christian Rosentreter" on #openttd
20:29-!-mode/#openttd [+v tokai] by ChanServ
20:29<Samu>more checks
20:30<+glx>yeah if invalid location return NULL is better than returning wrong town after heavy calculation
20:30-!-Supercheese [] has quit [Quit: Valete omnes]
20:30<@peter1138>So, I'm working on it :-)
20:30<Samu>returning NULL can be bad
20:31<Samu>nullptr stuff happening
20:31<+glx>well you can return an error too
20:31<+glx>AIs know errors :)
20:31<+glx>just another precondition
20:32<Samu>I was thinking more like... return the actual town
20:32<Samu>return Brinnington
20:32<@peter1138>You are thinking wrong.
20:32<+glx>you can't search for the town if the airport can't exist
20:32<@peter1138>The airport is not buildable there. It should fail.
20:33<Samu>but what about non ai functions
20:33<+glx>GUI prevent it
20:33<+glx>when you try to place an airport you don't wrap around the map
20:34<Samu>I suspect that's going to kill many AIs, probably mine too :|
20:34<Samu>oh well
20:35<@peter1138>No it won't
20:35<@peter1138>Your AI can't build a town there.
20:35<@peter1138>Can't build an airport there.
20:35<+glx>so getting the town was a useless call anyway
20:35<+glx>in this case
20:36-!-tokai|noir [] has quit [Ping timeout: 480 seconds]
20:36<_dp_>aren't preconditions part of api? I mean needing compat code
20:36<+glx>compat code is only for argument change IIRC
20:37<+glx>well signature change
20:37<+glx>they prevent "compile" failure
20:37<_dp_>glx, ah, so if shit breaks runtime it's ok?
20:38<+glx>I think it won't break anything, in this case an AI is looking for a town and probably tries to build an airport there depending on the result
20:39<+glx>but building will fail anyway
20:40<+glx>so I guess returning TOWN_INVALID and an error is correct
20:40<+glx>should not break the AI
20:40<_dp_>you're assuming some stuff about AI here, I'm talking compatibility in general
20:41<_dp_>but whatever, not like I care
20:41<_dp_>just curious for the next time I break something in gs xD
20:41<+glx>AI "compilation" is done at runtime
20:42<+glx>failing at precondition should not kill the script
20:43<+glx>it's not fatal :)
20:46<DorpsGek_II>[OpenTTD/OpenTTD] glx22 updated pull request #7270: Introduce CMake (and removing all other project-related code)
20:50-!-stormcone [] has quit [Quit: Bye!]
20:59<Samu>no more asserts, but then again... no more towns
21:00<@peter1138>Wrong place
21:00<Samu>wrong place why?
21:01<Samu>ah, the table it's retrieveing is [0]
21:01<Samu>which airport is 0?
21:01<@peter1138>Because you are already testing at that point.
21:01<@peter1138>It's airport table layout 0.
21:01<@peter1138>For non-NewGRF airports, that's the only one.
21:02<Samu>intercontinental layout is 0?
21:02<Samu>i doubt it
21:02<@peter1138>Each airport has its own layouts.
21:03<+glx>and some can have more layouts
21:04<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7429: Codechange: Check airport table would fit within map bounds before iterating tiles.
21:04<@peter1138>Maybe that
21:05<@peter1138>Okay, that hot chocolate tasted weird. I suspect the milk was off :/
21:05<Samu>that's a lot of code, eww
21:05<Samu>but ok, will test it
21:05<@peter1138>It's mostly comments.
21:05<@peter1138>But it's also at the right place.
21:07<Samu>airports can rotate?
21:08<+glx>with newgrf yes
21:08<Samu>ah ya, i remember, there's some newgrf that could rotate
21:08<+glx>but AI don't care, they use only the first layout
21:10<+glx>there's already enough complexity for AIs with newgrf vehicles
21:10<@peter1138>Yup. I still test for rotation, in case the first layout is rotated.
21:10<@peter1138>Unlikely but you never know.
21:10<+glx>yeah don't trust newgrf authors
21:10<+glx>we saw that recently ;)
21:11<Samu>oh it's not in master yet t.t
21:11<+glx>we never push in master without PR
21:12<Samu>i mean 7429, i was doing git fetch rebase stuff, and it wasn't in
21:13<+glx>but you can get the PR locally to test it
21:13<@peter1138>I'm fairly sure you were testing PRs earlier :p
21:14<Samu>yes, but i can't mix them :(
21:14<+glx>you can
21:14<Samu>they're not mine
21:14<+glx>checkout master
21:14<+glx>branch test
21:14<+glx>merge any PR in test
21:15<Samu>can't make branch on repository that isn't mine
21:15<+glx>why would you ?
21:15<Samu>because PR isn't mine
21:15<+glx>you can get master PR as branch in your local clone
21:16<@peter1138>Now I wonder *how* Samu was testing PRs earlier..
21:16<Samu>i downloaded repository
21:17<Samu>navigated to your branch, build
21:17<@peter1138>I guess that's a fairly brute-force way of doing it.
21:19<@peter1138>"git fetch upstream refs/pull/7429/head:7429" creates a local branch of the PR.
21:19-!-tycoondemon [] has quit [Ping timeout: 480 seconds]
21:20<@peter1138>You and your horrible GUIs
21:23<+glx>Samu: "git config --global --edit" then paste in the config file, save and close
21:23<+glx>will add 3 useful commands to git
21:25<+glx>rb to rebase with master, pr to get a PR, pr-clean to remove all retrieved PRs
21:29<+glx>some stuff is not easily doable in GUI
21:29<Samu>i prefer to do rebase with visual studio, the diff tool is greater than that of git CLI crap
21:29<+glx>"git mergetool" opens winmerge for me
21:29<+glx>works well
21:30<+glx>3-way merge
21:30<Samu>my config has some entries already :(
21:30<+glx>in alias section ?
21:31<+glx>my paste is not a replacement, it's an addition
21:32<+glx>hehe you can already do "git mergetool" from CLI to fix the merge in VS ;)
21:32<+glx>you can paste at the end of the config file
21:32<+glx>no issues
21:34<+glx>oh and you should remove the paste, there's your email in it
21:38<Samu>pr to get a pr?
21:38<Samu>how do I use?
21:38<+glx>git pr 7429
21:38<Samu>oh, interesting, just that?
21:38<+glx>it will create a pr/7429 branch and checkout
21:39<Samu>i must be on my repository, right?
21:39<Samu>in master or anywhere else?
21:39<+glx>I usually do it in master
21:40<Samu>let's test
21:41<Samu>cool stuff
21:41<+glx>once you get all pr you want via CLI you can do the rest via VS
21:42<+glx>create a test branch and merge pr branches into it
21:42-!-Thedarkb-X40 [] has joined #openttd
21:42-!-Thedarkb-X40 is "realname" on #openttd #/r/openttd #oolite
21:55<Samu>triple assert!
21:55<Samu>assert(forall == kdtree && kdtree == kdtper);
21:55<Samu>mixed with 7429, now testing
21:56<+glx>of course the result will differ ;)
21:56<Samu>it's being called from the AI
21:59<Samu>ugh, so slow
21:59<Samu>on the 13th January, I'll be done
21:59<Samu>0.32 frames /s
21:59<+glx>still testing on giant map ?
22:00<+glx>you really should test on smaller maps
22:00<+glx>will be easier for you
22:00<Samu>testing 64x64, then raising
22:01<+glx>only one town in 64x64 usually
22:01<+glx>it's very small
22:01<+glx>standard is 256x256
22:02<Samu>currently at 512x512, it passed so far
22:03<Samu>1024x1024 is taking its time...
22:04<Samu>2048x2048 now
22:06<@peter1138>What does "pass" mean?
22:06<Samu>passed the assert
22:08-!-Samu_ [] has joined #openttd
22:08-!-Samu_ is "realname" on #openttd
22:11-!-Samu [] has quit [Read error: Connection reset by peer]
22:16<Samu_>not sure I wanna test 4096x4096
22:16<Samu_>took 10 minutes for this one
22:17-!-Wormnest [~Wormnest@] has quit [Quit: Leaving]
22:17<Samu_>expecting it to finish in 1 hour
22:19<Samu_>if it passes, then works!
22:29<Samu_>I suppose my while tests aren't needed
22:29<Samu_>you say the gui takes care of it previously
22:33-!-SimYouLater [] has joined #openttd
22:33-!-SimYouLater is "OFTC WebIRC Client" on #openttd
22:34<SimYouLater>Can someone please explain to me what #ifdef and #endif mean? No, they aren't hashtags.
22:34<Eddi|zuHause>they have conditions, and the code between them is ignored if that condition is false
22:34<+glx>and it's checked at compile time
22:35<Eddi|zuHause>SimYouLater: see
22:35<SimYouLater>Why does pybuild.bat not recognize them?
22:36<SimYouLater>Are you telling me I need to use both C+ and Python to make Recycled Infrastructure Set?
22:36<Eddi|zuHause>dunno what that pybuild is
22:37<Eddi|zuHause>usually you would use cpp (or gcc -E) to combine the .pnml files into .nml
22:37<SimYouLater>All I know is that Nutracks has the only GPL v2 narrow gauge, and it's code uses #ifdef and #endif.
22:38<SimYouLater>I have a make.bat and a pybuild.bat, and I no longer remember exactly why but I know they're used to compile the code..
22:38<Eddi|zuHause>well, you can do all the condition checking manually
22:38<SimYouLater>^ should be one period, end of sentence.
22:38<Eddi|zuHause>and remove the #ifdef appropriately
22:39<SimYouLater>Except I am in over my head. I don't know where the conditions are located.
22:40<SimYouLater>I do have the Nutracks source, so if you could point me in the right direction.
22:40<Eddi|zuHause>i don't think i ever looked at the nutracks sources
22:40<Eddi|zuHause>but lets start with the words following "#ifdef"
22:41<Eddi|zuHause>(which is now your turn, to tell me)
22:49-!-psilynt [] has joined #openttd
22:49-!-psilynt is "realname" on #openttd
22:50<psilynt>Hello. I'm new. That topic is such bait. Is asking to ask to ask a question OK?
22:51-!-psilynt [] has quit [Read error: Connection reset by peer]
22:51-!-psilynt [] has joined #openttd
22:51-!-psilynt is "realname" on #openttd
23:02<psilynt>I have two serious questions:
23:02<psilynt>1) What are some good settings for games with really long trains (20+ wagons)
23:02<psilynt>2) Is there some patch or config setting to allow smaller stations to load large trains faster?
23:03<Eddi|zuHause>there is a patch which loads trains in a drive-through fashion. load all wagons that fit into the station, drive forward a bit, load more, etc.
23:06<Eddi|zuHause>don't know right now, but it is probably included in JGR patchpack
23:07<psilynt>I use JGR but haven't found it
23:08<Eddi|zuHause>"Freight train through load (added in v0.24.0) This is an alternative loading mode for freight trains for the case where the train is longer then the platform."
23:08<Eddi|zuHause>it'll be in the order list, there is "stop at beginning/middle/end of platform"
23:08<Eddi|zuHause>if you click on that, it will cycle through the options
23:10<Eddi|zuHause>(i don't think i've ever read the first post of the JGR thread before)
23:13<SimYouLater>Eddi: Sorry, got distracted. Here...
23:13<SimYouLater>#ifdef INTROS introduces_railtype_list: [INTROS]; #endif #ifdef REQS requires_railtype_list: [REQS]; #endif
23:13<SimYouLater>That's literally the whole thing, so hopefull it's easy to solve?
23:14<Eddi|zuHause>yeah, "INTROS" and "REQS" will come from a table somewhere
23:15<Eddi|zuHause>(and that section is probably included repeatedly, with different definitions for "INTROS" and "REQS"
23:15<+glx>probably a #define on top
23:16<Eddi|zuHause>you will find multiple definitions of "#define INTROS" in some source files that include that file
23:16<+glx>or it's passed as -D flags in some makefile
23:16<SimYouLater>Then maybe I can just edit it to have values that make sense? What does introduces_railtype_list do?
23:17<+glx>guess it's some intro date
23:17<Eddi|zuHause>it's a list of additional railtypes that will be made available simultaneously
23:18<Eddi|zuHause>(so you don't have to define vehicles for each one)
23:19<+glx>but as eddi said, check the files including this one
23:19<+glx>they should have #define INTROS ... #include "file"
23:20<SimYouLater>I found it. tt-table-definitions.pnml contains the definitions, I think.
23:22<+glx>BTW I don't see why they do it like that ;)
23:22<SimYouLater>ERROR: "src/graphics_NBAN_NBAE.pnml", line 92: Syntax error, unexpected token "RANDOM_LC_YEAR"
23:23<SimYouLater>Because of...
23:23<SimYouLater>RANDOM_LC_YEAR(lc_NBAN_closed_snow_switch,level_crossing_NBAN_closed_snow, level_crossing_NBAN_closed_snow_modern) RANDOM_LC_YEAR(lc_NBAN_open_snow_switch,level_crossing_NBAN_open_snow, level_crossing_NBAN_open_snow_modern) RANDOM_LC_YEAR(lc_NBAN_closed_switch,level_crossing_NBAN_closed, level_crossing_NBAN_closed_modern) RANDOM_LC_YEAR(lc_NBAN_open_switch,level_crossing_NBAN_open, level_crossing_NBAN_open_
23:23<+glx>it's a macro
23:24<+glx>you want to find #define RANDOM_LC_YEAR
23:24<SimYouLater>I know what a macro is, but not what it's doing in a pnml file.
23:24<+glx>it's for the preprocessor
23:24<+glx>like #ifdef stuff
23:25<+glx>.pnml once preprocessed become .nml I think
23:25<psilynt>OK, the load-through option works amazing. I didn't see that. Thanks.
23:26<SimYouLater>+glx: Don't worry, I at least know what pnml files are for.
23:28<SimYouLater>I can't seem to find the rest of the macro. How do I replace RANDOM_LC_YEAR with something I can work with?
23:30-!-Supercheese [] has joined #openttd
23:30-!-Supercheese is "Caseum" on #openttd
23:32<SimYouLater>No one knows how to un-macro-ize RANDOM_LC_YEAR?
23:32<SimYouLater>Should I provide the code?
23:33<SimYouLater>Since you're probably trying to help me blind.
23:34-!-SimYouLater [] has quit [Remote host closed the connection]
23:34-!-SimYouLater [] has joined #openttd
23:34-!-SimYouLater is "OFTC WebIRC Client" on #openttd
23:34<SimYouLater>Stupid internet cut out.
23:34<SimYouLater>Did I miss anything?
23:40<SimYouLater>ERROR: "src/graphics_NBAN_NBAE.pnml", line 15: Encountered unknown template identifier: tmpl_tunnel_tracks
23:41<SimYouLater>Not sure where to look to give it what it's looking for
23:41<Samu_>yes! it finished!
23:41-!-Smedles [] has quit [Ping timeout: 480 seconds]
23:41<SimYouLater>What is it, Samu?
23:42<Samu_>took 1h14m to iterate every tile
23:42<SimYouLater>Like, map size?
23:43<SimYouLater>Or something else?
23:43<Samu_>4096x4096, 13k towns, getting closest town when placing intercontinental airport
23:44<Samu_>no errors
23:44<Samu_> works!
23:44<Samu_>now I'm off to bed, cyas
23:45<Samu_>i meant to say 7424 + 7429
23:45<Samu_>k now cyas
23:45-!-Samu_ [] has quit [Quit: Leaving]
23:57-!-Compu [] has joined #openttd
23:57-!-Compu is "Compu" on #help #openttd #/r/openttd
23:57-!-Compu [] has quit [Remote host closed the connection]
23:59-!-debdog [~debdog@2a00:79c0:64e:c700:7a24:afff:fe8a:d04d] has joined #openttd
23:59-!-debdog is "Wowbagger" on #bitlbee #openttd
---Logclosed Thu Mar 28 00:00:09 2019