February 21, 2015

Caves 'n Critters

So I have started playing what is probably one of the geekiest games around: Dungeons and Dragons. A friend of mine wanted to give it a go, and was offering to DM the experience. We quickly found enough party members to actually give it a go, and we haven't looked back since.

We're currently just playing with the default characters, acquanting ourselves with the game mechanics, and getting into the whole roleplaying spirit. But, being geeks, we also quickly started looking at apps which could help us out with all of the bookkeeping which comes with this game.

What we found was that there was no one app for all our different platforms, and certainly not one which would share its data across our devices. Which meant that we couldn't really help each other out very easily.

Now, as loyal readers of this blog you may have already guessed at what's coming. Yes, I decided to write something myself. And yes, I put it on sourceforge. It's called Caves 'n Critters, and it currently looks something like this:

The main features are that it works across all of our devices, which include laptops (Mac and Windows) and tablets (iPad and Android). In addition, any player who is connected gets all updates made by other players. This is most effectively seen in the combat initiative tracking screen:

The current life totals reflect the changes made by players as their characters take damage or heal. When rolling initiative each player just enters their roll, and the initiative list gets sorted automatically across all screens. The DM can indicate the current active player, and that too is shared across screens.

In its current state it's definitely usable, but the experience on tablets could be much better. It seems much harder than it needs to be to make nice apps by means of HTML, CSS and Javascript. The browser gets in the way too much, and some things just feel sluggish...

We'll be tweaking this one further as we keep playing. If anyone else feels like giving it a try, just download the code, read the readme, and let me know how it all went.

October 19, 2014


If the previous post piqued your interest, then there is now more to be found over at incidentalcomplexity.com. What was initially called Aurora has been renamed to Eve. Looking forward to playing with this one!

September 10, 2014

Projectional Editing

I have written on this blog before about my attempts at building a structural editor which turns the parsing equation upside down. Today I learned there is a name for what I have been trying to create: Projectional Editing. The top hit when googling that term comes from Martin Fowler; which is nice as I based some of my work on his articles on language workbenches.

I stumbled on this terminology through a presentation on InfoQ titled "The Art of Building Tools–A Language Engineering Perspective". It's showing examples of this technique in different contexts. Some pretty low-level programmer stuff, but also in the realm of requirements specification. Very cool.

A related presentation, also on InfoQ, is "Enhancing Notational Flexibility and Usability of Projectional Editors". This is showing off JetBrain's MPS, which is a language engineering workbench used as the backbone by the first presentation. I have stumbled on MPS before some years ago, but I think I may have to take a second look at it.

More interesting still is Aurora, a project being worked on by Chris Granger (of Light Table fame), which I'm desperate to take a closer look at. I'm not sure if Aurora is doing projectional editing, though it sure sounds like it. That and some other pretty crazy stuff (programming in a database !?).

I don't know about you guys and galls, but I'm looking forward to see where all this is going.

August 11, 2014

Hardened Quines are hard

I have mentioned Quines here before as pieces of code which bend the mind. Well, the following Quine bends it a bit further: this one is "radiation hardened".

To refresh everyone's memory, a Quine is a piece of code which, when evaluated, yields its own source code. Well, the linked Quine is one which still functions if you delete any one character!

Who does it better ?

April 28, 2014


While exploring Clojure's core.logic a bit, I stumbled on a set of just amazing videos. Clojure's core.logic is based on an implementation of miniKanren. If you don't know what that is, don't worry, I did not either. But it is really simple: MiniKanren is a DSL for logic programming based on three logical operators (==, fresh and conde) and one inference operator (run). If you take that you can do some really cool stuff. What exactly ? Well, that's where these videos come in:
I'm purposefully not saying what exactly is being shown. Just pick any one and you'll probably catch the bug. (Or maybe that's just me. :-))

April 10, 2014

Minimalist Parser Combinators

Now over at my github account: a minimalist implementation of parser combinators. Parser combinators provide an easy yet powerful way of implementing parsers, without the need of understanding compiler theory or formal grammars (though it can't hurt, of course). They also form the basis for my Koopa project, precisely because you can easily extend this technique to fit your needs.

This minimalist implementation may be slightly too minimalist, though. It only tells you whether something can be parsed or not. There is no way to extract anything useful while doing so —yet.

April 01, 2014

Minimalist Entity/Component System

I just uploaded a new addition to the minimalist code series. This time it's a minimalist version of an Entity/Component System. An ECS is a bit of a specialized architecture for modeling complex systems of dynamic objects. The origins for such systems come from the gaming world, but it has made its way into very different kinds of applications (the LightTable IDE is a great example here). If you're interested, the Entity Systems Wiki is a great resource for going deeper.

Javascript makes it really easy to set up such a system. In fact, the example I added is way more complex and took much longer to write than the actual engine itself. I was debating with myself whether or not to go for a more fluent API than what I provided now, but I was somewhat worried that I would be explaining the fluent part more than the actual ECS principles. If anyone is still interested in a more fluent version, though, let me know and I'll spend some time on that.