Ravi Mohan's Tech Blog. To read my non technical blog, click here

Friday, February 6, 2009

Exploring Game Engines

A few of us meet on the last Saturday of every month to review our technical progress (or the lack of it). This is somewhat like an iteration meeting in an agile project but focussed on personal achievement. I've written on such "Loser's Club" meetings before.

Recently we added a new wrinkle - each participant of the monthly meeting sends a weekly progress report to the others explaining what he worked on this week.


The following is the (lightly edited) report I sent a few minutes ago.


For the first time in a very long time I worked every day of the week without unnecessary distractions.

As you know, I am working on an AI simulation project. Visualization is a key component and to understand how best to do this, I've been working on understanding the game loop in game engines and what modifications need to be made to use it in simulations. There seems to be a trade off between running the simulation as fast as the hardware allows (needed for effective sims) and slowing the simulation down to (some small multiple of) the screen refresh rate (typically 50-75 Hz) so humans can interact effectively. Networking multiple machines (the simulations needs to, ultimately, run on a cluster) has design implications on implementing the Game Clock (or Sim Clock).

One approach is to completely decouple the sim (which could write the results out into a file, say) and the display (which could work off that file). For some algorithms, ( eg Apprenticeship Learning) , where human intervention and process modeling is part of the learning process, this approach would be problematic, and anyway networking is still an issue, so I need to find a good approach).

I have the beginnings of a really nice game framework (if I do say so myself). I have implemented multiple buffering strategies (pointer flips vs image redraw - The j2se comes with all this bundled up but since the final implementation will not be in Java I am implementing them from scratch to get a good understanding of how it works - only machine for e.g pointer flips give a 50 % boost to the fps), image loading, and a controller that allows either human or algorithm control (most game engines tie the event handling into the guts of the game).





I've attached a (really yucky for now) screenshot. It just shows some sprites moving against a nondescript background, but I am doing some interesting experiments behind the scenes.

In the coming week, I hope to resolve the sim vs game timing issue and also understand (a) tiled backgrounds and (b) how level editors work.

Regards,


The act of writing out what was accomplished every week is very helpful. There's nothing like having to write "Nothing useful accomplished this week" a few times in a row, to alert one to the fact that your life is flowing down the drain!

Last week, I also read "One Jump Ahead:: Challenging Human Supremacy In Checkers", which is an account by Dr.Jonathan Schaeffer of how he built Chinook, a program to beat the Checkers World Champion. This is a very interesting and (to researchers) very inspiring book. Jonathan also explains how he went on to solve Checkers (in the sense that Tic Tac Toe is a completely solved game). All in all, a great account of how research is really done.

4 comments:

Kunid said...

Hi,

Thanks for the insight - although it wasn't clear just how much progress you made since the previous week. Could you shed some light on that please? (or was everything mentioned in the 4th paragraph of your report achieved in 1 week?)

Secondly, do your colleagues/friends offer any help/guidance with your project(s)?

Lastly, what kind of feedback do you (or any other) members get if they don't have much to say on their progress? (if it ever happens :) )

Regards,
Dinuk

Ravi said...

@Kunid,
"was everything mentioned in the 4th paragraph of your report achieved in 1 week?"

yes that's one week's work.That said, I was actively working on *this* project only about three hours a day,since I had some travelling to do so this is roughly 20 hours worth of work.

"Secondly, do your colleagues/friends offer any help/guidance with your project(s)? "

Yes they do. They are all working on very interesting projects. The members of the group are there because they are people worth listening to!

"Lastly, what kind of feedback do you (or any other) members get if they don't have much to say on their progress? (if it ever happens :) )"

This does happen sometimes. In which case the weekly report is "Nothing accomplished this week". When you write that 2 -3 weeks in a row, you'll feel so bad you'll get right back to work!

John Haugeland said...

If you like stochastic learning and game agent books, you need to pick up a copy of the book Blondie24: Playing at the Edge of AI.

Ravi said...

@stonesypher,
I was reading One Jump Ahead" by Johnathan Schaeffer (author of Chinook) and he does a pretty devastating critique of "Blondie 24", which sounded logical to me at first glance

That said I should pobably pick "Blondie" up anyway.