Skip to content

mumahack/eGymKart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EGym Kart

An interactive and flexible adapter for the eGym Training Devices that maps certain real-time-training-data to a GameController. Additionally it currently maps from the GameController to simulated Keyboard strokes so we are able to control games that are running on the machine.

Also, this repo contains an idea for an App to easily start games - just open the file frontend/eGym 64.html in your browser

Contributors to this Project

This was developed during a hackathon. Special thanks to:

  • Paulina Baginska (Project Management and Pitch Preparation)
  • Jan Wingefeld (Project Management)
  • Timo Morawitz (Pitch Preparation, Design and Frontend App)
  • Johannes Eisenlohr (Coding)
  • David Losert (Coding)

Special thanks to all members of MunichMakerLab as well as Deborah Köpfer for the valuable inputs and a ton of fun.

Also Thanks to the Organizers of Burda Hackday for a really nice Hackathon.

Contact

If you have any questions about this project, feel free to contact me at [email protected]

How to make it work?

You need a NodeJS Installation on your machine. Then:

  • Checkout or Download this repository
  • Execute npm install to install all dependencies
  • If npm install fails, check if your OS has all package dependencies for robotJS (see section Building)
  • Execute npm start to start gaming (see more details in Section Use with Mario Kart)

To start the tests, execute npm test

A Note on Code Quality

This repository was implemented during a hackathon and we therefore had to put in some hacks to be fast (especially timeouts in tests. etc). Don't mind us - it was a long night ;)

Architecture & Further Contribution

We set this repo up to be easily extendable by the eGym people. Our goal was for them to be able to have predefined interpreters for their data that can control a virtual GameController (currently an N64 one) which can be mapped to whatever output is needed (currently a simple keyboard output). There are the following packages:

  • EGymConnector: Very basic module to connect to the EGym ZeroMQ Server and retrieve and parse all messages
  • EGymDispatcher: Uses the EGymConnector and allows for several listeners to be registered - so it is basically responsible to dispatch all messages retrieved from the eGymConnector to all currently registered listeners
  • MessageHandlers: Predefined Handler that interpret the EGym Message and can be configured to execute certain controller commands on certain inputs. Currently there are two handlers:
    • ThreeStepHandler: Executes Controller Commands when reaching a certain, positional step on the machines
    • ContinuityHandler: Executes "holding down" a Button as long as the machine is constantly pushed from concentric to accentric mode in a configurable timeout
  • Game-Controller: A abstracted and virtual game controller which has several predefined GameControllerCommands that can be executed. This is just an abstract interface that needs to be implemented by a fitting output controller
  • Keyboard-Controller: Implements the Game-Controller by simply mapping the GameControllerCommands to Keyboard strokes on the current system

Use with Mario Kart

Somehow you'll have to start an Emulator that runs Mario Kart. You have to own Mario Kart to be allowed to do this.

Keyboard Mapping

The current Keyboard Mapping for the Controller would be Arrow-Keys for directions & 'e' as the A-Button on the N64 controller - so you have to configure the emulator to follow this convention. Alternitavely, you could adjust the Keymap in the KeyboardGameController

Players

For the sake of the Hackathon, we used two static players with static RFIDs (see index.js). You will have to adjust those RFIDs to your own (or make it dynamic)

There are two player types:

  • Steering: A player who can steer the car by holding the workout device in concentric or eccentric (for left & right) or middle position (for driving straight)
  • Accerlating: A player who can accelerate the car only by constantly moving the workout device from concentric to eccentric and having no more than 1 second between the two extremes.

Start the Game

  • Start Mario Kart and step through the menues to start a game
  • Exectue this App with npm start
  • Switch the focused window back to Mario Kart
  • START WORKING OUT

What would be next?

  • Implement proper EGym Device Mode: The current workout modes on the eGym-Devices are not really good for playing, as they usually stop after a certain time or after certain repetitions. In a game this is not forseeable. Therefore the Machines would need modes with little weights that can run until the game is actually over.
  • Frontend-App: Implement an App to dynamically control players and games (let players connect with each other via the eGym Screen, assign which player has which role in a game etc.). A Mockup of this App can be found in the frontend Folder. A clickdummy by simply opening the frontend/eGym 64.html file in your browser.
  • Integrated Game Execution: Make the actual game be started by the Application instead of having it to start manually (like right now)
  • Stream Game: Stream the started game to the application so all players can see it on their eGym Device Screens

About

almost like a real cart @ Burda Hackday Ep. 5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published