Neural Network & Decision Trees
I know it has been a while since my last post but I have been busy with working on this project complaining that Demigod has terrible networking, and I do not even start talking about the AI. So I will discuss what I have done instead. Over the weekend I fully implemented a neural network into our game that looks at the influence map as a unit spawns, moves, and dies. It will then tell the NPC what decision tree it should use. The trees the network has to decide from are Aggressive and Cooperative, Aggressive and Solo, Defensive and Cooperative, or Defensive and Solo. These trees are being developed and implemented by another member of the team.
In the game as a unit dies a heuristic determines how the tree should change and this becomes the expected output for the neural network. The network then gets a training iteration on this expected output.
If a NPC kills a unit another heuristic gets run on the tree the NPC currently has and trains the network based on the expected outcome. To test the adaptation of the network I have a few test trees in the game currently. I start the game and seed the neural network to run that gives me an expected output that represents a sit and do nothing tree. I know this is not one of the ones mentioned above but it is for testing.
So the units on my team just sit there and play cannon fodder. They do a really good job of this, as a few of them die the team learns that this is not the best strategy. With some fancy output I can see that the units gradually learn to not use that tree when surrounded by enemies instead use the attack solo tree. As they kill a few units they learn that others around them are doing the same thing and they use the attack regroup tree.
With these half implemented trees and my testing tree this provides a unique experience each time the game is run. The teams adapt to becoming aggressive really fast. I will continue to work on the heuristic to take the player into account and balance between defending the player and attacking the enemy.
3 Responses to “Neural Network & Decision Trees”
June 16th, 2009 saat: 2:00 am
I have been looking looking around for this kind of information. Will you post some more in future? I’ll be grateful if you will.
April 21st, 2010 saat: 12:19 am
Весьма забавная штука…
Начальник отдела So I will discuss what I have done instead. Over the weekend I fully implemented a neural network […….
May 18th, 2010 saat: 1:26 pm
Жаль, что не смогу сейчас участвовать в обсуждении. Не владею нужной информацией. Но эта тема меня очень интересует….
Косметолог So I will discuss what I have done instead. Over the weekend I fully implemented a neural network […….
Leave a Reply