Shantanu Pandey
  • Projects
    • Hard Light Vector
    • Memory Manager
    • Samurai Crusader
    • Dyslexia VR
    • Geriatric Depression Suite
  • Prototypes
    • Game Mechanics
    • Diana's Inferno
    • MakeUp & BreakUp
    • 10Pest
    • Ninja Pinball
  • Blogs
    • Sic Parvis Magna
    • Game Engineering - Week 1
    • Game Engineering - Week 2
    • Game Engineering - Week 3
    • Game Engineering - Week 4
    • Game Engineering - Week 5
    • Game Engineering - Week 6
    • Game Engineering - Week 7
    • Game Engineering - Week 8
    • Game Engineering - Week 9
    • Engine Feature - Audio Subsystem
    • Final Project - GameEngineering III
    • AI Movement Algorithms
    • Pathfinding Algortihms
    • Decision Makiing
  • About

Week 6 - 09/26/2018

10/3/2018

0 Comments

 
This week assignment was the introduction of Lua for this semester. Instead of passing the vertex and index buffer data in game, we had to read it from a Lua file. The goal was to create a human readable lua-based mesh file and parse it in our program to create a mesh. 

Lua File Format
Human readable data files are very useful, especially in game development. It makes the debugging easier as the user knows what could be expected form the output. These files are also useful for people with limited coding background, like game designers where they can try out different values for the program without needing to do or change anything with the code. I used the below file format for lua:
Picture
As we can see, I have two tables for vertex array; one main table (vertexArray) and nested tables (position) inside that. Initially, I used 3 tables instead of two; vertexArray à vertices à position. This was adding undue complexity while parsing the data without making much difference to the readability. Thus I decided to go with two table approach. With complex table, we can use comments to further improve readability.

[Note: How this project is setup is it treats all the warnings as errors. When I was finally testing this assignment (cleaning and rebuilding), even though everything worked in Direct3d, I got a linker error in OpenGL. The reason was I was getting a warning of possible loss of data while converting lua length to int in OpenGl, which was treated as warning, which cause the static manager in mesh class to not load and which caused the linker error. It took me some time to realize this, but it was an interesting error.]

Mesh Builder
We added another project in this assignment to build the mesh file. The responsibility of this project was to copy our human readable file from a source to destination. Since a new project was added, important thing here was to properly setup the dependencies (as told to us countless times by JP!). Our AssetBuilder project uses this MeshBuilder to build the mesh file (like it uses shader builder file). So, an explicit dependency was setup there to avoid any linker errors.

Game Screenshot
Playable EXE Download
Controls: W S A D to move game object
                  Up Down Left Right to move camera
                  Ctrl to switch the mesh of game object
Picture
Assignment06 - Getting Mesh Details from LUA
  • I update the last week's assignment to have a separate project for Game Object. After having a discussion with JP, its advisable to not have Game Object as a part of Graphics project.
  • As a part of this assignment, we are using handles (file handlers to be more specific) and using those to get the mesh instead of directly having mesh pointer in the MyGame class. There are different ways we can implement this. We can either have our GameObject contain a handle which will be used to get/set any meshes used by it or we can have MyGame class store a handle and use that handle to pass mesh pointer to game object. We can use either of these approaches (I am using second approach) based on our use case. Thing to keep in mind here is that meshes should be properly reference counted whenever we use/release them in game objects.
0 Comments

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    October 2018

    Categories

    All

    RSS Feed

FOR ANY FURTHER DETAILS


Telephone

801-859-1131

Email

Resume
File Size: 227 kb
File Type: pdf
Download File

Visit Hard Light Vector
[email protected]
Git Hub
  • Projects
    • Hard Light Vector
    • Memory Manager
    • Samurai Crusader
    • Dyslexia VR
    • Geriatric Depression Suite
  • Prototypes
    • Game Mechanics
    • Diana's Inferno
    • MakeUp & BreakUp
    • 10Pest
    • Ninja Pinball
  • Blogs
    • Sic Parvis Magna
    • Game Engineering - Week 1
    • Game Engineering - Week 2
    • Game Engineering - Week 3
    • Game Engineering - Week 4
    • Game Engineering - Week 5
    • Game Engineering - Week 6
    • Game Engineering - Week 7
    • Game Engineering - Week 8
    • Game Engineering - Week 9
    • Engine Feature - Audio Subsystem
    • Final Project - GameEngineering III
    • AI Movement Algorithms
    • Pathfinding Algortihms
    • Decision Makiing
  • About