Monday, October 24, 2016

Andrew DiNunzio - Oct. 11 - Oct. 18

This week I started by trying to get a force to pull the ball towards the player. Based solely on acceleration, my initial method failed horribly. I stepped back a bit for a while, and some of the other coders got a better means of controlling the ball from a distance, which felt like telekinesis and was incredibly fun to play around with.

Later, I worked with Mike Cancelosi, Mike DiLucca, and Johanna Oberto to try to get the whip mechanic to be drawn. We reached out to I-Illusions, the creators of the game Space Pirate Trainer, and asked if they could give us any clues as to how they got their grapple beam on the "Volton" working. I received a response from Dirk Van Welden with two very helpful points:

First, he said that rigid bodies could have different forces applied to them with dynamically different forces and drag, as well as dynamically changing the weight of the object.

Second, he said that not only does the game take the position of the Volton into account, but also the point that is equidistant from the Volton as the droid (in SPT) is from the Volton in the direction of Volton is pointing.

We used the second point to draw the spline between the controller and the ball for our game successfully. As shown in the following picture, we started by finding a point (call it Forward Point) at a distance d, in the direction of the controller, where d is distance between the controller and the ball.





We then "drew" lines from the ball to this point and the controller to this point. We divided these lines into thirds, with two points along each line. We then drew a spline through these points to represent the grapple beam / whip. We had forgotten that the spline would actually pass through each of the points we give as input, so we noticed a few straight lines in the beam. Therefore, we changed our method from using thirds to splitting each line in half instead (for a total of 5 spline points - two near the player's hand, one along each line going to the Forward Point, and one at the center of the ball).

We think it could still use work. If possible, we would like to try to smooth out the spline more. There are two things I'd like to try:
1) using something as shown in the bottom left of the image above. Here, we would find the center point of the line connecting each of the center points to the Forward Point, then connect lines from that point to the controller and the ball, then create spline points along these lines instead.
2) Use the four points we found to draw a Bezier curve instead.

Time spent: Total: ~5 hours
  • ~2 hours - Work on creating a gravity beam to pull the ball towards the player - FAILED attempt; way too much acceleration when the ball gets to the player for this to be a viable method
  • 3 hours - Work on drawing the spline curve representing the game whip / grapple beam

Pros:
  • We have a working visual for a grapple beam that looks good enough for an alpha
  • We might be able to use a tangent along the spline to decide which direction to apply a force to the ball in.
  • While attempting a whip mechanic, some of the other coders came up with a "telekinesis" way to control the ball that is very fun.
Cons:
  • We still don't have a good force mechanic for the whip, though I do have some ideas I could try in the coming weeks.