Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Thank you for playing it!

For the fish movement, I implemented a simple flocking algorithm, basically I calculated the cohesion, avoidance and alignment vectors for each fish.

For the photo system, it was quite tricky and I'm not sure this is optimized, but I first used the OnBecameVisible and OnBecameUnvisible Unity functions on each fish to determine which fishes were seen by the camera. Then, each time the player takes a photo, I draw a raycast on each potential target to determine which are actually seen by the camera. And after that, I converted the world position to the screen position to check which fishes are on the picture frame.

(+1)

That makes a lot of sense. I did watch a video about flocking algorithms, and it looked kind of tricky to set up but maybe that was because they were trying to be super performant with it. Though one weeks worth of time is still quite impressive to get that set up, plus everything else you had to do.

OnBacameVisible and OnBecameInvisible was a good choice, even if it isn't performant. I had completely forgot that was a method on Monobehaviours and it does account for the whole frustrum of the camera whereas a cube trigger collider misses the gaps as the far plane expands out.

I'll have to look into implementing those ideas.

Thank you for the reply.