Real Run is a Flutter game that lets people experience the real effort virtual characters have to bring up when running endlessly and avoiding barriers. With the help of an eSense headphone the game measures the movement of the player with its internal IMU sensor. Therefore, the real worlds players running, jumping and ducking movements directly translate into the virtual world. The game is standalone and can also be played without this device by swiping the player up or down or using the arrow keys on the keyboard. Keep in mind though that the main use case is a mobile android app using the eSense device.
- Movement Tracking: Use an IMU sensor to detect when the real world player is standing still, running, jumping or ducking.
- Animated virtual character: The stickman character tries its best to represent you, including a little running animation.
- Random barrier placement: The stickman will face random barriers on its (endless) way to escape, on the ground and in the air. Dodge them!
- Start the application
- (Recommended) Connect your eSense device: You have to change the eSense device name. To change it temporarily, click on the settings-button. To change it permanently, you have to modify the static constant in the ESenseHandler class. Click on "Connect" to connect to the eSense device. The button will turn green when the connection was successful. Click the button again to disconnect. Make sure you place the earplug well in your ear.
- Press the Play-Button: A Countdown will appear.
- Never stop running: Once the countdown has run out, you have to start running! If you are standing still for too long, you will lose the game. (Note: This feature is not available when playing without eSense device. You will run automatically.)
- Dodge the barriers: Barriers will appear randomly. Jump to avoid ground barriers and duck yourself to avoid flying barriers! If you're playing without the eSense headphone, you can swipe the player or press the ↑ ↓ keys to initiate a jumping or ducking motion.
- Share your highscore: The game will count your score and remembers your highscore until the next restart.
The movement detection was developed and adjusted for my ear position and movement style. It may happen that the recognition of the movements is not as accurate as it was for me when developing. If this is the case, try to slightly adapt the earplug position or your running style, especially the magnitude of your steps, jumps and ducking movements.
- esense: This folder is responsible for everything related to the eSense device. The main object is the ESenseHandler. It manages the connection and the reading of IMU values. As a Singleton instance it provides its data via the ESenseConnectionObservable and ImuObservable interface. Any objects interested in the data of the ESenseHandler can access it there.
- player_tracking: This package processes the IMU sensor data given from the ESenseHandler and calculates a PlayerState that it provides again with an Observer pattern. It uses a combination of statistical methods such as a moving average and moving variance filter to detect the 4 different movement patterns of the player (Still, Running, Jumping and Ducking).
- game: This folder is the largest and contains the game logic. The main page is the 'GamePage' which holds all game elements. The game is powered by the 'GameClock'. Its Observer interface updates all objects in the game with the given tick interval. It starts running once the play button has been enabled. The 'ui' folder contains all buttons, texts and other ui elements that are visible throughout the game. The 'model' folder holds the objects in the game world, in particular the player and the different kinds of barriers. There are air and ground barriers. The 'CrashDetector' detects when the player hits any barriers or runs out of scope of the display and triggers the game to be over. The game will automatically reset.
- data_evaluation: Outside of the lib folder you will find the data evaluation folder. These python scrips were used on recorded IMU data to plot the data and evaluate the optimal movement detection strategies. It also contains a find_rotation.py script. This was used to find a rotation matrix that transforms the built-in coordinate system of the eSense device into the coordinate system of the person wearing the device. The X direction faces forward, the Y direction faces to the left and the Z direction faces upwards from the perspective of the playing person. For that, a recording where the person was standing still was used to transform these acceleration vectors to the gravity vector.
This Flutter project was created 2024 by the Computer Science student Louis Wagner within the scope of the "Mobile Computing" lecture at the Karlsruhe Institute of Technology.
