Jam-o-Drum

From ETC Public Wiki
Jump to: navigation, search

What is the Jam-o-Drum?

Jam-o-Drum is a beloved platform developed by ETC students. Jam-o-Drum is based on a four-mice system. Spinning is map to rolling up and down, and hitting is map to left click. Jam-o-Drum was running on Panda3D for a long time, but it did not fit in Unity3D since the current version of Unity3D does not support multiple mice. Thanks to Byran Maher's work in building a server reading mouse raw input from Windows and sending data to Unity3D via network, we have our Jam-o-Drum back.

Launch Jam-o-Drum Server

In order to Jam-o-Drum world, you need to launch the Jam-o-Drum server and do calibration.

  1. Turn on Jam-o-Drum projector.
  2. Launch JamoDrumServer.exe.
  3. As its instruction, hit Pad 1 to 4 in order to calibrate.
  4. Once the the calibration is done, you can minimize the server (Do NOT quit the server).
  5. Run your Jam-o-Drum world.

Bringing Jam-o-Drum in to Unity

Install the Unity Package

The pre-built Unity package includes everything required to start running your world. To install, simply import the package, and all of the required assets will appear in your project.

The following items are included within the package:

Plugins

  • JamoDrumClient.dll - This is Jam-o-Drum client that gets data from the server.

Scripts

  • JamoDrum.cs - This is the script that gets data from Jam-o-Drum client to Unity3D.

Textures

  • table_template.psd - This is the template mask for Jam-o-Drum. You can develop your basic interface based on this file.

Using the Scripts

Before building your world, you need to set your project:

  1. Use 1024x768 resolution. This is the resolution for Jam-o-Drum projector.
  2. Use full screen mode, unless you have a very good reason not to.
  3. Hide cursor. It is EXTREMELY important for Jam-o-Drum.

Then you can attach JamoDrum.cs script to one of you game objects and start development.

JamoDrum.cs

  • spinDelta - a int[] represents the difference of spinners between current frame and last frame.
  • hit - a bool[] represents whether the pad has been hit during the time between last frame and current frame.
  • void AddSpinEvent(SpinEventHandler func) - Method "func" will be called when some spinners get spun. "func" should be of form "func(int controllerID, int delta)". (Refer to "void HandleJodSpin(int controllerID, int delta)")
  • void AddHitEvent(HitEventHandler func) - Method "func" will be called when some pads get hit. "func" should be of form "func(int controllerID)". (Refer to "void HandleJodHit(int controllerID)")

Simulators

It is important to create a simulator for testing the Jam-o-Drum so that you don't have spend so much time in the platform room. You can use four mice but isn't the most efficient way to test. In the resources section there is a modified version of Jam-o-Drum.cs which allows to create a unity-based simulator, it includes an example simulator that uses the keyboard to simulate the drums.

Contact

If you have any question or if you are interested in further development, please contact [Bryan Maher].

Thread Errors

If you receive and error about something that "can only be called from the main thread.", this is caused by multithreaded nature of the Jam-o-Drum client. In the resources section there is a new version of JamoDrum.cs which takes care of this threading issue in the background and is 100% backwards compatible with existing projects.

Resource

Jam-o-Drum Package for Unity3D
Jam-o-Drum Example Project for Unity3D
Jam-o-Drum Server
Source Code for Jam-o-Drum Server and Client
Unity Scripts for Jam-o-Drum simulator support and example simulator
JamoDrum.cs which correctly handles threading.