I don't know much of anything about AI programming, but I know the basic logic of it...I just need pathfinding GAH!!!
The purpose of using a score system is so you can evaluate the best possible decision, so you loop through all surrounding conditions, and score each condition. For example, If playerhealth > (npcHealth * 2) then choicescore = choicescore-50. This way, you can evaluate your choicescore at the end of processing the conditions, so you can say: if choicescore < 20 then runaway(). Using a system like this, you can make an AI usually choose the best action for the current decisions, and you could even make "personalities" using the score system, for example, for a cowardly npc this would be more realistic: if choicescore < 40 then runaway. Basically, higher choicescore would mean the conditions are leaning further toward the npc, and it stands a better chance if it were to fight than if it ran away. A choicescore system would work best when integrated with a finite logic system, so you can further enhance the personalities of different npc's, so as to extend the logic from numbers to numbers and if statements, for example:
hope that helped.
The purpose of using a score system is so you can evaluate the best possible decision, so you loop through all surrounding conditions, and score each condition. For example, If playerhealth > (npcHealth * 2) then choicescore = choicescore-50. This way, you can evaluate your choicescore at the end of processing the conditions, so you can say: if choicescore < 20 then runaway(). Using a system like this, you can make an AI usually choose the best action for the current decisions, and you could even make "personalities" using the score system, for example, for a cowardly npc this would be more realistic: if choicescore < 40 then runaway. Basically, higher choicescore would mean the conditions are leaning further toward the npc, and it stands a better chance if it were to fight than if it ran away. A choicescore system would work best when integrated with a finite logic system, so you can further enhance the personalities of different npc's, so as to extend the logic from numbers to numbers and if statements, for example:
if choicescore < 20 and surroundingallies < 1 then runaway() elseif choicescore < 20 and surroundingallies > 1 then standandfight() endif ;this would do something to the effect of, if conditions are bad and there are no allies around, run away, ;if conditions are bad and there are allies around, stand and fight
hope that helped.