Hi everyone…Right now I’m learning Neural Networks and I want to try to make a little game/project based on Neural Nets but I don’t seem to find a good idea…My ideas so far have been this ones: Sudoku game with an AI based on Neural Nets and a Flappy Bird style game with an AI using Neural Nets to see how far can the AI learn…
Do you have a better idea on using Neural Networks to make a little game/project?
I actually did the Flappy Bird thing as a project in university. It’s extremely simple and should work without fail if you’re implementing it correctly.
I used a NES implementation of Flappy Bird and cranked up the emulator speed to make it faster. The bird learned to fly perfectly in a few seconds every time. So if you want a simple example just do that.
Flappy Bird is much too simple, the net will learn to play perfectly after a few iterations.
Typical student projects often include physics, e.g. balance stick on a small cart, or have motorized joints on dog or ant legs and have it learn to walk as efficiently as possible.
Or all the deepmind atari stuff: e.g. build a simple space invaders or something and then apply DQN to that. Read the deepmind atari papers if you have not already.
The stick balance thing you can make into a game, e.g. the player can throw stuff to try to make the stick fall off the cart that the DNN tries to balance.
I agree with this. While it is possible to train a neural network to play a game, it usually is inferior to the usual game AI methods. And neural networks can sometimes get trained too well, and then they are not fun to play against. The usual game AI methods have the goal of providing the user with a good experience while minimizing CPU usage by the AI (to leave room for more visuals).
You could have training the neural net be part of the game. This could work well in a game where you are raising creatures. Each creature would have a neural net and the player would have to train each creature for whatever task they are supposed to perform. For example, lets say combat is what you train the creatures for. There could be high attacks, middle attacks, and low attacks, with ducking, blocking, and jumping negating the respective type of attack. You could start off with minigames training the creature to dodge different types of attacks. Balls would be thrown at the creature to simulate the 3 different types of attack, and if they successfully dodge it, the player needs to give the creature a treat to reward them and train the neural net. You would also need to train them on the appropriate time to use each type of attack.
Once you get to the real combat, the neural net will learn on its own based off of its performance in combat. Instead of the creature gaining experience points like in most games, it would gain experience in the form of its neural net being better (which is closer to experience in the real world). Could be a fun little game. Not many games make it feel like you are actually teaching/raising something, but this has the potential to.
General issue with this approach is the training time. It can take a thousand generations to train a net properly. You aren’t going to have a player sit through that.
Ya, you might have to fake it a bit, like doing some regular training of the neural net behind the scenes after the player successfully does the training minigame. It probably wouldn’t be a very serious game since before the net is properly trained it is likely to have the creature do some pretty silly stuff, like jumping constantly.
Not to long ago i was playing around with neural networks, and the idea of trying to make a game out of it somehow.
On the surface the concept appears to lend itself well to the idea of working it in to some sort of game… Once you start working with them you quickly start to realize some of the constraints that are involved with the creation of a proper neural network do not work will with trying to create a game.
As @Kiwasi posted out the main issue is the shear amount of time it takes to properly train a network to be “useful” or “enjoyable” .
Beyond that there is the design of the network itself. You need to fully understand the “problem” you want your neural network to “solve” in order to properly design its underlying structure. Digging deeper in to this you need to understand what inputs you will give, how should these inputs be represented (a single input, or multiple inputs representing a choice, etc) how these inputs correlate, should their values be normalized, etc etc etc… Then once you know your inputs you will need to determine your networks structure… then determine what your outputs are, again similar things to decide as inputs…
Dont get me wrong… you could TOTALLY make a game out of all this, and to some crazy people (like myself) i would find this fun… but most people wouldn’t because even after you figure out your networks layout… you still have to train em… and thats long and boring no matter how you dress it up.
Random thought occurred to me. You could sort of “cheat” the learning progress so to speak and perhaps shorten the length of time it takes the network to learn…
This would assume the network structure, inputs, and outputs are already defined and a set thing in the game.
You could have the player start with a random untrained network… but before release you could fully train a network of the same structure to function as expected… So now you actually know the direction and amount you would need to shift each neurons values during training. The downside is obviously the network is then thus limited to operating exactly as the one you trained and are using as a reference, you wont see the emergence of other behaviors.
From this though you could associate the NN completing certain goals with a pre-defined shift in the direction of the end networks values. For instance a goal could be finding food. When a network either randomly, or through purpose runs in to some food it triggers a 1% shift in the current networks values in the direction of the end network. This would allow learning to appear to happen much quicker then normal… and could still possibly allow random behaviors to emerge for a short time depending on how off the starting network is from the end network…
idk, like is aid random idea that occurred to me that might make making a game more feasible.
Typical chimer inners of the old guard. Don’t use it because I say I disapprove which makes you stoopid. Can you bunch get over yourselves and stop hijacking interesting threads and go back to counseling newbie FPS folks not to make an MMO-whatever? I want to know about neural nets and deep AI in regards to game engines and Unity. Every app done by Unity is NOT a game/FPS /RPG. The contributors can carry on thank you. I am interested in what may come up or links to whatever to further my education and learning processes. I apparently am still good to go on learning new tricks and then being creative with them, even at the ripe old age of 60.
I think you are mistaking people sharing common pitfalls and their own experiences from already having tried for people nay-saying an idea. In addition the original question did pertain specifically to making a game.
What would you like to know about neural nets? I can provide links to resources, and some limited advice from my own experiments.
The first think I think i would look in to if you wanted to research neural nets is look in to the different types of neural networks. The most common starting ground being a multilayer perceptron (MLP) which is a type of feed forward network and is fairly easy to implement.
Once you have a grasp of MLPs, i would then look into articles discussing the use of input variables, how to classify/group them, and if and when to normalize values. This is perhaps one of the most important steps in a neural network as the inputs are what the network operates on…
I might have told a lie before. This thread contains a network/genetic algorithm project that converges on an obstacle avoidance solution in half a dozen generations. So you probably could adapt that to have a player sit through it all generations.
Perhaps have the player design a training course, give them a set number of generations to train in, then have the network the player has designed compete on a random course. Or something similar, just spitballing here.
I don’t think any of us were ripping on neural networks. I like them, but they are not always a great fit in games. And for every productive thread about neural networks there seems to be thousands of misguided/misinformed threads. I lot of people have a very unrealistic perception about what neural networks do and how they can be integrated. Personally, I would love to see more useful threads about neural networks in games.
One very interesting use for neural networks is in RTS games. For example, groups of AI units may need to make a decision about which tactic to pick when they spot enemy units. A properly trained neural network can be great for something like that. Just set up the RTS to play AI vs AI, collect details about the unit strength ratios, have the AI randomly select a tactic each time, record the outcome of the tactic along with unit strength data, and then have the AI play over and over. Use all of the collected data to feed into an AI training algorithm. Then use the long term memory vector to create a function in the game to handle tactic selection.
It is not the ripping of neural networks. it is this attitude that fahgetaboudit 'cause it ain’t good in games. I saw this when the same crew shut down the thread about the Wolfram plugin. Because they could not imagine a use for it then it should not be discussed and anybody wishing to use it was being trolled passive aggressively. I am simply commenting on thaty mindset and ask them instead of naysayiong to go reply another thread and let us intellectual brats enjoy our speculation and creative juices flowing wth possibilities. I don’t do only games so any kind of knowledge i can use. For example a large railraod firm wants to check out VR fo their training and tracking. Neyural Nets amy be able to assist in some part of this. i do not know exactly but this is the type of a simulation of real world dynamics that neural nets may shine in. How to use them in Unity is something I want to see examples of. Then I can formulate a sales pitch. Before this thread shuts down with naysaying.
I have a BioIK pulugin from the asset store that uses genetic algorithms and it produces some very interesting IK in multiple branching connected chains with each chain affecting the others to some degree depending on setup…
If you are really interested in using neural networks, you should read about the fundamental concepts. The biggest challenge for most people is trying to figure out what inputs to use and how to come up with a useful training data set. One book that is useful for understanding these fundamental concepts is “Artificial Intelligence for Humans, Volume 1: Fundamental Algorithms” by Jeff Heaton. https://www.amazon.com/Artificial-Intelligence-Humans-Fundamental-Algorithms/dp/1493682229
As for neural networks themselves, there are multiple open source projects in C#. You can pick and integrate your choice of neural networks. But to really make any use of neural networks, you need to get really comfortable with the fundamental concepts.