final

Power Soccer

Written by Jessie Speert

Link to code

Welcome to The Chair Soccer Simulator!

The Chair Soccer Simulator was created to serve as a resource for chair-soccer players that wish to gain more practice moving the mechanics of their chairs to best play the game. This idea was inspired by the passions of Deandra Bardell. Dee has been playing soccer since the 5th grade, but had always thought it would be fun to practice on the computer. Dee drives her chair with a joystick, but also uses a joystick for her mouse when operating the computer. With the physical connection between the two means of operation came the innovative idea of The Chair Soccer Simulator.

Everything that we wanted to implement at the time of the check-in is now complete, in addition to some exciting additional features. In addition to the construction of the court with a chair model that is able to intersect and move a ball based upon a physics-model of animation, the user is able to select between/move two cameras, change the goal width, change the ball size, and change the ball color. The project flow was rather steady, yet notable obstacles include an initial model with too-much complexity, fine-tuning the chair speeds to meet realistic expectations, and transforming the ball object after collisions. Overall, the finished product is satisfactory to our expectations, yet leaves plenty of room for growth.

Check-in Project Description:

From the progress report:

  • Deandra Bardell & Jessie Speert.
  • Dee plays a sport called power soccer: https://www.youtube.com/watch?v=Q5A12baiB9s
  • Dee’s been playing since 5th grade. She drives her chair with a joystick, and her computer mouse is also a joystick. She always thought it would be fun to be able to practice via a computer game. This is essentially what we’d like to start building for our final project.
  • Our goal is to have a court, ball, goal posts, and a chair like model. We want to have two camera modes: One like the user is in the chair, and a "God" overhead view that can be switched between. In the chair-view, we plan to have keyboard keys that move the "head" Up/Down Left/Right. The chair can be controlled with mouse or arrow keys. We plan to add some physics to the ball so the chair can hit it at least forward. If it reaches the edge of the court we'll either stop it or have it pretend it hit a wall and bounce it. I don't think we'll have time for much more. Dee planned to make a model in blender, but Jessie made it instead in Wings3D.
  • Write a obj parser to get the model into OpenGL.


Final project description:

  • Completion of all the features mentioned in the check-in description, & the ball bounces off edge
  • Accomplished all goals (plus more!)
    • Spin Kicks (hits using the side of chair)
    • Head movement camera simulation
    • Moving goal posts
    • Change in ball size
  • Obstacles:
    • The original model we planned to use was too complex, slowing the program too much to suffice. Jessie was able to create a new, simpler model of the chair to substitute.
    • Getting the chair acceleration/deceleration for turning and forward/back motions. The math was not difficult, but trial-and-error tactics resulted. The desired effect was to feel as close to possible as driving the actual chair.
    • Ball chair collision: First had to transform to local chair coordinates, do physics, then transform back. For spin kicks, we had to figure out how to convert angular velocity to linear based on how far out the ball collides with chair. Farther out should have higher velocity.

Connections to class:

  • Ray Tracer:
    • Intersections: In order to implement our physics simulation, we had to calculate the ball-chair and ball-wall intersections. By projecting rays from points, we were able to identify when the ball is in contact with the chair/wall, then redirect the direction and velocity accordingly. This is similar to the recursive ray-tracing strategies used in assignments 2 & 3 of the course.
  • Graphics Pipeline/OpenGL:
    • Programming in the language: Although the language is similar to C++, slight variations in OpenGL and OpenGLSL (the shading language) distinguish it from others.
    • Instancing objects into the scene: While there are not many objects in The Chair Soccer Simulator, a collection of different objects are used to complete its construction. A chair model was custom-made for the simulator as well. It had to be transformed into court coordinates and scaled.
    • Model View -> World View -> Camera View: In accordance with instancing objects, getting them into the right places relative to the user’s perspective requires a series of transformations. The model view represents the object’s coordinates itself, the world view represents the virtual world in which the object is placed, and the camera view represents the object’s position relative to the camera’s position, or what the user actually sees.
    • Texture Mapping (the court on the ground): The court was constructed using u,v coordinates to map into an image of a court texture.
    • Lighting: Vertex and fragment shaders are used for ambient, diffuse, and specular lighting. We modified the fragment shader a little to tone down specular highlights. We also multiply the specular component of color by the luminance of the texture or solid color of the surface. Light surfaces show intense specular highlighting, dark surfaces have less; all surfaces show ambient lighting.
  • Animation (based on a physics model): In addition to the transformations that OpenGL performs to move the models into the correct positions at a given dt, additional transformations were made to the chair and ball based upon physical motion. The most difficult transformations resulted from the ball’s changing directions in result to intersecting the chair or wall. A physics-based model is appropriate for simulations.


Features

chair model

Created with Wings3D, imported using our obj parser

court

Converted to bmp, scaled accurately to a professional court aspect ratio

chair camera

Like a GoPro camera, "head" moves with WSAD

Overhead

And ability to pan with WSAD

overhead follow

Chair forward direction always points up

Shoot!

Moveable goal posts and realistic physics

***************Game Instructions:
Hit 'f' to toggle fullscreen.There are two ways to drive: arrow keys or mouse. Hit 'm' to toggle mouse mode.There are two camera views: chair or overhead. Hit 'g' to toggle.In chair mode: shift + up or down arrow adjusts height. wsad rotates your head up/down left/right.In overhead camera mode: wsad lets you pan. 'i' zooms in, 'o' zooms out. 'h' toggles chair follow mode. Camera rotates with chair.
Other: shift + left/right arrows change ball size. 'k' and 'l' make goal smaller or larger. '.' (period) stops the ball. 'c' change ball color.***************


Future Features:

  • Multiplayer:
    • Real (Player vs. Player)
      • Local game play
      • Online game play (global)
    • AI (Player vs. Computer)
  • Drill Settings
    • Ability to place cones
    • Balls are set with an initial velocity
    • Enable users to click and drag balls, cones, barriers from a UI menu (ray casting)
  • Chair/Ball Textures (Requires knowledge of the ball’s change in rotation upon collisions)
  • Build a more-realistic gym environment
  • Chair customizations, allow players to modify and save driving and chair settings
  • Mini games, like HORSE or obstacle course
  • 3D movement of the ball (Including bouncing and the implementation of gravity)
  • Virtual Reality
  • Use the chair core features for disability awareness program. For example, build a UMN campus to have people experience campus accessibility, good and bad aspects of campus, and be a catalyst for change