IRC logs for #openttd on OFTC at 2021-07-28
            
01:06:01 *** tokai has joined #openttd
01:06:01 *** ChanServ sets mode: +v tokai
01:13:06 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
01:48:55 *** tokai|noir has joined #openttd
01:48:55 *** ChanServ sets mode: +v tokai|noir
01:55:44 *** tokai has quit IRC (Ping timeout: 480 seconds)
02:09:29 *** Gustavo6046 has quit IRC (Ping timeout: 480 seconds)
02:13:43 *** Gustavo6046 has joined #openttd
02:21:12 *** snail_UES_ has joined #openttd
02:21:37 *** debdog has joined #openttd
02:25:01 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:30:11 *** Wormnest has quit IRC (Quit: Leaving)
03:04:30 *** glx has quit IRC ()
03:58:52 *** snail_UES_ has quit IRC (Quit: snail_UES_)
04:11:49 *** Flygon has joined #openttd
04:21:23 *** azubieta60 has quit IRC (Quit: The Lounge - https://thelounge.chat)
04:22:11 *** azubieta60 has joined #openttd
05:01:55 *** sla_ro|master has joined #openttd
06:33:54 *** tokai has joined #openttd
06:33:54 *** ChanServ sets mode: +v tokai
06:40:51 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
06:42:06 *** tokai has quit IRC (Ping timeout: 480 seconds)
08:09:39 *** andythenorth has joined #openttd
08:51:41 *** sla_ro|master has quit IRC (Ping timeout: 480 seconds)
09:41:33 *** EER has joined #openttd
09:56:12 *** virtualrandomnumber has joined #openttd
09:56:26 *** virtualrandomnumber has quit IRC ()
10:06:50 *** Samu has joined #openttd
11:08:41 *** Tirili has joined #openttd
11:16:49 *** andythenorth_ has joined #openttd
11:23:56 *** andythenorth has quit IRC (Ping timeout: 480 seconds)
11:42:29 *** Tirili has quit IRC (Quit: Leaving)
11:42:45 *** Tirili has joined #openttd
12:42:49 *** glx has joined #openttd
12:42:49 *** ChanServ sets mode: +v glx
12:43:08 <Samu> hi
12:43:27 *** snail_UES_ has joined #openttd
12:47:12 <Samu> a miracle happened
12:49:23 <Samu> limiting to a rectangle inside min_x, min_y, max_x, max_y yields more routes build that even bresenheims' line
12:49:41 <Samu> don't know how to describe it in words
12:49:54 *** andythenorth_ has quit IRC (Quit: andythenorth_)
13:14:41 *** snail_UES_ has quit IRC (Quit: snail_UES_)
13:44:38 *** nielsm has joined #openttd
13:46:08 <Samu> is there a way to make this check faster? https://pastebin.com/raw/J1JZC98U
13:46:15 <Samu> the bresenham's check, that is
13:48:11 <Samu> self._bresenhams_line has about 150-250 tiles
13:48:57 <Samu> this is iterated everytime the pathfinder gets the cost of a node, it slows down the number of iterations by a great deal
13:49:05 *** Terkhen has quit IRC (Ping timeout: 480 seconds)
13:51:32 *** Terkhen has joined #openttd
13:51:32 *** ChanServ sets mode: +o Terkhen
13:56:24 <Samu> https://imgur.com/a/uOVhTfx
13:57:18 *** WormnestAndroid has quit IRC (Remote host closed the connection)
13:57:31 *** WormnestAndroid has joined #openttd
13:58:11 <LordAro> Samu: is _bresehams_line sorted in any particular order? might be good enough to just take first/last result
13:59:21 <Samu> it's just a list of tiles representing a "line" starting from source tile to goal tile
14:01:15 <LordAro> if you generate it in a sorted way, (i.e. shortest distance first), you may be able to avoid the loop entirely
14:02:53 <Samu> how? I don't understand
14:06:23 <Samu> gonna try something that just came to mind
14:07:18 <Samu> create a list of tiles inside the line + distance manhattan < range
14:07:40 <Samu> then i only check if the new_tile is in the list
14:07:46 <Samu> avoid the loop
14:09:14 <Samu> initializing the pathfinder might be slow, but since it's a one-time thing, it might be worth it
14:12:44 <_dp_> Samu, are you just trying to calculate distance from point to line? that can be done geometrically, without bresenham at all
14:13:42 <Samu> yes, I belive that's what I'm trying
14:13:51 <Samu> how do i do that
14:14:26 <_dp_> https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
14:14:38 <_dp_> you'll need to adjust for manhattance distance though
14:14:51 <_dp_> and for grid if you need exact result
14:15:14 *** andythenorth has joined #openttd
14:17:28 <_dp_> here is for manhattan: http://artis.imag.fr/~Xavier.Decoret/resources/maths/manhattan/html/
14:39:37 <Samu> i don't understand those symbols :(
14:41:05 <_dp_> well, main takeaway there is that you either go horizontal or vertical depending on the inclination of the line
14:41:28 <_dp_> so you don't really need all that math if you just think about it a bit
14:42:10 *** andythenorth has left #openttd
15:13:44 *** Eddi|zuHause has quit IRC ()
15:17:29 *** Eddi|zuHause has joined #openttd
15:19:27 <Samu> https://i.imgur.com/D5p0NFU.png these are all the points that are distancemanhathan away from bresenham's line. Computing a list with all these tiles wasn't as cheap as I expected
15:20:18 <Samu> pathfinding is limited to these tiles
15:22:14 <Samu> I put it in the InitializePath, and it really took long to initialize. The act of checking node costs was however very fast
15:22:31 <Samu> just needed to check if the node is already in the list
15:23:13 <Samu> i dont understand the math behind xavier decoret
15:23:26 <Samu> or I would try that approach
15:28:55 <_dp_> it's just x tiles up and down the line in this case
15:29:01 <_dp_> and diamonds on endpoints
16:17:03 *** Progman has joined #openttd
16:22:11 *** keenriser has joined #openttd
16:27:05 *** EER has quit IRC (Ping timeout: 480 seconds)
16:43:57 *** Wormnest has joined #openttd
16:55:07 *** frosch123 has joined #openttd
17:01:14 *** HerzogDeXtEr has joined #openttd
17:19:53 *** andythenorth has joined #openttd
17:27:41 <Samu> i copied some of the code here https://stackoverflow.com/questions/12132352/distance-from-a-point-to-a-line-segment
17:27:47 <andythenorth> YO
17:27:48 <Samu> not sure if it is what I need :o
17:27:54 <andythenorth> I AM NOW HERE
17:28:47 <Samu> hello
17:30:10 <Samu> https://imgur.com/LFYr9GV vs https://i.imgur.com/D5p0NFU.png
17:30:17 <Samu> seems to be doing what i want
17:31:03 <Samu> not sure what happens behind source and past goal, need to know
17:31:20 <frosch123> did you increase your KPI today?
17:37:09 <andythenorth> I didn't
17:37:11 <andythenorth> did anyone else?
17:37:19 <andythenorth> I don't know what my KPI is
17:37:29 * andythenorth existential crissi
17:37:34 <andythenorth> or crisis
17:37:37 <andythenorth> crissi is a nice word
17:40:18 <frosch123> head of marketing asked the employees about how they define success (not sure for what purpose)
17:40:35 <frosch123> some really answered "maximizing profit of the organisation"
17:41:33 <frosch123> i think she expected some creative answers, but i think after that answer the thing was dead :p
17:42:16 *** HerzogDeXtEr has quit IRC (Ping timeout: 480 seconds)
17:43:10 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:44:36 <andythenorth> I read a thing that nobody, from the CEO downwards, really cares about profit
17:44:45 <andythenorth> can't remember if it was a survey, or just someone talking
17:45:53 <frosch123> depend on the meaning of "cares" :p cfo and controlling people talk a lot about it :p
17:47:02 <frosch123> sales people are evaluated by turnover
17:48:58 <andythenorth> how do you define success frosch123 ? :P
17:49:22 *** HerzogDeXtEr has joined #openttd
17:51:07 <frosch123> being successful is the opposite of being a smart-ass, or something
17:53:04 <frosch123> not sure about the english connotation, maybe i mean "gasbag" instead of "smart-ass" or some combination of them
17:53:21 <Rubidium> and manager of developers about the number of people they hire?
17:55:13 <andythenorth> hiring developers is so hard, that's a valid metric :P
17:55:20 <andythenorth> anyone who can hire developers should be made king
17:55:54 <frosch123> hiring some developer is easy, i assume you mean hiring *good* developers :p
17:56:19 <Rubidium> hiring good developers, yeah... that would be a reasonable metric. Though... people != developers and people is definitely not the same as good developers
17:57:08 <andythenorth> frosch123 yes
17:57:19 <andythenorth> I don't count 'bad developer' as developer :)
17:57:21 <andythenorth> maybe I should
17:57:28 <Rubidium> and letting someone go because they are deemed "expensive" and then hiring someone new with zero knowledge about the subjects they'd be working in... good for your KPI, bad for the company
17:57:56 <andythenorth> this is why my business mostly doesn't have KPIs
17:58:12 <andythenorth> aligning personal metrics and actual company goals is like defusing bombs
17:58:55 *** HerzogDeXtEr has quit IRC (Ping timeout: 480 seconds)
17:59:15 * andythenorth plays blitz
17:59:28 <andythenorth> I fixed my mac so the tank game runs at 60fps again, not 19fps
18:03:30 *** jottyfan has joined #openttd
18:03:44 *** jottyfan has quit IRC ()
18:12:47 <peter1138> Cleared the dust, right?
18:22:52 <andythenorth> and the fluff
18:23:07 <andythenorth> fluff ball the size of a small rodent
18:26:47 <peter1138> I have a pale ale (but not an IPA)
18:52:44 <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://git.io/JBCXJ
18:52:45 <DorpsGek> - Update: Translations from eints (by translators)
18:55:19 <TrueBrain> Is it me, or are the specs kinda suggesting that you should have only 1 industry GRF loaded in your game? Mostly referring to "Conflicting industry type", which doesn't seem to allow to not be close to industries in any other GRF?
18:56:59 <frosch123> the problem are "cargos"
18:57:16 <frosch123> multiple industry newgrf are fine, see ECS vectors
18:57:26 <frosch123> but they have to coordinate their cargo definitions
18:57:57 <TrueBrain> but is there a way to know about other industries? For placement etc?
18:58:55 <andythenorth> yes
18:59:02 <frosch123> https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Industries#Count_of_industry.2C_distance_of_closest_instance_.2867.2C_68.29 <- there is stuff like that
18:59:15 <andythenorth> "conflicting industries" is unrelated to "try not to mix industry grfs"
18:59:39 * andythenorth considers pasting some FIRS nfo
18:59:43 <andythenorth> probably unfair
19:00:40 <TrueBrain> I was somehow looking for an industry identifier for it :P
19:01:02 <TrueBrain> but okay, so via action0 you cannot, and you need to do magic with action2 to get some of the info, if I get this correctly :)
19:01:34 <frosch123> the "conflicting industrry types" property only works for industries in the same grf
19:01:41 <frosch123> but the callback allows to check other newgrf
19:01:43 <TrueBrain> similar with var64, I See
19:01:58 <frosch123> but "industry identifier" is just "grfid + grf-local id"
19:02:13 <TrueBrain> yeah, somehow I assumed it would be like cargos
19:02:19 <TrueBrain> where you can just say: I HAVE A COALMINE
19:02:25 <TrueBrain> and all other NewGRFs go: okay
19:02:26 <TrueBrain> :D
19:02:47 <TrueBrain> okay, var67 does allow other GRFIDs, k :)
19:04:18 <andythenorth> "conflicting industries" is another example of "don't use this, if you're actually authoring grfs, not an authoring tool"
19:04:30 <andythenorth> your case is different I guess :D
19:05:14 <andythenorth> "I HAVE A COALMINE"
19:05:18 * andythenorth has a coalmine
19:05:32 <TrueBrain> I hope you enjoy it :)
19:05:35 <andythenorth> it's coaly
19:06:23 <TrueBrain> owh, sorry frosch123 , you actually linked to 67 .. my browser was showing that to me very poorly ... and I was puzzled because it showed var60 :D
19:06:31 <TrueBrain> makes more sense now :D
19:06:45 <TrueBrain> I wish browsers highlighted anchors ..
19:07:07 <frosch123> your screen is too tall
19:07:15 <frosch123> turn it landscape
19:07:20 <TrueBrain> or there is not enough text on the wiki :P
19:08:09 <frosch123> people using screens in portrait are as fascinating as people using tiling window managers
19:09:48 <TrueBrain> I turned my screen 90 degrees, and now the problem is EVEN WORSE
19:09:56 <TrueBrain> :D
19:11:38 <andythenorth> your screen is now flat on the desk?
19:11:41 <andythenorth> or face down?
19:12:04 <TrueBrain> so tempted to scream: YOU'RE STUPID, and leave the room :P
19:12:09 <TrueBrain> I have seen too much series, I am sorry
19:19:30 <TrueBrain> at least I have cookies that taste like brownies, but are not really brownies
19:20:22 <frosch123> brownies are the most overated thing
19:20:56 <TrueBrain> if brownies are your #1, I don't want to know what else is in your top 5 :P
19:21:44 <TrueBrain> lol @ action10, that reads funny :)
19:22:33 <frosch123> i don't think we ever found a usecase for loops
19:22:45 <TrueBrain> don't tell andythenorth
19:22:45 <TrueBrain> :P
19:23:28 <andythenorth> mmmm
19:23:32 <andythenorth> loops and lists...
19:29:20 <TrueBrain> "Get industry or airport tile ID at offset " <- what is airport doing in Action2 industry tiles :P
19:29:43 <frosch123> copy/paste .)
19:29:52 <TrueBrain> ha, okay, that makes sense :D
19:29:55 <TrueBrain> I was thinking oilrigs :P
19:30:00 <frosch123> the tile variables are mostly the same for airport/industry/object tiles
19:32:54 <TrueBrain> guess the best way to debug action2 chains is to trigger an error with a string you prepared?
19:36:17 <frosch123> https://wiki.openttd.org/en/Development/NewGRF/Debugging#variable-property-inspection-tool <- you can check variable values in-game
19:37:52 <TrueBrain> cool
19:39:35 <TrueBrain> animation chains of 200+ .. that is a bit too much detail for my taste :D
19:40:25 <frosch123> https://gist.githubusercontent.com/frosch123/889b6478a6d5d7b10f89d9b014845331/raw/b11d0d479c773153722a617b3d7b8c1d0041f57a/inspect_backtrace.png <- some years ago i had something like that
19:40:51 <frosch123> but it became someone useless with nml
19:40:57 <frosch123> *somewhat
19:41:24 <andythenorth> I think you meant someone :P
19:41:37 <frosch123> next time i would implement it without an in-game gui
19:41:43 <frosch123> but rather some newgrf debug port
19:41:48 <frosch123> to attach some external tool
19:41:51 <andythenorth> presumably you meant that nml does loads of hidden magic?
19:42:03 <TrueBrain> let's call the tool TrueGRF? :P
19:42:11 <frosch123> andythenorth: how do you find the nml line to a sprite number? :p
19:42:22 <andythenorth> yes
19:44:09 <TrueBrain> okay, so prop13 for industry tiles allows me to set the acceptance list, for as many cargos as I want
19:44:20 <TrueBrain> I could also do it via a callback, but that limits me to 3 cargos
19:45:38 <TrueBrain> (I am looking how/where to assign functionality :D)
19:48:44 <frosch123> so, well, if ottd had a newgrf debug port, nml could output debug symbols (nfo sprite to source line mapping), and then you can write a vs code plugin that allows you to debug newgrf running inside ottd
19:48:59 <frosch123> or you can fork truegrf and turn it into grfbolt.org or so
19:49:29 <frosch123> TrueBrain: the acceptance callback is limited to 3 of the first 32 cargos
19:50:18 <TrueBrain> stepping through action2 chains could be useful, I would guess :P
19:51:23 <frosch123> "stepping" is only the presentation part. you would probably run the callback once, record it's trace (as in my old patch), and then present that as backtrace in the IDE
19:52:11 <TrueBrain> would be useful for something insane I have in mind :P But .. I first need to see if I can do it, and if it is useful .. :D
19:52:12 <frosch123> basically "do not freeze ottd while debugging callbacks", but rather "record the whole callback execution, and replay it in the ide"
19:52:41 <frosch123> "insane" is redundant in context of "truebrain has something in mind"
19:52:49 <TrueBrain> FU :P
19:54:49 <TrueBrain> yesterday you mentioned that action2 chains are "jumps". Is there a way to define a chain as a "call"-like structure, so I can declare some common things once and call it multiple time from another chain, yet get back to the original chain to continue?
19:55:09 <frosch123> yes, variable FE
19:55:24 <frosch123> glx had a lot of fun implementing that in nml
19:55:41 <andythenorth> it's the best thing ever
19:55:56 <TrueBrain> okay, searching for "FE" was a bad idea :P
19:56:01 <frosch123> err, 7E
19:56:10 <TrueBrain> ah
19:56:16 <frosch123> https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2#Variable
19:56:20 <TrueBrain> the "Available in the purchase list. " didn't make me consider that :D
19:58:14 <TrueBrain> okay, cool, that is useful :)
19:58:31 <Samu> interesting that sqirrel has a sqrt function
19:58:45 *** HerzogDeXtEr has joined #openttd
19:58:46 <Samu> where is it located in openttd code?
19:58:48 <TrueBrain> ugh, I can see where this ends .. with the need to have a "library" of procs available for others to use .. :D
19:59:52 <andythenorth> lol
20:01:12 <TrueBrain> I like how action0 is like: set some props on an industry, how it looks, what it does, just, you know, the basics
20:01:20 <TrueBrain> owh, and here is action2, do what-ever-the-fuck-you-want, go nuts
20:01:23 <TrueBrain> its cute :)
20:01:24 <frosch123> TrueBrain: "library" is opposite of "disagreeing" though :p
20:01:40 <LordAro> Samu: sqstdmath.cpp
20:01:46 <LordAro> no, i have no idea how it works
20:01:57 <LordAro> or indeed where the actual code is
20:03:39 <TrueBrain> these functions are just normal C functions being called if my memory serves me well
20:04:34 <LordAro> i'd expect so
20:05:06 <TrueBrain> hmm, yes, I think I make TrueGRF somewhere a bit between action0 and action2 .. allow changing simple props, but also built-in give some more powerful way of controlling what is happening .. and an insane "export" mode
20:10:21 <TrueBrain> "There is one exception: operation 00 would never generate a message, but it still will when bit 8 is set. This is useful in conjunction with callback 35, to tell the player about things that don't change the production multiplier, but are still important enough to require a news message. " <- I love these kind of things :D
20:11:19 <frosch123> i think its just worded complicated
20:11:29 <TrueBrain> at least I understood it :P
20:12:44 <TrueBrain> right, I guess tomorrow I give this a whirl :D
20:12:47 <TrueBrain> for now, telly time!
20:13:41 <Samu> corecrt_math.h
20:13:47 <Samu> it's a microsoft file
20:15:16 <LordAro> well done Samu, you've found the standard library
20:16:54 <Samu> minkernel\crts\ucrt\src\appcrt\tran\noti386\sqrt.c
20:16:59 <Samu> source not found
20:17:02 <Samu> what now? :(
20:17:36 <Rubidium> why do you want to know your specific C library's sqrt implementation?
20:20:10 <Rubidium> though arguably MSVC's implementation is not much more than calling the CPU instruction for sqrt, i.e. FSQRT
20:22:17 <LordAro> you'd hope not, really
20:26:15 <Samu> well, forget it, i was just being curious
20:26:16 <Rubidium> https://godbolt.org/z/Wb4unC <- okay, not FSQRT but SQRTSS
20:27:51 <Rubidium> still the same idea; its functionality is encoded somewhere deep in the microcode firmware or even hardware
20:37:07 <Samu> found this, https://opensource.apple.com/source/Libm/Libm-47.1/ppc.subproj/sqrt.c.auto.html
20:37:16 <Samu> not exactly microsoft, but
20:39:05 <dwfreed> Rubidium: a compiler would only use FSQRT if SSE or SSE2 was not available (SSE for single precision, SSE2 for double precision)
20:40:29 <dwfreed> all amd64 processors have SSE2 (it's a requirement of the base spec)
20:43:40 <Rubidium> still the point I tried to make remains the same... it's some instruction called directly instead of some C-implementation of sqrt, so looking for the code of the library's sqrt is kinda pointless
20:46:27 <Rubidium> which is basically what the link from Samu is as well; the documentation specifically mentioning it is for PowerPC and not meant for Intel architectures screams its using some hardware specific shenanigans which you can't employ within Squirrel
20:50:55 *** andythenorth has quit IRC (Quit: andythenorth)
21:11:00 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:13:38 *** frosch123 has quit IRC (Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn)
21:14:04 *** Speeder_ has quit IRC (Ping timeout: 480 seconds)
21:27:26 *** Samu has quit IRC (Ping timeout: 480 seconds)
21:51:38 <glx> <frosch123> glx had a lot of fun implementing that in nml <-- 7E was already used internally, I just made it available to all
22:21:11 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:09:22 *** Progman has quit IRC (Remote host closed the connection)
23:11:01 *** qwebirc21786 has joined #openttd
23:11:43 *** qwebirc21786 has quit IRC ()