Advertisement

Any help required?

Started by August 10, 2001 07:28 PM
48 comments, last by Mathematix 23 years, 3 months ago
quote: Original post by Mathematix
FAO: Geta.

Hello Geta,

The first thing to remember about neural networks is that they were specifically created to search for frequently occuring patterns in examples presented to them. Neural nets are composed of what are called ''feature detectors'' that are designed for this specific purpose. The problem that you wish to solve for your first-person shooter is primarily a path finding problem, for which neural networks are not ideal.

Another branch of AI that is regularly used for such problems is A*. This algorithm involves dividing up the environment into a set of locations/vertices, and using these locations to determine the lowest cost (distance) to get to the desired location. This location could be a player him/herself, or the location of the enemy flag in a CTF game. The only real application for neural networks in such a game would be if you wished for the other bots to learn the movement patterns of players and other bots around the arena. This is such a complex, and time consuming thing to achieve that I am trying my best to delay my first attempt at solving such a problem for as long as possible!

Hope this answers your question.



Regards,
Mathematix.


Sorry, it did not.

Thanks anyway,

Eric
Heh. Mathematix, Geta is, uh, quite knowledgable in the field, and was looking for something a little more detailed. No doubt just to test you

(Note profile: Job Title Computer Game AI Consultant. He is also a ''Major Player in the Gaming Industry'', at least according to http://www.dperry.com/eric-dybsand.htm. Sorry Eric, had to be said )
Advertisement
quote: Original post by Kylotan
Heh. Mathematix, Geta is, uh, quite knowledgable in the field, and was looking for something a little more detailed. No doubt just to test you

(Note profile: Job Title Computer Game AI Consultant. He is also a ''Major Player in the Gaming Industry'', at least according to http://www.dperry.com/eric-dybsand.htm. Sorry Eric, had to be said )


To be clear, I was not trying to test Mathematix.

I am genuinely interested in what a ANN-Expert would think are the AI Decisions in FPS
and RTS games that make good canidates to be solved using ANNs. As I mentioned in
my original question, I believe one of the reasons ANNs are rarely used in commercial
computer games is that developers have not been able to find good uses for them.

Perhaps this could change if we got the ANN experts to offer up opinions on where ANNs
could be useful?

Eric
Well I did post a reply about ANN''s in computer games. It did have the boring homeostasis bit at the top but I left instructions on where to find my, oh-so-important opinion. Perhaps my ideas were so foolish as to not be worth a "pah and have done with you varlet" reply.

While I''m not an "ANN''s in FPS" expert I am pretty competent in that I''ve written AI for computer games professionaly and I know a reasonable amount about ANN''s from academia.

Mike
quote: Original post by Geta
Original post by Kylotan
Heh. Mathematix, Geta is, uh, quite knowledgable in the field, and was looking for something a little more detailed. No doubt just to test you

(Note profile: Job Title Computer Game AI Consultant. He is also a ''Major Player in the Gaming Industry'', at least according to http://www.dperry.com/eric-dybsand.htm. Sorry Eric, had to be said )


To be clear, I was not trying to test Mathematix.

I am genuinely interested in what a ANN-Expert would think are the AI Decisions in FPS
and RTS games that make good canidates to be solved using ANNs. As I mentioned in
my original question, I believe one of the reasons ANNs are rarely used in commercial
computer games is that developers have not been able to find good uses for them.

Perhaps this could change if we got the ANN experts to offer up opinions on where ANNs
could be useful?

Eric


My statements require no further analysis, I answered the question posed. There was no need for me to go into the specifics of neural networks if it was going to lead to exactly what I had just stated (QEF). As anyone who has come across neural nets will know, it is near impossible to accuratly describe in sufficient detail why neural nets would be unsuitable for specific applications in one posting. The features of neural nets architectures are numerous and focus on different ''methods'' for solving similar problems. I''m sure that it is possible to develop a neural net that would be suitable for any type of AI in game development, but if you wish to reduce the computational load on your system, it would be unwise to use such an architecture. More efficient methods exist.

Regards,
Mathematix.
quote: Original post by MikeD
(Before you start reading, bit about academic homeostasis at the top, reply about ANN''s in games half way down. Wouldn''t want you to bore yourselves now would I)

I only wrote that first reply because it''s what I''m working on at the moment for my dissertation and buggered if I can get it to work ;-). Homeostasis, btw, is something I feel is very important in neural networks and is the basis of learning during the lifetime of an agent. To quickly spill my guts and get on with a more game related discussion, if you imagine that an agent is born into an environment that is always the same, then no learning is necessary and all adaptation can be achieved phylogenetically (by evolution).
The idea of using homeostasis as a behavioural mechanism is that the agent may have certain internal variables that must remain within bounds such as heat, heart rate, pain level, hunger levels etc for the agent to continue functioning. If the organism is evolved so that adaptation in the environment is homeostatic, so that the agent''s behaviour keeps those internal variables within bounds then adaptation and learning are adjustments to behaviour due to transient (i.e. non-permanent) properties of the environment (where predators live, general climate changes), where changes to behaviour are aimed at causing the behaviour to adjust to _continue_ to keep the variables within bounds.
If adjustments to internal parameters (neuron firing rates, synaptic strengths) only occur when the essential variables are out of bounds, then evolving for internal stability while evolving for a specific behaviour should, in theory, evolve for an organism that retains external, behavioural stability by retaining internal stability in a changing environment.

Imagine an RTS AI has inputs from the world and outputs to actions, everything is going smoothly and its troops are _not_ being slaughtered (essential variables are in bounds), then it doesn''t adjust its evolved behaviours.
Suddenly the human player retaliates, the AI''s troops are being killed quicker than sin and the essential variables disappear out of bounds, then the AI''s behaviour is adjusted by rules evolved to change in a direction that will retain those essential variables within bounds. Hopefully, by adjusting its behaviour to regain internal stability, it''s being slaughtered is halted and it gets back into a more stable defensive or offensive position.

Sod it, I''ll just post my dissertation here when I''ve finished it.

Anyway...

On the subject of ANN''s in computer games (at last).
The problem with ANN''s is that they are an abstracted form of AI. They''re not easily human understandable finite state rules, they''re numbers connected to other numbers that give a numeric output. With a final state rule you can read it, have an expected event, see the event not occur, re-read the rule, see your mistake and debug. With ANN''s you can look at the network, see some numbers, stare at the numbers, cry a bit and go down the pub. If it doesn''t evolve to work you''re buggered.
The good thing about ANN''s is they are very easily evolvable as they are numeric values with a smooth genotype-phenotype mapping. With logical rules, evolving an answer has a very brittle fitness landscape. This means that a small change in the logical statement (think LISP, adding or removing a tree) can have huge phenotypic effects. This, in evolution, is bad and can lead to low local optima with no easy way of escape. Rolling hills fitness landscape good, manhatten skyline fitness landscape bad.

How to use ANN''s for an FPS then? Well, if you have a number of logical facts as inputs such as position of guns on the level, distance of agent from all these guns, position of enemies on level, their weapons, your health, their speed, your speed etc. you could, in theory have this as an input to a neural network and your next action as an output. Some kind of polling network, maybe, 25 possible next actions (find health, find sniping rifle, find bfg-2000, find cover, just f**cking run etc) then the one that got the highest score from the network could be kicked in to work with your handwritten code for actually performing the actions. You could, of course, have 10 outputs of amount to turn left, amount to turn right, gun to use, amount to move forward etc. and use them directly but that is unlikely to work, on a hunch, without a very complex, continuous-time (i.e. internal state) network that could be written by hand much quicker. I''m not saying it would work, but I''d have a backup plan. Perhaps even have a sub-sumption architecture with actions such as move from A to B as the base levels and goals, such as find health as the later evolved levels, all working together. Sounds a bit harsh if you ask me, but it could work if your company gives you the time for R&D.

So, ANN''s then, use them as heuristics for your next move, not necessarily directly without any other form of AI.

As to the number of layers? Personally I''d ditch the feed-foward network, evolve a fully connected network, possibly including recurrence, allow for the number of neurons to be increased by evolution i.e. a variable length genotype, but have a neutral addition mechanism, such as add the neuron but make all of the connections from it have zero weighting, so it makes no difference initially but can have its weights evolved onwards, letting evolution decide.

This is a long post, I''m not feeling great, so, goodnight ;-)

Mike


??????????? How you you get tiny quotes? ???????

Are you having me on Mike? :D Yes neural networks are abstracted from AI because they do not resolve logical expressions to come to conclusions, they instead modify a set of internal parameters to come up with a ''matrix'' which models the many possible conclusions that the network can come to. A fully connected network wouldn''t really do anything useful. Since synaptic weights are used to compute products during the training phase of a net, and 0 x n = 0 (for any value of n), the synaptic weights themselves will not be updated and equal to zero. In other words, your network will have a zero IQ.

Why do I get the feeling you know this??? You also know that the size if your network will be massive!

Regards,
Mathematix.
Advertisement
Damn it, then those agents performing phototaxis and landmark navigation on my computer must be the most functional dumb-asses I''ve ever seen.

Of course any network architecture that connects inputs to outputs can be used functionally and feed-foward networks are far from the be-all and end-all of neural nets. It''s the connections in a network that make the difference, not the number of neurons. So to have a limited number of neurons, all interconnected, can be of equal (perhaps more, perhaps less) use as a feedforward architecture with the same number of connections, depending on the problem.

If you''re argument is that you can''t train non-feedfoward architectures, then you''re right, but only if you''re talking about back propagation. You can evolve the synaptic efficacies just fine using a ga. In fact feedfoward architectures are only trainable because their architecture is so simple and mathematically tractable, which suggests that the dynamics of the system can be nothing but simple. No cross layer synapses, no recurrence, no dynamic system potential.
Not that I have anything against back-prop, it''s just that it does gradient descent error reduction, which dives into the nearest local optima it can. Okay, so you can use momentum (and other mechanisms) to prevent that, but back-prop only comes up with straight forward solutions. Not the novel potential of more interesting architectures.

I even once starting building networks out of Lindenmayer systems to see what would happen, but only tried it on phototaxis, which is the simplest of simple things. Basically I found that the more inputs connected to the network (it was possible that the branches would connect anything to anything else), the better it functioned. Maybe I''ll try it on something difficult one day.

I''m sure you have plenty to say on these matters and I look forward to hearing it :-).

Cheers,

''Highliy opinionated'' Mike
quote: Original post by Mathematix
My statements require no further analysis, I answered the question posed. There was no need for me to go into the specifics of neural networks if it was going to lead to exactly what I had just stated (QEF). As anyone who has come across neural nets will know, it is near impossible to accuratly describe in sufficient detail why neural nets would be unsuitable for specific applications in one posting. The features of neural nets architectures are numerous and focus on different ''methods'' for solving similar problems. I''m sure that it is possible to develop a neural net that would be suitable for any type of AI in game development, but if you wish to reduce the computational load on your system, it would be unwise to use such an architecture. More efficient methods exist.

Regards,
Mathematix.


Actually, the question posed was also about all the other AI decisions that are made in FPS and
RTS games, and not just pathfinding (which was simply offered as an example).

From your answer above, I get the feeling that you are offended in some way. If so, then you have
my apology. Offending you was not my intent. I had geniune interest in learning if an ANN Expert had
new ideas about how to best use ANNs in these types of games. I still do.

So in summary, is it your opinion that there are more efficient methods (other than ANNs) for providing
all AI Decision-Making in FPS and RTS games? And thus, that may be a key reason why ANNs are
rarely found implemented in commercial computer games?

Eric
quote: Original post by MikeD
Well I did post a reply about ANN''s in computer games. It did have the boring homeostasis bit at the top but I left instructions on where to find my, oh-so-important opinion. Perhaps my ideas were so foolish as to not be worth a "pah and have done with you varlet" reply.

While I''m not an "ANN''s in FPS" expert I am pretty competent in that I''ve written AI for computer games professionaly and I know a reasonable amount about ANN''s from academia.

Mike


I get the impression that I somehow offended you too. If so, you have my apology.

I read your long "boring homeostatsis" post, and with all the "in theory", "unlikely to work"
"have a backup plan" comments you made, I got the impression your post was simply wishfull
thinking rather than actual suggestions. Maybe I missed something?

Since you have "written AI for computer games professionaly" and you "know a reasonable
amount about ANNs from academia" then maybe you have actually implemented ANNs in
commerical computer games? If so, then for what types of games, and how did you use
the ANNs in those games? What kinds of decisions did you have the ANNs make? Were
the ANNs still performing learning after you shipped?

Thanks,

Eric
You only offended me by making me feel unanswered and unloved .

Seriously though, I did specifically state my backgrounds separately because I have never shipped a game with ANN''s in them, nor ones using GA''s or any of that malarky. I have created autonomous agents for simple tasks using ANN''s and GA''s, but only in an academic setting, I have also shipped games using fuzzy logic and your standard tried and tested AI methods for doing seemingly intelligent behaviour. I have, as I''m trying to make clear, never done both.

Your statement was

"I would be interested in reading your thoughts about how you would apply ANN to the AI decision-making needs of the typical First Person Shooter or Real Time Strategy game."

I replied, merely stating that using this kind of technology might lead to a dead end, might not work in time and that it would probably be difficult to implement without a more standard AI system running with it.

It might be useful to discuss what exactly forms the problems of an FPS game and why an ANN system should/shouldn''t be used to try to solve those problems. You have a far reaching background in this stuff Geta, so perhaps you could elucidate us with your opinions, even if they''re not what I (too much idealism, not enough pragmatism) or Mathematix would like to hear.

I am not pissed at you, I''ve known your background for some time, respect you and would value your opinion.

There are obvious facets of any game that have well defined solutions. A* for routing problems is an obvious one. Of course, I would argue here (and test, when I get my next job and am not so busy) that you could use GA''s (I know we''re talking about ANN''s here, but a little sidetracking won''t hurt anyone) to optimise the heuristics for various behaviours, before shipping. If you wanted heuristics to find the best path through a battlefield that won''t get you killed then a logical analysis might find you some good solutions. Evolution, on the other hand, might find you great soulutions as how different factors effect the probabilities of dying along each path and at each node, in a variety of situations.
Once you have a general path to the goal sorted out, then you still have to traverse it. As games don''t come in block worlds any more, your general path can only tell you where to head for and in a dynamic world there will be changing and moving obstacles along the path, which you will not necessarily want to recalculate again and again, per pixel, to complete the route.

So on a small scale you would want your agents to survey the local area and not get trapped behind each other or moving scenery. You could have simple rules defining whether to turn left or right under certain circumstances, to try and get passed the blockage, but if everything did the same thing in, approximately, the same circumstances, the illusion of intelligence would be lost (one reason I hate the AI in Dune 2 is things like this...harvester AI makes my skin crawl...loved the game though). By having the current state of the immediate environment passed to the agent''s evolved ANN (by line firing of the 90 degrees in front of the agent for several metres ahead, perhaps once every second or less), the reactions and decisions of which way to turn would be more individual due to no two situations being exactly the same. The agent would approach gaps between buildings or other agents to attempt to move towards its next node point and if other agents, who are stationary, had different ANN''s due to their status (still vs not moving) they could easily (and I have done this for a simple 2D world) be evolved to move out of the way, within boundries.

Of course there are other ways to achieve this reactive layer of action, but ANN''s are one that may prove promising compared to a more mechanistic approach. I''d have to use a profiler to compare speeds, but as ANN''s can be translated into linear equations I''m sure the maths co-pro would be fine.

Anyway, that''s one aspect of an FPS you could achieve with ANN''s, your thoughts?

Mike

P.S. One aspect of this kind of communication I hate is that you''re never sure how other people are phrasing their questions, in anger or with an interested smile on their face, without using a million of these buggers. Mostly I''m doing the latter .

This topic is closed to new replies.

Advertisement