Currently im creating a game Engine together with a friend for learning porpuses and fun. Because I read the article “Write games not engines” I decided to write a small tetris game with our engine to test the mechanics. During this process I found many flaws and bugs in the engine and fixed them. Also I had lots of ideas how to improve our engine.

The whole game logic is written in lua. Also all draw calls are made by lua. The engine collects the draw calls and executes them later. The engine setup is also done by lua. So the engine is not restricted to forward rendering or deferrend rendering. For this game deferrend rendering was used for learning porpuses. Also I implemented 2 post processing shaders. A edge detection shader and a glow shader. The input is also managed by lua, so it was very easy to write a configurable input system. Even axis of controlers can be used for binary key events because I wrote a small converter in lua.
For small games it is planed to do the logic and draw calls completely in lua. If we some day plan on doing a bigger game like an ego shooter or something like that, more of the logic moves into the C++ code to maintain good speed.

The shaders are generated out of xml files with the option to embed lua code into the xml file, to be able to generate many diferrend shaders out of the same file. In this game this feature was used for the differend qualities of the outline shader.

A huge effort was also taken to use multi threading in the engine. I wrote a task manager that collects all the taks and executes them in the right order, depending on their dependencies to other tasks. To use mutli threading in lua, we wrote data synchronzing commands for lua. Because the multi threading code just went usable recently, this game still runs single threaded because it’s developement startet earlier before.

All displayed strings are indentified by a string name and saved in extern files so this game can be easly puplished in different languages. Currently the game comes with the fowolling languages: german, english and russian.

I know that in this game many things could be solved better, but it was never the aim to go for perfection. Instead this game was only developed to test and improve the engine, to learn lua and for fun.

You can download the game at: