On Friday, I imported the fish into my UE4 scene and considered my options. I found out very quickly that I couldn't actually use a skeletal mesh in a particle effect and had to consider my other option instead, which was AI blueprints.
Firstly though, I found an issue where the water absolutely hated the translucency of the fish and barely rendered it with the body of the fish. The masked mode however, wasn't any better as it made the fins look more like spines. Luckily, I found a solution which was to use the DitherTemporalAA node in the material to create the perfect blend between a masked material and the gradient I wanted in the fins.
I quickly got incredibly frustrated by the lack of resources online depicting how to create a simple AI blueprint for fish. I ended up using
this tutorial to create fish AI that travelled between target points set underwater.
 |
Swim Controller: Timeline that controls how often the fish finds a new location |
 |
Target points set up underwater |
 |
Swim Controller: Making the fish pause before collision and find a new location to travel to;
casting to the AI blueprint and setting it as a variable, then setting a timer for HitObject |
 |
Swim Controller: Finding a location to travel to from an array of target points and resetting when it gets to the end of the array.
I'm thinking of coming back to this later, as I realise that using a random number from the array each time would mean that I wouldn't need to reset the find, and could cut away a large amount of the nodes here. |
 |
Swim Controller: setting the new actor location and rotation based on the newly set location variable, interpolating between them using the alpha generated from the timeline. |
 |
Setting a custom event on a timer to generate a sphere and box trace by channel for both an arrow in front of the mesh (for collision before the head of the fish actually hits an object) and for the ledge it's around to set how far the AI has to travel to get around it (ledge location). |
I then created the same AI function for the dragonfly, which worked effectively in the scene as it could zoom around the scene, but was less effective for the butterfly since it needed to have a moere gradual method of travel, so I decided to come back to it again later when I find a solution.
No comments:
Post a Comment