Monday, January 9, 2017

Andrew DiNunzio PPJ 1/9/17 [Winter Break]

Over winter break, I spent a lot of time gaining a better understanding of C++ and how to work with it in Unreal Engine.

I continued working through the Unreal Udemy course, which helped my understanding of working with C++ in UE4 tremendously. I've learned how to make C++ classes that Blueprints can inherit from (and that the reverse isn't possible), and I found out how to make interfaces that blueprints must implement to help with input to the whip. I also learned how to make C++ class members available in Blueprints, so designers can tinker with them without having to look at C++ code.

I also read the first 4 chapters of C++ Primer (by Stanley Lippman, Josée Lajoie, and Barbara E. Moo) and the first 3 chapters of CLRS, and I'm planning on continuing these books and their exercises throughout this term.

In terms of work on the project itself:

I pulled out the code for the whip into a C++ component (with a Blueprint that inherits from this C++ class). This improved performance drastically. I pulled the logic out of the MotionControllerPawn and set it to use Dan's static mesh for the tool. Having it as a C++ class has the added benefit that multiple people can actually work on it at the same time, and merging changes is possible. Both hands have this tool as well, instead of one hand being essentially useless.

I changed the way the spline points are chosen to draw the whip (via its C++ class) using a Bezier curve. The control points were chosen similarly to the ones used before (one where the player's hand is, one halfway to the Forward Point from the hand, one halfway to the Forward Point from the ball, and one at the ball). The number of spline points generated from the Bezier curve is an adjustable property on the Blueprint (along with debug point sizes and colors).

I also fixed a minor issue where the whip was creating static meshes in a way that was generating thousands of log messages (one every tick), since we were trying to attach a static mesh to a non-static object. This seemed to fix the issue where performance was dropping after playing for a short time.

Time spent: Total: ~50 hours

25 hours - Pulling the whip logic into a C++ component
10 hours - Following Udemy course
10 hours - Reading CLRS and C++ Primer and doing exercises
4 hours - Generate spline points with a Bezier curve
1 hour - Fix whip performance issue

  • Whip has a fast C++ component now
  • Whip drawn with Bezier curve
  • Performance improved
  • I learned a LOT about C++ and how to use it in Unreal Engine

  • Everything I learned still feels like a drop in the bucket
  • Whip still behaves somewhat erratically, since the linear damping hasn't been working as expected

    No comments:

    Post a Comment