IRC logs for #openttd on OFTC at 2017-08-07
⏴ go to previous day
00:03:01 *** argoneus has joined #openttd
01:06:13 *** glx is now known as Guest1684
01:14:06 *** FLHerne has joined #openttd
01:47:52 *** mindlesstux has joined #openttd
03:16:32 *** JacobD88 has joined #openttd
04:18:07 *** sim-al2 is now known as Guest1704
04:18:13 *** sim-al2 has joined #openttd
06:03:05 *** sla_ro|master has joined #openttd
08:27:12 *** andythenorth has joined #openttd
08:48:51 *** Celestar has joined #openttd
08:55:54 *** dark_pingus has joined #openttd
09:21:05 *** andythenorth has left #openttd
09:27:09 *** ChanServ sets mode: +v tokai
10:32:52 *** FLHerne has joined #openttd
11:18:01 <__ln__> it's time for a Wolf01
12:15:56 <__ln__> there he is, 54 minutes delayed from the approximated time
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
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
15:45:18 *** Alberth has joined #openttd
15:45:18 *** ChanServ sets mode: +o Alberth
16:09:04 *** Maraxus 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: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: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:34:46 *** Progman has joined #openttd
17:34:50 *** synchris has joined #openttd
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:59:37 *** HerzogDeXtEr has joined #openttd
19:00:56 *** Wormnest has joined #openttd
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:42:59 *** FLHerne has joined #openttd
19:59:43 *** andythenorth has joined #openttd
20:04:05 <V453000> can you help me with this pls? :)
20:04:24 <andythenorth> Wolf01: I only use Pool
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:34 <andythenorth> you might need a python developer :P
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: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: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: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:08 <andythenorth> I probably use pillow
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: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: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: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:23 <andythenorth> never seen that :P
20:37:36 <V453000> oh the guide is for python 2.7
20:39:12 <andythenorth> V453000: windows?
20:39:26 <V453000> that doesn't work for me, same error
20:39:57 <andythenorth> oh is it __main__ ?
20:40:45 <V453000> which has the main thing :)
20:42:46 <andythenorth> second one is better
20:43:40 <Wolf01> V453000: install linux subsystem
20:44:26 <andythenorth> nah just use __main__
20:46:05 <V453000> do i need to import anything for it?/
20:47:25 <andythenorth> multiprocessing effectively reimports the same file
20:47:36 <andythenorth> so it will fork bomb if not protected :P
20:58:25 <V453000> :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
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: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:47 <Wolf01> That feature is maybe onw of the most useful made by microsoft
21:08:27 <Wolf01> ECS, because FIRS was made by a crazy man
21:09:16 <frosch123> i would claim that applies to both
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: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:42 <frosch123> neither ecs nor firs have yeti
21:16:42 <eekee> yup :D #openttdcoop use it sometimes
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:25:07 <andythenorth> who wants to build massive networks like that :P
21:25:14 <andythenorth> it’s a model train set
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:48 <andythenorth> maglev is so ugly eh :)
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:29:32 <eekee> sheesh that wetrail network :D
21:29:35 <andythenorth> dunno what all that other stuff is
21:30:56 <eekee> i've made big changes since that screenshot actually
21:30:58 <andythenorth> who need subways? ^^
21:31:09 <andythenorth> subway idiots :P
21:31:23 <andythenorth> where would be the challenge in building everything underground?
21:32:19 <eekee> in that 2050 game i made a metro line before i used any grf
21:36:44 <eekee> i'd update my screenshot thread, but actually playing the game is more fun
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: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:49:34 <V453000> that's only because it has higher loading speeds
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:50:24 <V453000> 3 loading stages help :)
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: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: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: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:59:09 <V453000> I'll probably do it eventually
21:59:13 <V453000> it's just a matter of time really
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:09:11 <frosch123> but i am too afraid to buy american chocolates
22:09:51 <andythenorth> how long are the slugs?
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: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:14:30 <V453000> the biggest issue probably was the run() and traceback stuff
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: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: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:50 <V453000> because the variable isn't global or somehow exported by the function which I forgot how
22:44:43 <V453000> I'm guessing the putpixel from L 129 should also be outside of the loop?
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: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:57 <andythenorth> [(foo, bar), (ham, eggs)] etc
22:54:12 <V453000> well that I already have I guess :D
22:54:54 <V453000> I guess I have [[,], []]
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:56:30 <andythenorth> you’ve pretty much got them in q already
22:56:38 <andythenorth> and unpack it in the function
22:57:02 <andythenorth> rgb2palette(input_image, x_start, x_end) -> rgb2palette(queue)
22:57:13 <andythenorth> then queue[1] etc
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:28 <V453000> omg it's doing things again
23:00:51 <V453000> now to save the picture somehow I guess?
23:03:56 <V453000> right so now I need to somehow access the imageOutput
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: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: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: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:24 <V453000> so away from the function to the top somewhere
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: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:15 <andythenorth> show() is easiest way to debug PIL scripts :P
23:17:04 <andythenorth> saved image is white or black?
23:18:19 <V453000> I'm guessing it's ignoring the putpixel
23:18:28 <andythenorth> seems non-standard
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:34 <V453000> when the script is running
23:20:37 <V453000> the image keeps changing
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: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: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:50 <V453000> ok moar optimizing later :D
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: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:26:06 <V453000> because queue is kind of a long list
23:26:22 *** JacobD88 has joined #openttd
23:26:45 <V453000> ok now it was fast as hell
23:27:08 <V453000> output picture iz 1 strip
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: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: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: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: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: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:55 <V453000> I will try some self study tomorrow and let's see where I get
23:34:12 <V453000> wouldn't do shit without you tonight
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:39:08 *** FLHerne_ has joined #openttd
continue to next day ⏵