Cool Stuff!, EAE 6320-001 GameEngII Game Engine Project, Game Dev Adventures!

Assignment 1: Project Setup and Simple Animation

NancyNewren_ExampleGame_01

This game is a simple triangle animation. The player need not do anything but enjoy the beautiful movement of this simple shape.

(Simple one-click download. Once downloaded, unzip, play the executable, enjoy!)

About the Project

This was a fun one to program. It was very straightforward and when it came time to do some math, I was excited! The object was to simply animate a triangle on screen using the given solution files and graphics project.

To animate the triangle I took the sin of time to give it a smooth vacillation. Sin’s limits are [-1,1] though, so to animate the color I essentially took the absolute value of sin and changed the value of the green between 0 and 1, as color is represented as rgba in [0,1]. Because I didn’t want to call a math library to do a simple absolute value, to calculate the abs(sin()) I used the mathematical definition of absolute value:

f(x) = x if x >=0
f(x) = -x if x<0

Thus in my code I have something like this:

absSin = sin >=0 ? sin : -1*sin;

Now this does give a sharp point to the animation, but I wasn’t interested in smoothness at every point along the graph and like the quick turnaround. However, if I had desired a smooth animation I would have halved the peak size and moved the graph above the x-axis (to get that [0,1] range) as follows:

moreDifferentSin = 0.5*sin(time) + 0.5;

Instead of moving the triangle around I decided to make it shrink and grow by multiplying the abs(sin(time)) to the position of x for all vertices. Since the middle vertex was already at (0,0), it remained in place. The result: continuous similar triangles of varying size and color.

I definitely struggled getting the project to build. But I learned quite a bit about setting up dependencies and building while doing it. I was even able to quickly help some classmates as their errors came up because pretty much everything I could do wrong, I did. But now I recognize the errors and know what to do for them. The class discussion boards were definitely helpful in resolving this, but especially the two hours I spent with the professor JP after posting two discussions myself finally got my build working. He did this late on a Saturday night and that is definitely going the extra mile.

I first built on my Windows 8 laptop, knowing that the project code was written for Windows 8+. However my classmate, Cornelia, also did a test for me of the project on Windows 7. His was a VM though and he didn’t get it working. JP asked me to test on my desktop and I found that it worked! I had already installed all the necessary programs and SDKs previously, but didn’t need to install anything else to get it working except the game itself. It was exciting to see it work on my Windows 7: for all configurations and all platforms (we’re using openGL and D3D). Now I don’t have to upgrade. Hooray! 😉

Working with the Graphics Project

We were given the entire solution minus the graphics project which we then had to add in to the rest of the solution and then add the appropriate references and dependencies to it and the projects that called its functions within their cpp files. I added Graphics as a reference to ExampleGame_, and Applications.

I did not add it to the Tools project however, even though Graphics is referenced by the ShaderBuilder files, because all references to Graphics were enums, which aren’t necessary to link. For example, in Tools/ShaderBuilder/cShaderBuilder.cpp it reads:

Graphics::ShaderTypes::eType shaderType = Graphics::ShaderTypes::Unknown;

Which references the Graphics library, but doesn’t call a function which is used in the cpp file, so it’s not necessary to add the reference.

Expectation of Class

Based on the class so far I expect to learn quite a bit about programming graphics. JP (my professor) was the first person to ever explain how to tell which way the triangles were wound in such a way that I completely understood and understood with confidence. I’ve also learned the difference between creating a solution build, and a building a project. I never understood why you would do one over the other before. (Essentially you build projects when you want to just build it and its dependencies. You build solutions to build everything in the solution, whether or not it is listed as a dependencies. This is especially helpful to know if you have projects that rely on the output of each other, but don’t need each other to build. I don’t think I’ve ever had a setup where this was true before, but it makes sense in large projects that you wouldn’t want to set dependencies on other projects just so they build together. The upside to this is if you change a part in one project you only need to build that project and whatever depends on it, and not anything else. In very large projects that can save a lot of time!) I’m definitely expecting to learn lots more C++ programming insights, visual studio shortcuts, and become a much more proficient programmer.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s