Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 31 Jan 2009
Offline Last Active Private

#5312376 Why C# all of a sudden?

Posted by on 25 September 2016 - 01:11 AM

For 20 years C++ was the recommended standard language, especially in the gaming industry. Mostly because it is fast and powerful, inheriting most programming language standards you can possibly think of.

Game and engine development have diverged for a while and the breach is only getting larger over time. Neither AAA nor indie studios build their own engines anymore, that job is now left to middleware developers. All that performance you're talking about needs to be done on the engine side of things, while game developers now instead focus on the higher level stuff - and that can be done with languages that aren't as close to the metal as C++.

It also says something about how complex the game industry has gotten now.

#5309765 Why didn't somebody tell me?

Posted by on 07 September 2016 - 02:53 AM

Consistency? Pretty much every program will let Ctrl+C work as long as anything is selected, that's just how the clipboard works. If anything, Visual Studio is letting you to work around that =O)


EDIT: wait, are you talking about like when you select a blank line and accidentally copy it, or literally when absolutely nothing is selected? If the latter then yeah that's horribly dumb...

#5306945 Fast way to cast int to float!

Posted by on 20 August 2016 - 08:10 PM

In somewhat related news, today a coworker said two words that were never meant to go together: "Enterprise JavaScript". With systems like node.js being more popular we are seeing the rise of abominations that should have been killed on sight, without mercy. I told him I did not accept "Enterprise JavaScript" could possibly be a thing in a reality I participate in.



"Enterprise HTML5" has also been mentioned in that thread.

#5306516 When you realize how dumb a bug is...

Posted by on 18 August 2016 - 05:26 AM


Why do I keep getting all the weird tool bugs?
You're too deadly for normal bugs, so they went to plan B, and attack you indirectly by hiding in tools.


Considering how once I got a game to travel backwards in time by pausing it, I think you probably aren't too far off from the truth.

#5306342 GUI Objects

Posted by on 17 August 2016 - 06:57 AM

Yeah, you need to do these things:

  1. Not use the depth buffer
  2. Use a different projection matrix (2D instead of 3D)
  3. Render it after the 3D scene (so it's on top of it)

That's the simplest way to render UI elements. And of course undo all that when you start rendering 3D again the next frame!

#5306105 When you realize how dumb a bug is...

Posted by on 16 August 2016 - 01:40 AM

Had a sound engine spazzing out because it turns out the last byte of the stream data got trimmed out somehow. It required three tools and the memory layout to align just right (wrong?) for this to happen.


Why do I keep getting all the weird tool bugs?

#5302826 When Tertiary Operators Become Confusing

Posted by on 27 July 2016 - 04:56 PM

Yeah, the example replacement in the first post is not that great because it's actually adding more stuff (and indeed adding enough to be way too much for the ternary operator to stay readable).


That said, if it was up to me I'd do:

move_speed = normal_speed;
if (running)
   move_speed *= run_speed;

I'm lame =P

#5302711 Why didn't somebody tell me?

Posted by on 26 July 2016 - 11:52 PM

I always thought the saying was "Disaster adverted" until I looked up the definition of adverted... It is "Disaster averted". =(

Disaster advertised.

#5302710 When you realize how dumb a bug is...

Posted by on 26 July 2016 - 11:49 PM

This is why I put indenting and // before the quotes and not inside them. (surprised the link stage didn't complain though? is that OK?)

#5301641 When you realize how dumb a bug is...

Posted by on 20 July 2016 - 05:07 PM

C++ allows overriding your parent's privates.

I'm having a hard time reading this with a straight face.

#5301506 Why didn't somebody tell me?

Posted by on 20 July 2016 - 05:24 AM

The bbq in omgwtfbbq stands for "be back quick", not for "barbacue". Apparently I ruined the day for several people already by revealing this.

#5301504 When you realize how dumb a bug is...

Posted by on 20 July 2016 - 05:18 AM

Wasted an entire day wondering why the heck graphics weren't being loaded. I examine RAM, the data is there. I look at the code in a debugger and it's indeed executing in the subroutines it should. I look at the code that sends the commands to the video hardware, pointers are OK, then I step and the loop is running, yet somehow the video hardware is ignoring them... wait a second, did an instruction just get misassembled?



cmp.l a4, a5


cmpm.l (a4)+, (a5)+

Huuuuh not only it got converted to the wrong instruction (CMPM instead of CMPA), where did the assembler get the idea of adding postincrement?

#5296198 Why didn't somebody tell me?

Posted by on 12 June 2016 - 05:34 AM


Is this some GNU extension or actually part of the standard? o_O


EDIT: it's in C99, but not C++... https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Designated-Inits.html

#5293109 Some people just want to watch the world burn

Posted by on 23 May 2016 - 02:38 PM

I'm open to hearing about why it's insidious, but have yet to hear a good reason.

That the -> operator is actually a thing and I had to stop and think to figure out how it was supposed to be parsed (because I kept seeing - -> instead of -- >). You definitely don't want to slow down people like that, especially not during crunch period. (and yes, this is all a matter of where whitespace goes, the operation itself is fine)


Also I can attest to the string thing, I swear. I reduced loading times from 4-5 seconds to a fraction of a second just by computing a "quickhash" of each string (just add every character) when the list was first generated, then when it searched for a string it'd compare the quickhash first. Turns out that a lot of filenames differed only in their suffix (e.g. run_1, run_2, run_3, and so on - yeah, talking about animations here). A naïve comparison would have to scan practically the whole strings before failing, but the quickhash made them fail immediately. That the quickhash was stored alongside the pointer (and hence didn't need an extra dereference) probably also helped regarding the cache.


Obviously only useful for things like lists where you compute the quickhash of those strings only once then reuse it over and over, but it's definitely worth it even though it's quite simple to implement.

#5292868 Some people just want to watch the world burn

Posted by on 22 May 2016 - 08:55 AM



That's all I'm gonna say.