/Learning-to-Bounce-a-Ball-in-Virtual-Reality

Reinforcement Learning is an active research area which studies the methodological approaches for enabling machines to perform intelligent and expert behaviours. Frameworks of Reinforcement Learning has been utilized for solving various types of problems including games such as Backgammon, Chess or control problems such as inverted pendulum. Here we implement two RL approaches namely Q-Learning and Eligibility Traces for enabling an agent to control the trajectory of a ball with a paddle. First, the game environment is defined as a discrete space and then the aforementioned algorithms are implemented using the MATLAB software. The results indicate that the agent learns in a reasonably fast time and is able to play 4 the game and keep the ball in the air for a considerable number of hits. The results of this project can be compared with human performance in order to infer physiological parameters affecting human learning.In this project a RL based solution for the VR ball bouncing was proposed and tested in MATLAB environment. The results indicate that the agent can learn how to play the game and hit the ball multiple times in a row. Finally, the resulting optimal actions for the state space were implemented into Unity and performed by a virtual agent. In order to achieve this, many tasks had to be completed. The state and action space had to be refined in order to for the project to be computationally feasible. A continuous physics simulation was made for collisions in both Matlab and Unity. The Unity simulation was hooked up to external tracking for player input recording. Multiple iterations of code refinement were performed in order to better improve the performance of the agent in the environment. For example changing the discrete action space was performed in order to ensure that there is no internal constraint for the agent hindering visitation to all states in the environment. A number of graphical means were used to visualize the results from the Q matrix. For example the number of successive hits were plotted in order to examine to which extent the algorithm is able to make the the ball hitting working. Overall this project gave us the opportunity to increase our knowledge of machine learning specially Q-Learning and helped us gain hands on experience for implementation of learning algorithms. Our current results improve through learning but our solution is not as optimal as we imagined it could be. More iterations need to be done on our multiple design decisions in order to gauge the full potential of our model. Ultimately, we were able to implement the broad groundwork needed for an agent to learn to bounce a ball in virtual reality.

Primary LanguageC#MIT LicenseMIT

This repository is not active