Beruflich Dokumente
Kultur Dokumente
This assignment was mainly focused on us learning the basics of LUA and how to supply game
data at run time.
Lua- Lua is a scripting tool which we use in our project. This is basically used to supply user
specified data to the game in a user friendly format. This is because the game files in a real
game need to be edited by a non-technical person as well.
Lua is open source software and it can be fully integrated with C, C++. There are different ways
that we can interface with Lua1. Calling Lua functions from C- Using this method we can create different functions in Lua
and call those functions from C. These functions can have to be first registered with
C/C++ and then these can be called. So in this way, Lua file can have all the actual logic
of a function but C will just have its definition.
2. Calling C functions from Lua This can also be done. But the main difference between
this and the above method is that, the function parameters in lua need to pushed onto
the stack. The C functions need to get these parameters from the stack, process the
data and then push the resulting parameters onto the stack. The only legitimate
argument for the function is the Lua state and the return parameter is always an int
which is the number of parameters pushed onto the stack before returning.
Lua also has basic data types similar to Cnil - Used to differentiate the value from having some data or no(nil) data.
boolean -Includes true and false as values. Generally used for condition checking.
number - Represents real(double precision floating point) numbers.
string - Represents array of characters.
Using these variables we can process real time data such as user data which user may provide
in a .ini file as well.
Log Files- We also learned in this assignment how to output data to a log file. Both errors and
information messages can be transferred to a log file. This will allow the users as well as the
engineers to know what exactly went wrong in the code or which steps were executed in the
game.
Above screenshot shows the start of the game where the white square is drawn by using two
triangles.
Above screenshot shows the progress of the game after a few frames where the height of the
square is decreasing. Also the fragment shader has changed the color to cyan. This behavior
occurs repeatedly as a function of time.
Dependencies
1. Lua This project is only depending on the source code of Lua which is included in the
project.
2. User settings This project depends on Asserts, Logging, Lua and Platform projects to
be built.
3. AssetBuild System This is only dependent on the AssetBuildLibrary which inturn is
dependent on other projects.