4Blocks Source Code

7 05 2010

Today I decided to try my hand at releasing a cabal package with the 4Blocks code. I finally managed: http://hackage.haskell.org/package/4Blocks-0.2. (I made a newbie mistake in 0.1 so please ignore that release).

Unfortunately the library can be compiled only with, as far as i know:

  • GHC 6.8.3
  • Gtk2hs 0.9.13

The reasons why are in the README file in the cabal package, copy/pasted here:

Some notes:
– The game currently works only with GHC 6.8.3 due to its use of Gtk2hs 0.9.13.
– I haven’t tested with anything later but it is likely to fail due the fact that later versions of Gtk2hs have a different system of handling events.
– To make this project compatible with later versions of GHC and Gtk2hs two changes are required:
– Remove the function “permutations” which was copied from a later GHC base library
– Alter key-event handling to the version used by later Gtk2hs: some functions (in CommandKeys.hs) were simply introduced in order to disallow some of the keys used in the game (namely rotation) to trigger continuously when a key is held pressed. I believe this kind of behaviour can be managed automatically with Gtk2hs’ new event handling mechanism, however I haven’t had time to recode accordingly myself.
– I hope to write a patch for this in the near future.

So yeah, fairly old now, but I thought, I’d share the code all the same as some people have requested it earlier. Hopefully I will release the code with my AI later on after my project is over and done with in summer and also a patch to make it work with newer versions of GHC and Gtk2hs.

I have to say I really enjoyed coding the game in Haskell and if you have any comments for me, regarding better ways to code stuff, silly things I did, or anything else please let me know by leaving a comment!





Space Generals

6 05 2010

Hi all!

It’s been more than 4 months since my last post! I’ve been really busy lately creating a website for a game called Space Generals which we are going to use for our research in game AI. The game itself is actually a turn-based one much in the style of Risk with a little twist which will allow us to study hierarchical AI and domain-specific embedded scripting languages. The website’s front-end is developed in Java using the GWT framework while its back-end, which carries out turn-processing and game-logic, is developed in Haskell. Here are some screenshots of the game:

More information about the game and how to play can be found in the User Manual.

Feel free to register and play the game. You need at least one more friend to play a game and up to 5 players can play together.  Also, if possible report any errors and provide suggestions using the game’s:

Email Address

Twitter

Facebook Group

Also, it would be of great interest to us for you to share your game-playing strategies using the above methods as we shall be using them to create different AIs using the DSEL we are working on at the moment.

Thanks! We hope you enjoy the game!

P.S. Currently only Mozilla Firefox and Google Chrome are supported.