Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DK_L

AI programming

This topic is 6914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Can anybody tell how to write a simple AI source code?? Because I have no idea how it works... Thanks cu DK_L

Share this post


Link to post
Share on other sites
Advertisement
What is the AI going to be used for? What type of game/project? AI is inplemeted differently based on what it is for.

Domini

Share this post


Link to post
Share on other sites
Very, very simple player-tracking code:


if(playerx < monsterx)
monsterx--;
if(playerx > monsterx)
monsterx++;
if(playery < monstery)
monstery--;
if(playery > monstery)
monstery++;


That''s a start... you probably get the idea that it''s mostly just if-this-do-that. Of course, there are higher-level things that are more abstract, like neural nets, but that''s a little too advanced for a simple example.

lntakitopi@aol.com | http://geocities.com/guanajam/

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!