2024-Group 16

Polar Pacman: a Haptic Experience

Project team member(s): Tom Soulaire, Oskar Wendt, Talie Wilmans, Nick Woehrle
Full assembly + visuals

For the final project, we aimed to create an enhanced version of PacMan including haptic feedback paired with visuals. The player’s avatar is controlled with a 2 degree of freedom device which allows one to rotate and move forward and backward at varying velocities. The player will experience force-feedback if they run into a wall or an enemy ghost. The purpose of this project is to improve the experience of the player, allowing for better performance and an overall more fun and engaging experience. Although the controls were slightly unintuitive, people generally enjoyed the game and the haptic feedback provided throughout play.

Introduction

Video games are incredibly popular and act as an application that can be greatly enhanced by haptic feedback. We wanted to integrate haptic feedback into a classic game enjoyed by players of all ages: PacMan in order to create more engaging gameplay. For a greater challenge and an opportunity for the player to experience more dynamic movement, we decided to work with polar coordinates to determine player position.

Background

Since the invention of video games, developers have looked for ways to elevate the player’s experience. While games include visual and auditory elements, the introduction of haptic effects has been shown to greatly improve a user’s experience. Over the past few decades, as video games have become increasingly popular, lots of research has been done regarding the application of haptics. Since many different control types exist, we specifically sought to understand joystick control and feedback. While maximizing the degrees of freedom is ideal, it is sufficient to provide users with two degrees of freedom for realistic force feedback while maintaining lower production cost and greater hardware mobility in a joystick [1]. This confirmed that a two degree of freedom control with haptic feedback would suffice for the application of haptics into a simple game like PacMan. Regarding system control in terms of polar coordinates, joystick movement can be tracked using angle Θ, measured from some zero point for rotation within the workspace. Lateral movement about a central joint can be represented by another angle: ɸ from the center of the z-axis [4]. This provides some basic logic behind the development of polar coordinates to track player movement. Furthermore, studies focused on user feedback regarding the application of haptic effects coinciding with various game elements lead to positive reactions to a gaming experience. Even small impacts in the event of a monster attack or texture effects when interacting with different objects lead to an overall greater experience [3]. This further informed our design and inspired the additional handle rumbling effect when PacMan runs into a ghost.

Methods

Hardware Design and Implementation


Base 3D Print

Hapkit

The hardware includes the Hapkit provided in class which is attached to a rotating circular acrylic platform via suction. The platform’s rotation is tracked and driven by a stepper motor and encoder which is housed within a 3D printed base. The motor attaches to the platform directly with a press fit aided by a bit of superglue. The user directly interacts with the Hapkit handle which can be moved back and forth. The speed of the player is determined by the position of the Hapkit handle. If the user runs into a wall or an enemy, the handle will provide haptic feedback driven by a motor which simulates the force of the wall or enemy attack.

System Analysis and Control

We used a Hapkit board, stepper motor controller, and encoder. The Hapkit board acted to connect the tracking and control of the two main components of the joystick: the Hapkit and the acrylic turntable. The stepper motor and control board tracked the movement of the turntable while the Hapkit board tracked the motion of the handle using a rotating magnet on the Hapkit’s motor shaft.
Rotation of joystick controls the angle of PacMan


PacMan rotates
according to base
movement

Modeling the forces on PacMan when running into the walls at the edge of the game window proved to be a challenge. Since PacMan can rotate, it was important that we account for directionality as the wall is hit, that way the player is not effectively pulled into the walls of the game. Essentially the angle PacMan is facing allows one to track the direction in which the handle is moving as a wall is hit. Using this information, we coded for the wall to push the player “out.” By changing the direction of the force, this allows the handle to be pushed back to center when moving forward and backward into the wall. The specifics of the logic are shown in the figure below.

The torque output by the motor on the Hapkit is determined using torque Tp= rh*rprs*F. Where the values of rh, rs, and rp are measured from the Hapkit and pulley dimensions:

  • rh = 0.089m
  • rs = 0.074m
  • rp = 0.007m

Additionally, the player also experiences a vibration when they are hit by an enemy ghost and the game resets. This was achieved by exerting a 1.0 N force in each direction with a 0.5 second delay between each then the reset. We also wanted the player to feel a small torque exerted by the bottom motor controlling the rotating plate when encountering the ghost. Unfortunately, this failed to move the platform with the weight of the Hapkit atop it and required an additional voltage source, which we did not include for fear of a last-minute motor burnout.

Visual Component and Enemy Movement

The visuals for the game were made in Processing and use images similar to the characters from the original game. The images are housed in the same folder as the code so they are able to be called as the code is read. The position of the ghosts are tracked and controlled through Arduino. Each of the three are initialized to move either right, left, or down. Once the ghosts hit the boundary, they stop, then randomly change direction and begin to travel once again. This continues until the player encounters a ghost, resetting the game.

Results


Hapkit error: reset to have a different 0 location

The reception of our game was overall good. The actual control of PacMan was challenging since our motor and encoder were faulty, so rotation didn’t always look smooth for the visual component of the game. Furthermore we experienced some issues with the haptic rendering impacting controls if players moved too quickly into walls. The force provided at the wall could push the handle too far back so that once the position was out of the wall the zero point of the handle would be skewed. This impacted the velocity control so that players could move in one direction very quickly and in the other little or none at all until the game reset. Despite these issues, our users generally enjoyed the game, describing it as “fun” and “cool.” They especially liked the extra degree of freedom provided by the rotating platform.

Future Work

We would like to improve the rendering so that the user feels a more realistic interaction with the walls. We also would want to allow the player to change direction and move out from the wall more easily to prevent instances of being stuck and having to restart the game. Additionally the game could be further complicated by designing a maze for the player to navigate through while avoiding ghosts in order to operate more similarly to the original game. While this was outside the scope of this particular project, it would be the logical next step in creating a haptic PacMan.

We also would want to obtain a more robust power source so that the stepper motor can provide sufficient torque to rotate the joystick contraption. This would add an extra layer of haptic feedback for the player to experience.

Finally, we would like to organize the hardware neatly in a cylindrical container so that the base, wiring, and control boards are hidden from the user, creating a cleaner appearance.

Acknowledgments

Thank you to the teaching team– Allison, Ankitha, Dani, and Yiyang for their support in this project and throughout the course.

Thank you to the folks at Lab 64 with assistance in obtaining hardware – motor, wires, breadboards, etc…

We would also like to extend our thanks to everyone who tried Polar PacMan at the Haptic’s Open House.

Files

Arduino Code: Attach:PacMan_Final_Arduino.pdf

Processing Code: Attach:ME327FinalProjectProcessingFinal.zip

Bill of Materials:

Open House Poster: Attach:PacPoster.pdf

References

[1] B. Bae, T. Koo, K. Park, et Y. Kim, « Design and control of a two degree of freedom haptic device for the application of PC video games », in Proceedings 2001 IEEE/RSJ International Conference on Intelligent Robots and Systems, oct. 2001, accessible at: https://ieeexplore.ieee.org/abstract/document/977229

[2] Sabique P. V., & P. Karthikeyan « 2-Degree-of-Freedom Haptic Device for Different Medical Procedure Decision », International Journal of Engineering Research, vol. 4, no 26, 2016, accessible at: https://www.ijert.org/research/2-degree-of-freedom-haptic-device-for-different-medical-procedure-decision-IJERTCONV4IS26015.pdf

[3] Y. A. Shim, K. Park, S. Lee, J. Son, T. Woo, et G. Lee, « FS-Pad: Video Game Interactions Using Force Feedback Gamepad », in Proceedings of the 33rd Annual ACM Symposium on User Interface Software and Technology, oct. 2020, accessible at: https://dl.acm.org/doi/pdf/10.1145/3379337.3415850

[4] Ming Ouhyoung, Wu-Nan Tsai, Ming-Chang Tsai, Jiann-Rong Wu, Chung-Hsi Huang and Tzong-Jer Yang, "A low-cost force feedback joystick and its use in PC video games," in IEEE Transactions on Consumer Electronics, vol. 41, no. 3, pp. 787-794, Aug. 1995, accessible at: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=468083

Ghost PNG file website: https://www.hiclipart.com/free-transparent-background-png-clipart-dhheq

Appendix: Project Checkpoints

Checkpoint 1

The first week of the project was dedicated to adjusting the design of our system and getting the hardware done. We also wanted to start on writing parts of the code, excluding haptic rendering at first.

We decided to cut a disc which we will use as our rotating platform. The platform has been mounted on the shaft of a stepper motor, from which we will be able to extract information about angular position and angular velocity. On top of the platform, we mounted a full Hapkit with suction cups (see Figure 1). So far, the whole system on top of the platform is a bit shaky since the platform-shaft joint is a bit loose. We will need to adjust this part in the next steps so that we do not damage the motor.

We also started to write some parts of the Arduino code so that we can interface with the motors. We already have a basis for extracting information from the Hapkit motor, that we will need to adapt. We also wrote code to extract the angular position and velocity of the platform from the stepper motor. The major problem we are facing now is that we are not able to test this mast piece of code since we could not find the appropriate wiring in any lab on campus. We are currently discussing whether we should buy new wiring or change to another motor.

Checkpoint 2

The goal for this checkpoint was to have the code and the hardware complete. Additionally, we wanted to begin with the integration of the hardware and code to improve the final design and debug.

Our hardware is nearly together. We have our Hapkit and Arduino board to control the linear motion of the player. We also have the laser-cut acrylic base which sits atop a stepper motor to control the rotational motion. We have sourced a motor and encoder to track and control the base movement.

The Arduino code to track the user movement has been developed since the last checkpoint. We plan on testing it with the hardware complete and debugging from there. Regarding the game's visuals, we've used Processing to create a virtual component to our haptic experience. This includes a PacMan icon which is controlled by and represents the user as well as three enemy ghosts who move randomly throughout the screen during gameplay.

We also developed a first piece of code for haptic rendering, including virtual walls, proxy position and texture rendering. One challenge remaining in this area is to translate the forces applied by the virtual walls into torque commands so that the rendering is realistic. This task was much easier in one dimension or in cartesian coordinates, and will need some reflexion.

Our next steps include integrating the code with the hardware and troubleshooting to achieve our desired product. We also plan on conducting a series of tests to determine our approach to most realistically render walls and enemy interactions.