Freedom!
Previously, a large majority of the look and functionality of our game was defined in hard coded C++. Meaning, if you wanted to change the look of in game objects, this had be done before compiling the game down to a playable executable. This time, we aim to give some freedom on how to define some features of the objects in our game via human-readable .lua files. By opening up the cube and floor data to a more human readable format like .lua code, now you can directly manipulate the look of the in game objects without having to modify C++ code!
Besides just making this example here on the example game here on my website more interesting to work with, this was also an implementation in the argument for human-readable asset files. Meaning, files that define the look or functionality of an in game asset that is “readable” by a human. This could be viewed and understood by more than just a computer. Fellow programmers and designers can now manipulate this data without having the godly ability to decipher compiled C++ code or having to reach directly into the C++ themselves. It can now be easily modified via a regular text editor! The Human Readable Floor
Design Goals
When coming up with the syntax to determine how these files would look, I aimed to use easily distinguishable language, array indexing (since I’m assuming that users of this tool would understand those at least), and descriptive variables. On line 3 and 46 of the above file it’s immediately clear what the following array blocks are describing, the vertexes and triangle indices used to construct the mesh. In addition, it should be easy enough to know which variables describe which characteristics of the vertexes of the mesh. That being either the position (x,y,z) or color / look (r,g,b,a).
ControlsThe Camera: [Key : Action]
[W : Move Forwards]
[A : Move to the Left] [S : Move to the Right] [D: Move Backwards] [Space: Move UP] [Left / Right Ctrl: Move DOWN] The Cube: [Key : Action]
[Arrow UP : Move Forwards]
[Arrow LEFT: Move to the Left] [Arrow RIGHT : Move to the Right] [Arrow DOWN: Move Backwards] [Page UP: Move UP] [Page DOWN: Move DOWN] Downloads
You can try out these games via the below links. The only difference is that Direct3D will be used in the x64 version, with OpenGL in the other. They have been built and verified to work on Windows. You may reach into the data/Meshes folder to get to the underlying .lua representations of the in game objects. Try manipulating some of the color or position values of the object!
![]()
![]()
- Garin
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
Categories |