Monday, October 3, 2016

Andrew DiNunzio - Sept. 27 - Oct. 4

Over the past week, I spent some time prototyping a "gravity orb".

I attempted to model the gravity orbs after "real" gravity, where the acceleration applied to the ball would be the sum of all of the forces divided by the mass of the ball. I based it off of the equation

F = (g * m1 * m2 / (|| v || ^2)) * v

However, this force was not strong enough, so I tried increasing the constant by many factors of 10. This resulted in strong forces applied near the center of the orb, but rather weak forces near the outside. To make the force decrease less with distance, I used || v || * sqrt(|| v ||) instead of squaring it. This made it better (after decreasing the constant again), but it still needs a lot of tinkering.

I found that the gravity orb makes it extremely unpredictable as to where the ball will go when thrown into it. For it to be a skill-based game, the player's actions should have predictable consequences. Therefore, I changed it so that instead of adding the sum of the accelerations to the ball, I first take the dot product of the unit vector of the acceleration and the "forward vector" (temporarily hard-coded as the direction normal to the wall behind the player), and I multiply that by the acceleration before adding it (or by 0 if the dot product is negative).

This made it much easier to predict how the ball would respond to the gravity orbs (especially when multiple orbs are present). However, it also meant that it lost a lot of the "hook" from the orbs. Increasing the gravitational constant didn't give great results either, since it hooked more, but also resulted in ridiculous hook when the ball goes through the center.

I also tried making the "outer" part of the orb have the most gravitational force while the center has the least amount (so sort of inverse to how gravity actually works). This had a much more desirable effect, but it was difficult to gauge how far from the center the "ideal" (or strongest) point was from the orb. To fix this, I changed the orb to have an "inner" sphere, and an "outer" sphere, making both of them transparent. This made the "strongest" part of the orb much more obvious, since there was no gravitational forces on the ball outside of the outer sphere. An issue I came across with this approach was that two gravity orbs in close proximity to each other resulted in the ball either behaving erratically or simply going straight.

These mechanics will require a lot of tinkering.

Time spent: Total: ~5 hours
  • 30 mins - Creating basic gravity orb
  • 30 mins - Modifying the "BP_PickupCube" from the UE4 VR template to be a sphere instead.
  • 1 hour - Making the PickupBall respond to a gravity-like force from a gravity orb, then changing it so it is a sum of forces from all gravity orbs nearby.
  • 2 hours - Tinkering with gravity values, applying dot products to try to limit the gravitational force to be more predictable.
  • 1 hour - Attempted to "flip" the influence of gravity so it's strongest on the outside. Worked semi-well, but needs a lot of tinkering. 

Pros:
  • I have an idea of how to apply gravity to the objects
  • I have identified new issues when it comes to the gravitational force, such as: the ball orbiting around the orbs, unpredictable movement, and incredibly high skill floors to get the ball where I want it to go)
Cons:
  • I am not quite sure how to go about lowering the skill floor without taking away from the skill component (thereby lowering the skill ceiling). As it stands, it's incredibly difficult to throw the ball and hit a target on the opposite end of the room.
  • There are some issues I have no idea how to resolve, like the ball sometimes rolling on the ceiling (though I have made it less of an issue by including an "angular dampening" on its movement. It may be a non-issue though once the players have options to pull the ball towards them.


No comments:

Post a Comment