how do i create AI for my npc(s) in my game

This topic is locked from further discussion.

Avatar image for CHEATSman115
CHEATSman115

348

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#1 CHEATSman115
Member since 2009 • 348 Posts

like the topic says. how do i create AI for my npc(s) in my game

Avatar image for Chris_Williams
Chris_Williams

14882

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#2 Chris_Williams
Member since 2009 • 14882 Posts

why come to a fourm site for this kind of information, Google is your best friend in these kind of situations

Avatar image for deactivated-5c37d3adcd094
deactivated-5c37d3adcd094

8362

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#3 deactivated-5c37d3adcd094
Member since 2006 • 8362 Posts
Over 9000 'if' statements.
Avatar image for the_foreign_guy
the_foreign_guy

22657

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#4 the_foreign_guy
Member since 2005 • 22657 Posts
Over 9000 'if' statements.kamikaze_pigmy
else head-desk
Avatar image for medic36
medic36

486

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#5 medic36
Member since 2010 • 486 Posts
Breathe into them?
Avatar image for cybrcatter
cybrcatter

16210

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#6 cybrcatter
Member since 2003 • 16210 Posts

[QUOTE="kamikaze_pigmy"]Over 9000 'if' statements.the_foreign_guy
else head-desk

End If
Hax0r

Avatar image for 194197844077667059316682358889
194197844077667059316682358889

49173

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#7 194197844077667059316682358889
Member since 2003 • 49173 Posts
I did not fight in the Butlerian Jihad just so that you could make AIs, geth-breath :x
Avatar image for comp_atkins
comp_atkins

38931

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#8 comp_atkins  Online
Member since 2005 • 38931 Posts
what do you want them to do?
Avatar image for JIT93
JIT93

5590

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#9 JIT93
Member since 2007 • 5590 Posts

[QUOTE="the_foreign_guy"][QUOTE="kamikaze_pigmy"]Over 9000 'if' statements.cybrcatter

else head-desk

End If
Hax0r

No :evil:
Else if :twisted:

Don't forget to return a boolean, int, or whatever the javacla$$ says at the beginning

Avatar image for the_foreign_guy
the_foreign_guy

22657

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#10 the_foreign_guy
Member since 2005 • 22657 Posts
I did not fight in the Butlerian Jihad just so that you could make AIs, geth-breath :xxaos
The political correct term is synthetic. VI's just don't cut it.
Avatar image for kweeni
kweeni

11413

Forum Posts

0

Wiki Points

0

Followers

Reviews: 10

User Lists: 0

#11 kweeni
Member since 2007 • 11413 Posts
If Enemy.Spotted = True Then Do Badguy.ShootEnemy(You) Loop until You = Dead End If There you go. :D
Avatar image for jeremiah06
jeremiah06

7217

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#12 jeremiah06
Member since 2004 • 7217 Posts

like the topic says. how do i create AI for my npc(s) in my game

CHEATSman115
Just reverse engineer someone else's source code. I doubt you're trying to make a profit off of this game else you'd know how to program it your self...
Avatar image for sboyer2
sboyer2

941

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#13 sboyer2
Member since 2010 • 941 Posts
HTML
Avatar image for cybrcatter
cybrcatter

16210

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#14 cybrcatter
Member since 2003 • 16210 Posts

[QUOTE="cybrcatter"]

[QUOTE="the_foreign_guy"] else head-deskJIT93

End If
Hax0r

No :evil:
Else if :twisted:

Don't forget to return a boolean, int, or whatever the javacla$$says at the beginning

So you only know how to do it in Java?

Avatar image for the_foreign_guy
the_foreign_guy

22657

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#15 the_foreign_guy
Member since 2005 • 22657 Posts

You'll also need to load the data files into a blue box, don't forget that.

Avatar image for 194197844077667059316682358889
194197844077667059316682358889

49173

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#16 194197844077667059316682358889
Member since 2003 • 49173 Posts

[QUOTE="JIT93"]

[QUOTE="cybrcatter"] End If
Hax0r

cybrcatter

No :evil:
Else if :twisted:

Don't forget to return a boolean, int, or whatever the javacla$$says at the beginning

So you only know how to do it in Java?

Better than VB :x Though only slightly :(
Avatar image for chessmaster1989
chessmaster1989

30203

Forum Posts

0

Wiki Points

0

Followers

Reviews: 8

User Lists: 0

#17 chessmaster1989
Member since 2008 • 30203 Posts
Lots of loops I'm guessing. :( Friend and I made a text-based game back in 8th grade, it was fairly straight-forward but what you'll need is likely some randomizers and events based on those randomizers, as well as some sort of response mechansim.
Avatar image for JIT93
JIT93

5590

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#18 JIT93
Member since 2007 • 5590 Posts

[QUOTE="JIT93"]

[QUOTE="cybrcatter"] End If
Hax0r

cybrcatter

No :evil:
Else if :twisted:

Don't forget to return a boolean, int, or whatever the javacla$$says at the beginning

So you only know how to do it in Java?

Sorta, that AP Java test gave me a 3 :cry: so I know a little of it

Avatar image for cybrcatter
cybrcatter

16210

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#19 cybrcatter
Member since 2003 • 16210 Posts

[QUOTE="cybrcatter"]

[QUOTE="JIT93"] No :evil:
Else if :twisted:

Don't forget to return a boolean, int, or whatever the javacla$$says at the beginning

xaos

So you only know how to do it in Java?

Better than VB :x Though only slightly :(

I can't argue with that statement.

Avatar image for Oleg_Huzwog
Oleg_Huzwog

21885

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#20 Oleg_Huzwog
Member since 2007 • 21885 Posts

There are countless books and films out there that warn us of what will happen if we give birth to AI, yet people like you still try for it. No sir, I will not assist you in this doomsday endeavor.

Avatar image for 194197844077667059316682358889
194197844077667059316682358889

49173

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#21 194197844077667059316682358889
Member since 2003 • 49173 Posts
[QUOTE="chessmaster1989"]Lots of loops I'm guessing. :( Friend and I made a text-based game back in 8th grade, it was fairly straight-forward but what you'll need is likely some randomizers and events based on those randomizers, as well as some sort of response mechansim.

This is actually a good point; one thing I learned when doing AI for a pong game 10 or 15 years back is that behavior should cluster but not be flatly deterministic. In my case, introducing a short but random delay in response time to the ball changing trajectories suddenly made the opponent about a million times more convincing, as well as suddenly becoming possible to beat, as opposed to when it perfectly followed the trajectory at all times.
Avatar image for 194197844077667059316682358889
194197844077667059316682358889

49173

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#23 194197844077667059316682358889
Member since 2003 • 49173 Posts

[QUOTE="kweeni"]If Enemy.Spotted = True Then Do Badguy.ShootEnemy(You) Loop until You = Dead End If There you go. :Djeremiah06

void enemyAi(eneAi)

{

if (enemy.spotted == true)

{

while(enemy.health =/= 0)

badguy.attack = true

}

else

badguy.walkRoute

}

Tut tut, failed to type your argument, and it's not used anywhere in the method body. Also "!=" is the inequality comparison operator and walkRoute needs function specifiers to be called. Son, I am disappoint :x
Avatar image for deactivated-5c37d3adcd094
deactivated-5c37d3adcd094

8362

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#24 deactivated-5c37d3adcd094
Member since 2006 • 8362 Posts
ITT: Bad 'if' statement jokes.
Avatar image for 194197844077667059316682358889
194197844077667059316682358889

49173

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#26 194197844077667059316682358889
Member since 2003 • 49173 Posts
OK you got my on the "!=" however eneAi is an object so calling it in the function allows me to use all of its member functions...jeremiah06
Ah, but since you aren't referring to it anywhere in the scope of this function, you are just pushing a reference on the call stack, degrading performance minutely for no reason :P
Avatar image for jeremiah06
jeremiah06

7217

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#27 jeremiah06
Member since 2004 • 7217 Posts
[QUOTE="jeremiah06"]OK you got my on the "!=" however eneAi is an object so calling it in the function allows me to use all of its member functions...xaos
Ah, but since you aren't referring to it anywhere in the scope of this function, you are just pushing a reference on the call stack, degrading performance minutely for no reason :P

lol see edits...
Avatar image for kweeni
kweeni

11413

Forum Posts

0

Wiki Points

0

Followers

Reviews: 10

User Lists: 0

#28 kweeni
Member since 2007 • 11413 Posts

[QUOTE="kweeni"]If Enemy.Spotted = True Then Do Badguy.ShootEnemy(You) Loop until You = Dead End If There you go. :Djeremiah06

void enemyAi(eneAi)

{

if (enemy.spotted == true)

{

while(enemy.health =/= 0)

badguy.attack = true

}

else

badguy.walkRoute = true

}

ehhh....yeah....that's a little to complicated for me xD
Avatar image for jeremiah06
jeremiah06

7217

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#29 jeremiah06
Member since 2004 • 7217 Posts

[QUOTE="jeremiah06"]

[QUOTE="kweeni"]If Enemy.Spotted = True Then Do Badguy.ShootEnemy(You) Loop until You = Dead End If There you go. :Dkweeni

ehhh....yeah....that's a little to complicated for me xD

Its not accurate there are tons of mistakes... but its C++

Avatar image for kweeni
kweeni

11413

Forum Posts

0

Wiki Points

0

Followers

Reviews: 10

User Lists: 0

#30 kweeni
Member since 2007 • 11413 Posts

[QUOTE="kweeni"][QUOTE="jeremiah06"]

jeremiah06

ehhh....yeah....that's a little to complicated for me xD

Its not accurate there are tons of mistakes... but its C++

Yeah I know what it is. :P But I never used it before. We only use Visual Basic at school lol.
Avatar image for jeremiah06
jeremiah06

7217

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#31 jeremiah06
Member since 2004 • 7217 Posts
[QUOTE="jeremiah06"]

[QUOTE="kweeni"] ehhh....yeah....that's a little to complicated for me xDkweeni

Its not accurate there are tons of mistakes... but its C++

Yeah I know what it is. :P But I never used it before. We only use Visual Basic at school lol.

I can use VB, C++, java, and just a little C#. My school only teaches C++ and VB though...