[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] AI Module



Dear All,

My Names is James Ravenscroft and I am an Artificial Intelligence and Robotics major from Aberystwyth, United Kingdom. I am interested in taking part in PyGame for the Google Summer Of Code.

I was interested to see that a pygame 'AI' module was on the list of ideas, under the unsorted/incomplete section. I had a quick read through your mailing list and noticed that a couple of other students have also been interested in this field. However, I wanted to bring something new to the table.

I appreciate that a general purpose 'AI' module is quite a difficult concept to explain, never mind to implement. I noticed that previous students who were interested in this field, were looking to implement a handful of AI algorithms without any particular framework or design. I wanted to look at a general AI construct, suitable for almost any game or simulation. I believe that the algorithm that carries out the AI's behaviour is less important to the game designer than the behaviour itself. AI algorithms are often very complicated and since one of PyGame's focuses is simplicity, I think it would be best if the various algorithms are kept out of the way of the PyGame users (unless users really want to play with them).

Since PyGame is a game/multimedia framework, I started by brainstorming the aspects and attributes that game AIs have in common. During my investigation, I realised that there are many types of computer game and therefore, many types of game AI. I did, on the other hand, still manage to find a small collection of attributes that most Game AI constructs have in common.

Most modern game AIs:

I believe that over the course of a couple of months, it would be possible to knock up a general purpose AI construct (suggestions for names and humorous acronyms welcome) that integrated into an end user's game model. The construct would subscribe to some aspect of the game model, running in a loop that compares it's performance to it's SCs and reacts relevantly. I also plan on implementing path finding in a 2D (and perhaps ultimately a 3D) environment.

When a user wants to use the AI, they would:

  1. Derive from the AIConstruct class, writing actions for their SCs. e.g. locate a health machine on the map, find a path to it, travel the path and use the machine.

  2. Map a dict of SCs against a 2 element tuple of how close the AI is to achieving/failing as a percentage and the relevant action implemented in step 1.

  3. Run the AIConstruct loop which would repeatedly carry out comparisons with the SCs and perform the most relevant action.

My proposal still needs some refining, however, I think that this AIConstruct framework would be a convenient way for developers of varying types of game to include artificial intelligence in their code.

Please write back with any thoughts and feedback on my idea.

Kind Regards,

--

James Ravenscroft