Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ANN: Chess III Arena 0.5
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] ANN: Chess III Arena 0.5
On Tuesday 03 July 2007 22:48:40 Grant Olson wrote:
> Chess III Arena 0.5 is my first (allegedly) non-trivial app in OCaml.  It
> is a fully functional chess game, although it lacks some desirable features
> such as a computer opponent and network play at this point in time.  It
> uses Quake III player models as the pieces.
> Binaries for windows and source for other platforms are available at:
> I've also detailed some of the things I like about OCaml on that page,
> since I don't write enough to have a blog, but I imagine I'm preaching to
> the choir on this list.

ROTFLMAO. Wow! That is absolutely amazing! Love the name. =8-)

Here's a quick patch, if you put this right after your definition of draw_md3 
in then the whole program runs an order of magnitude faster:

let draw_md3 =
  let m = Hashtbl.create 1 in
  fun x y ->
    try m (x, y)) with Not_found ->
      let list = GlList.create `compile in
      draw_md3 x y;
      GlList.ends(); list;
      Hashtbl.add m (x, y) list

This simply memoizes the rendering of each frame of animation for each model 
in a display list. The result is that your geometry is stored on the graphics 
card and rendered directly, hence the gratuitous speedup.

This is a wonderful idea for a first project in OCaml. I've taken a quick look 
at your code to give you some constructive criticism but your coding style is 
already excellent. Keep posting!

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The OCaml Journal