I’m moving to https://eliasdaler.github.io

Hello, everyone.

Recently I’ve decided to create a new blog which will be cooler looking and easier for me to modify. So I’m proud to present it to you!


This will be the blog I’ll be using in the future and then maybe I’ll move to some domain like eliasdaler.com or something like that.

You can find all the info about why I’m moving and what I’m planning to write about next here.

See you there. :)

P.S. This blog will remain as an archive of everything I’ve written before that, but I’m probably going to put big notices at the bottom of the pages to go to newer articles or I’ll just remake some parts of the articles which I consider to be out dated.

Using Lua with C++ in Practice. Iterating over Lua tables

Hello, this is new part of Using Lua with C++!
This part will be short, but very helpful. It will use LuaBridge and Lua C API, but it’s pretty easy to rewrite stuff for other Lua/C++ bindings.

The problem

Suppose you have a Lua table this:

someTable = { 1, 5, 10, 20 }

Suppose that someTableRef is a LuaRef pointing
It’s pretty easy to iterate over it using LuaBridge:

for (int i = 0; someTableRef.length(); ++i) {
    // note the i + 1 here, it's because arrays in Lua start with 1
    LuaRef elementRef = someTableRef[i + 1];
    ... // do something with the element

But what if you have a table like this:

someTable = {
    firstKey = "someString",
    anotherKey = { ... -- some stuff }

and want to iterate over it?

This can be easily done in Lua:

for k, v in pairs(someTable) do
    ... -- do stuff with k

But how do we do the same in C++? I’ve found no way to do it in LuaBridge (and seems like lots of other libraries don’t include this functionality as well), but fortunately we can use lua_next from Lua C API to do the thing for us!

Continue reading

Using Lua with C++ in Practice. Getting data from scripts and why globals are evil.

This part doesn’t depend on the others, so you can read it even if you haven’t read previous parts. (I suggest to check them out, though. You may find some interesting stuff!)

This part will mostly use Lua C API only. LuaBridge is used for a small part to show some cool stuff. (Though you’ll be able to follow with most other bindings)

This part contains one of the most important practices in Lua programming which I discovered pretty recently and felt dumb afterwards because for the last two years I’ve been doing stuff wrong.

Today I’m going to talk about storing Lua tables and variables in scripts.

Storing data in Lua is great. You can easily store stuff in neat way and you can also store functions which you can later call from C++. You can store tables (or other variables) in scripts in two ways: as global variables and as local variables. Let’s talk about each one.

Continue reading

Re:creation dev log. April-May 2015. Recreation mechanic, archers, event system and more!

Last two months were pretty awesome. I had lots of free time and was able to implement lots of new stuff!

Recreation mechanic

Let’s start with a gameplay gif:

It’s another example of recreation mechanic.
For those who don’t know, recreation mechanic is the main mechanic in my game. When undead hero kills people, he can leave his body and control dead people with his ghost. He gains their abilities to progress through the game and solve various puzzles. But he can’t leave his body behind for a long time because he can’t carry the hammer while controlling other people. The hammer can do some stuff which normal weapons can’t. (break some floors, for example)
This hammer is very heavy so he can’t carry other weapons. So, for example, in order to shoot arrows, you need to kill archers and control them with your ghost.
He can also use his ghost to reach inaccessible areas. But this won’t be very useful if there are no corpses lying there because he won’t be able to interact with the world this way. But it has another use: you can look around and see what you have to deal with next. This will be very helpful when solving complex puzzles.

Continue reading

re:Creation week #5. Improved level format and saving system.

Previous weeks:


Last week I’ve posted this screenshot of re:Creation to /r/IndieGaming to know what people think about new graphics. I expected 2 or 3 people tell me something like: “it’s good, keep working” or “that’s bad, keep working”. The thread got lots of upvotes and comments and there was lots of constructive critique which I didn’t expect. Some people said the game looks really great. This was really awesome and now I know in which direction art style should be moving.

And here’s what I’ve been doing this week.

Continue reading



You’ve stumbled upon my blog. I’m Elias Daler, though my real name is Ilya Daylidenok (Илья Дайлидёнок). I write code, turorials and make video games!

I’m developing a game called Re:creation. Info/press kit.

This is my old blog and newer can be found here:


Here are some things I’ve written and which will be here as an archive.

Dev log

Follow me on twitter! @EliasDaler

E-mail: eliasdaler@yandex.ru. Feel free to write and ask questions.

If you like the stuff I do, check this out:

Donations and ways you can help

I also write articles about Lua and C++.

Using Lua in Practice.

Using Lua with LuaBridge

Using Lua with C++ (writing your own binding with Lua C API).

Other tutorials and articles

Some sprites on this blog are from Legend of Zelda: A Link to the Past by Nintendo.