• What Are You Working On? May 2015
    1,601 replies, posted
Have not had any time to work on my Illuminati confirmer. It's bearly any code so whoever wants to give it a shot here you go: [code]#!/usr/bin/env python2 import cv2 source = 'dew.jpg' img = cv2.imread(source) gray = cv2.imread(source, cv2.IMREAD_GRAYSCALE) def filterImage(image, downScale): height, width = image.shape[:2] scale = (width if width > height else height) scale = (scale * downScale) / scale image = cv2.resize(image, (int(width * scale), int(height * scale))) image = cv2.resize(image, (width, height)) return image def findSimpleShape(image, corners): ret, image = cv2.threshold(image, 128, 255, 0) contours, h = cv2.findContours(image, 1, 2) for cnt in contours: approx = cv2.approxPolyDP(cnt, 0.03 * cv2.arcLength(cnt, True), True) if len(approx) == corners: yield approx for i in range(2): target = filterImage(gray, 1 - (0.01 * i)) for shape in findSimpleShape(target, 3): cv2.drawContours(img, [shape], 0, (0, 255, 0), -1) cv2.imshow('img', img) #cv2.imshow('gray', threshold) cv2.waitKey(0) cv2.destroyAllWindows()[/code]
[QUOTE=COBRAa;47742976]I wish someone would write a feature-complete Bash shell, but actually [B]written cleanly[/B]. I've tried to view the source code for bash in an attempt to visualize predictions, but I can't out find how lines are edited (or if they're even using readline)... [editline]17th May 2015[/editline] Visualize predictions as in show what would happen if you pushed tab.[/QUOTE] Man, I'm not that familiar with C, or writing neat code in general. Glad to hear the real bash is also ugly.
[QUOTE=COBRAa;47742976]I wish someone would write a feature-complete Bash shell, but actually written cleanly. I've tried to view the source code for bash in an attempt to visualize predictions, but I can't out find how lines are edited (or if they're even using readline)... [editline]17th May 2015[/editline] Visualize predictions as in show what would happen if you pushed tab.[/QUOTE] Did you even read any of the builtins?
<-- fp has github profile icons now!
[IMG]http://i.imgur.com/rSHjBo0.png[/IMG] This works now. I've also managed to avoid having a `get` function for retrieving values from properties. It's now implicitly called based on how you use the property.
[QUOTE=Rocket;47744940]Sure, sounds great now, but now it's going to take another few years for Garry to update the forums again.[/QUOTE] [url=http://facepunch.com/showthread.php?t=1465833]Robotboy is making a lot of miscellaneous improvements.[/url]
does this shape look vaguely fascists? (It is not supposed to) [thumb]http://i.imgur.com/6xYYDod.png[/thumb] Agree: yes Disagree: no It's a central part of the game so players will see it a lot.
[QUOTE=polkm;47745641]does this shape look vaguely fascists? (It is not supposed to) [thumb]http://i.imgur.com/6xYYDod.png[/thumb] Agree: yes Disagree: no It's a central part of the game so players will see it a lot.[/QUOTE] My eyes and brain certainly find it worse than Hitler. I mean, that's a huge optical illusion dude.
I'm having a really hard time reading it period to be honest.
Does this effect help with the fuckyness? I know it still looks off, but can you tell what 3d shape it is? [IMG]http://i.imgur.com/EhRrFp2.png[/IMG]
I doubt anyone is going to complain if you need to rotate three of the ends to make it a swastika.
[QUOTE=polkm;47745799]Does this effect help with the fuckyness? I know it still looks off, but can you tell what 3d shape it is? [IMG]http://i.imgur.com/EhRrFp2.png[/IMG][/QUOTE] It looks like four staircases facing to the upper left and right corners of the screen
I miss making games.
[QUOTE=TrafficMan;47745837]It looks like four staircases facing to the upper left and right corners of the screen[/QUOTE] The shadow to the right doesn't really seem to match the shape. If there's an inward corner throwing it there it should reflect that in the flat "top" surface.
[QUOTE=geel9;47745853]I miss making games.[/QUOTE] then make a game
[QUOTE=polkm;47745799]Does this effect help with the fuckyness? I know it still looks off, but can you tell what 3d shape it is? [IMG]http://i.imgur.com/EhRrFp2.png[/IMG][/QUOTE] I can certainly tell what it looks like, but perhaps instead of culling all of those edges off, instead give them some transparency or something.
[QUOTE=polkm;47745641]does this shape look vaguely fascists? (It is not supposed to) [thumb]http://i.imgur.com/6xYYDod.png[/thumb] Agree: yes Disagree: no It's a central part of the game so players will see it a lot.[/QUOTE] [img]http://i.imgur.com/hIYhEDN.png[/img] Fix the artifacts [editline]17th May 2015[/editline] Make the occluded walls start opaque at the bottom, then fade out to the middle
[QUOTE=Garb;47746119]then make a game[/QUOTE] I don't really have time for hobbies so much anymore
For people who've done hourly contract work... How do you guys keep track of your hours? I've made an excel document with the hours I've worked times the rate they hired me for, but how do I know in good faith that I'm billing them correctly? Because I know there are some people who could write what I do in half the time and more efficiently. Do I go by what actually happened or do I cut my hours back to seem like the other guys?
[QUOTE=blacksam;47746642]For people who've done hourly contract work... How do you guys keep track of your hours? [/QUOTE] I've made a simple winform that calculates the time my IDE is open and while i'm writing things in it. Then rounding the time like: if worked for 1h15, i charge for 2 hours.
[QUOTE=Ott;47746323][img]http://i.imgur.com/hIYhEDN.png[/img] Fix the artifacts [editline]17th May 2015[/editline] Make the occluded walls start opaque at the bottom, then fade out to the middle[/QUOTE] Yeah I'll get around to the shadow artifact, and the line artifact is a mystery to me. Its pretty spooky. I think making the culled bits of wall transparent would be difficult because each little bit would have to be its own depth sorted object, which is not impossible but it would be difficult to do, hence the hard cull. What do you think of these ideas. Agree for the first, disagree for second, dumb for neither [IMG]http://i.imgur.com/gy6CSlp.png[/IMG] [thumb]http://i.imgur.com/iyBtBLh.png[/thumb] the second one shows a different shape but yeah ignore that.
By the way your game looks really fucking awesome regardless. It's [i]extremely[/i] pleasant.
Polkm, that looks fucking [I][B][U]RAD.[/U][/B][/I] Also on a side-note I have made GREAT progress. The old ALU from my virtual processor project, which only supported [B]Add[/B] and, well that's it actually. [T]http://i.imgur.com/dDlBHFM.png[/T] For comparison here is my new and impressive multifunction ALU, which will support all the basic integer arithmetic, bitwise and shift operations. It will have an embedded barrelshifter for n-bit shifts. I mean just [B]look[/B] at my progress: [T]http://i.imgur.com/xewjJG2.png[/T] For those wanting the specs, it's a dual-input ALU with 16-bit parallel buses. Current plan is for the opcode bus to be taking up around 6 bits, but I will likely make it 8 bits to make it fit in with the overall design better. The status in is really just a fancy way of saying "carry in".
[img]http://i.imgur.com/Oltd6sG.gif[/img] spent today improving level transitions, adjacent levels are now loaded in advance on a separate thread so moving into another level has zero delay
I've been learning how to use Git more effectively. [IMG]http://i.imgur.com/q1ZWmQ8.png[/IMG]
Thanks guys about the feedback, I am seriously reconsidering the options now. But I will work in summer for that pay anyway, so I still got time to decide :v:. [QUOTE=geel9;47746546]I don't really have time for hobbies so much anymore[/QUOTE] [video=youtube;1uszErQbnmc]https://www.youtube.com/watch?v=1uszErQbnmc[/video]
I know it's not much, but here's the start of something I'm working on: [unity]http://andrewault.me/space/Build.unity3d[/unity] it's my first unity project and my first time using c#, but I think I'm starting to get the hang of it!
Nothing terribly interesting. Just had a random idea for memoizing naive weighted probabilities. So as I'm sure most of you know, the naive solution to calculating weighted probabilities can be done in a flavor similar to this: [code]let Elements be a list of (Object,Weight) pairs Init: Max = 0 for each P in Elements: Max += P.Weight Choose: X = random(0,Max) for each P in Elements: X -= P.Weight if (X < 0): return P.Object return null[/code] It's a straightforward enough solution, and is pretty space-compact. Its issue is scalability, though: every time you call choose, it performs a linear scan through every single element in Elements until it finds what it is looking for. My idea of memoizing such an implementation was pretty straightforward: create a secondary "lookup" list that is split into k elements. The Spacing between each element in k is equal to Step = Max/k, floored. Then you populate lookup with the indices into Element for each Step-th weight. Init will look something like this: [code]Init: Max = 0 for each P in Elements: Max += P.Weight Step = Max / k Cur = 0 Interval = 0 for each P in Elements: Cur += P.Weight if Cur > Step Cur -= Step Lookup[Interval] = Index of P Interval++[/code] Then, you modify Choose such that it first finds the largest Interval such that (Step * Interval) is smaller than X, but (Step * (Interval+1)) is bigger than X. This should simply be X / Step. You then decrement X by (Step * Interval), and then start looping through Elements at index Lookup[Interval]. Choose then looks something like: [code]Choose: X = random(0,Max) Interval = X / Step StartIndex = Lookup[Interval] X -= (Step * Interval) for i from StartIndex to Elements.Length: P = Elements[i] X -= P.Weight if (X < 0): return P.Object return null[/code] I wrote a concrete implementation of both of these (the naive, and my memoized version) in C#. I would share the code, but it's pretty sloppy, without checks, and rife with off-by-one errors. However, while the numbers are off, the technique itself I am convinced is sound. Here are some interesting statistics, each trial run 4 times and then averaged on my computer. For each trial, 10000 elements were generated, each with a weight between 1 and 100, and then 500000 selections were called. These timings were started with initialization and ended after the pickings, so they include construction overhead (which is, admittedly, fairly minimal) [b]Naive:[/b] 17300ms [b]Memoized, 1 section[/b]: 17900ms (It's actually a bit slower, due to overhead. No surprise). [b]Memoized, 4 sections[/b]: 3400ms [b]Memoized, 16 sections[/b]: 1180ms [b]Memoized, 64 sections[/b]: 310ms [b]Memoized, 256 sections[/b]: 106ms [b]Memoized, 768 sections[/b]: 59ms Unsurprisingly, the running time is inversely related to the size of the sections, though the overhead does start to take effect once the number of sections begins to exceed 1/20th the total elements in the list. As a final test, I also did a run of 1,000,000 elements and 50,000,000 picks, using both the naive solution and 4096 sections in the memoized version. I didn't want to make an array bigger than 4k in size, though compared to a list of 1,000,000 elements I suppose that's a drop in the bucket. When it took over a minute for the naive function to even reach 50,000 picks (memoized finished in 25 seconds), I decided to revise my timing function, and instead see how many times each could choose in 15 seconds. Here are the results for that: [b]Naive; 1,000,000 elements; 15 seconds:[/b] 4285 selections [b]Memoized; 1,000,000 elements; 4096 sections; 15 seconds:[/b] 2,922,298 selections So yeah. Like I said. It's nothing terribly interesting. But it was just a random idea I had, and I wanted to test it out. And hey, I had fun doing it.
I can't sleep, so I figured I'd post this: Some really horrible stuff is happening in my life right now. I'm not going into specifics, but I have been experiencing overwhelming anxiety that has turned into significantly more serious issues. I probably won't be programming for a while. I feel bad because I was really looking forward to making the next release of Rant something awesome to show you guys. It looks like I can't make that happen anymore. Life has a tendency to fuck people over at the worst possible times. I wanted to spend this summer making cool stuff, not battling mental illness. So that's what's going on. I'll still be reading this thread, because you guys make awesome stuff and it cheers me up a little on my worst days. But in my current state, I just can't do any work. If my life situation gets better, I can hopefully get back to my projects. But I don't see that happening anytime soon. I am sorry.
[QUOTE=geel9;47746546]I don't really have time for hobbies so much anymore[/QUOTE] In the time it took you to write this whining, you could have made 10 levels! Democracy was a terrible idea.
Sorry, you need to Log In to post a reply to this thread.