# ANN

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

## Recommended Posts

i would like to use ANN to modify the state of my NPC. i was wondering how could i transform floating output values of the net into NPC state values... cheers !!

##### Share on other sites
Well, you could set the NPC values directly to the output from the net if it is the same format or if the npc value is a toggle with discrete settings then you could assign each output to a state and then whicever output is the highest that is what the npc state will be set to. If you provide a little more detail as to what exactly your are trying to do I might be able to help more.

##### Share on other sites
my NPC should have some states like the following:

according to the output values, i would like my NPC takes one of these states. my problem is a net output could doen't give discrete values like that, i can't for example only give me -1 or +1.

basically i don't know how to transform the net output to some values which can be used in my game....

##### Share on other sites
What you should do is have as many outputs that you have states, except maybe for dead, which is not a decision your NPC takes...

So, for ATTACK, HIDE, FLEE, WEAPON_SEARCH, MEDECIN_SEARCH, BLOCK, IDLE, SEARCH and FOLLOW, you'd define a neural net with 9 outputs from [0,1], and then, after processing your input, you check each output and select the one with the highest value. Since each output is matched to a state, the index of the output that's activated the most should match with the "decision state" from the list of states you gave.

Hope this helps

##### Share on other sites
your idea for the output values seems good. what about the input values?
basically, i would like to feed the network with some values like: distance, life and weapon.

All of these inputs are floating values, are often greater than 1, how do you think should i represent them in order to feed the network ?

##### Share on other sites
Well, its usually recommended to transform your input data to something simpler for your NN to learn. As an example, turning your health from 0 to max_health to 0 to 1 would help. Other than that, it depends on what you're trying to do... like what would trigger the BLOCK state? What would trigger the FLEE state?

If you want to use supervised learning, I guess you'll need to know what sorts of input are required to trigger your outputs so that you can build your training set.

Hope this helps

Eric

##### Share on other sites
Quote:
 Original post by jolyqri would like to use ANN to modify the state of my NPC.

Why? Is your problem that you want to drive your NPC by a 'brain' learned from training data (perhaps from watching a human player). Is your motivation for choosing an ANN for this task that you think it is the best tool for the job, or are there other motivations for choosing this framework?

Quote:
 i was wondering how could i transform floating output values of the net into NPC state values...

A fuzzy classifier would be appropriate for this task.

##### Share on other sites
Quote:
Original post by Timkin
Quote:
 Original post by jolyqri would like to use ANN to modify the state of my NPC.

Why? Is your problem that you want to drive your NPC by a 'brain' learned from training data (perhaps from watching a human player). Is your motivation for choosing an ANN for this task that you think it is the best tool for the job, or are there other motivations for choosing this framework?

Quote:
 i was wondering how could i transform floating output values of the net into NPC state values...

A fuzzy classifier would be appropriate for this task.

i'm doing some researches on ANN. basically i would like to create a NPC capable of learning the player behaviour and react accoding to it...

as i said earlier, my problem is how to transform the game variables to ANN valid inputs

##### Share on other sites
Quote:
Original post by Timkin
Quote:
 Original post by jolyqri would like to use ANN to modify the state of my NPC.

Why? Is your problem that you want to drive your NPC by a 'brain' learned from training data (perhaps from watching a human player). Is your motivation for choosing an ANN for this task that you think it is the best tool for the job, or are there other motivations for choosing this framework?

Quote:
 i was wondering how could i transform floating output values of the net into NPC state values...

A fuzzy classifier would be appropriate for this task.

could you tell me more about the fuzzy classifier?

##### Share on other sites
If all you want to do is creating an interesting sample space in which to observe the behaviour of a neural network then this sounds a bit like overkill.

Afterall, it means you first have to create the environment in which you want to test it. i.e. an environment in which your choices of {ATTACK,HIDE,FLEE,WEAPON_SEARCH,MEDECIN_SEARCH,BLOCK,IDLE,SEARCH,FOLLOW,DEAD} all make sense. For instance, how clear is the difference between HIDE,FLEE and BLOCK? and in what situations will one be suitable instead of the other.

I would suggest you start with a smaller sample space first e.g.{ATTACK, FLEE, HEAL}.

If, however, you are working in a pre-existing environment, e.g. modding a game, then your outputs could be mapped to states the way xEricx described. From what I know of fuzzy logic it's practically the same thing.

As for your inputs you need to figure out what information is important in determining the best state.
For instance, distance from opponent will probably be important, availability of cover, current health status, current weapon status, weapon oppenent is carrying, opponents health status, ... basically, think of everything that would help you in making a decision of how to act in that environment, and give that information to it.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 15
• 14
• 46
• 22
• ### Forum Statistics

• Total Topics
634054
• Total Posts
3015274
×