Advertisement

NPC modeling

Started by January 07, 2007 03:25 PM
19 comments, last by Timkin 17 years, 10 months ago

1D vs 2D vs 3D (labels for relative complexities....)



Ive been looking at '3D' simulations for behaviors of NPCs and I agree that the processing load is prohibitive (my simulation project requires a cluster of servers) and you are working toward a '2D' solution (when most games are stuck at '1D'....)

Each increase in complexity requires a magnitide (or more) increase in resources. You can still do clever things to minimize and optimize (Im doing that and the resource requirements are still huge in the '3D' level).



The player has to be clasified and the appropriate response patterns be applied.
You have to build a matrix of what different/patterns of attributes/appearance/actions(including history) of the player will trigger which policies(different flavors of behaviors) your Shopkeeper NPC will action in response. The more diverse and intricate it gets, the more logic endcases there are to handle.

I assume you want your simulation to have several increments of ways of handling the player and that requires as many subclassifications. Likely it will take a NPC customization vector of several control coefficients for the classification logic (lots of if-then clauses) to use. One per-player variable value might work for a player's history to weigh into the evaluation.

I dont see the difficulty being the history storage aspect, but as in the classification logic and the policy execution -- especially if made fairly generalized so it can be applied to all your NPCs (as far as even for random encounters) AND if you have per-NPC customization coefficient sets.
Even limiting it to 'shopkeepers', you could have them act somewhat differently for each NPC (and for the flavor of the shop...)
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
I had another thought about the weights. If somebody does something that's wildly different from what the NPC expected, much better or much worse, it would make sense for that to lower the weight in addition to (and before) updating; a sort of "I guess I didn't know you as well as I thought I did" response. This effect should probably be bigger for much worse than expected actions than for much better than expected actions. One could also keep a "craziness" record; when the PC does unexpected things, the weighted value for the NPCs opinion of how unreliable they are goes up, and that value reduces the weights given to new data in other areas (as well as likely simply tending to lower the favorability of the NPCs attitude toward the character).
Advertisement
you should read up about neural nets.
they seem quite perfect for this kind of things.

just use some input from the customer:
- clothes
- weapons
- reputation

and some things of your memory:
- what did the guy say who sold this item to me ?
- do i have a good relationship to him ?

and finally the question:
- can i trust him ?


you have to train your neural net, this is the hardest part i think.

but it adds some other nice side-effects:
if everybody wants to buy sth. for much less, you can go down with the price.
the npc will make quite good decicions and be a hard business partner.
I back the last idea and give some suggestions: store in a small db (indexed by all fields).Inputs about the current situation,output decided on each action and the Reality feedback on the decision if necessary .
This is for natural and explicit reference.

Train a NN with those values(using fuzzified or not Reality feedback)
The layers should be like this:

Nfo.about exterior(Inputs)
Special attributes about this exterior(intermediary layer)
Sumatory attributes(collection of special attributes)(another intermediary layer)
Output layer(Outputs)

This will allow however only non-reactive systems (the merchant won't decide something twice in a row unless you use what he has previously said in a sort of additional inputs(refer to reactive systems))
What does the neural net add to the picture? Sure, take fuzzy values and do fuzzy compares, but why run it through a neural net as well? What does that add other than complexity and the problem of needing to train the neural net?

Neural nets for this would be likely a waste of time (effort) when the decision processes is well defined. Fuzzy logic with control coefficients are more than enough to handle this and will be much less painful.
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
Advertisement
We need to institute a 30-day NN ban on this board. Sigh.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Quote: Original post by InnocuousFox
We need to institute a 30-day NN ban on this board. Sigh.


Neural Networks aren't the solution to every AI problem?
Heheh...

I agree with the last few posters. I don't believe an ANN would be an appropriate classifier in this domain. Decision trees, a fuzzy classifier, even a Bayesian decision network would be appropriate (and they have clearly understandable semantics with respect to the domain, making developing them a lot easier).

Quote: Depending on which theory the merchant accepts, he may react in different ways, and his beliefs may change.


This is a key statement in your question. You're suggesting that given a hypothesis, the agents actions and subsequent beliefs will change. Presumably the agent chooses its actions according to what it expects the action outcomes will be and it wishes to maximise the value of those outcomes. The actions chosen will determine what is observed. The observations are the basis for review of the likelihood of the hypothesis.

My impression is that what you want would be well handled by a Bayesian approach to solving a sequential Markov Decision Problem. Your merchant would benefit from using Value of Information methods to support its choice of actions and determination of the most likely hypothesis.

Cheers,

Timkin

Would the bayesian approach be able to adapt to new output solution, given feedback?

This topic is closed to new replies.

Advertisement