1. Post #2881
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    Hmm, ok, I'll look into something like that. Right now I'm trying to sort out the discrepancy in performance between the C# and C++ versions (C# one is faster).
    If you want to paste code, I'll be glad to check it out.
    Reply With Quote Edit / Delete Linux Australia Show Events

  2. Post #2882
    NovembrDobby's Avatar
    April 2007
    1,152 Posts
    Do you really want to sift through 18k lines of terrible code and work out where the bottlenecks are?
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  3. Post #2883
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    Do you really want to sift through 18k lines of terrible code and work out where the bottlenecks are?
    You have no idea where the bottlenecks may be? Haven't you profiled your code?
    Reply With Quote Edit / Delete Linux Australia Show Events

  4. Post #2884
    NovembrDobby's Avatar
    April 2007
    1,152 Posts
    You have no idea where the bottlenecks may be? Haven't you profiled your code?
    That's the point, it's what I'm doing now.
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  5. Post #2885
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    Oh, I thought this was a specific thing to do with the name GUI code, rather than the entire game.
    Reply With Quote Edit / Delete Linux Australia Show Events Informative Informative x 1 (list)

  6. Post #2886
    Gold Member
    Darwin226's Avatar
    January 2009
    4,145 Posts
    Oh, I thought this was a specific thing to do with the name GUI code, rather than the entire game.
    You just can't stand the idea that a C# program outperforms a C++ one :D
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Zing Zing x 14Optimistic Optimistic x 1 (list)

  7. Post #2887
    Gold Member

    November 2011
    45 Posts
    You just can't stand the idea that a C# program outperforms a C++ one :D
    All it means is that the c++ implementation is bad. C# cannot outperform the equivalent c++ application...
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 6Agree Agree x 2Disagree Disagree x 1 (list)

  8. Post #2888
    NovembrDobby's Avatar
    April 2007
    1,152 Posts
    All it means is that the c++ implementation is bad.
    I'd be the first to agree with this. I am getting better at it though :3
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Winner Winner x 3 (list)

  9. Post #2889
    May I ask you where the fuck the initial light comes from? :confuzzled:
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Agree Agree x 3 (list)

  10. Post #2890
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    You just can't stand the idea that a C# program outperforms a C++ one :D
    It's one of the few things that makes me toss and turn at night and ruin relationships.
    Reply With Quote Edit / Delete Linux Australia Show Events Funny Funny x 10 (list)

  11. Post #2891
    www.bff-hab.de
    Dennab
    February 2009
    7,832 Posts


    Now onto reflection and refraction


    It's all bugged :(
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 5Disagree Disagree x 5Late Late x 2Funny Funny x 1 (list)

  12. Post #2892
    Gold Member
    Robbis_1's Avatar
    July 2005
    344 Posts
    May I ask you where the fuck the initial light comes from? :confuzzled:
    Yeah I was confused at first, but then I understood how it worked.


    Edited:



    It's all bugged :(
    Looks correct for me.. You only moved the light source to be at the bottom facing up.

    Look:
    Reply With Quote Edit / Delete Windows Vista Sweden Show Events Informative Informative x 1 (list)

  13. Post #2893
    sim642's Avatar
    July 2010
    1,039 Posts
    Looks correct for me.. You only moved the light source to be at the bottom facing up.

    Look:
    If it was correct then why would there be light inside the squares?
    Reply With Quote Edit / Delete Windows Vista Estonia Show Events Dumb Dumb x 2Agree Agree x 1 (list)

  14. Post #2894
    Follow me on GitHub!
    Ziks's Avatar
    June 2011
    2,099 Posts
    If it was correct then why would there be light inside the squares?
    When the squares are filled in everything is correct. For squares I only clip along the diagonal or closest face.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 2 (list)

  15. Post #2895
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    By any chance does anyone know if strings that you push to the Lua stack are copies of whatever you pass or not, and if you're passing a new char will Lua clean up that up for you?

    I get the feeling they're not copies.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #2896
    Follow me on GitHub!
    Ziks's Avatar
    June 2011
    2,099 Posts
    Last picture before I go back into hiding:

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Artistic Artistic x 7Programming King Programming King x 1 (list)

  17. Post #2897
    alexaz's Avatar
    October 2010
    294 Posts

    DAT BUTTON
    Reply With Quote Edit / Delete Windows 7 Lithuania Show Events Programming King Programming King x 16Funny Funny x 2Winner Winner x 1Agree Agree x 1 (list)

  18. Post #2898
    Gold Member
    Darwin226's Avatar
    January 2009
    4,145 Posts
    All it means is that the c++ implementation is bad. C# cannot outperform the equivalent c++ application...
    Why?
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 1 (list)

  19. Post #2899
    Gold Member
    vexx21322's Avatar
    December 2008
    10,618 Posts

    DAT BUTTON

    Heh, I'm not the only one that rants to myself through code.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 17Agree Agree x 4 (list)

  20. Post #2900
    alexaz's Avatar
    October 2010
    294 Posts

    Heh, I'm not the only one that rants to myself through code.
    Oh, seems like i forgot about that.
    Reply With Quote Edit / Delete Windows 7 Lithuania Show Events Funny Funny x 19 (list)

  21. Post #2901
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 1 (list)

  22. Post #2902
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,067 Posts


    Blooooood!
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Artistic Artistic x 3Funny Funny x 1 (list)

  23. Post #2903
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    I did a bunch of work on my netbook and committed and ran push before realizing that a) I hadn't pulled on this machine in over a month and b) I was on a branch I merged into master two weeks ago.
    So I did what any idiot would do and panic merged.
    To the wrong branch again.
    I've spent the past 2 hours learning how to defuck both my local and remote repos.

    On the bright side I also learned about __git_ps1, which should hopefully stop this happening again.
    Reply With Quote Edit / Delete United Kingdom Show Events Funny Funny x 1Friendly Friendly x 1 (list)

  24. Post #2904
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,067 Posts


    Shit, so many enemies!
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #2905
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    I did a bunch of work on my netbook and committed and ran push before realizing that a) I hadn't pulled on this machine in over a month and b) I was on a branch I merged into master two weeks ago.
    So I did what any idiot would do and panic merged.
    To the wrong branch again.
    I've spent the past 2 hours learning how to defuck both my local and remote repos.

    On the bright side I also learned about __git_ps1, which should hopefully stop this happening again.
    Did a similar thing. Went and coded on my laptop which was about 1-2 weeks out of date, realized it, figured "Oh it'll be easy to merge!". Got back and went to merge it (after making sure the main was up to date) and then got fucked up when I tried to move the not-checked-in-project solution back over, and I was stuck with files existing but not being in the solution so it wouldn't compile.

    Took me a while to sort that one out, lesson learned.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  26. Post #2906
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts


    Blooooood!
    My scroll wheel scroll depth is just enough where if I scroll up and down, the grass doesn't move its relative position.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 16Informative Informative x 2Disagree Disagree x 1 (list)

  27. Post #2907
    AtomiCasd's Avatar
    June 2011
    588 Posts
    Does FP programming have an irc channel?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  28. Post #2908
    NovembrDobby's Avatar
    April 2007
    1,152 Posts
    Yeah, #fpcoders on GameSurge

    Edited:

    afaik it's not very popular though
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  29. Post #2909
    Gold Member

    November 2011
    45 Posts
    There's overhead in the runtime vm, the .net library, the garbage collector that cause .net applications to have a larger footprint in every way. Longer startup time, more memory usage, boxing-unboxing of simple types, runtime type information isn't free... These things are inherent to the system and cannot be avoided.

    .NET does have many advantages, the huge platform library enables rapid prototyping that is hard in C++ without knowledge of third party libraries. That doesn't make what I said before wrong.
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 6Agree Agree x 1 (list)

  30. Post #2910
    sim642's Avatar
    July 2010
    1,039 Posts
    Last picture before I go back into hiding:

    What happens when you reflect light so that it goes off multiple mirrors and from the last one back onto the first? Recursion?
    Reply With Quote Edit / Delete Windows Vista Estonia Show Events Agree Agree x 1 (list)

  31. Post #2911
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,695 Posts
    Does FP programming have an irc channel?
    We have a steam community group. There's usually around 10-15 people active at a time. Right now there's 23.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Friendly Friendly x 2Agree Agree x 1 (list)

  32. Post #2912
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    What happens when you reflect light so that it goes off multiple mirrors and from the last one back onto the first? Recursion?
    I know that's probably what would happen, but raises the question of what would happen in real life if you had two completely flat mirrors pointed directly at each other. From my understanding the light would slowly fade as it loses its energy on collision.
    Reply With Quote Edit / Delete Linux Australia Show Events

  33. Post #2913
    Gold Member
    Bran's Avatar
    November 2008
    1,331 Posts
    Finally finished all of my coursework for this online course. I really slacked off because I don't like working with Visual Basic, but I did learn a lot in the later assignments.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Winner Winner x 1 (list)

  34. Post #2914
    Gold Member

    November 2011
    45 Posts
    I know that's probably what would happen, but raises the question of what would happen in real life if you had two completely flat mirrors pointed directly at each other. From my understanding the light would slowly fade as it loses its energy on collision.
    The glass absorbs some of the light as well. I don't remember where I saw it, possibly a department store changing room, each level of reflection slowly became more green looking because of the color of the seemingly transparent glass.
    Reply With Quote Edit / Delete Windows XP United States Show Events Agree Agree x 3 (list)

  35. Post #2915
    Gold Member
    Chandler's Avatar
    February 2006
    1,406 Posts
    I've gone and cleaned up my previous TMP example so it's MUCH shorter (and a LOT easier to understand, if you're just getting started with SFINAE and TMP)

    I also didn't have to change a thing to get it to work in MSVC either! (If I had to make a hacky workaround, I might have had to hurt someone.)

    Here's the 'final' code (without the #if defined(_MSC_VER) #elif defined(__clang__) #endif stuff)

    I could probably come up with a better name than "combo" for the return_type and param_type type-dependent container. Like "dependent"

    Note that inline is defined to __forceinline for MSVC and __attribute__((always_inline)) for gcc and clang. (Luckily MSVC will inline these in this case, as I'm avoiding instances where it might not. Yeah I'm #define-ing a keyword, but I don't like how the standard doesn't have stricter rules on semantics of inline)

    My goals currently are to avoid any #define macros aside from those needed to get basic build and configuration information at compile time like compiler name, version, and which compiler we're using, as well as compiler and platform specific defines (little endian or big endian), or defines to make certain compiler specific keyword fall in line with the standard (such as the 'sealed' contextual keyword being exactly equivalent to the new 'final' specifier in msvc).

    With the code below working so well, I think I might actually be able to do it :D

    namespace bitwise {
    namespace detail {
    
    template <typename T, typename U> struct combo {
      typedef typename std::conditional<
        sizeof(T) == sizeof(U),
        T,
        void
      >::type return_type;
    
      typedef typename std::conditional<
        std::is_same<T, return_type>::value,
        T,
        U*
      >::type param_type;
    };
    
    template <typename T, bool is_msvc=compiler::msvc> class swap;
    
    /* gcc/clang */
    template <typename T> class swap<T, false> {
      typedef typename combo<T, uint64_t>::return_type qword;
      typedef typename combo<T, uint32_t>::return_type dword;
      typedef typename combo<T, uint16_t>::return_type word;
    
      typedef typename combo<T, uint64_t>::param_type qparam;
      typedef typename combo<T, uint32_t>::param_type dparam;
      typedef typename combo<T, uint16_t>::param_type wparam;
    
    public:
      static inline qword call(qparam val) { return __builtin_bswap64(val); }
      static inline dword call(dparam val) { return __builtin_bswap32(val); }
      static inline word call(wparam val) {
        return ((val & 0xFF00) >> 8) | ((val & 0x00FF) << 8);
      }
    };
    
    /* msvc */
    template <typename T> class swap<T, true> {
      typedef typename combo<T, uint64_t>::return_type qword;
      typedef typename combo<T, uint32_t>::return_type dword;
      typedef typename combo<T, uint16_t>::return_type word;
    
      typedef typename combo<T, uint64_t>::param_type qparam;
      typedef typename combo<T, uint32_t>::param_type dparam;
      typedef typename combo<T, uint16_t>::param_type wparam;
    
    public:
      static inline qword call(qparam val) { return _byteswap_uint64(val); }
      static inline dword call(dparam val) { return _byteswap_ulong(val); }
      static inline word call(wparam val) { return _byteswap_ushort(val); }
    
    };
    
    } /* namespace detail */
    
    template <typename T> inline T swap(T val) {
      static_assert(std::is_integral<T>::value, "Only integral types are allowed");
      return detail::swap<T>::call(val);
    }
    
    } /* namespace bitwise */
    

    Now I just need to write some tests to make sure I never break this
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #2916
    AtomiCasd's Avatar
    June 2011
    588 Posts
    I know that's probably what would happen, but raises the question of what would happen in real life if you had two completely flat mirrors pointed directly at each other. From my understanding the light would slowly fade as it loses its energy on collision.
    That's why you always have I = (...) * 0.98 to avoid unlimited loops, or have a max bounce limit.
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  37. Post #2917
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    m̶aỳ ha͢v̨e ȁ̢͂̈ͧ ͗ͭ̋̓ͬ̊͜v̂ͦĩͤͯͥ̒ͨr̷̃ͯͣ͌̈́͐u͑͒ͬ̀ͩ͏s̛͂͗͐̏̇͒ Lͧ̋ͩ̑ͩͣ̀̄̇ͧͮ͑̾̑ͥ̾͂͏͇̟̻̫͓̱̞̖̻͔̤̘͎̭̦̠̀ͅÉ̢͌ͣ̄̅̓ͪ̂ͨ͟͝ ͏͈̤̠͇͉̞͎̥͎̯͇̞͡ͅA͙̺̳̳͎̪̤͎̅͐ͥ͗̽͂̐ͬͧͯ̉̾̌̅͗ͯ́͢͠V͑̐̐ͪͨ͋ ͚̜̣̺̝̭̣̥̱͎̫͎͚̙̦ͬ͗͞ͅE̥̹̞̣̫̳͙̘͖͓̔̎̍́ͭ̈́̾ͥ̀̃ͭͬ͆ͨ̊͗͗̀͢ͅ ͓̭ ̶̗̤͇͍̩̺̍̆͐ͬ̌ͦͭͫͧ͑́͟͠͠Ñ̋̈́̔̄̓͗͛͑ͤ̚̕҉͚̝͕͙͇͘O͛̒̈́ͦͯ̾͐͌ ̷̟̪͚̟̘̹͕ͯ͢W̶̨̛̙̪̺̗̔̃͌͐͑͒͒ͦ͢͜ i͠n͝ ͜W̡i͝n͟d̡ows̕'͢ fo̴n̸t ́ren͢d̷e͜r̕ing̡
    I lost the link to that website, what is it?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #2918
    Zyx
    Guest 3855 is lost and can't find the park exit
    Zyx's Avatar
    February 2005
    2,831 Posts
    I lost the link to that website, what is it?
    http://textozor.com/zalgo-text/ maybe?
    Reply With Quote Edit / Delete Windows 7 Show Events Informative Informative x 1 (list)

  39. Post #2919
    Gold Member
    Robber's Avatar
    January 2006
    6,138 Posts
    I lost the link to that website, what is it?
    It's e̫̹̜̫͐̐̓͗͂́e̹̘ͩͦͤe̒͐ͣ́̚m̸̤̞̻͒͊͌o͈̤̗̻̽̇͊͝.͙͛̾̃̾n̒ͪ͂ ̪͈̤̻͛̃e̡̫͊̃̊̒̂̔ͭt̼̗̂͊ͭͮ͌͗̓͠ of course.
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Agree Agree x 2Useful Useful x 1 (list)

  40. Post #2920
    Follow me on GitHub!
    Ziks's Avatar
    June 2011
    2,099 Posts
    What happens when you reflect light so that it goes off multiple mirrors and from the last one back onto the first? Recursion?


       I had a safeguard against this that I turned off to get this error   
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 19Informative Informative x 1 (list)