As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

PA Programming Thread :: PAdev.net - Need hosting for a service of yours? Check it out.

13567100

Posts

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Pfft. To do a dN just treat each rolled dice as one digit of a base-6 number and roll dice based on how many digits base-6 N has. If you end up with a greater value, just reroll! It's perfect!

  • Options
    InfidelInfidel Heretic Registered User regular
    Perfectly insane.

    Phyphor, ladies and gentlemen!

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    Most of us are I think.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    InfidelInfidel Heretic Registered User regular
    If your brain ain't fucked you ain't cut out for coding!

    OrokosPA.png
  • Options
    jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    "Programming you don't have to be insane but it... hell fuck shit why isn't this compiling!"

  • Options
    bowenbowen How you doin'? Registered User regular
    Some of the best coders have a touch of OCD. I know when something doesn't compile, even if it isn't correct in what it's spewing out, I will sit there for hours getting it to work. This annoys me when it's say 4:30.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    InfidelInfidel Heretic Registered User regular
    The "I'm a little OCD" stylings, which if inaccurate, are still a pretty common trait and useful yeah.

    True OCD I can tell you doesn't really help all that much. :(
    OCD isn't being organized or detail-oriented.

    OrokosPA.png
  • Options
    IncindiumIncindium Registered User regular
    edited September 2011
    Yeah... I got stuck a couple hours yesterday trying to figure out why a UnhandledExceptionHandler in a service wasn't logging everything it should to the event log. I had to make myself stop because I wasting time on a tangential issue and not fixing the bug I had introduced that was causing the exception in the first place(Since I already knew why the exception was happening that wasn't triggering my OCD tendencies).

    Incindium on
    steam_sig.png
    Nintendo ID: Incindium
    PSN: IncindiumX
  • Options
    bowenbowen How you doin'? Registered User regular
    edited September 2011
    OCPD I think is the more correct term, though I try not to be too OCD about it.

    Edit: :rotate:

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    InfidelInfidel Heretic Registered User regular
    Yep, it's a pet peeve of mine because everyone just uses "OCD" as a term and incorrectly too usually.

    I have OCPD tendencies too not surprisingly which are probably helpful in my work! And also why I sometimes sit working on a side project for hours until 4am etc.

    IN THE ZOOOOONE MANNNN.

    OCD is just a pain in the ass. It sucks having an inner dialogue that you have to constantly ignore or risk losing jobs and friends.

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    The OCPD is strong in that one.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    SaerisSaeris Borb Enthusiast flapflapflapflapRegistered User regular
    OCPD is what people usually mean when they say OCD. The two are actually quite distinct conditions, although the comorbidity rate is not insignificant.

    (OCPD is the one closer to being more of a boon than a bane.)

    borb_sig.png
  • Options
    Jimmy KingJimmy King Registered User regular
    I both love and hate reading about personality disorders. It's always really interesting. I have so many of them (have had some tests done by actual psychiatrists for the craziest one, not just reading symptoms myself and checking a list). They are the things that make me so socially awkward and stressed out most of the time, yet totally awesome in the right situations.

  • Options
    InfidelInfidel Heretic Registered User regular
    It would be awesome if I could find something productive for OCD but everything pretty much is inherently counter-productive. :P

    My other issues though, man, good times! Well, maybe.

    OrokosPA.png
  • Options
    Lux782Lux782 Registered User regular
    Infidel wrote:
    First off, rounding is not how you test for equal floating point values, you check the difference is within a small range (an epsilon).

    x = 0 at 90 and 270 degrees, not just 90.

    Possibly more issues dunno that was just looking quick.

    I know. Thats why I noted that I had not gotten to some special cases because TDD hasn't gotten me to that point yet. I'll try working with an epsilon for my tests to see how that works out.


    Infidel wrote:
    ...
    There's something deeper, but I can't seem to find it. 6 degrees is just over 0.1 radians - which is just far too large for rounding error using doubles.

    Yeah. I am taking a look at it again now. Thus far nothing really sticks out.

  • Options
    InfidelInfidel Heretic Registered User regular
    Lux782 wrote:
    Infidel wrote:
    First off, rounding is not how you test for equal floating point values, you check the difference is within a small range (an epsilon).

    x = 0 at 90 and 270 degrees, not just 90.

    Possibly more issues dunno that was just looking quick.

    I know. Thats why I noted that I had not gotten to some special cases because TDD hasn't gotten me to that point yet. I'll try working with an epsilon for my tests to see how that works out.


    Infidel wrote:
    ...
    There's something deeper, but I can't seem to find it. 6 degrees is just over 0.1 radians - which is just far too large for rounding error using doubles.

    Yeah. I am taking a look at it again now. Thus far nothing really sticks out.

    There are some calculations we don't even have in your code, let alone the step by step values. Can you provide for 225 case?

    OrokosPA.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Lux782 wrote:
    Infidel wrote:
    First off, rounding is not how you test for equal floating point values, you check the difference is within a small range (an epsilon).

    x = 0 at 90 and 270 degrees, not just 90.

    Possibly more issues dunno that was just looking quick.

    I know. Thats why I noted that I had not gotten to some special cases because TDD hasn't gotten me to that point yet. I'll try working with an epsilon for my tests to see how that works out.


    Infidel wrote:
    ...
    There's something deeper, but I can't seem to find it. 6 degrees is just over 0.1 radians - which is just far too large for rounding error using doubles.

    Yeah. I am taking a look at it again now. Thus far nothing really sticks out.

    Why are you using hyperbolic tangent?

  • Options
    InfidelInfidel Heretic Registered User regular
    Phyphor wrote:
    Why are you using hyperbolic tangent?

    Hahahahahaaha. Good catch.

    Also Phyphor, I will be recruiting you to test the security/breakability of a future game.

    OrokosPA.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Sure! That's always fun

  • Options
    Lux782Lux782 Registered User regular
    Infidel wrote:
    ...

    There's something deeper, but I can't seem to find it. 6 degrees is just over 0.1 radians - which is just far too large for rounding error using doubles.
    Infidel wrote:
    Phyphor wrote:
    Why are you using hyperbolic tangent?

    Hahahahahaaha. Good catch.

    Also Phyphor, I will be recruiting you to test the security/breakability of a future game.

    Good question. This has been fixed and now things work as expected.

  • Options
    EtheaEthea Registered User regular
    MPI is a silly goose when it comes to file reading and load balancing the file contents. Makes it even worse when the code is going to be run on anything from real clusters to workstations.

  • Options
    bowenbowen How you doin'? Registered User regular
    I take it MPI is a clustering thing. It sounds familiar.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited September 2011
    Wait... that actually works for most of your tests?

    You're calculating (for θ = y/x in 0...pi) angle = tan(θ) (which is simply sin(θ) / cos(θ)) and then x = cos(angle), y = sin(angle)

    But this is x = cos(sin(y/x) / cos(y/x) which I don't think is what you want...

    You want atan2 which, given an x,y vector returns the angle to get it

    Phyphor on
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Phyphor wrote:
    Why are you using hyperbolic tangent?

    Haha

    Oh man

    10 Points for Gryphyphor!

    Penny Arcade Developers at PADev.net.
  • Options
    Lux782Lux782 Registered User regular
    edited September 2011
    Phyphor wrote:
    Wait... that actually works for most of your tests?

    You're calculating (for θ = y/x in 0...pi) angle = tan(θ) (which is simply sin(θ) / cos(θ)) and then x = cos(angle), y = sin(angle)

    But this is x = cos(sin(y/x) / cos(y/x) which I don't think is what you want...

    You want atan2 which, given an x,y vector returns the angle to get it

    I use Math.Atan(y / x) which gives me the angle in radians (assuming I handle some special cases). Ill see what Math.Atan2 does, might remove those special cases.

    Here it is as of now.
    		public static UnitVector FromComponent(double x, double y) {
    			if (x == 0 && y > 0)
    				return FromAngle(Angle.FromDegrees(90));
    			
    			if (x == 0 && y < 0)
    				return FromAngle(Angle.FromDegrees(270));
    			
    			if (x < 0)
    				return FromAngle(Angle.FromRadians(Math.PI + Math.Atan(y / x)));
    			
    			return FromAngle(Angle.FromRadians(Math.Atan(y / x)));
    		}
    

    This makes all my tests pass as of right now but if I can remove those pesky cases that would make me a billion times happier.

    Edit: Just tried it and Atan2 takes care of the special cases. Its now
    		public static UnitVector FromComponent(double x, double y) {
    			return FromAngle(Angle.FromRadians(Math.Atan2(y, x)));
    		}
    

    Lux782 on
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Ah, you changed tanh to atan. That will work. atan2 removes basically all of the special cases, handles x = 0 and all quadrants

  • Options
    EtheaEthea Registered User regular
    bowen wrote:
    I take it MPI is a clustering thing. It sounds familiar.

    MPI is the classic interface for communication of large clusters see http://en.wikipedia.org/wiki/Message_Passing_Interface.
    Personally I can't wait to see what exaByte clusters use for communication since straight MPI won't cut it.

  • Options
    bowenbowen How you doin'? Registered User regular
    I would really like to develop something using clustering someday, I think that'd be fun, and potentially aggravating.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    EtheaEthea Registered User regular
    bowen wrote:
    I would really like to develop something using clustering someday, I think that'd be fun, and potentially aggravating.

    MPI is really a C API so it is really annoying when you want to transmit anything that isn't a flat array. For a fun project I would use google protocol buffers as the message passing interface as you can serialize full classes.

  • Options
    InfidelInfidel Heretic Registered User regular
    What Phyphor is basically saying is that atan2 is what you are trying to write in FromComponent. :lol:

    But letting you handle things yourself using atan, you are closer to the mark.

    You'll get a divide by zero error in a special case, QUICK WHICH IS IT?

    OrokosPA.png
  • Options
    CantidoCantido Registered User regular
    edited September 2011
    * delete, nvm found a solution.*

    Cantido on
    3DS Friendcode 5413-1311-3767
  • Options
    Lux782Lux782 Registered User regular
    Infidel wrote:
    What Phyphor is basically saying is that atan2 is what you are trying to write in FromComponent. :lol:

    But letting you handle things yourself using atan, you are closer to the mark.

    You'll get a divide by zero error in a special case, QUICK WHICH IS IT?

    You wont get a divide by zero with doubles, the result is Infinity. I am using Math.Atan2 as it takes care of the mess I had previously using Math.Atan.

  • Options
    zeenyzeeny Registered User regular
    jackal wrote:
    "Programming you don't have to be insane but it... hell fuck shit why isn't this compiling!"

    My equivalent to that is coming back to that beautiful, glorious idea from 5 days ago that makes bytecode spit rainbows, taking one look, thinking for 30 seconds and saying "Why the fuck did I spend 3 hours on that when I could have simply done X?"...but at the time....IT FELT SO RIGHT.

  • Options
    InfidelInfidel Heretic Registered User regular
    edited September 2011
    Lux782 wrote:
    Infidel wrote:
    What Phyphor is basically saying is that atan2 is what you are trying to write in FromComponent. :lol:

    But letting you handle things yourself using atan, you are closer to the mark.

    You'll get a divide by zero error in a special case, QUICK WHICH IS IT?

    You wont get a divide by zero with doubles, the result is Infinity. I am using Math.Atan2 as it takes care of the mess I had previously using Math.Atan.

    Oh hey cool, you're using C# right?

    edit: Hrm, looking further it seems like atan has been handling that correctly for a long time in other languages too. Why am I remembering having to handle that differently?

    Maybe I had a broken standard library. Or my memory fails me. :)

    Infidel on
    OrokosPA.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    C does as well, exceptions are only generated if requested and atan2 handles 0,0

  • Options
    InfidelInfidel Heretic Registered User regular
    I think this may be related to DJGPP game I did yeeeeeears ago involving trig. (BOMB clone :D)

    Thinking about it, I believe it is because I converted things to fixed point integer math to replace all my floating point calculations and was using SIN tables and shit, so NEVERMIND.

    OrokosPA.png
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Infidel wrote:
    I think this may be related to DJGPP game I did yeeeeeears ago involving trig. (BOMB clone :D)

    Thinking about it, I believe it is because I converted things to fixed point integer math to replace all my floating point calculations and was using SIN tables and shit, so NEVERMIND.

    Sin tables, eh?

    30 degrees => Missionary mapping?

    Penny Arcade Developers at PADev.net.
  • Options
    KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Ethea wrote:
    bowen wrote:
    I would really like to develop something using clustering someday, I think that'd be fun, and potentially aggravating.

    MPI is really a C Fortran API so it is really annoying when you want to transmit anything that isn't a flat array. For a fun project I would use google protocol buffers as the message passing interface as you can serialize full classes.

    Fixed that for you. :)

    And short of custom binary serialization where we're not even unpacking the message and using bitmasks to decode the contents, GPB is the fastest I've used.

  • Options
    ASimPersonASimPerson Cold... and hard.Registered User regular
    Infidel wrote:
    I think this may be related to DJGPP game I did yeeeeeears ago involving trig. (BOMB clone :D)

    Thinking about it, I believe it is because I converted things to fixed point integer math to replace all my floating point calculations and was using SIN tables and shit, so NEVERMIND.

    Sin tables, eh?

    30 degrees => Missionary mapping?

    Oh wow.

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited September 2011
    Anyone here ever dick around with stuff like Phantom OS or http://en.wikipedia.org/wiki/Microsoft_Singularity ?

    This kind of stuff is fascinating to me. I think it would be so cool to have a whole new technology stack based on something other than UNIX.

    Jasconius on
This discussion has been closed.