top of page

Game Engine Engineering Assignment - 1

  • Writer: Vikram Venkatesh
    Vikram Venkatesh
  • Sep 2, 2020
  • 2 min read

Updated: Sep 25, 2023

The main point of this assignment, I feel, was to get familiar with Visual Studio in general, exploring its nooks and crannies and experimenting with 'stuff not meant to be touched'.


For this assignment we had to integrate professor John-Paul's Graphics Library with his Engine and customize the solution, such that a game project, implementing the engine, could be easily created.


One another feature of this assignment was to help us identify platform dependence and making sure the code which goes through to the build is corresponding to the platform we are building for. For now, we are assuming the two graphics APIs (DirectX and OpenGL ) as our platforms and a custom rule where x86 builds the OpenGL version while x64 builds the DirectX version. This can be achieved using two methods:

  1. Preprocessor Macros

  2. Excluding files from build according to custom rule

Once everything was setup, it was time for some customization! First thing - Custom game title and icons. I quickly created this masterpiece with my initials in Paint3D, the greatest piece of software ever written, and 'iconized' it and now this will stay here forever.



One thing I realized when working with resource.h to register resource files, like icons and stuff, was that, resource.h is very nit-picky. For it to work, it needs to be in a format that it likes. I was pulling my hair for about 15 minutes after adding a #define for my icon because it wouldn't register that and started throwing errors but then realized that all it needed was an endline character at the end.



The most fun part for me, was to play with the shaders. It's time to color that gorgeous triangle with some math. I have been experimenting a bit with standard periodic functions and trying to color and animate the triangle in interesting ways.

Now to answer some of the optional challenges of the assignment:

  • Because of the two implementations of the different graphics APIs, there is this challenge of duplicate code for the constant buffers (different syntax). The solution for this would be to create a separate .incl file and put the constant buffer declarations in there, and include them in both, vertex and fragment shaders, hence declaring these constant buffers only once.

  • One can play with the g_elapsedSecondCount_simulationTime in the shader, to do effects like slowing down or speeding up. But given, if this has to be done via user input, we have to change the value of simulation time in the buffers via the application. Luckily there is already a method present in the Application library to do this, called SetSimulationRate(float rate) and we can trigger this on say a key-press. Currently the game speeds 5x on holding space.

Aaaand... that wraps up the first assignment. I've uploaded a zip file containing the builds for you peeps to test it out. Let me know in the comments if you're confused about anything or are wanting to know how I implemented something.


Comments


bottom of page