IRC logs for #openttd on OFTC at 2017-08-07
            
00:00:41 *** Wormnest has quit IRC
00:02:03 *** debdog has joined #openttd
00:03:01 *** argoneus has joined #openttd
00:16:01 *** HerzogDeXtEr has quit IRC
00:51:38 *** gpsoft has quit IRC
01:06:13 *** glx_ has joined #openttd
01:06:13 *** glx is now known as Guest1684
01:06:13 *** glx_ is now known as glx
01:12:36 *** Guest1684 has quit IRC
01:14:06 *** FLHerne has joined #openttd
01:22:24 *** FLHerne has quit IRC
01:47:07 *** mindlesstux has quit IRC
01:47:52 *** mindlesstux has joined #openttd
02:38:36 *** Wolf01 has quit IRC
03:16:32 *** JacobD88 has joined #openttd
03:37:15 *** JacobD88 has quit IRC
03:46:31 *** glx has quit IRC
04:18:07 *** sim-al2 is now known as Guest1704
04:18:13 *** sim-al2 has joined #openttd
04:23:08 *** Guest1704 has quit IRC
05:42:48 *** Flygon has joined #openttd
06:03:05 *** sla_ro|master has joined #openttd
06:32:50 *** Cubey has quit IRC
07:26:01 *** lolrus has joined #openttd
07:26:10 *** sla_ro|master has quit IRC
07:28:12 *** lolrus has quit IRC
07:56:54 *** gpsoft has joined #openttd
08:19:03 *** tokai|noir has quit IRC
08:27:12 *** andythenorth has joined #openttd
08:41:01 *** DDR has quit IRC
08:48:51 *** Celestar has joined #openttd
08:50:12 *** Celestar has quit IRC
08:55:54 *** dark_pingus has joined #openttd
09:11:19 *** debdog has quit IRC
09:17:05 *** debdog has joined #openttd
09:21:05 *** andythenorth has left #openttd
09:27:09 *** tokai has joined #openttd
09:27:09 *** ChanServ sets mode: +v tokai
09:35:19 *** debdog has quit IRC
09:40:40 *** debdog has joined #openttd
10:02:15 *** DDR has joined #openttd
10:28:36 *** debdog has quit IRC
10:32:37 *** debdog has joined #openttd
10:32:52 *** FLHerne has joined #openttd
11:16:07 *** dark_pingus has quit IRC
11:18:01 <__ln__> it's time for a Wolf01
12:00:02 *** Exec has quit IRC
12:00:36 *** Exec has joined #openttd
12:12:18 *** Wolf01 has joined #openttd
12:12:59 <Wolf01> o/
12:15:56 <__ln__> there he is, 54 minutes delayed from the approximated time
12:17:03 <Wolf01> Showered :P
12:17:19 <Wolf01> I take 50 minutes to clean all my fur
12:27:16 <Wolf01> Meh... microsoft... do they even try to not break stuff every 2 updates?
12:28:50 <Wolf01> Most people will say "it's impossible to work now, entire system fucked up, microsoft is shit"... but it's just that some store apps now have mixed english and italian strings :|
12:31:23 <__ln__> fortunately you know both!
12:41:38 *** Biolunar has joined #openttd
13:12:19 *** JacobD88 has joined #openttd
13:13:00 *** debdog has quit IRC
13:14:02 *** debdog has joined #openttd
13:21:46 *** JacobD88 has quit IRC
14:13:03 *** popup has joined #openttd
14:24:02 *** popup has quit IRC
14:30:33 *** Stimrol has joined #openttd
14:47:46 *** dark_pingus has joined #openttd
14:51:37 <V453000> I'm making the most badass looking python script ever
14:51:44 <V453000> who cares it will be slow as fuck
14:51:49 <V453000> F.A.N.C.Y
15:38:05 *** Flygon has quit IRC
15:45:18 *** Alberth has joined #openttd
15:45:18 *** ChanServ sets mode: +o Alberth
15:45:22 <Alberth> o/
15:45:29 <crem> \o
16:09:04 *** Maraxus has joined #openttd
16:12:00 *** debdog has quit IRC
16:15:02 *** debdog has joined #openttd
16:48:50 *** supermop has joined #openttd
16:51:25 <V453000> Alberth: have you ever used multiprocessing in python?
16:51:35 <V453000> I'm trying to make the palette converter run on multiple threads
16:51:47 <V453000> but something is fucking up and I can't seem to figure out why
16:51:55 <V453000> it kind of works but it requires my confirmation on every run
16:51:58 <V453000> hm one more test
16:58:17 *** sla_ro|master has joined #openttd
16:58:28 <supermop> big diesel trains ringing bells and idling outside of the window here making of an odd background noise
17:00:27 <V453000> in case anyone wants to help: https://dev.openttdcoop.org/attachments/download/8526/send.zip
17:00:33 <V453000> I have no clue
17:00:34 <V453000> :|
17:03:37 *** Maraxus has quit IRC
17:18:43 *** Cubey has joined #openttd
17:19:30 *** Gja has joined #openttd
17:26:51 <Alberth> V453000: no, but the standard library has a "multiprocessing" package
17:27:16 <Alberth> just adding threads won't work
17:27:43 <Alberth> you can have only 1 thread actually running in the Python interpreter
17:28:08 <Alberth> so unless most threads are waiting for IO or so, you don't gain much :p
17:29:02 <Alberth> https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing
17:34:46 *** Progman has joined #openttd
17:34:50 *** synchris has joined #openttd
17:40:34 *** supermop has quit IRC
17:44:26 <Wolf01> __ln__: do you need a chatbot? https://www.windowscentral.com/microsoft-built-chatbot-aims-shame-online-johns-trolling-sex
17:46:17 <__ln__> it may not be optimal for emulating Bjarni an T***
17:50:01 <Wolf01> Let me finish my exercises on design patterns, then I'll specialize on state machines and maybe later on neural networks
18:00:24 *** mescalito has joined #openttd
18:23:09 *** supermop has joined #openttd
18:33:52 *** roidal has joined #openttd
18:44:08 *** Edgeli has joined #openttd
18:45:21 *** Edgeli has left #openttd
18:48:42 *** FLHerne has quit IRC
18:51:34 *** Gja has quit IRC
18:58:36 *** Gja has joined #openttd
18:59:37 *** HerzogDeXtEr has joined #openttd
19:00:56 *** Wormnest has joined #openttd
19:01:58 *** roidal has quit IRC
19:04:03 *** supermop has quit IRC
19:05:42 *** Sheogorath has quit IRC
19:11:51 *** Sheogorath has joined #openttd
19:35:20 <V453000> Alberth: in the zip you can see I am using the multiprocessing thing, but there is just something basic I am missing which does not use it correctly
19:35:25 <V453000> but generally it seems to work
19:35:44 <V453000> but it just does each thing in individual steps and requires confirmation :D
19:37:20 <Alberth> I don't have time to debug your thing, but if it fails, it's too complicated
19:37:34 <Alberth> either make it simpler, or start from a working example
19:37:49 <Alberth> keeping it working is simpler than fixing something that is broken
19:38:47 <V453000> sounds like a good idea
19:39:35 *** Gja has quit IRC
19:42:59 *** FLHerne has joined #openttd
19:43:46 *** Gja has joined #openttd
19:51:08 *** glx has joined #openttd
19:51:08 *** ChanServ sets mode: +v glx
19:55:57 *** roidal has joined #openttd
19:59:43 *** andythenorth has joined #openttd
20:01:52 <andythenorth> o/
20:03:55 <V453000> andythenorth have you ever used multiprocessing in python? I have it almost working I think but there must be some little thing I am missing... https://paste.openttdcoop.org/pm3knafr6
20:04:05 <V453000> can you help me with this pls? :)
20:04:24 <andythenorth> Wolf01: I only use Pool
20:04:29 * andythenorth looks
20:05:15 <andythenorth> I use it here http://dev.openttdcoop.org/projects/road-hog/repository/entry/src/render_graphics.py
20:05:21 <andythenorth> probably doesn’t help you much :)
20:05:35 <andythenorth> what doesn’t work?
20:07:06 <V453000> when I run it, it asks for press any key at every "thread run"
20:07:13 <andythenorth> hmm
20:07:34 <andythenorth> you might need a python developer :P
20:07:47 *** mescalito has quit IRC
20:07:58 <V453000> I'll harass dudes at work tomorrow I guess :D
20:08:08 <andythenorth> I can look at it more later
20:08:19 <andythenorth> have to build some lego with kids
20:08:22 <V453000> I will try to figure it out but so far I seem to be hopeless :D
20:08:24 <V453000> sure thing
20:08:33 <andythenorth> what’s it supposed to do? o_O
20:08:40 <V453000> convert 32bpp to 8bpp
20:08:41 *** mescalito has joined #openttd
20:08:58 <V453000> which is slow as fuck with 50megapixel spritesheets
20:09:47 <andythenorth> http://sebastianraschka.com/Articles/2014_multiprocessing.html#the-pool-class
20:09:51 <andythenorth> I use Pool for a reason :P
20:09:57 <andythenorth> it removes the need to manage any threads
20:10:05 <andythenorth> you just define n workers in the pool
20:10:10 <andythenorth> then pass a function and a list
20:10:13 <V453000> interesting
20:10:20 <V453000> I'll try that
20:10:42 <andythenorth> it sounds like jargon, until you see how it works
20:10:46 <andythenorth> then it’s really simple and smart
20:11:10 <V453000> well my thing atm isn't working so trying anything else doesn't sound like a bad idea at all :P
20:11:27 *** gelignite has joined #openttd
20:11:28 <andythenorth> I use it to make graphics processing much faster with PIL
20:11:47 <V453000> yeah that's basically the same I want to do, I think I use pillow
20:12:04 <V453000> ok PIL
20:12:05 <V453000> :)
20:12:08 <andythenorth> I probably use pillow
20:12:15 <V453000> right
20:12:22 <V453000> it's the same syntax right
20:12:39 <V453000> as in from PIL import Image can mean pillow
20:13:27 <andythenorth> yup, pillow is just PIL repackaged mostly
20:13:51 <andythenorth> using Pool speeds up Iron Horse graphics from 4s to 2s
20:14:21 <V453000> my palette conversion takes 50 minutes...
20:14:25 <V453000> :)
20:14:41 <V453000> now have 16 thread processor so want to make use of it
20:17:55 *** frosch123 has joined #openttd
20:19:27 <V453000> k I go devastate my brain in the Pool
20:22:19 <Wolf01> <andythenorth> Wolf01: I only use Pool <- That's the last one I did
20:23:47 <V453000> https://dev.openttdcoop.org/attachments/download/8527/pool-wtf.png this is basically the same error I am getting from my multiprocessing thingy
20:23:56 *** FLHerne has quit IRC
20:24:16 <V453000> https://paste.openttdcoop.org/pwd6iyoac
20:24:36 *** FLHerne has joined #openttd
20:25:54 <Wolf01> V453000, in c# you lock the execution, so the other process must wait for the bootstrap
20:26:07 <V453000> I guess that's the pool.map thing then
20:33:27 <V453000> hm still
20:35:47 *** FLHerne has quit IRC
20:36:16 <V453000> weird thing is that I can't copypaste even the simplest scripts and make them run
20:36:20 <V453000> something must be proper fucked
20:36:45 <Wolf01> python 3 scripts on python 2.x or vice versa?
20:37:03 <V453000> python 36-32
20:37:14 <andythenorth> hmm
20:37:23 <andythenorth> never seen that :P
20:37:36 <V453000> oh the guide is for python 2.7
20:37:52 <Wolf01> It's *always* that
20:38:17 <andythenorth> this paste works for me https://paste.openttdcoop.org/pwd6iyoac/ih7evz/raw
20:38:19 <andythenorth> python 3.5
20:39:12 <andythenorth> V453000: windows?
20:39:26 <V453000> that doesn't work for me, same error
20:39:27 <V453000> yeah windoze
20:39:30 <V453000> win10 to be specific
20:39:57 <andythenorth> oh is it __main__ ?
20:40:39 <V453000> this worked https://paste.openttdcoop.org/p4t8frs64
20:40:45 <V453000> which has the main thing :)
20:42:14 <andythenorth> https://stackoverflow.com/questions/20360686/compulsory-usage-of-if-name-main-in-windows-while-using-multiprocessi
20:42:38 <andythenorth> or https://stackoverflow.com/questions/14175348/why-does-pythons-multiprocessing-module-import-main-when-starting-a-new-pro?rq=1
20:42:46 <andythenorth> second one is better
20:43:40 <Wolf01> V453000: install linux subsystem
20:43:44 <V453000> ..
20:44:10 *** sim-al2 has quit IRC
20:44:26 <andythenorth> nah just use __main__
20:45:00 <andythenorth> same as http://dev.openttdcoop.org/projects/iron-horse/repository/entry/src/render_graphics.py#L71
20:46:05 <V453000> do i need to import anything for it?/
20:47:04 <V453000> oh I see
20:47:06 <V453000> hm
20:47:25 <andythenorth> multiprocessing effectively reimports the same file
20:47:36 <andythenorth> so it will fork bomb if not protected :P
20:47:50 <andythenorth> https://en.wikipedia.org/wiki/Fork_bomb
20:52:03 *** Biolunar has quit IRC
20:58:25 <V453000> :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
20:58:27 <V453000> no module named PIL
20:58:32 <V453000> didn't install that at home yet I guess
21:03:33 <V453000> ok now I fail at installing pillow
21:03:36 <V453000> jeez :D
21:04:49 <V453000> all things I saw say > pip install Pillow
21:04:53 <V453000> but idk how to do htat :D
21:05:59 <frosch123> [20:43] <Wolf01> V453000: install linux subsystem
21:06:01 <frosch123> :p
21:06:47 <Wolf01> That feature is maybe onw of the most useful made by microsoft
21:07:44 *** eekee has joined #openttd
21:08:03 * eekee ponders ecs or firs
21:08:27 <Wolf01> ECS, because FIRS was made by a crazy man
21:08:31 <Wolf01> :D
21:08:33 <eekee> oh :D
21:09:16 <frosch123> i would claim that applies to both
21:09:47 *** roidal has quit IRC
21:09:48 <V453000> ._.
21:10:27 <ST2> nothing new... I'm still searching for a sane person around OpenTTD and not even the mirror says "yes" to me :S
21:10:34 <ST2> but that's normal ^^
21:10:34 <eekee> hehehe
21:11:19 <eekee> a local shop sells chairs with things like "we're all mad here" painted on the seat. i'd get one if i had room
21:12:58 <V453000> why does this have to be so hard
21:13:25 <eekee> because i like my games to last for years :)
21:15:39 <eekee> which one has the yeti?
21:16:12 <V453000> YETI? :D
21:16:42 <frosch123> neither ecs nor firs have yeti
21:16:42 <eekee> yup :D #openttdcoop use it sometimes
21:16:46 <eekee> ty
21:17:17 <andythenorth> there is yeti
21:17:54 <eekee> i like the idea of supplying workers to industries (which is what the yeti are,) but that one set had huge in-your-face graphics i don't really want
21:18:34 <eekee> ah, the whole set is called YETI extended towns and industrie
21:18:35 <V453000> yeah the graphics are shit
21:18:56 <frosch123> eekee: firs has supplies, isn't that the same?
21:19:19 <eekee> yeah kinda. firs it is, then :)
21:20:10 <V453000> YETI mechanism works better, more dynamically :P you can grow the industries basically as much as you can handle
21:24:55 <eekee> ah, right ^.^
21:24:56 <andythenorth> pssh
21:25:07 <andythenorth> who wants to build massive networks like that :P
21:25:13 <eekee> o/ :)
21:25:14 <andythenorth> it’s a model train set
21:25:24 <andythenorth> or boats
21:25:31 <andythenorth> FIRS has supplies to justify getting a bigger boat :P
21:25:36 <V453000> it's a retardedly large model trian set :P
21:27:28 <eekee> https://www.tt-forums.net/download/file.php?id=168408
21:27:29 <andythenorth> I’m not done until http://www.miniatur-wunderland.com/
21:27:48 <andythenorth> maglev is so ugly eh :)
21:28:02 <V453000> https://wiki.openttdcoop.org/images/a/ac/PSG268.png
21:28:08 <V453000> WETRail is where shit is at
21:28:09 <eekee> ooh i ought to visit that some day
21:28:25 <eekee> i converted that game to nuts, it's all color coded purr now :)
21:28:38 <V453000> purr needs 32bpp upgrade
21:28:48 <eekee> haha wetrail! i love it for decoration
21:28:59 <eekee> i like it
21:29:29 <andythenorth> this is a proper junction http://dev.openttdcoop.org/attachments/download/7782/4-way.png
21:29:32 <eekee> sheesh that wetrail network :D
21:29:35 <andythenorth> dunno what all that other stuff is
21:30:02 <andythenorth> or this http://dev.openttdcoop.org/attachments/download/7347/Wafflebury%20Transport,%2001-05-2007.png
21:30:19 <eekee> mmh, slow turns
21:30:52 <andythenorth> ah metro http://dev.openttdcoop.org/attachments/download/6775/Puddlebury%20Transport,%2011-02-1921.png
21:30:56 <eekee> i've made big changes since that screenshot actually
21:30:58 <andythenorth> who need subways? ^^
21:31:08 <eekee> <3 metro hehe
21:31:09 <andythenorth> subway idiots :P
21:31:23 <andythenorth> where would be the challenge in building everything underground?
21:31:43 <eekee> quite XD
21:32:19 <eekee> in that 2050 game i made a metro line before i used any grf
21:32:35 <andythenorth> hey look, I did a wetrail http://dev.openttdcoop.org/attachments/download/5384/iron_horse_wet_2.png
21:33:48 <eekee> hahahhaha
21:36:44 <eekee> i'd update my screenshot thread, but actually playing the game is more fun
21:36:51 *** sla_ro|master has quit IRC
21:37:04 <V453000> hm, thing runs, but it keeps throwing the same error as originally and is on just 1 thread
21:37:16 <V453000> will probably have to rewrite the thing I guess
21:37:28 <Wolf01> <andythenorth> or this http://dev.openttdcoop.org/attachments/download/7347/Wafflebury%20Transport,%2001-05-2007.png <- full of ugly 90° turns
21:39:10 <V453000> could it be something related to the thing that I am doing stuff to an image?
21:39:18 <V453000> do I need to save each of the threaded images separately?
21:39:22 <V453000> and then combine them or something?
21:39:31 <eekee> i try to only use those with (nuts) trains which can handle them, apart from metro lines
21:40:27 <eekee> sometimes there just isn't room though
21:48:57 <eekee> sometimes nuts seems too easy. when i switched to it, i halved the size of bradnor station https://www.tt-forums.net/download/file.php?id=182363
21:49:34 <V453000> that's only because it has higher loading speeds
21:49:41 <eekee> yeah
21:49:44 <V453000> the throughput on maglev trains isn't higher
21:49:49 <V453000> since wagon capacity is 22 per halftile
21:49:52 <eekee> i use its local trains a lot
21:49:59 <V453000> vs 37 of vanilla
21:50:06 <eekee> right, yeah
21:50:24 <V453000> 3 loading stages help :)
21:50:32 <eekee> dramatically :)
21:50:45 <eekee> i use its one maglev local a lot in another game
21:50:56 <V453000> all of the local trains have a use
21:51:00 <eekee> yeah
21:51:18 <V453000> the maglev one is good because it can travel through any curve at full speed
21:51:26 <eekee> also 'touch of hate', the one maglev intercity with a slightly higher loading speed
21:51:44 <eekee> not quite, it only takes /\ at 90mph XD
21:51:49 <V453000> yes, and lower curve length requirements :)
21:51:56 <eekee> yes!
21:52:01 <V453000> well, 90deg turns are assumed to be turned off :P
21:52:35 <eekee> i turned them on for my 'new wetworld' game. one station in particular just got insane!
21:54:46 <V453000> Slugs must rule the universe by 2055
21:57:06 <V453000> all threads under load =D finaly
21:57:09 <V453000> let's see if it shit something
21:57:44 <frosch123> how many rockets do i need to launch until one returns with a slug?
21:57:51 <frosch123> also, what stack size do slugs have?
21:57:57 <eekee> hahahahaha
21:58:01 <V453000> not YET
21:58:04 <eekee> I
21:58:08 <V453000> soon(tm)
21:58:14 <V453000> slugs must automate
21:58:55 <frosch123> i considered replacing the train engine with the nuts slug, but it's too much work for a short hoke :p
21:58:58 <frosch123> *j
21:59:09 <V453000> I'll probably do it eventually
21:59:13 <V453000> it's just a matter of time really
22:02:48 <frosch123> https://s-media-cache-ak0.pinimg.com/originals/5c/21/b5/5c21b5eb8e29a2fb2bec3d7690b3712f.jpg <- i can't quite read the company name
22:03:08 <V453000> nice
22:03:19 <V453000> oh now I know why factorio has no slugs yet
22:03:24 <andythenorth> Wolf01: if you don’t enable 90º turns, your ships get stuck :D
22:03:28 <V453000> didn't know how would the front-tail detection work
22:04:01 <Wolf01> We'll fix that
22:08:36 <frosch123> http://www.mackenzieschocolates.com/index.php/molded-items/animals/slugs <- found it
22:09:11 <frosch123> but i am too afraid to buy american chocolates
22:09:51 <andythenorth> how long are the slugs?
22:09:54 <andythenorth> integer?
22:09:55 *** Alberth has left #openttd
22:10:45 * andythenorth wonders how industry placement hints could be given
22:10:58 <andythenorth> seems like a UI for n random options is a non-starter :P
22:11:10 <frosch123> andythenorth: http://devs.openttd.org/~frosch/diffs/vehstack/vehstack_screenshot.png <- all the parts are 8/8
22:11:37 <andythenorth> how pleasing
22:12:03 <frosch123> there is also an 8bpp slug
22:12:26 <V453000> ok I got it to use all cores :D but it doesn't do anything useful
22:12:33 <V453000> just cycles in that one weird error
22:13:09 <andythenorth> haz want help?
22:13:49 <V453000> so the error is https://dev.openttdcoop.org/attachments/download/8528/pool-wtf-2.png
22:14:12 <V453000> code iz https://paste.openttdcoop.org/pte2anunx
22:14:27 <andythenorth> such
22:14:30 <V453000> the biggest issue probably was the run() and traceback stuff
22:14:37 <V453000> which was real weird
22:14:48 <andythenorth> delete Line 213
22:14:51 <V453000> now even if I use a tiny image, it runs for seemingly forever
22:15:23 <andythenorth> well what else are your fans for? o_O
22:15:58 <V453000> :D that seems better
22:16:08 <V453000> now it doesn't throw that evil error at least
22:16:27 <V453000> I won't try to understand why it does the run() thing through the main
22:16:37 <V453000> ok seems like there are other issues in teh code that need fixing
22:16:41 <V453000> should be straight forward though
22:16:49 <andythenorth> when you start the script directly, it’s name is __main__
22:17:01 <andythenorth> or something similar
22:17:13 <andythenorth> I won’t try to explain, I only vaguely know the facts
22:17:33 <andythenorth> when you import it to another script, it’s name is not __main__
22:17:37 <andythenorth> This Is Important
22:18:31 <V453000> k :D
22:18:42 <V453000> hm, variable isnt global
22:18:49 <V453000> now how did I do this :)
22:24:33 *** FLHerne has joined #openttd
22:25:16 <andythenorth> just type randomly until it works
22:25:33 <V453000> that's pretty much exactly what is happening right now
22:25:33 <andythenorth> how many monkeys would it take pasting from Stack Overflow to create works of Shakespeare?
22:26:02 <andythenorth> V453000: unless you know better, I would use Pool.map()
22:26:06 <andythenorth> you may know better
22:26:26 <V453000> that seems to be working now, just the script itself has fucked places
22:40:09 <V453000> OMFG it seems to be doing something right
22:40:15 <V453000> just not able to save pictures yet
22:42:30 <andythenorth> you can call Image.show()
22:42:33 <andythenorth> to check progress
22:42:38 <andythenorth> I wouldn’t if you have lots :P
22:42:50 <andythenorth> can DoS your system for a bit
22:43:33 <andythenorth> your save is outside the loop?
22:43:39 <V453000> hm the thing is that it doesn't see the imageOutput atm
22:43:47 <andythenorth> L 203?
22:43:50 <V453000> because the variable isn't global or somehow exported by the function which I forgot how
22:43:51 <V453000> yeah
22:44:43 <V453000> I'm guessing the putpixel from L 129 should also be outside of the loop?
22:45:01 <V453000> no
22:45:02 <V453000> hm
22:45:37 <andythenorth> I would do one function for the entire open->transform->save
22:45:45 <andythenorth> and call that with map() and a list of images
22:46:09 <V453000> the list of images being the inputs?
22:46:24 <V453000> what's the difference between map and apply?
22:46:40 <andythenorth> stuff I barely understand, so can’t explain :)
22:46:44 <andythenorth> apply seems to be blocking
22:46:59 <andythenorth> why you’d want blocking with multi-processing, I have no idea :P
22:48:24 <andythenorth> you need Eddi|zuHause or someone else proper to explain it :)
22:49:17 <eekee> i have no idea why you wouldn't want blocking :)
22:49:27 <eekee> i don't know much though
22:49:39 *** sim-al2 has joined #openttd
22:49:56 <andythenorth> if we’re processing images, each image is usually totally independent from the others
22:50:00 <andythenorth> so map() seems best
22:50:07 <V453000> pool.map(rgb2palette, q[0], q[1], q[2]) I'm trying to use map now
22:50:14 <V453000> but it says incorrect amount of arguments
22:50:29 <V453000> which is weird because this is the amount it worked with before, just with apply
22:51:14 <V453000> TypeError: map() takes from 3 to 4 positional arguments but 5 were given
22:52:28 <andythenorth> it usually takes 3
22:52:38 <V453000> I mainly don't see the 5th
22:52:44 <V453000> I just see 4
22:53:07 <V453000> the rgb2palette is function name, and the 3 others are part of the queue list
22:53:29 <andythenorth> map() takes a function, a list, and an optional chunk size iirc
22:53:46 <andythenorth> if you want to pas multiple args you have to wrap them up in the list
22:53:53 <V453000> OH
22:53:57 <andythenorth> [(foo, bar), (ham, eggs)] etc
22:54:12 <V453000> well that I already have I guess :D
22:54:32 *** synchris has quit IRC
22:54:54 <V453000> I guess I have [[,], []]
22:54:57 <V453000> not ()
22:55:06 <V453000> difference iz?
22:55:10 <andythenorth> with map you don’t have to fuck around handling results
22:55:27 <andythenorth> and it will use as many workers in the pool as it can
22:55:44 <V453000> map's fine, that I am going to use
22:55:48 <V453000> just wondering how to feed the list to it
22:55:58 <V453000> ah maybe this
22:56:30 <andythenorth> you’ve pretty much got them in q already
22:56:34 <andythenorth> just pass queue
22:56:38 <andythenorth> and unpack it in the function
22:57:01 <V453000> current thing https://paste.openttdcoop.org/pllisyxce
22:57:02 <andythenorth> rgb2palette(input_image, x_start, x_end) -> rgb2palette(queue)
22:57:04 <andythenorth> or so
22:57:12 <V453000> oh
22:57:13 <V453000> :0
22:57:13 <andythenorth> then queue[1] etc
22:57:42 <andythenorth> or so
22:58:12 <andythenorth> L52-54 here, then L63 then L37-39 http://dev.openttdcoop.org/projects/iron-horse/repository/entry/src/render_graphics.py
22:58:42 <V453000> I think I understand
22:58:59 <V453000> https://paste.openttdcoop.org/pz6fqzdif
22:59:19 <V453000> and pool.map(rgb2palette(queue))
22:59:33 <V453000> well there are no crashes atm
22:59:37 <V453000> but something doesn't seem right
23:00:01 <andythenorth> pool.map(rgb2palette, queue)
23:00:18 <V453000> oh :) was wondering
23:00:28 <V453000> omg it's doing things again
23:00:46 <V453000> right
23:00:51 <V453000> now to save the picture somehow I guess?
23:02:52 <andythenorth> Image.save()?
23:03:56 <V453000> right so now I need to somehow access the imageOutput
23:04:15 <V453000> https://paste.openttdcoop.org/pkhcjzhw9
23:04:20 <V453000> at 207
23:04:25 <V453000> it can't see the imageOutput
23:04:32 <V453000> because it's a variable from the function
23:05:02 <V453000> should I just move the saving to inside of the function? That would just save the last thread strip that finished, right?
23:05:13 <andythenorth> you need to do the save inside rgb2palette
23:05:18 <V453000> oh
23:05:23 <andythenorth> you might eventually split that up into smaller functions, but eh
23:05:48 <andythenorth> that’s why I have all the pipelines stuff, but let’s not go there now :P
23:06:00 *** Gja has quit IRC
23:08:55 <V453000> something is wrong but I think I just need to understand my own script better
23:09:13 <V453000> even when I am saving the picture at the end of the function it still saves a blank image
23:09:26 <andythenorth> that will just be PIL shit
23:09:34 <andythenorth> it’s quite easy to get a blank image :P
23:09:58 <andythenorth> paste it
23:10:23 <V453000> https://paste.openttdcoop.org/pukavouiq
23:11:42 <andythenorth> I would move L134 somewhere else
23:11:51 <andythenorth> probably don’t need to check that for every pixel in the image ;)
23:12:08 <V453000> sense it makes
23:12:24 <V453000> so away from the function to the top somewhere
23:12:52 <andythenorth> I would
23:13:00 <V453000> ok that's there :)
23:13:29 <andythenorth> can’t see why it’s not working though
23:13:44 <andythenorth> how many images you testing with?
23:14:10 <V453000> 1
23:14:13 <andythenorth> ok
23:14:23 <andythenorth> try L52 “i.show()"
23:14:28 <andythenorth> see if the input is valid
23:15:04 <andythenorth> dunno if show() works on windows eh
23:15:36 <V453000> it tried to open it in some image viewer but failed
23:16:04 <V453000> iz valid
23:16:04 <andythenorth> balls
23:16:15 <andythenorth> show() is easiest way to debug PIL scripts :P
23:16:23 <andythenorth> seems https://www.daniweb.com/programming/software-development/threads/308081/problem-with-pil
23:17:03 *** gpsoft has quit IRC
23:17:04 <andythenorth> saved image is white or black?
23:17:38 <V453000> pure alpha
23:17:40 <V453000> guess black
23:18:19 <V453000> I'm guessing it's ignoring the putpixel
23:18:20 <V453000> or something
23:18:21 <V453000> but why
23:18:23 <andythenorth> maybe
23:18:28 <andythenorth> seems non-standard
23:18:30 * andythenorth looking again
23:18:42 <V453000> maybe the finalR G B is inside of he for cycles?
23:18:50 <V453000> while the imageOutput is outside?
23:20:28 <V453000> now I see something
23:20:34 <V453000> when the script is running
23:20:37 <V453000> the image keeps changing
23:20:40 <V453000> OH
23:20:46 <V453000> I undertand why it's empty now
23:20:55 <V453000> because it's only taking some strip which only has alpha
23:20:58 <V453000> and that one is saved last
23:21:03 <V453000> for $reason
23:21:13 <V453000> basically it's not combining the images but just saving each of them over and over
23:21:26 <V453000> so I need to somehow merge them
23:21:32 <V453000> from all the threads
23:21:48 * andythenorth will look
23:22:16 <andythenorth> likely you want to swap to point() at some time
23:22:22 <andythenorth> it’s faster than putpixel afaik
23:22:25 <andythenorth> but not urgent
23:22:27 <andythenorth> http://pillow.readthedocs.io/en/4.2.x/reference/Image.html#PIL.Image.Image.point
23:22:46 <andythenorth> pixel access has a speed warning http://pillow.readthedocs.io/en/4.2.x/reference/PixelAccess.html
23:22:50 <V453000> ok moar optimizing later :D
23:23:35 <andythenorth> https://stackoverflow.com/questions/2181292/using-the-image-point-method-in-pil-to-manipulate-pixel-data
23:23:38 <V453000> another weird part is that it seems to be running again and again
23:24:09 <andythenorth> the whole function?
23:24:12 <andythenorth> or just part of it?
23:24:31 <V453000> I think everything
23:24:40 *** frosch123 has quit IRC
23:25:20 <andythenorth> add “print queue” somewhere around L 202 or so
23:25:29 <andythenorth> see if it’s 1 item or more
23:25:41 <andythenorth> also you don’t need L204 for q in queue:
23:25:50 <andythenorth> just do pool.map(rgb2palette, queue)
23:25:59 <V453000> OH
23:26:01 <V453000> that might be why
23:26:06 <V453000> because queue is kind of a long list
23:26:09 <V453000> XD
23:26:22 *** JacobD88 has joined #openttd
23:26:31 *** mescalito has quit IRC
23:26:45 <V453000> ok now it was fast as hell
23:27:08 <V453000> output picture iz 1 strip
23:27:45 <andythenorth> super
23:28:10 <andythenorth> I didn’t really look what all the thread and chunks stuff is
23:28:29 <V453000> ok yeah now it works properly, just the saving not
23:28:34 <V453000> all threads at 100% utilization :D
23:28:38 <V453000> fans started doing serious shit :D
23:28:55 <V453000> and it took like several seconds for a bigger file
23:28:56 <V453000> holy shit
23:29:56 <V453000> well now it's just about figuring out that output
23:30:02 <V453000> idk fi point will help me with that?
23:30:06 <V453000> if*
23:30:08 <andythenorth> yeah I can’t see what’s wrong with it currently
23:30:15 <andythenorth> what is all the chunk stuff doing? o_O
23:30:22 <andythenorth> seems that it breaks up multiple jobs per image?
23:30:26 <V453000> yeah
23:30:32 <V453000> exactly that
23:30:33 <andythenorth> is this multiple images on a spritesheet?
23:30:46 <andythenorth> or frame output or something?
23:30:51 <V453000> yes it's a giant spritesheet of potentially even thousands of sprites
23:31:16 <andythenorth> ok, opening that a bazillion times might have IO trauma
23:31:21 <andythenorth> although you might have SSD :P
23:31:25 <V453000> https://dev.openttdcoop.org/projects/brix/repository/entry/gfx/BRIDGES_8bpp.png
23:31:35 <V453000> I have m.2 ,it's fast as hell
23:31:49 <andythenorth> probably we can just past the image across in the args, you already have it open
23:32:01 <V453000> right
23:32:07 <V453000> that sounds like a good idea
23:32:09 <andythenorth> might be no difference, dunno
23:32:23 <V453000> speed is whatever if it's reasonable
23:32:29 <V453000> just need 8bpp conversion :D
23:32:41 <andythenorth> I would probably slice out the sprite, and then pass the image in the args
23:32:49 <andythenorth> it’s an object, you can just pass it around
23:33:05 <andythenorth> not for tonight though
23:33:08 * andythenorth needs bed
23:33:44 <V453000> exactly
23:33:55 <V453000> I will try some self study tomorrow and let's see where I get
23:34:00 <V453000> many thanks mate
23:34:12 <V453000> wouldn't do shit without you tonight
23:34:26 <andythenorth> faster is fun
23:34:34 <andythenorth> just check stuff down the function
23:34:41 <andythenorth> e.g. I’d try printing (finalR,finalG,finalB,finalAlpha) and so on
23:35:14 <V453000> will try stuff
23:35:19 <V453000> good night :)
23:35:22 <V453000> and thanks again
23:35:30 <andythenorth> bye
23:35:33 *** andythenorth has quit IRC
23:39:08 *** FLHerne_ has joined #openttd
23:39:08 *** FLHerne has quit IRC
23:39:11 *** FLHerne_ has quit IRC
23:40:49 *** gelignite has quit IRC
23:49:52 *** HerzogDeXtEr has quit IRC