Assignment 01
Assignment 01
The beginning of this project was primarily focused on the setup.
The most important topics were: making sure that our references were correct, making sure that we correctly bring the Graphics project into the pre-made Solution as a static library (with the correct properties!), making sure that only files relevant to a particular build are built, and making sure that our Solution defaults to our Game Project.
There were two critical moments for me in this process where I'd made a mistake and needed to troubleshoot. The first was, when designating my .prop files and setting the Force Include Files property, I only changed the Debug configurations. When I tried to run the Release configurations, the program loaded with errors. Easy fix. I figure this part of the assignment, tedious as it was, probably carved these configuration setup steps into my brain.
The second critical moment was when trying to run the OpenGL version of the game. I would later find out that many other students had this issue! My Graphics project hadn't yet included the OpenGlExtensions project. Because the DirectX configuration obviously didn't need this to work, I was lulled into a false sense of security. Another easy fix, though I made the mistake of thinking at first that I'd made a mistake with my properties. Once I found where the OpenGL extension functions were declared, I realized the missing reference.
During the reference set-up step, there was a stage in which we needed to make sure other projects correctly referenced the Graphics project. Although many other instances of the Graphic signature came up in the Ctrl+F search, Application was the only project which required this reference in order for the game to work.
Beyond that, the stages of creating our own build project, our own game project, making them correctly load into Visual Studio despite having their contents copied from the example, and then making our game project the Default Project of the Solution - specifically through the ordering of the file, not just a user setting. This all went smoothly.
Is this what it looks like when I write instructions for people?
I specifically asked in class if the aside about Logging was asking us to add to the log to show that we understood it. Since the answer was yes, the results of my logging are shown in the image to the left. I added many logs from the initialization process. Mostly successes, but also some additional error logs. This was to make the .log file much more informative, especially in these steps where I imagine the bulk of the work is happening thus far.
I modified some of the log messages that we were initially provided with to add clarity and to maintain a common syntax. I added some spacing, and a line separation to indicate a difference between the startup and shutdown phases of the program.
I might want to add timestamps to this procedure in the future so we know if a step takes too long - I figure, only if we start making changes to the underlying initializers (or add our own).
In the code, I chose to follow the design pattern of Logging and Time by putting the Log outputs in the called function, as long as that function already had access to Logging. Otherwise, I kept it in the iApplication.cpp file.
I did also come across functions which I tried to log after the Logging was supposed to be closed. I'll call the log messages I got as a result of re-opening the closed Log an Easter Egg.
For my shader, I used the suggested "simulationTime" variable with sine and cosine functions to create a simple fluctuating color value. I put a slightly different function for each. After a bit of tweaking, I decided that I got annoyed first at the rate of change being too slow (it made the program feel like it wasn't as fast as it was), and then annoyed when my wave functions would line up and create a very dark or black triangle, which would not be visible against the background. I tried to make the frequencies of each of my wave functions different, such that this convergence would happen less.
As far as the math goes, since a simple sin(x)/cos(x) function ranges from [-1, 1] but colors range from [0, 1], I made two tweaks.
By multiplying the function by .5, I was able to shrink the wave between outputs of [-0.5, 0.5]. By adding .5 afterwards, the output range becomes [0, 1].
The unlucky result of making the frequencies very different was that getting both of my OpenGL and DirectX instances to be synced up visually pretty much required recording from the startup of the game. But hey, it looks like a rave now!
And last but not least, the write-up process itself. I won't pretend I didn't physically recoil at the asks of the submission. However, as someone who has tended to not interact with website making - both as a result of my schooling and as a result of my hobbies not aligning with it - I know I'll appreciate the experience.
At a later date.