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

Re: [pygame] AI Module



I suggest getting in touch with people who work with game AI. For
example jdog500 is modifying the
AI for the game Civilization 4 and possibly is using python for some
of it, you can contact him on the forum:

http://forums.civfanatics.com/forumdisplay.php?f=245

He has worked a lot on optimizing the AI code, perhaps a basic
optimized toolset can be useful and more
flexible. I'll throw some links at you, I haven't gone through them,
but they are threads around when such
discussions took place for the Civ AI:

http://forums.civfanatics.com/showthread.php?t=331141
http://forums.civfanatics.com/showthread.php?t=336052
http://forums.civfanatics.com/showthread.php?t=329393

Mark

On Tue, Mar 30, 2010 at 2:08 AM, Thadeus Burgess <thadeusb@xxxxxxxxxxxx> wrote:
> Sounds like an excellent idea to me.
>
> -Thadeus
>
>
>
>
>
> On Mon, Mar 29, 2010 at 11:08 AM, James Ravenscroft
> <ravenscroftj@xxxxxxxxx> wrote:
>> 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:
>>
>> are simulcra of a human player's behaviour – whether in the form of hard
>> hitting FPS bot, a General in an RTS or a Sim, happily bobbing through their
>> daily life (Ok so they might be called NPCs but they take cover, use medkits
>> and kill each other too).
>>
>> have a set of conditions that they strive to meet – to kill other
>> players/bots, to heal the player magically in an RPG, to maintain a very
>> important strategic structure by defending it with their lives. From herein,
>> I refer to these as Success Conditions (SCs).
>>
>> give priority to their SCs, making some more important than others - for
>> example it might be preferable for a Bot to heal and prevent their own death
>> than to attempt to kill the player if the bot's health is low.
>>
>> have an assigned action for improving their performance against each SC.
>> E.g. if the dinosaur is limping badly, it should run (or hobble) away from
>> the player to avoid death.
>>
>> 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:
>>
>> 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.
>>
>> 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.
>>
>> 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
>>
>