Captain Cat Update

last I talked about Cap’n Cat it was mostly just a proof of concept, and a lot of things hadn’t really been to fleshed out and there was a lot of things still to be done to actually have a proper concept.
So many many brainstorming sessions, a half-baked design document and a doubling in the size of the team, we now have a much clearer goal and some exciting concepts in the works.

Here is a little peek at what it looks like now

So that’s looking pretty good, Now I’m going to talk about how I failed at something but found a different solution.

Spawn Boxes
So the main dilemma the Captain faces on their subaquatic adventure is leaks springing in the hull of the submarine, So to handle this I started building a 2D polygon class, simple enough, it’s essentially just a list of vector2s that contains the position of each vertex.
One of the functions of the class would be to find a random position within the polygon and return it and create a leak at that position.

To achieve this I looked into barycentric coordinates.
This required breaking down the polygon into triangles, weighting each of these triangles, since they would be different sizes, and then find a random position from within one of those triangles based on weight and number of triangles.

So after spending a little too long working on trying to get that to work I reconsidered the problem and just decided to use quads since its simple enough to return a point from within a quad and for the current use its all I really need, so I did that and the spawn boxes became simple to implement.

I am going to continue my work on barycentric coordinate systems if only out of interest, however, I am sure it may come in handy with shader development possibly?


Leave a Reply

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