Hierarchical state machine implementation in Erlang-Collection of common programming errors

I am the original question author (in fact I would like to claim the question as mine, but I don’t know how).

I already know about all the things OTP offers, gen_fsm included.

The idea is to use a HIERARCHICAL state machine, and gen_fsm is a plain state machine. To keep track of the game turns, phases, etc, I don’t think a plain state machine as gen_fsm would be enough.

Anyway, I have been investigating further, and I think that I will use erl-lua so I can use Lua for all the game logic. Once it is working I can search for bottlenecks and move them to a C implementation or whatever.