A downloadable game for Windows

Write Up:

  • Show us a screenshot of your game running
    • Ta da!
  • Show an example of a binary geometry file built by your GeometryBuilder:
    • Binary files look so cool!
    • In the screenshot, red is vertex count, green is the index count, blue is the index data, and all the data in between green and blue is the vertex data. It's a little bit difficult to read, but it'd be even harder to read if I tried to mark out the vertex data.
  • Tell us at least two advantages of using binary file formats:
    • Well, the obvious first one is speed of loading/reading.
    • It took me a minute of thinking, but I think the second advantage JP is looking for is the data size of the binary file. The binary file size will just tend to be smaller, but also you can fine-tune just how large the file is in the binary file format (eg. using uint32_t instead of uint16_t.)
    • There's also, of course, the process of converting character data to numerical data which with a binary file you can do that just once and load the pre-converted data.
    • Human-readable vs Binary formats:
      • Human-readable formats are great for when you need to be able to debug your source data. You can also mess around in them using automation scripts like python very easily. They are, however, slower to load.
      • Binary files are fast to load, but difficult to debug.
      • Human-readable files make sense to put into source-control because those work like the "source" files of code as well. Putting a binary "built-asset" file into source code would be like committing your .exe to source control. I mean, I guess there might be certain situations in which you actually want to do that, but in general that's not good practice.
      • Also, git and binary files do not get along (hello, merge conflicts) so it's best we avoid committing binary files to git. 
  • Tell us whether the built binary geometry files should be the same or different for the different platforms, and explain why.
    • No, they shouldn't be the same, because Direct3D and OpenGL have different winding orders and since we can build platform-specific geometry files, we can build in the correct winding order.
  • Show us how you extract the four pieces of data from binary data at run-time
    • Check screenshot 3!
    • Now's a good time to explain why I copied the data over using memcpy(). Because of the way my code is structured, it looks like the memory that the binary file is loaded into goes out of scope before the index and vertex data can get to my Initialize() function. Unless I have something completely wrong and memcpy() allocates memory on the heap for you. I imagine there's a way to refactor this so I won't run into this issue, but nothing comes to mind now.
  • Create a geometry in Maya with many vertices and indices to measure the advantages of binary files
    • Size difference: 358KB (lua file) to 71KB (binary file)
    • Load Time difference:  (for 4816 vertices and 7236 indices)
      • Lua: 0.525508 seconds
      • Binary: 0.000372 seconds
      • Holy canoli that's like a 1000x improvement.

Download

Download
MyGame_x64_Direct3D.zip 197 kB
Download
MyGame_x86_OpenGL.zip 191 kB

Leave a comment

Log in with itch.io to leave a comment.