Please vote on things you want implemented on the Trello Board
These fish models and code have been added to the Community Ocean WIP! , , and myself will be collaborating to bring you the best complete community ocean possible!
Recently I have been working with a team of 4 others on a serious game for my senior project. The game was mostly set in a underwater environment, so there were a lot of fish behaviors and 3D Models to be created. I personally implemented the schooling behaviors using Boids Behaviors, while my artist created the models and textures for a lot of fish. Our time developing the game is almost over, so we wanted to leave the community with something that will allow people of almost every skill level to implement good looking fish into their game! I hope to continue development on the fish logic, and my artist may be convinced to create more fish ;). If you have any ideas on how to improve our AI, or if you are an artist that wants to contribute your own fish, please do! I will add you to the list of contributors.
If you use in your project, I would be more than delighted to see video of your game posted here!
Are you an artist? Would you like to be listed as a contributor? Submit a textured fish or underwater creature through Texture and .FBX that is scaled correctly and is facing the +X direction and I’ll add it here with your name! For bigger underwater creatures please include a swimming animation, not required for smaller fish. Also submit an image of the fish that is similar in size to the ones listed below…
Hey guys! I’m the artist that made the fish. I tried to keep them pretty low poly so that you could have lots of flocks and larger schools. Only the biggest creatures (like the sharks) have animations, the rest look fine just moving regularly through an environment. I also researched the average sizes of all the fish so that you can scale them appropriately. I hope you guys enjoy the models! Feel free to ask me any questions.
@Triplelexx, Thanks, I will move it to github as soon as I am able. Was packaging project for senior project today, so just posted what I was able to :).
@kkhaial, I will post a tutorial video as soon as I can, but for now I will leave you with these (rather scant) instructions:
FlockFish and FishManager Instructions
-> Add Code To Project (2 Files: FishManager and FlockFish)
-> Create a Blueprint that extends FlockFish, and another that extends FishManager
-> Add a mesh to your FlockFish Blueprint
-> Ensure under default config of your FlockFish blueprint that:
playerType is set to your player blueprint.
neighborType is set to the fish’s own blueprint
MaxBounds and MinBounds is set to the bounds of the volume you want the fish to swim around in. (Ignore part if utilizing fish manager)
-> Option 1: No Fish Manager
Place your FlockFish BluePrint in level, ensure isLeader is set to true.
Copy/Paste your leader, and ensure isLeader is set to false on the copy.
Copy/Paste your copy as many times as you want… Tada… Fish Flocking
-> Option 2: Utilizing Fish Manager
Drag a FishManager Blueprint into your level
Set MaxBounds and MinBounds to the bounds of the volume you want the fish to swim around in.
Add a your FlockFish Blueprint to the “FlockType” section in fishmanager
Set how many fish you want in the flock by setting the float value under “FlockNum” section in fishmanager
Although not the prettiest way, what I would do is from the menu select “File->Add Code to Project…” and make sure that the parent class is Pawn (You may have to select the ‘all classes’ tick). Name the file “FlockFish”. Copy paste all my code over into the .h and .cpp files for FlockFish. Do again for “FishManager”, but with its parent class as Actor. If anybody knows a better solution for adding external code to project, please enlighten me
Ahh, ok. That’s actually an with the fish code itself. Right now at runtime the fish code is trying to find the specified player blueprint in world, but when you simulate your player is not spawned, so the fish are throwing around nulls everywhere. My advice for now would be to play, then eject rather than simulating. I will be sure to fix in the next version. As for uploading the project folder, I will setup a scene and post a project as soon I get a to go up to the School’s lab.
First, is simply awesome! Thanks so much for sharing the code.
Looking forward to post-processing!
Lastly, I did add the code as per your instructions, but when I add it to my skeletal mesh and play, the fish just shoot straight-up, regardless of how I set the Underwater Min and Max. Any ideas or anyone else having the same?
@kkhail, I’ll have to wait to giving you the Post Process Volume. I need to ask my friend if it is ok to distribute it, but if he says yes, I will definitely let you guys have that.
@, How many units is the Z of your bounds? I ask because the code for checking if a fish is close to max bounds was made hastily so that it would work for my groups senior project. My current code (planning a fix for with ray casting) adds and subtracts “obstacleDist” for the fishes z location to check if it is close to the surface or sea floor. value’s default is set to 300, which may be way too much depending on the size of your bounds, but can be turned down. That may be the you’re running into, if not let me know
Thanks for writing back so quickly!
Well, I’ve tried a few parameters for Z. I’ve used the fish manager as well as just setting it on the fish mesh itself, but it’s always the same result. I’ve even tried setting the min to 1 and the max to 5.
I’ve also lowered the obstacleDist variable and the result is the same.
Interesting, I will go up to the lab sometime week (Spring Break) and test out the fish on a fresh project to see if I run into something similar. If you have any video or images of the that would help too!
Also: What do you have set for the fish’s ‘turnFrequency’?
Found somebody who said in the forums, I believe covers project as well:
is released under the CC0 1.0 Universal license meaning you can use it however you want with no attribution. Although if you’re using them in some kind of finished project it would be cool to let me know where!