Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 28 Apr 2007
Offline Last Active Jun 29 2015 09:55 PM

Topics I've Started

Allocation of Money

20 May 2015 - 09:25 PM

For my current game project, I am saving money so I can pay for some freelance work. This is the first time I will be putting money into one of my projects and was wondering if anybody had advice on where to allocate funds.


What percentage was spent on art, animation, music, sounds and other assets?

What is a ballpark estimate for the cost of a single playable character animated in something like spriter?


I realize the numbers will vary greatly from game to game as well as how much polish I want to put on it but if somebody would be willing to share their experience with getting good freelance work, what pitfall to lookout for, and how to best spend my money it would be greatly appreciated. Thanks.

HLSL 5 to GLSL cross compiler

08 September 2014 - 03:11 PM

Right now I am working on a graphics engine for my next game. I have tried using Ogre in the past but it feels too outdated. In my over ambitious quest to make a cross platform and cross API graphics engine I have decided to make a HLSL to GLSL cross compiler. I know there is already a cross compiler for DX9 HLSL, but I want a cross compiler that works with DX11.


Its nowhere near being complete but I thought I would post a link to the repo if anybody was interested in helping or using the project.


The cross compiler is located under the subdirectory ShaderBunder/HLSLParser


If you would like to contribute to the project let me know

If you would like to use this let me know and let me know what features you need


It isn't ready for use yet, but I wanted to get some feedback to make sure I am not taking this in the wrong direction.


15 August 2014 - 02:59 PM

A friend of mine told me about an experience he had in one of his programming classes. I found it funny, so I thought I would share it here.

Programming joke of the day; this actually happened to me:

We have a little program we need to run on our code called "Checkstyle" that goes through our code to find anything stylistically wrong with it. If it doesn't pass check style, we can't get credit on it. Sometimes, it takes issue with stuff that really shouldn't (in my opinion) be an issue.

Today, it spat out a bunch of error messages telling me that some of my lines of code were more than 100 characters long. I said "Are you kidding me? We aren't allowed to have lines of code longer than 100 characters?"

A haughty T.A. passing by said "Of course. Checkstyle likes readable code. It's more professional."

A person sitting next to me said "Hey, if your line is too long, try taking out the 'space' characters between your operators and your operands. They aren't needed to compile anyway."

I said "Great Idea! That'll cut down the line size, which makes it more readable, right?"

Somebody else suggested "Are your variable names too long?"

I said "Yeah, probably. I'll global search and replace them into names that are only one character long. That should help too."

After looking at my code, I found that the issue was my error message. My error message was about 60 characters long, politely informing that the only legal strings allowed in the method are "heads" and "tails". I replaced the error message with a frowny face emoticon instead.

After putting the finishing touches on my code, I ran it through checkstyle. It passed. I got 102% on the lab. I'm so glad they gave me such a wonderful tool to make my code more professional and readable!

Along a similar vein, checkstyle doesn't like "magic numbers." In one lab, it told me that "4" was a magic number, and needed to be replaced. In class, somebody commented on it. "What is a magic number, and how do you avoid using them?"

The teacher said "A magic number is a number in the code that is there for no apparent reason, but makes the program work right. Typically, you should replace them with global variables. Like, can anybody tell me how to handle the magic number '4' in the first lab?"

I raised my hand.

"Well, '1' isn't considered a magic number, so just replace all instances of '4' with '(1+1+1+1)."

The entire class laughed. Including the teacher.

"Just in case you were wondering," he added, "that was not the right answer."

Weird Syntax Tricks

23 July 2014 - 02:04 PM

So I was looking to see if any languages supported overloading a function by return type and found this answer.

The bottom of the post contained this snippet of code that fakes overloading by return type in c++. 

struct func {
   operator string() { return "1";}
   operator int() { return 2; }

int main( ) {
   int x = func(); // calls int version
   string y = func(); // calls string version
   double d = func(); // calls int version
   cout << func() << endl; // calls int version
   func(); // calls neither

While I would never use this hack in a real project, it does make a fun exercise in understanding c++.


What other examples of strange language hacks do you know of?


28 June 2014 - 02:44 AM

I am working with directx for the first time in a a long time. I am working on generating input layouts and notices that DXGI_FORMAT_R8G8B8_UNORM doesn't exist.  R8, R8G8, and R8G8B8A all exist. For some reason R8G8B8 doesn't. Why is that? Why add support for 1, 2 and 4 normalized byte components but leave out support for 3? It seems like it is a common use case to have a RGB color stored as bytes, yet this is left out.