Neural nets, Boring gameplay?

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Neural nets, Boring gameplay?

Post by omaremad »

I am attempting to use neural networks and genetic algorithms to control zombies that evolve, I was planning to have each "wave" of zombies be a new generation with offspring zombies of the best zombies from the previous generation. Sounds fine in theorey but in my tests it takes around 40-50 generations for the zombie behaviour to show any change; making the player kill 50 generations of zombies before the notice an ai change would be rather boring esp in the early generations.

Does anyone here have any experience with neural networks know of any methods to accelrate the evolution by genetic algorithms? even if it uses other learning methods in combination.

If not i will abandon neural networks and maybe use a finite state machine where things like move speed turn speed etc... evolve rather than neural nets.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Neural nets, Boring gameplay?

Post by Radikalizm »

I believe the discussion about neural nets for games has been brought up somewhere on these boards before
You could always try some optimization to get better training times, although I don't know exactly which kind of implementation you are using, but I don't believe it would ever out-perform a state machine in terms of flexibility
ANNs are very hard to fine-tune and tweak to your liking because of their "solve-anything" nature, which doesn't really make them ideal for these kinds of situations

I'd suggest you use the finite state machine like you suggested, it gives you much more control over what you can expect from your AI and will probably avoid you some serious headaches
HerrAlmanack
Posts: 52
Joined: Mon Jun 13, 2011 3:50 pm

Re: Neural nets, Boring gameplay?

Post by HerrAlmanack »

well, assuming you are using some system of mutation for your neural networks to "learn", which it really just sounds you are using natural selection, you could increase two parameters: the rate of mutation and the number of zombies.

EDIT:

i have been in the same boat you have been, trying to focus on amazing AI, but I've learned it all boils down to whether it is fun or not. sure, it might be cool from a devs point of view :) but for an end user with thousands of products to choose from (free or propriety) the novelty can wear off very soon. it's not so much about what's under the hood, as much as it is about how that final experience for the user is fun.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Re: Neural nets, Boring gameplay?

Post by Lonesome Ducky »

These days there are a lot of people who want to apply neural networks to almost every aspect of ai. But where it really shines is pattern recognition, e.g. face and letter detection, as you can easily supply it the tens of thousands of samples it needs to learn and the objective can't easily be achieved by other types of ai. But here, it will take ages for the neural network to learn anything while a much simpler, less computation intensive, ai can easily do the job better. I'd recommend not using neural networks for something like this.

Maybe you could actually combine the neural network with the base ai. The base ai could make the big decisions, while you could let the neural network learn to make small changes in those plans. This way, your ai will be functional from the start, but it can adapt at least somewhat.
HerrAlmanack
Posts: 52
Joined: Mon Jun 13, 2011 3:50 pm

Re: Neural nets, Boring gameplay?

Post by HerrAlmanack »

if you really are dead set on using neural networks, you probably have already heard of this, but I've seen some examples of OpenCL, and you can use that you harness your GFX card computation to do massive neural network computations. of course the idea is novel, and would be limited by things like hardware requirements, if you want to reach the masses with your game, that is.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Neural nets, Boring gameplay?

Post by Radikalizm »

Lonesome Ducky wrote:These days there are a lot of people who want to apply neural networks to almost every aspect of ai. But where it really shines is pattern recognition, e.g. face and letter detection, as you can easily supply it the tens of thousands of samples it needs to learn and the objective can't easily be achieved by other types of ai. But here, it will take ages for the neural network to learn anything while a much simpler, less computation intensive, ai can easily do the job better. I'd recommend not using neural networks for something like this.

Maybe you could actually combine the neural network with the base ai. The base ai could make the big decisions, while you could let the neural network learn to make small changes in those plans. This way, your ai will be functional from the start, but it can adapt at least somewhat.
I agree with this; if you're actually set on creating an AI which incorporates an ANN you should do a hybrid where the ANN makes minor decisions to kind of let the gameplay vary based on the player's actions
An ANN in itself is very cool from a developer's point of view, but my opinion (and as far as I know, the opinion of a lot of other game devs) is that you should try to avoid them for most purposes when it comes to game development (although in some genres they could be of some use)
HerrAlmanack wrote: if you really are dead set on using neural networks, you probably have already heard of this, but I've seen some examples of OpenCL, and you can use that you harness your GFX card computation to do massive neural network computations. of course the idea is novel, and would be limited by things like hardware requirements, if you want to reach the masses with your game, that is.
The concept of GPGPU to handle these problems is a very efficient and interesting idea, but as you said it's rather new and not supported in the majority of GPU's out there today
I hope to see an evolution of this in game development as soon as newer hardware (eg. DX11-compliant hardware) gets more mainstream; I'm doubting whether to integrate compute shader features in my engine to share the workload more between the CPU and GPU myself, I think it's a very fascinating concept but it would require a lot of work to be able to make it compatible with 'older' hardware

EDIT: Post 900! w00t!
fmx

Re: Neural nets, Boring gameplay?

Post by fmx »

Sounds like an interesting concept, but Lonesome Ducky is right that it would usually take a very very long time for the results to evolve, so using pure ANNs is not the best way to go.

You can easily simulate neural net results by simplifying the problem.
Have the system log all the player's movement patterns and use deterministic algorithms to modify zombie behaviours in future waves.
Say for example, the computer notices the player tends to stand in one spot onscreen, the zombies would then try to go around and trap the player from all sides
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Re: Neural nets, Boring gameplay?

Post by xDan »

I think this is more useful when evolving offline, e.g. at high speed and not involving a player (bots fighting against themselves).

About fine tuning and whether the results will be fun, in this
http://irrlicht.sourceforge.net/forum/v ... p?p=189008
the best tactic often seemed to be simply going around in circles... Which certainly wasn't very interesting.

I guess maybe with a more complicated environment and more ways to succeed it might improve.. Also if the GA/ANN decision making is at a higher level rather than right down on motor control.
Post Reply