EPIC news

So playing with clojure has spawned some useful results :). Namely EPIC, an engine for game combat. This is part of a huge secret project some friends and me are working on.

It works nicely so far, speed is - even so not at all optimized yet, quite good. Clojures STM and concurrency methods do a good job in allowing some stuff to run in paralell. So after a meeting on wednesday we decided to make this part of our project open source and publically available.

But what does EPIC do exactly? It calculates the outcome of fights mostly. You can define modules with certain propaties to them - a good set of them are predefined but you are free to extend them as you see fit if you want to do something else. Then once you've a set of modules they assamble to units, as in the unit is build from a certain cet of modules. Finally you toss in some AI for the units, stirr on medium heat and voila, you are ready for a fight.

We have set up a little demo if you want to see what EPIC can do. The fights on this page are all pre calculated and played back only (not live). But the calculation is done in EPIC with the current master branch from github with some custom modules.

So we don"t yet have a way to post combats yourself, but I can offer to add your own combats if you drop me a line and would like to see something. An example can be found here.

Have fun and let me know if you have any questions/suggestions.

Oh and you can find the source on github ;)/

Posted by Heinz N. 'Licenser' Gies Fri, 05 Mar 2010 09:36:00 GMT


A venture into 'new' technology

Lately I looked into a few new technologies. Namely Clojure - a very interesting and young language and MongoDB a also quite interesting database.

Clojure

Clojure is a new (it celebrated it's second birthday just this month) language. It is a functional programming language that is based in LISP and runs on the JVM. This is an interesting combination in itself, but to be honest it would not have cought my attention, while I always wanted to lern LISP just that it runs on the JVM isn't a reason to sit down and try it out, acutally since I'm not really fond of Java it is rahter something that makes me careful.

Saying that Clojure has a great way to deal with it's Java heritage, it claims to make Java suck hless (I think it's not their wording but it's the essence). It either hides the Java entirely from you or gives you a ver nice interop thtat indeed makes using java less painful. My cudos to that. I would like to show an example from the clojure.org website:

(. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))

That is about what needs to be done for a Hello World in Java, no classes no crazy main functions, I find that quite impressive.

Okay but I wanted to get to the point what made me curiose enough about Clojure to touch it even so it has the smell of Java stuck to it. Concurrency, since I usually work with ruby and this is the one thing ruby really does horribly, it cought my attention that Clojure promised to be very good with concurrency. It achiefs that by being functional and keeping all datatypes imutabel, which makes sense, everything that can't change is thread safe. But it does not stop there Clojure implement STM (Software Transactional Memory) to deam with cases where you actually have to change state from more then one thread - a nice solution since you don't really have to deal with the details of why it works even in cases where you've a concurent environment.

So in short, I really love this languyge, it is great work and the community is very nice. Everyone who had pondered with the idea to learn LISP it's now a good mement to do so, Clojure provides a good reason to sit down and learn, and it's even quite easy to do so.

MongoDB

Another new software I stumbled upon, acutally in combination with clojure, is MongoDB. MongoDB as the name suggests is a Database. So it is not a traditional relational database but a Document Store. That means it does not store tables with rows and fields that follow a fixed structure but collections that have documents which again have key value combinations without a enforced structure.

MongoDB is fast, I was impressed, since you can add keys for about everything most queries can be performed in close to no time. Another thing that is really nice is that you can store complex data structures as nexted structures or arrays, which is very nice since you don't have to care about refferential integrety and all that annoying stuff.

So it is not hard to notice that MongoDB still is young there are things that just don't work well yet, updating is a pain at times or requires workarounds, the Java Driver is confusing and leaks features, fortunately there is a quite good Clojure driver that encapsulates most of the confusion into a clean interface. And the concurrency support is more or less non existant.

Non the less I think MongoDB is a very nice database and I found it way easyer to use then traditional databases as MySQL, also while I've not tried it yet, MongoDB promisses a good scalability on clusters and clouds which is a big plus in my eyes.

Posted by Heinz N. 'Licenser' Gies Fri, 30 Oct 2009 09:27:00 GMT