Tuple Markup Language
tl:dr I rewrote Google’s Gson JSON library for use with TML. If you use Java and want clean, human-readable/editable data, use it.
https://github.com/codetaylor/Juple
Initially I decided to expose game data via scripts, or rather through a Java api. The scripts were just java classes that got loaded dynamically at run-time. Now keep in mind I’m just talking about data, not logic. This seemed like an awesome idea at first. Then I started using it.
It quickly became apparent that there was too much overhead, boiler-plate, cruft-shifting type coding going on. If I wanted to add a property to something, first I had to define it in the API, then go write the code to handle populating the value in-game, and finally, go modify the script. On top of that, there was the Java-doc for the API that would have to be kept up to date, not only for the data mapping methods, but also for the logic.
If I have a game entity that has four values, I don’t want to have to define a package, define imports, think of a clever class name (or concoct a new naming convention), write an interface in the API, write the class loading code, write the definition handling code, update the java-doc… ugh. Monolithic Sisyphus syndrome.
After a little thought, I decided to split the data definition from the scripting altogether. Scripts will now simply exist for logic and data will be defined without logic. Not to say that data will be generated illogically. A sniper? Let’s give her a hand-to-hand combat bonus. What? I didn’t see an ‘if-then’! No no… I digress.
The first tech that came to mind was XML. I played about with XML for a bit and then moved on to JSON. XML felt too cumbersome for what I imagined and JSON was a move in the right direction. Google has a pretty robust, open-source Java JSON lib called Gson, and I really liked how easy it was to use and extend. Then I ran across TML…
TML, or Tuple Markup Language, is a minimalist, all-purpose markup language created by John Judnich. I thought to myself, “That’s it! That’s what I’m going to use!” I delved into the GitHub repo.. ok C, C++, Javascript, Python: no lib for Java. So sad. Back to JSON I went, sighing all the way.
I was writing stuff like this:
{
"first name": "John",
"last name": "Smith",
"age": 25,
"address": {
"street address": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": 10021
}
}
…while dreaming about stuff like this:
[
[first name | John]
[last name | Smith]
[age | 25]
[address |
[street address | 21 2nd Street]
[city | New York]
[state | NY]
[postalCode | 10021]
]
]
I felt like I was painting with rocks. I just had to have the power and flexibility of the Gson lib, but for TML.
That’s why I rewrote Gson for TML… FTW.
It’s free, open-source, and has some decent docs, check it out.




