by primaryobjects · 12y ago · 0 comments
- Have a neural network with 6 inputs for:
- player x
- player y
- acceleration speed
- acceleration direction
- next pipe mid-point x
- next pipe mid-point y
- Two outputs of 0 or 1 for click or no-clickThe fitness score would be how close the player is to the pipe mid-point. Hopefully, this would cause the bird to stay as close as possible to fly between the pipes. The genetic algorithm would select the best neural network that knows when to flap based on the current input state.
I go by a rule of thumb like this:
- If you are able to collect lots of training data (inputs and valid outputs) then use back-propagation. It's faster and you might get better results.
- If you don't know the outputs for inputs or if there are simply too many possible combinations (such as in the case of a game), then use a genetic algorithm. It's effectively a search engine that finds the best solution within the problem space (the solution being the optimal weights for the neural network).
Using Neural Networks and Genetic Algorithms http://primaryobjects.com/CMS/Article105.aspx