Monday, January 23, 2017

Andrew DiNunzio PPJ 1/17 - 1/23

This week I spent some time working on a few different small things.

First, since the whip's behavior was very difficult to control, I created a temporary solution to the damping problem. I determined the overall damping to apply to the held ball based on a complicated trial-and-error-based function, taking into account the damping that the stretching force wants, the damping the bending force wants, and a third category of damping for proximity, and I choose the max damping candidate as the damping to set on the ball.

Then I added the ability for tools to use the grip buttons on the Motion Controllers. To show how to implement that in a tool, I implemented new features for the Psychic Wand. When the grip buttons are held in, the wand goes into "greedy" mode, which increases the force applied by a factor of 1.7 and allows forces in all 3 axes (instead of being limited to the yz-plane), so the player can push and pull the ball. It also is set to increase charge consumption by 3x while in greedy mode. These factors can be customized in the blueprints easily.


I also worked with Mike C to get the AI character to hold whips instead of just having the ball teleport to the AI. We were able to get the AI to grab the ball but didn't get it to return the ball yet. Also, the tools held by the AI don't change position relative to the AI mesh yet.

We started trying to figure out a different way for tools to grab the ball (since it was way too easy to grab the ball when it was close up and too hard when it was far away). We wanted to make sure that the ball's logic and the whip's logic remained separate, and we had trouble doing that, since we essentially wanted the ball to be easier to grab the farther away it was. Resizing the invisible "grab sphere" around the ball based on how far away it was from the tool was not a clean solution that kept the logic separated. Therefore, I went in later to the Whip's logic and changed it to find balls within a certain field-of-view and grab the closest one. The Range and Field Of View (in degrees) can be set within blueprints, encapsulating all of the implementation within the C++ base class.

Finally, I spent some time making the gravity well forces stronger. I changed the gravity wells so that the force scales with velocity (raised to the power 3). It worked well, and I was able to make good use of the gravity wells on the field to score points, but Unreal's build system is a bit weird, and when I went to rebuild, it seems like the behavior changed (so it must have been using old compiled binaries). They feel sort-of weak again, but I don't think it will be difficult to get it back to feeling good again. I also fixed the way the gravity wells are constructed, so they can be resized more easily, and the radius of influence increases/decreases by the correct amount now.


Time spent: Total: ~30 hours

5 hours - Damping fix hack
10 hours - Psychic wand greedy mode, plus updating the documentation for that
4 hours - Get AI character to hold whip
5 hours - Give all tools a Field-of-View member that can be used to find all balls within its FOV.
6 hours - Work on gravity well forces; make them resizable; and try to fix weird build issue


Pros:
  • AI now holds two whips
  • Whip now behaves semi-normally
  • Added ability for tools to use grip buttons, showed how by doing so for the psychic wand and documenting it in the original how-to doc.
  • New way for tools to grab objects based on field-of-view, which is customizable in blueprints

Cons:
  • Whip damping fix hack resulted in some code that's really ugly and will be difficult for others to maintain / change.
  • Whip still doesn't feel 100% perfect

No comments:

Post a Comment