So today, not sure why, I was looking at the very first commit on the game's code and it turns out it was done on the 17th November 2009! Making the code exactly 9 years old today!

So I thought I'd make a little retrospective of how things where at the very beginning at the 1 day, 1 week, 1 month, 6 months and 1 year marks. This way you can see how things started, including some screenshots of stuff I'm probably the only one to ever have seen ;)

Oh and if you log ingame this week, you will get a little special celebration event! Yayz!

For each step we will also count the number of files and lines of code of the game (for simplicity of counting this includes libraries too, this is mostly important for the C code).

But first, a little anecdote of how the game came into being.

Tales of Maj'Eyal was born as Tales of Middle Earth 4, set in a Tolkien setting. It was meant as the successor of my old game aptly named .. Tales of Middle Earth 2 (and the aborted 3), itself being the evolution of Tales of Middle Earth 1 and Pernangband, which was started a long time ago in 1998.

After Tales of Middle Earth 3 had mostly failed due to trying to make old non adaptable code into something new I stopped doing anything with it for a few years. Before that however Tales of Middle Earth 2 was a well known game in the, then way smaller, roguelike community. So a few years had gone by but I kinda always felt guilty to abandon my players, but I just couldn't force myself to work with such old inflexible code anymore where every new feature felt more like a struggle than a joy to add.

Then, in the middle of November 2009, I caught a bad case of the flu, I was forced to stay home for a week and well, felt like crap, sweating and being in pain in my bed for no reason. But I simply can not stay put and do nothing, I don't work this way and thus I decided that given I'd feel like crap, I could also feel like crap on my computer and work on something. All the guilt I felt of abandoning my old players, and the fact that no roguelike at that time gave me an acceptable pure spellcaster experience, made me decide that I wanted to start on Tales of Middle Earth 4, but on my own term, on my own code, starting from nothing and building from there.

I spent some hours thinking of how I'd like the main structures of the game & engine to work and articulate and then started coding it. This is probably one of my proudest code moments because the structure I devised back then handled the test of time very well and is still today the foundation of Tales of Maj'Eyal and still feels adapted to whatever new strange ideas I have for the game.

So without further ado, let's have a quick look at the first commit!

First Commit

Stats: 4 lua files totaling 104 lines and 105 C/C++ files totaling 42822 lines.

The first ever commit saw the introduction of a very (very) basic map and entities code on the Lua side, and very basic SDL display & keyboard code on the C side. There was no yet any concept of modules, but a commented line in the lua engine code shows they were planned from the starts, as it says 'dofile("/game/modules/tome/")'.

First Day



Stats: 8 lua files totaling 237 lines and 103 C/C++ files totaling 42627 lines.

On the last commit of the first day, the modules system was now working. All game tests, map example, ... were done in the "tome" module, split from the engine.

The number of lua files, and lines, had more than doubled already and was showing no signs of slowing down as you will see in the next time mark.

First Week



Stats: 53 lua files totaling 4660 lines and 137 C/C++ files totaling 47997 lines.

By the one week mark, most of the important engine's structures which still exist today, identical but much enhanced, was in place and working. This also saw the beginnings of an UI layer as seen in the screenshot with the tooltip and basic combat log. The engine also saw many additions, map generators, specialization of entities into actors and grids and so on.

The tome module was also starting to show signs of a structure that is still used to this day. with zones split into their own folders and so on.

Oh and please, delight your eyes at the magnificent player tile I drew myself! Such art, much talent! ;)

First Month



Stats: 116 lua files totaling 11413 lines and 156 C/C++ files totaling 52296 lines.

The magnificent player tile is obviously still present! But a lot of things have changed or evolved, too many to list them all but let's have a look at a few of them.

On the engine side the two biggest additions, because of how far reaching they are, are the serialization code and the temporary values code.

Every single object in memory gained this capability which for non-coders can be explained as being able to generate some text that represent the object in memory. Using this important feature the engine could now "dump" it's memory into a file and reload it later, effectively giving savefiles. And what's important about those is that they would automagically record any change to anything without me having to plan for them to save. This is extremely freeing on the design side and helped a lot to get wild with things later on.

The temporary values code of entities is a bit technical too but basically, imagine that any actor/grid/object/... has a whole bunch of properties (color, weight, price, damage, life, whatever). This system allows any part of the code to tell an entity "ok now you add X to the value of this property of this object". This is rather easy and basically just adding two numbers; but the other side of the system is that later on the code can say "ok now revert *this specific change* and not the rest". Effectively the engine remembers every change to every property of every entity and thus is later able to revert them individually. This is heavily used by all talents and timed effects code (and much more). For example, every single time you use a regeneration infusion in game, this system is used.

On the side of that the engine also saw the addition of other important systems like multiple, switchable, map generators, the further specialization of entities into objects, and thus an inventory system, the ability to have either turn-based or realtime game modules, and the talents/timed effects code.

Six Months



Stats: 461 lua files totaling 50739 lines and 238 C/C++ files totaling 82574 lines.

While up to the first month all I had to fight "ingame" were dragons of death, the next months would see the addition of actual playable game data. The screenshot even starts to look like a game at that point. On it the most notable thing we can see is the addition of a tileset instead of using ASCII tiles. But this is not all at all!

The engine started to support sounds and musics, the switch to LuaJIT code for more speed, the support for customizable options and keybinds. It also saw the birth of the "boot" module. This is what you see when you start the game: the main menu where you can set options, start a new character, load one, and so on. This is actually a game module like any other!

It is also the first time the number of lua files (but not the number of lines) passed the number of C files, good times!

On the game side there was much progress made, and could be recognizable by players today (even though the game had not yet transitioned to its own setting yet). It had multiple playable zones, many objects and NPCs, a whole bunch of classes (the wilders being the latest added at the time) and even some quests working.

Also for fun, notice how on the screenshot there is a potion of lesser healing listed. Yes at this time the inscriptions system didn't exist yet.

Somewhere along the line the first alpha was sent to some of my old players and later on public beta started.

First Year



Stats: 1283 lua files totaling 138612 lines and 278 C/C++ files totaling 132743 lines.

Potions are gone! Inscriptions are in! Yes, one of the very important ToME system was never planned to exist; it only came into being when a player suggested it'd work better than spam quaffing potions like other games did. And it did work so much better.

Oh yeah an other thing that is gone: the Tolkien setting! Replaced by my own custom one. While I really love Tolkien's work it wasn't fitting anymore for the wild stuff I wanted to do. Also I had been bitten by a C&D letter long ago with Pernangband and I didn't really want to repeat the experience. And doing my own setting was liberating! "Eyalverse" is my baby now, the more stories and facts I write for it, the more ideas I get! It is both great and frightening because I can easily see myself adding new stuff to it in 20 years ;)

Aside from that the game was now really starting to feel like an actual big game with many zones, quests, classes, races and so on. Lore notes started to appear, providing insight into the past of the game's universe, or npc's motivations, or simply random fun bits like the minions of The Master writing poems to his glory!

Oh and it could be won, which is kinda important too ;)

Some of the whacky classes were already in, like the chronomancers. Funny thing about them too: remember the serialization code I talked about much earlier that is used to make savefiles? This is also the very basis of time spells that let you go back to the past! And that cool See the Threads spell were you can live three different timelines and choose your best? Yup that too! When you do choose at the end, you actually have 3 copies of the game world inside the game!

The engine received even more additions, to AI and pathing (distance maps, A*), to map generation and so on and so forth. But the two huge additions are most certainly the switch of the whole graphical stack using OpenGL directly instead of SDL and the addition of a particles system to display spell effects.

The first online features also started to appear, namely the saving of your unlocks, achievements, .. online. There wasn't yet any ingame chat or character's sheet upload though.

This is also the first time that there are more lua code lines than C code lines. And you have to understand that the C lines include many third parties libraries I use while the lua code have very little, so that's a whole bunch of custom lua code ;)

Nowadays



Stats: 2467 lua files totaling 382106 lines and 466 C/C++ files totaling 230310 lines.

And finally this brings us to today, as you can see the lua files and line count has the C side thoroughly beat and this is not including any official addon or expansions. If those were to be used the counter would skyrocket!

I will not even try to list all the changes that happened in 8 years, there are far too many but it's been a wild ride, full of joy and sometimes annoying bugs. What's more, and best, about it is that I have not been alone for this amazing ride, I've always had the support of a great community and out of it along the years many individuals have stepped forward and gave their time and energy to contribute many important stuff to the code. I can not list them all here (they are in the credits in any case) but they, and all players, have my thanks!

As for the future? Well, as long as players keep loving the game and getting even more friends to play I'll happily keep developing it. If one thing is certain is that I do not lack ideas about new stories to tell in the "Eyalverse", only time is lacking! So watch out for a huge 1.6 patch coming to you! Also know that the next expansion is already being work on and will focus on stuff that happens on Eyal at the same time as the main campaign but... elsewhere.

Hell there may even be some new cool stuff coming to Embers of Rage... did anybody say new class? No ? Oh I thought so..

But for now I feel like I've written more than enough and if you managed to read it all and not get utterly bored, I thank you and will see you soon!

Have fun in Eyal!