Fisheyes and lights

Progress on Fathoms has been slow while I’ve been working on Advesperation 2 for the Asylum Jam as well as a point+click adventure game that grew too big for the jam it was meant for.  (More on that later!)


It hasn’t been completely still, though. I’ve been tinkering with the flocking AI, e.g. adding obstacle avoidance for both stationary and moving things. So now the little tadpoles can avoid the bigger fish as well as rocks. The logic for avoiding obstacles is a bit different, though, as they should only avoid what they’re about to hit, otherwise you’d never see them swim alongside the rocks. So I’ve been trying to use their direction/velocity vectors as their ‘eyes’ instead. It’s not perfect yet and for the larger fish I may need something like additional ‘eye vectors’ on either side to get more natural movement.



The way I made the underwater lights needed an update as well. The lights were just sprites layered underneath everything else which is a fine illusion until solid objects like rocks/islands are introduced. I downloaded a plugin to render some basic 2D lightcones (or full circles) but it produced strange artefacts when overlapping. So I had to figure out how to make my own. I’ve never tried generating meshes in Unity before, but luckily it’s not nearly as hard as I thought and after about an evening’s work I ended up with this:

light1I’m not completely happy with the texture yet (overlapping lights should be similar to having a ‘screen’ blend mode), but I’d rather learn more about procedurally generating meshes before I dive into shaders as well.


Leave a Reply

Your email address will not be published. Required fields are marked *