|
A neural network was used in this demo to show how decision making of computer agents can be learnt with sample data.
First, the sampling of data has to be done. The user will control the behaviour of an enemy robot, while the supposed player robot is controlled by the computer. When the supposed player robot moves around and attacks, your intelligent response as the "enemy robot" will be sampled by the A.I. system and fed into the neural network for training. Once the sampling is done, the actual game is executed. The enemy robots will react according to the attacks of the player. The quality of their reactions is based on the quality of the training data. I did manage to get quite a good training data. Below is a video that shows the actual game in action, after training.
Video showing how the enemy robots react to the player's actions using Notice these things about the trained robots in the video:
All the responses to different situations are handled solely by a single neural network without any if-statements. Note that the zig-zag fleeing manner is procedural and not done by the neural networks. Note: Scene setup done by Goh Cheng Teng. Neural Networks provided by Andre Tong.
Waymarkers are placed on the ground to serve as locations where the computer agents will move to, as they traverse through the game level. In this demo, the calculations of the paths are done using the standard A* search technique which uses heuristics to find the guaranteed shortest path to reach a certain destination. As an enhancement, the waymarkers are broken down into hierarchies so that the time and space complexities are significantly reduced. In the video below, the robot is moving to a waymarker (represented by the flags) which the user has selected. It is doing this by moving from waymarker to waymarker, until the destination has been reached. Every time it reaches some intermediate waymarker, it will query from the pre-computed A* shortest path table to find out the next waymarker to go to, in order to reach the destination. Video showing how a robot finds the shortest path from one waymarker to the next using a pre-computed A* search table If the selected waymarker is in another room, the robot will find the shortest path in terms of rooms (e.g. shortest path from room A to B is through rooms C and then D etc). Then within each room, the robot will find the shortest path from door to door. This hierarchical search carries on until the robot ends up in the final selected waymarker. Note: Scene setup done by Goh Cheng Teng. |
|