top of page

My views on Assignment 8

Game Screenshot

Credits:

Geometry in the screenshot by my fellow classmate

Danny Diaz

SS.PNG

Binary Geometry file

BitsCapture.PNG

I chose the following order while writing them.

1) Vertex size (uint32_t)

2) Index size (uint32_t)

3) vertex array

4) Index array (uint32_t)

  • In the picture you can see the first four bytes with blue color, They represent vertex size. The next four green bytes represent the index size.

  • The yellow bits are the vertex array. next to that, the red-brownish bytes are index array.

Advantages of using Binary Geometry file over human-readable

  • First, as we will see next in the article and very obvious reason is that the size is smaller for binary files which are a plus point for us.

  • Second, I think it is a good way of storing them while shipping the product on different platforms as most of the platforms have a pretty easy way of reading binary files rather than installing other human-readable files external libraries.

  • We use human-readable files to store in source control because it is easy to change for a non-engineer guy, but we use binary format to read the file in order to optimize the performance and make the reading operation faster.

  • Also, both platforms (64 and 32) will have it's own different built binary files as we use different winding order for the geometry index data.

Extracting Geometry data from a Binary file

I use the LoadBinaryFile() to load the data as a chunk of memory and then traverse using the offset.

extractData.PNG

Comparing the sizes between Lua vs Binary file

At this point, I already converted my geometry to use uint32_t type, so the following comparison is based on that.

Total vertices in the Geometry: 116,336

Lua        vs        Binary

Size (MegaBytes)

7.42

2.10

Loading Time

(Seconds)

3.95914

0.04499

0.00018

0.000815

0.000132

0.000048

Clearly there's a significant amount of difference that can be decisive for sure in terms of larger-scale projects

Instructions to install and play

  • Unzip and run the exe file

  • Arrows to move the object

  • W S A D for camera movement and G H for zoom

  • Control and shift to switch player controller and shape of an object

bottom of page