• What are you working on? v19
    6,590 replies, posted
[img]http://i.imgur.com/GBMlp.jpg[/img]
Arduino duemilanove?
[QUOTE=Map in a box;31487305]Arduino duemilanove?[/QUOTE] AVR ATMega168 It's the microcontroller arduino is running on, but I don't use arduino but write raw code for it.
Alright The next thing i tried after doing the shadows which you can see above is to have the shadows be longer in the middle, and shorter near the edge of the planet. Didnt go so well the first time [IMG]http://dl.dropbox.com/u/9317774/Shadows1.png[/IMG] Turns out that while id scaled the outside coordinate of the light between 1 and -1, id forgotten to scale the current pixel as well :v: how its meant to work is (here comes a crappy explanation): you find the distance if each pixel on the screen from the point on the edge of the circle which represents the light source which is fairly easy to work out given the angle and radius of the circle. You then scale it between 1 and -1 (and times by -1 to get the point on the other side of the array) to find the point in a 3x3 array in a pixel that you want to shade in, except you then multiply by the distance from the light (scaled), which gives you the fraction of how much shadow you want. You then stick that distance*how dark you want the shadow to be in that point in the pixel-modification modification map (that needs a better name), checking if the pixel at that point is in the same "band" of colour as you (eg, you dont want land to cast a shadow on land, only ocean) pretty much gives you this, but 0 for shading has been changed to lighting direction to stop shadows popping in and out [IMG]http://dl.dropbox.com/u/9317774/Proper%20shadows.png[/IMG] I also tried using the perpendicular distance for each part of the x-y coordinate from the x-y of the light as lighting multipliers for the shadows - this makes all the points correctly orientated for the light [IMG]http://dl.dropbox.com/u/9317774/Proper%20shadows%202.png[/IMG] You cant really do this though, if you spin a light around it it causes "lines" of shadow changing-ness, from horizontal and vertical lines cast from the light. This is a bit annoying, it happens because in a 3x3 array there isnt a lot of room for swivelling shadows around gracefully. I could interpolate where the shadow will be arriving and place it in increasing prominence the closer you get to the change point, but thats quite a lot of hassle for some small visual correctness that ill probably do anyway at some point :v: Edit: I should probably mention this is an absolutely horribly slow method of doing it, it takes about a second to generate and shade the whole thing. But i only need to do it once, and relighting it isnt so awful afterwards, so it should be alright if its moving slowly through space Edit 2: I forgot to mention, if you turn off the edging and make the distortion filter in the noise generation lopsided, you can get this: [IMG]http://dl.dropbox.com/u/9317774/GG2.png[/IMG] Edit 3: Whoever rated me informative has officially unlearnt all efficient programming techniques
Worked on generation of minerals and fog! I need to work on some logic that somtimes places more of certain minerals together. Maybe clean up some minerals as well, if they have too many neighbors that are minerals. [img]http://i3software.org/s/SS-2011-08-02_08.44.46.png[/img] [img]http://i3software.org/s/SS-2011-08-02_08.44.32.png[/img] [img]http://i3software.org/s/SS-2011-08-02_01.13.20.png[/img]
[QUOTE=Icedshot;31487391] I forgot to mention, if you turn off the edging and make the distortion filter in the noise generation lopsided, you can get this: [IMG]http://dl.dropbox.com/u/9317774/GG2.png[/IMG][/QUOTE] Looking at that sort of reminds me of what I would think the sandy planet from Dune looks like.
Working on ambient occlusion, and I finally got some results! [img]https://lh5.googleusercontent.com/-8Ycyfc3ua9E/TjgjTmsrMQI/AAAAAAAAAXQ/2LQ5EGaS9HQ/s1016/AO.png[/img] It's way too slow, though. I'll probably end up implementing SSAO, which would result in smooth shadows as well.
[QUOTE=i300;31487619]I need to work on some logic that somtimes places more of certain minerals together.[/QUOTE] A 2D noise map could give you some nice ore clumps if that's what you need :)
[QUOTE=Chris220;31484953]Actually depends on how you take it. If you look at it literally, infinity / 4 does indeed equal infinity. However if you take it as meaning it tends towards infinity, then you'd have to other bit tending towards infinity / 4 (i.e going up by 1/4 the amount the first bit does), so it works like that.[/QUOTE] Pretty sure the concepts of relative infinity exist in higher math.
[QUOTE=Downsider;31489238]Pretty sure the concepts of relative infinity exist in higher math.[/QUOTE] We shall all evolve into a higher plane of existence.. for higher math. We just can't reach it from down here
Guess what I'm working on. [img]http://dl.dropbox.com/u/3695360/webSteam/app2.PNG[/img]
A minecraft clone?
[QUOTE=Dryvnt;31490864]A minecraft clone?[/QUOTE] Naw, its a top down zombie shooter obviously.
I've made something 100% useless and extremely inefficient. It's a type that stores virtual bits (Really an array of bools) and outputs ints and stuff. It can do arithmetic, including and limited to addition and subtraction. [img]http://dl.dropbox.com/u/2670708/woo.PNG[/img]
I remember seeing a link in the form of [url]http://www2.site.com[/url] and thinking it was black magic, some sort of new internet. Anyways, working on open.gl atm.
[QUOTE=Dryvnt;31492614]I've made something 100% useless and extremely inefficient. It's a type that stores virtual bits (Really an array of bools) and outputs ints and stuff. It can do arithmetic, including and limited to addition and subtraction. [img]http://dl.dropbox.com/u/2670708/woo.PNG[/img][/QUOTE] Don't shyts some bricks man! [editline]2nd August 2011[/editline] What I'm working on: A TCP tunnel.
After several weeks of sort of kind of working on my build system, I ran into a huge show-stopper bug. Within my build system, I was relying on a new module in Python 3.2 called "concurrent.futures", which lets a user use a ProcessPoolExectuor, and then parallelize their work. This is extremely handy if the results from one function don't matter at all for the next one (i.e., the data you are working with is immutable). Unfortunately, this module requires that for any functions passed in, the user needs to allow them to be imported by the ProcessPool, so you can't pass a lambda, nor a function within a function, or even a class method. This resulted in the very actual core execution of my build system being made completely and utterly useless, because I rely on classes with state to perform a given task in parallel. So all of my hard work, getting these parallel processes to run, and designing my build system around them, have been all for naught. :( So I have a few choices now. Remove parallelization of all tasks (which makes scons and make -j1 faster than my system :[), or write it to work with IronPython. I'm currently leaning toward the latter because I get * Not a real GIL (there's bit of a fake one to ensure atomicity with the .NET runtime, but no locks) * Real threads (see above) * Cross platform if you use mono * Performance requiring portions can be written in what the hell ever I want (C#, F# [which is really fantastic for data processing. just sayin'], etc.) * The idea of plugins would be possible, and they could be compiled binaries if one wanted * My job requires me to work in .NET anyhow, so I'd be in good practice for both all day erry day * Turb (wherever you are~) would probably be able to figure out some magic to make it faster than everything else out there (Minus maybe the python :v:) I've been avoiding talking about my build system up until now because when I do, I end up having this nasty habit of not delivering in the slightest. And now, of all things, I can't even deliver it regardless. Ugh :/
[QUOTE=Sam Za Nemesis;31493189]Please finish this, are you planning to port Vapor or just make yet another Steam community app?[/QUOTE] It will mainly be used for Steam Chat, but will have the other community features like the other apps aswell. While I am making this there is a semi-function web version I have made @ [url]https://www.pocketsteam.com/[/url] EDIT: What a briliant time to post that, Steam community went down.
My TCP tunnel turned to a minecraft tunnel.
[QUOTE=Chandler;31492851]I end up having this nasty habit of not delivering in the slightest. And now, of all things, I can't even deliver it regardless. Ugh :/[/QUOTE] Did I coax you back after making a delivery myself? :v:
[QUOTE=Map in a box;31493500]My TCP tunnel turned to a minecraft tunnel.[/QUOTE] How odd, I was just starting that same thing...
[QUOTE=NovembrDobby;31494475]Did I coax you back after making a delivery myself? :v:[/QUOTE] If only :v: I was getting really close to an alpha release the past few days, with this issue being the primary one, and then I found out why it was happening. (womp womp :/)
[img]http://i3software.org/s/bo-jenkins.gif[/img] Aw yeah terrible gif image!
[QUOTE=DrLuke;31487242][img]http://i.imgur.com/GBMlp.jpg[/img][/QUOTE] I think that that photo, in a better resolution, would make a cool wallpaper.
[QUOTE=benjojo;31494501]How odd, I was just starting that same thing...[/QUOTE] I saw that in WDYNHW, I was making something to help you with and then I got caught up in making it a tunnel.
[QUOTE=DeadKiller987;31494950]I think that that photo, in a better resolution, would make a cool wallpaper.[/QUOTE] Sadly, my camera is pretty old and crappy.
[QUOTE=Chandler;31492851]Unfortunately, this module requires that for any functions passed in, the user needs to allow them to be imported by the ProcessPool, so you can't pass a lambda, nor a function within a function, or even a class method.[/QUOTE] Presumably you're referring to the restriction that "only picklable objects can be executed and returned." And presumably you have a reason why you can't use a ThreadPoolExecutor instead. I don't know much about your build system, but I don't see why you'd [i]need[/i] to pass things like lambdas or class methods into the build engine. If you want to want to pass a task that carries state, make a class with a __call__() method, and pass an instance of it to the ProcessPoolExecutor. The class has to be picklable, but that's not really hard to do. Alternatively, why not just use a ThreadPoolExecutor? Sure, CPython isn't truly multi-threaded, but a build system probably spends most of its time just waiting for child processes (e.g. compilers) to finish, and that should parallelize just fine since Python releases the GIL while waiting on I/O.
[QUOTE=Wyzard;31497988]Presumably you're referring to the restriction that "only picklable objects can be executed and returned." And presumably you have a reason why you can't use a ThreadPoolExecutor instead. I don't know much about your build system, but I don't see why you'd [i]need[/i] to pass things like lambdas or class methods into the build engine. If you want to want to pass a task that carries state, make a class with a __call__() method, and pass an instance of it to the ProcessPoolExecutor. The class has to be picklable, but that's not really hard to do. Alternatively, why not just use a ThreadPoolExecutor? Sure, CPython isn't truly multi-threaded, but a build system probably spends most of its time just waiting for child processes (e.g. compilers) to finish, and that should parallelize just fine since Python releases the GIL while waiting on I/O.[/QUOTE] Actually no, because that gives the same error. For the CPython ProcessPoolExecutor can only take an unbound function (i.e., one not in a class), because in the underlying process that is then spawned, it needs to be able to import the function, not pass the same instance (This is a limitation with the underlying multiprocessing module. All of the classes I was trying to pass are more than picklable, as they simply hold state of data, with their methods perform mutable changes to them). So creating a class with __call__ is right out. (I even passed just a plain class, one that wasn't an instance so the class would be initialized with data, and that was when I first found out. I also passed a class with call, and a class with a bound method. None of these work.) I tried the ThreadPoolExecutor, but it doesn't like it when you create pools with a number of threads greater than the number of sys._threads, so what's the point of using it on single threaded systems? (Of which I still have one). Additionally, there were other pickling issues that arose, such as trying to pass a class instance (bound methods worked, just not a class that already contained a state).
This works for me: [code] #!/usr/bin/env python3.2 import concurrent.futures import time class Foo: def __init__(self, message): self.message = message def __call__(self): print("Foo: %s" % self.message) with concurrent.futures.ProcessPoolExecutor() as executor: executor.submit(Foo("hello")) time.sleep(5) [/code]
[QUOTE=Wyzard;31499301]This works for me: [code] #!/usr/bin/env python3.2 import concurrent.futures import time class Foo: def __init__(self, message): self.message = message def __call__(self): print("Foo: %s" % self.message) with concurrent.futures.ProcessPoolExecutor() as executor: executor.submit(Foo("hello")) time.sleep(5) [/code][/QUOTE] I'm not using submit, I'm using map. I was getting even more unexplained errors within the concurrent.futures.as_completed() and concurrent.futures.wait() functions when I was going the submit route. At this point, I don't feel like having to fight with python on these small little inconsistencies within its own library. I've chosen and am sticking with .NET now.
Sorry, you need to Log In to post a reply to this thread.