Development log

The Veins of the Earth is here!

A new version of The Veins of the Earth (formerly known as Underdark) is out.
Only two more features until 0.0.8.

Feedback and ideas welcome!

Underdark roguelike

Version 0.0.6 of my Underdark roguelike has been uploaded to the ToME site.

Therefore, I must ask for feedback and ideas. Feel free to leave them in the comments. I would also like a rating.

Contributors are wanted - simply grab a github client, fork Zireael07/Underdark, check out your repo, make your changes and make a pull request back.

Missing Hot key icons.

I was in the beginning forest for Sun Elves (vs the Naga) and suddenly my hot key icons disappeared after I was attacked. I did freak out after trying every possible key combination and having no luck getting them back. The icon bar is there but the key icons are gone.

I checked another character and their icons were fine so it is save specific. I have no idea what is going on and it really drove me crazy (My gf left the apartment after I started raging...) After several game restarts, computer reboots and general mishaps with my machine and no luck getting them back I am about to give up.

Also of annoyance is the fact that my Tome forums login seems to have been deleted.

screen shot:

RPG Engine - version 0.2.0, now in the module repository

I've updated my JRPG module to version 0.2.0. You can get it from the module repository on

New features:

  • Polished user interface in some places
  • Added an adventurers' guild to the town. You can now create new characters and add or remove characters from your party.
  • Information about monsters you fight is now recorded in a monster encyclopedia. You can view it through the party menu.
  • Sample dungeon reworked and expanded to two levels
  • Added a debug menu. Keybind: Ctrl-D, will work even if you don't have cheat mode on
  • You can escape from battles now
  • Added a game over dialog


To-do list:

  • Rework the code to make it easier to modify it and build new games on this engine
  • Improve user interface further and make it more intuitive
  • Rework battle handling, display battles in the main window instead of a dialog
  • Separate classes from predefined characters
  • Add a party creation dialog
  • Make it possible to build your party in a formation where the characters' positions matter -
for instance, with warriors in front row protecting mages in the back
  • Rework skill targeting, make it possible to hit enemies in a row, a column
  • Rework skill system, make it possible to manually level skills up
  • Add support for graphics, music


Currently I'm working on improving user interface and battle handling. I'd like to eventually have
the battle being displayed in the main screen instead of dialog, so I'll be eventually reworking the
battle handler classes. Also I plan to develop the skill system further, to make it possible for the
player to level up the characters' skills - sort of like how you level up talents in Tales of Maj'Eyal.

Link to the module page:

Benchmarking Lua

Just out of curiosity, I decided to see how much I had to worry about optimization in Lua. I downloaded a Lua binary from and ran a few tests.

Fresh boot, AMD dual core 2.6ghz. In case you're curious, that's a pretty old computer; it was at the price-performance sweet spot when I bought it, but parts are going to start failing soon.

local time = os.clock(); for i=1, 10^7 do if i==0 then break end end; print(os.clock()-time)

Note that this basic loop consists of 1 increment, 2 compares, and 1 jump. Every loop that follows is going to be the same, except sometimes they have 1 less compare (the if in the middle of the loop). I can run it more than 20 million times in a second. If I was doing this in ToME, I wouldn't notice any difference in framerate until I did it around 2*10^4 times every frame. That would drop my framerate from 30 to 29.

local time = os.clock(); local p; for i=1, 10^7 do p = math.sqrt(i) end; print(os.clock()-time)
Takes about four times longer to do a square root loop. I could only do 5000 square roots every frame before affecting Lua framerate.

local time = os.clock(); local p; for i=1, 10^7 do p = i^0.5 end; print(os.clock()-time)
Huh, that's funny. For the non math inclined, i^0.5 is the exact same thing as sqrt(i). I repeated this several times to be sure-- sure enough, ^0.5 is faster. And, I might add, easier to type, and easier on the eyes. So adjust that square estimate to 9000 a frame until we affect framerate.

local time = os.clock(); local p; for i=1, 10^7 do p = math.sin(i) end; print(os.clock()-time)
Slowest yet. Looks like I could get away with 4000 sines. I'm going to assume tan and cos work at similar speed (maybe not a safe assumption in light of the surprising square root discovery!)

local time = os.clock(); local p; for i=1, 10^7 do p = math.exp(i) end; print(os.clock()-time)
About the same as trig. Can't imagine wanting to do a lot of this.

local time = os.clock()local p = "test"; for i=1, 10^7 do if p~="test" then break end end; print(os.clock()-time)
Comparison of strings isn't any slower than comparison of numbers. That's because of how Lua handles strings. p is a pointer to a string; "test" is a pointer to the exact same string.

TL;DR: Unless you're writing display code or pathfinding code, there is almost nothing you can do that will noticeably impact the performance of ToME. Don't worry about speed-- worry about having your code do what it's supposed to do, and do it clearly.

7drl 2013: The start

So if you don't know today the seven day rouge-like contest starts today, and like last year I am participating. So This year I am calling my game Iron and Steam (which tells you there will be iron and steam in the game). My vision currently is a version of mount and blade set in a steam punk world. You will also get to build steam powered robots. That and a wilderness map are the only 2 features I am sure about so yeah.... Regardless I am starting at 6pm est on 3/10 and have 168 hours. My progress and final attempts will be posted at . To my fellow participants I wish you the best of luck, and to all others enjoy the new rouge-likes.

Updates to Con based stamina addon and No Unlocked Categories Addons

I realised earlier that my old addons didn't work when downloaded from here, as I was playing them from the extracted ones and not the "compiled" ones.

Anyway I updated the addons for b43. So you can use them if you want.

Both are intended to make the game significantly easier. (The one only for Stamina based classes).

JRPG module - version 0.0.3 released

JRPG module is now at version 0.0.3. New features in this version:

 -Sample dungeon level expanded, several new monsters added. Also there are
  several chests with treasures scattered around the level.
 -Added a town level, with shops and no random encounters
 -Shops - locations where you can buy or sell items
 -Synthesis (aka crafting). You can create new item out of components in a
  synthesis store.
 -Added potions, which you can use to heal during battle or on field.
  Also, you can use healing skills outside battles.
 -Reworked character details dialog
 -Your characters can defend in battle, doubling their defenses until their next turn

Download link:

Post your feedback, suggestions and bug reports in this thread:

Note: I have trouble posting or replying to comments on blog pages - I can read them just fine, but I'm unable to reply. If you want me to reply, post in the forum thread.

JRPG module progress, test demo released

Lately I was working on creating a JRPG-like module for T-Engine, and I managed to recreate most of my beta-4 module in beta-38.

Impemented features are:


 -You control a party consisting of several members
 -You can open a party menu, which shows HP and SP of all your party member
 -You can view information about individual party members
 -Party members can gain experience and level up, increasing their stats
 -Party members have individual skills

Skills (named 'Attacks' internally):
 -Can be physical or magical based
 -Can be elemental
 -Can heal allies
 -Behaviour can be customized further
 -Damage calculation made more JRPG-ish - now characters and enemies have
  Attack and Defense stats, and damage is calculated as ATK - DEF / 2.
  Of course, this behaviour can be changed in the corresponding file.

Battles and enemies:
 -Supports random and predefined encounters
 -Battle process is handled in a separate dialog, with a few helper dialogs for player input
 -Enemies attack party members
 -Enemies can have elemental weaknesses or resistance
 -Active turn-based battle system. All combatants - players and enemies - gain energy on each tick. When a combatant's energy reaches 1000, that combatant can perform an action.

 -Waypoints, a way for the player to instantly teleport to a certain spot
  Not really utilized just yet.
 -Savepoints, locations where you can save and recover your party
 -You can't save normally

What's not here yet:

 -Status effects - poison, paralysis, buffs and debuffs and so on
 -Interface probably can be made more user-friendly
 -Speed (the character stat) is not used yet
 -No dialogs on party member levelup
 -No chat system implemented
 -No equipment
 -Can't choose characters to form a party
 -Maybe there's a better way to handle locations

I already have a test demo, where you can walk around a small room fighting random encounters.
The save point in that room also allows you to fight two different opponents. There's not much to see in actual gameplay sense, but I think this module demonstrates the features I've implemented.

The player party characters I'm using in this module are from Touhou Project (a Japanese shoot-em-up series). It doesn't really matter that much - this is a test demo, not an actual game.


  In the dungeon:

  Enter - Open party menu
  m - Start a battle, for testing purposes

  During a battle:

  Escape - End a battle immediatly, for testing purposes

All other input is handled with List and ListColumn objects - you're presented a list of possible options, and you choose one with arrow keys & Enter, or with the mouse.

I think this module already can be used to make an actual game - the basic RPG elements are here. Keep in mind, though, that it is still currently in development and might contain bugs. If you want to make your own module based on this one, feel free. Just remember to give me credit.

If you're interested in this module's inner working, take a look in the .team file (it's just a renamed .zip file). I've tried to write enough comments in order to make my code understandable. If something is unclear to you, ask away.

Post your suggestions and bugs you discover on this blog entry, or contact me:


The module can be downloaded here:

Non-roguelike modules

I'm interested whether T-Engine4 can handle modules with non-roguelike gameplay well. For instance, I wonder whether you can create more RPG-like modules, where you control a party of adventurers and walk around predefined maps, battling monsters and gathering treasures - and you control all of them directly. Here are some of my thoughts on this:

1. Making a module with more RPG-ish gameplay would probably be simple enough. The main change from standard gameplay would be that you now control several characters instead of one, and the battle system would probably need to be altered as well.

I did experiment with making a JRPG-like module, where you walk around a dungeon with random encounters. When an encounter started, the battle between the party and monsters proceeded in a separate dialog. Your characters could level up, you could use spells in combat to damage enemies, heal yourself or to temporarily power your characters up. It was back in beta4, and now I'm considering porting it to the current version.

2. A turn-based tactical RPG - think Fire Emblem, where your characters and enemies take turns moving around the battlefield and attacking, would be harder to implement. I've seen this idea proposed on this site before. In such a module, the combat situations - the area where the fight is happening and the enemy combatants - would probably have to be stored in a separate file, and loaded when required.

3. Speaking more generally, in such non-standard modules death and saving would probably have to be handled differently. Death no longer should be permanent, and saving probably can be made possible only at certain spots - in a town or at special locations in the dungeons.

As I can see, a module with RPG-like gameplay would be easiest to create. I've managed to get the basic elements working, so it looks possible.

Syndicate content