Beruflich Dokumente
Kultur Dokumente
NEURONALE NETZWERKE
für nicht-spielbare Charaktere
Quellen:
https://towardsdatascience.com/an-exploration-of-neural-networks-playing-video-games-3910dcee8e4a
https://www.heise.de/tp/features/Bio-inspired-Computing-4876451.html
https://towardsdatascience.com/an-exploration-of-neural-networks-playing-video-games-3910dcee8e4a
https://www.innovecsgames.com/blog/neural-networks-games/
https://software.intel.com/content/www/us/en/develop/articles/an-introduction-to-neural-networks-with-an-
application-to-games.html
https://www.techradar.com/news/what-is-a-neural-network
https://www.datasciencecentral.com/profiles/blogs/crash-course-on-multi-layer-perceptron-neural-networks-1
http://cs231n.stanford.edu/slides/2017/cs231n_2017_lecture6.pdf
http://pages.cs.wisc.edu/~dpage/cs760/ANNs.pdf
http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf
Inhalt
1.1 Einleitung
1.2 Neurale Netzwerke für NPC`s
1.3 Beispiele
1.4 Theorem
3.1 Fazit
3.2 Quellenangaben
Struktur
Einleitung: Zuerst wird das Ziel des Artikels untersucht; wo machen neurale Netzwerke für
NPC`s Sinn, um anspruchsvollere Gegner zu erschaffen. Wo wurden ANN schon
eingesetzt für NPC`s und auch Spieler? Der lernende Gegner – nicht nur für Schwärme.
Hauptteil: Wo eignen sich neurale Netzwerke, spezifisch NEAT (ANN mit genetischen
Algorithmen), Spezies-Entwicklung, Supervision durch den Spieler.. Einzelne Intelligente
Gegner mit komplexem Verhalten, Übergeordnetes NEAT mit vielen Agents, (Evt erwähnt:
ANN als Spieler, Rennspiele, Strategie, Funktionsweise des ANN), und reguläre NPC`s.
Decision-Makers* und Anpassung an Spielerverhalten.
Endteil: Neue Erkenntnisse über die Verwendung von ANN, Ausarbeitung einer der oben
genannten Bereiche (Species, racing, strategy, all kinds of genres). Testen einer KI welche
Decision-Makers nutzt um sich den Angriffen des Spielers anzupassen(hide-camp, frontal
attacks, flanking, nest building), und sich dann spezialisiert.
Schwerpunkte Steuerung mit Rays, Pixeln, Entscheidungstreffen, Supervision durch den
Spieler und Reinforcement Learning, Beispiel an eigenem ANN Projekt.
Beispiel für Decision-Maker AI: „More likely than not, you're going to use a traditional state
machine for the majority of AI decisions but you may be able to use neural nets to
complement the decisions or to enhance the hard-coded state machine. An example of
this might be a neural net that takes as input such things as health of the character,
available ammunition, and perhaps health and ammunition of the human opponent. Then,
the network could decide whether to fight or flee at which point the traditional AI would
take over to do the actual movement, path-finding, etc. Over several games, the network
could improve its decision making process by examining whether each decision produced
a win or a loss (or maybe less globally, an increase or decrease in health and/or
ammunition)...
...The use of neural nets for pattern recognition of various forms is their ultimate strength.
Even in the problems described, the nets would be used for recognizing patterns, whether
health and ammunition, forces acting on an object, or something else, and then take an
appropriate action. The strength lies in the ability of the neural nets to be trained on a set
of well-known patterns and then be able to extract meaningful decisions when presented
with unknown patterns. This feature of extrapolation from existing data to new data can be
applied to the areas of speech recognition, handwriting recognition and face recognition
mentioned in the introduction... “
Artikel https://software.intel.com/content/www/us/en/develop/articles/an-introduction-to-
neural-networks-with-an-application-to-games.html
Ebenfalls interessant wäre die Evolution eines player supervised NEAT, welches sich
weiter entwickelt und je nachdem welche Parameter zum Erfolg führten, sich verschiedene
Stats (STR, CON, DEX, INT) weiter entwickeln und sich spezialisieren – bei meiner
Kampfdrohne (siehe Titelbild) könnten je nach Entwicklung ein Tech-Tree verwendet
werden, der je nachdem verschiedene Module (Beine, Sensoren, Waffen) anbaut an
gewissen Slots, zB alle 2 Generationen.
NEATs könnten in gewissen Spielen sogar die FSM ersetzen durch Decision Makers,
welche verschiedene Parameter wie Health, Energy, Ammunition, Threat und weitere
Berücksichtigen (bevorzugte Spielerwaffe?) und dabei immer effizientere Entscheidungen
treffen auf gewisse Verhalten, wenn zB der Spieler die KI immer mit der selben Waffe
erwischt ein entsprechendes Verhalten wählen dass die Gewinnchancen der KI erhöht –
verschiedene Waffen testen usw.
Denkbar dabei wären persönliche Decision-Makers auf jeder Einheit welche auf das
jeweilige NEAT zugreifen und per forward feed Entscheidungen trifft, unter
Berücksichtigung einiger ausgewählter Parameter. Dadurch passt sich die KI auch dem
Spielerverhalten an, und je nach Spielstil des Spielers entwickelt sich das NEAT
unterschiedlich.
/////**************************************////////
/////* inputs hidden layers outputs *////////
/////**************************************////////
/////* x1 * - i1 - * *////////
/////* * ji * *////////
/////* x2 * - i2 - * - k1 *////////
/////* * j2 * *////////
/////* x3 * - i3 - * - k2 *////////
/////* * j3 * *////////
/////* x4 * - i4 - * *////////
/////**************************************////////
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MathNet.Numerics.LinearAlgebra;
using System;
using Random = UnityEngine.Random;
inputLayer.Clear();
hiddenLayers.Clear();
outputLayer.Clear();
weights.Clear();
biases.Clear();
neuronCount = hiddenNeuronCount;
//copy weights
for (int i = 0; i < this.weights.Count; i++)
{
Matrix<float> currentWeight = Matrix<float>.Build.Dense(weights[i].RowCount, weights[i].ColumnCount);
newWeights.Add(currentWeight);
}
//*********************************************************************************************************
//override weights
public void RandomiseWeights()
{
for (int i = 0; i < weights.Count; i++)
{
for (int x = 0; x < weights[i].RowCount; x++)
{
for (int y = 0; y < weights[i].ColumnCount; y++)
{
}
}
}
}
weights[i][j,k] = weight;
}
}
}
}
//this feeds input from the unitNEAT into the Neural Network
//it feeds the values of the 3 sensors into a hyperbolic tangens
//and sigmaoid function to generate an output forward and right/left
public (float, float) feedNeurons(float a, float b, float c)
{
inputLayer[0, 0] = a;
inputLayer[0, 1] = b;
inputLayer[0, 2] = c;
//*********************************************************************************************************
}
//convert to 2D connection array
connections = connectionList.ToArray();
return connections;
}