Computer Science Canada Artificial Intelligence. |
Author: | KeyBladeMaster [ Thu Nov 22, 2007 3:35 pm ] | ||
Post subject: | Artificial Intelligence. | ||
I Have know idea what I am doing. im making a game that u need to fight little things. i dont know how to make them random these are the declarations for the enemy
|
Author: | Euphoracle [ Thu Nov 22, 2007 4:38 pm ] |
Post subject: | RE:Artificial Intelligence. |
Is there a question in this post? :S What do you need help with? |
Author: | Tony [ Thu Nov 22, 2007 4:52 pm ] |
Post subject: | RE:Artificial Intelligence. |
Grammar, apparently. Also there was something about "random". He might be looking for Rand.Int() |
Author: | KeyBladeMaster [ Thu Nov 22, 2007 5:18 pm ] |
Post subject: | RE:Artificial Intelligence. |
Sorry, guess i didnt make it that clear... I want to know how to make the character attack and walk randomly would someone be able to give me an example code or something? |
Author: | Tony [ Thu Nov 22, 2007 5:57 pm ] | ||
Post subject: | RE:Artificial Intelligence. | ||
something like
maybe |
Author: | petree08 [ Thu Nov 22, 2007 7:52 pm ] |
Post subject: | RE:Artificial Intelligence. |
mabey you want to have a comparasion between the players position and the enemy and have the enemy folllow the player, thats what i did for my jedi game heres some psuedo code for a side view if XEnemy < XPlayer - (A random distance from player) then move enemy right elsif XEnemy > XPlayer + (A random distance from player) then move enemy left else Enemy is still (may face player though) end if sorry for crappy formating make sure the random distance from the player doesn't change after it's randomized (using randint or Rand.Int) other wise enemy tends to "spaz out" and constantly change dierction also you could have the enemy go on a set path that is calculated with random values OR the players position tells the enemy what path to follow base on set values or the enemy could be in a "patrol sate" (where the enemy walks back and forth) until the player gets with in range when the player is in the range the enemy is in an "attack state", well that's the basic idea behind my halo game's ai system Well hope that helped there are many differn't ways to do AI try out differnt things see what works out |
Author: | LaZ3R [ Thu Nov 22, 2007 9:50 pm ] | ||
Post subject: | Re: Artificial Intelligence. | ||
Random moving circle?? That's not AI though... It's in no way intelligent. That only comes in when you factor in the environment around the enemy. So on a blank white screen, he shouldn't be having a heart attack running in circles. If he see's a player, based on his character, he would charge them or be defensive, etc etc... |
Author: | KeyBladeMaster [ Fri Nov 30, 2007 5:02 pm ] |
Post subject: | RE:Artificial Intelligence. |
thanks, that actually helped a bit:D |