A downloadable game for Windows

Details of Assignment:

  • The Assignment was divided into 2 main parts:
    • The First one was to make object moveable in the world space
    • The Second was to make a camera object and make it move
  • The game has following controls:
    • “W” is used to move object forward(z+)
    • “S” is used to move object backward(z-)
    • “A” is used to move object left(x+)
    • “D” is used to move object right(x-)
    • “E” is used to move object up(y+)
    • “Q” is used to move object down(y-)
    • “SPACE” is used to change object geometry
    • “TAB” is used to switch between objects
    • “UP” is used to move camera forward(z+)
    • “DOWN” is used to move camera backward(z-)
    • “LEFT” is used to move camera left (x-)
    • “RIGHT” is used to move camera right (x+)
    • “PAGE UP” is used to move camera up (y+)
    • “PAGE DOWN” is used to move camera down(y-)
  • I had few problems starting the assignment as I was confused where to start, Rohan helped me in figuring out where to start the assignment.
  • I created a new project called controller for creating my rederable objects which I am using to transfer geometry, effect and physics into graphics for creating my object
  • Whose size is 12 bytes in x86 and 24 bytes in x64 as it have 3 pointers

Running Part of Assignment:


Fig 1. Objects at default location


Fig 2. Bottom triangle moved to left (press tab and “A”  key)


Fig 3. Bottom Triangle with different shape

How I reach at this Point:


Fig 4. My Renderable object class

  • Using Simulation By Input, I am using keys to set the velocity of my object which in turn updates the position.
  • I also had to change the vertex.shader to use the location position created by my object when it is draw to change its position in the game
  • Once the position has been rendered I am passing the value to Graphics using submit function
  • For that I am passing 2 things, one my renderable objects which has geometry, effect and physics, and second a array of matrix which has future position of where all objects should be after the game finishes the ongoing frame


Fig 5. My Interface to transfer object to graphics

  • For camera, the difference is I am sending future position Matrix to graphics to cache and aspect ration for getting the projected view
  • The total bytes the graphics need to cache for creating the graphics is 584 (292 * 2) bytes in x86 and 624 (312 * 2) bytes in x64
    • The difference in byte values is because of the pointer size in x86 and x64
    • Out of 292 for each cache bucket draw call uses 128 (64 * 2) bytes for 2 objects for each x86 and x64, and data frame take 144 bytes for both x86 and x64
    • Geometry and effects both take 8 (4 * 2) bytes between 2 objects and color take 4 bytes for x86.
    • Geometry and effects both take 16 (8 * 2) bytes between 2 objects and color take 8 bytes for x64.
  • In our engine the rendering and simulations work at different frame rate, in which simulation is faster than rendering, so we use extrapolation to predict the future position of object and pass it in the rendering frame to get the final position the physics need to be at the end of frame while simulation frame updates the physics at faster frame rate and reaches the final position.


Fig 6. My interface to transfer camera to graphics


Fig 7. Zoom camera view


Fig 8. Zoom out view of camera

 

Optional Challenge:

  • We had two optional challenge but I only had time to do one, which was to add depth buffering to effects
  • In our game before this, our object were rendered on top of each other so the object created first will be below the object drawn after but by adding depth effect we can change which object can come on top of other


Fig 9. Triangle above the square


Fig 10. Square above triangle

Download

Download
MyGame_D3D.zip 289 kB
Download
MyGame_OpenGL.zip 284 kB

Leave a comment

Log in with itch.io to leave a comment.