Closed Thread Icon

Preserved Topic: Anyone good at writing AI? Collaboration? Pages that link to <a href="https://ozoneasylum.com/backlink?for=8921" title="Pages that link to Preserved Topic: Anyone good at writing AI?  Collaboration?" rel="nofollow" >Preserved Topic: Anyone good at writing AI?  Collaboration?\

 
Author Thread
RobertG
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2003

posted posted 10-23-2003 14:24

I'm lousy at writing game AI, if I write the enemy behaviours for my raycasting game it'll end up looking something like:-


if(enemyX<playerX)enemyX++;
else if(enemyX>playerX)enemyX--;
...and so on

The engine is fairly flexible with adding behaviours to objects, for example to make lights flash from white to red (alarm type effect) I have a function:-

function Behaviour_ALERT()
{
//init
if(this.Dir==null){
this.Dir=(LD)?1:0;
this.Count=(LD)?0:100;
LD^=1;
this.OriginalColor=this.c;
}

if(this.Dir){
this.Count+=10;
if(this.Count>=100)this.Dir=0;
}
else{
this.Count-=10;
if(this.Count<=0)this.Dir=1;
}

this.c=RGB(BlendColor(this.OriginalColor,RGB(0xff0000),this.Count));
}

Which is passed to the object when it's spawned:-

CreateLight(x,y,color,Behaviour_ALARM);


Enemies, etc can be done in the same way:-

function Behaviour_CRAPPYENEMYTHATRUNSAWAY()
function Behaviour_STRONGENEMYWITHBIGGUN()
,etc..

So I can add a large number of different enemy types to the game.. I just don't know how to write the actual AI for them

If anyone's interested in collaborating on something then let me know.. I'd be interested in getting help on the AI coding, and the actual design, art, etc. The engine I have now is at http://www.elephantsneverforget.co.uk/dm/dm2.html I don't want to add texture mapping (speed) to it but could do if necessary. Could also add variable height walls, etc.

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 10-23-2003 17:32

there's a lot on AI at http://www.flipcode.com ... I heard somewhere that the best way to do AI is to play the game until the AI does something wrong.... then fix it and try again...

...and remember the "Double or Half" rule....


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-23-2003 18:09

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 10-23-2003 19:25

quick post : another great ressources for AI, is gamasutra, and obvsiouly ai-depot/. Beware, ai-depot goes really deep in the AI domains.

Mathieu "POÏ" HENRI

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 10-25-2003 02:22

holy crap, poi... that http://ai-depot.com/ has to be the coolest site on the planet!!!

*descends for months reading everything on it*


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 10-25-2003 17:30

Petskull: For sure Ai-depot is a great ressource. You know, it's an affiliate of flipcode.com. Have you ever had a look in the right panel, 1-2 screens down on the home It's linked with cfxweb, gamedev, ...

RobertG: AI is not my domain of expertise but what kind of informations are you looking for ? navigation ? combat ? teamplay ?
Check out Flipcode's Development Tutorials and Development Links, plus the articles and links at Ai-depot.

Mathieu "POÏ" HENRI

« BackwardsOnwards »

Show Forum Drop Down Menu