Archived

This topic is now archived and is closed to further replies.

jakovo

What do Naural Networks are used for?

Recommended Posts

Hi floks! I know that Neural Networks technology are used some times in game development, I know how they work, but I can''t figure out what are they exactly used on... has anybody worked with them before?, and how did you implemented it?... or at least any exmples of how can N.N. be used into a game??? Thanks! jakovo

Share this post


Link to post
Share on other sites
The best use in a game would be for AI. A neural net could give a more realistic responce to a paticular action in the game. However I couldn''t tell you how to write one.

Share this post


Link to post
Share on other sites
Ok, no problem about writing them... I know how...

but... any examples about AI implemented this way ?

jakovo

Share this post


Link to post
Share on other sites
Hi,

Neural nets are used to classify a set of data into belonging to a predefined class (set up during training). They are good at recognising things that they haven''t seen before, as long as they are fairly similar to what it knows.

You can''t just input a picture (for example) and expect it to recognise what type of monster (or player) is in it. I thought you could before I actually did a few courses in them... It should have a fairly small number of inputs so complicated data like a picture would have to be pre-processed. So if you want to detect a green-skinned enemy, just work out the percentage of green pixels and use that single value as an input to the net. This also means that in a green location, the neural net would get confused, almost as if the enemy was camoflaged. You could also work out the number of pixels that have changed since the last frame and use that if your character is not moving.

An example of it''s use in games might be for an AI character to choose which weapon to use. The inputs would be if there was an opponent in the room, how much health he/she has, the size of the room and the amount of ammo for each weapon. Based on that the neural net could rank how good each weapon would be in the current situation and best one could be picked, or ignored for different difficulty levels.

Another example could be what to do for an AI character. Given the amount of health and ammo, does he try and attack someone, go for a health pack, go for more ammo, etc.

Depending on how you train the net, it can give different characters different personalities, so one might always try and stay at maximum health where another one might just run into every fight he sees. This requires a neural net for each AI character but can add a lot of depth to the game. You can also train them (not too fast though or the framerate will suffer) as the game runs so that they can learn your tactics.

One thing I have learned whilst studying them is that you don''t actually have to train them sometimes. All a single neural net layer is doing is space partitioning in n-dimensional space, where n is the number of inputs into the layer. So for small numbers of inputs (2 or 3), it is possible to define a line or plane that partitions space between the classes and put the parameters of the line or plane equation striaght into the layer weights. It sounds a bit strange, but it does work. All the training phase acheives is to find these partitions and put them roughly between the classes, which are usually clustered in space. A second layer can simulate a logic operation to combine a class clustered in two areas in an ''AND'' or an ''OR'' operation. So for a 2-input layer, like my second example above, you can just give a seperate program a few classes, and tell it what situations should be classified as that class and the program can generate the partitions using Voronoi diagrams (I think that''s the right one?). I can post a diagram (or a link to one) if it helps.

Dan

Share this post


Link to post
Share on other sites
Thanks Dan!

Now I see how can it be implemented, I found very intresting all you mentioned!. If you can post or send a link of one of those diagrams it would be very helpful

jakovo

Share this post


Link to post
Share on other sites
I''ll try and put one together tonight and post a link.

I also forgot to mention that if there are too many inputs to make a 2d or 3d representation, you can use a Kohonen layer and a coordinate layer to reduce it down to that. That might start getting be a bit complicated though.

Dan

Share this post


Link to post
Share on other sites