There are so many powerful terrain tools out there, but too often you will find yourself having to choose between procedural generation and a hand-crafted touch. For most terrain assets out there, adding polish means that your pipeline become destructive. If you need to go back and alter procedural elements, you will lose all polish work you have done. And what if one asset does one thing well, but not another? How can you combine the results from multiple sources?
Mad Maps is a powerful, integrated collection of tools to solve all of your Unity terrain pipeline needs. It is an effort to build a terrain pipeline that is non-destructive, extensible, flexible, fast and modular. It’s been battle-tested for the past 2 years in a professional studio environment, used for creating massive open world levels. It can be integrated with existing procedural solutions, allow you to split complex levels up into manageable chunks, and easily modify and reuse areas of a world.
Check out some overview videos below:
This is currently making its way to the Unity Asset Store. Stay tuned!
Have you ever had two arbitrarily rotated and sized rectangular prisms, and wanted to check if they’re intersecting? I know I have! Just an old AABB won’t do the trick, as very snug fitting rectangular prisms need to be detected and dismissed. There are some dastardly configurations (for instance, imagine a very very small rectangular prism sitting just above the surface of a massive and highly skewed rectangular prism) which also need to be sussed out.
It turned out to be a surprisingly tricky problem, and I had to pull a lot of different things from a lot different places together to get it working.
So how does it work? Well first lets think about the problem in 2 dimensions. There’s 3 escalating tests we can run to check if these rotated boxes overlap. The first is to generate two axis-aligned boxes and run a quick AABB check as a broad phase check. The second is to iterate the points of one of the boxes and check the overlap. If there are any points within the box, the box is overlapping. If that is inconclusive, we run the final and most expensive test. First, we pick one of the boxes to define a set of axis in whatever dimensions we’re working with. We basically rotate the whole world in such a way that one box is now perfectly aligned with the axis. Then, we project to each axis. If any of the projections do not overlap, we can guarantee that the boxes do not overlap either.
It’s pretty much a straight shoot up into the third dimension for the first 2 tests. However, for the 3rd, instead of projecting a 1D line from a 2D shape as above, we instead project a 2D shape onto a 2D surface. To do this, we decompose the rotated 3D rectangular prism into its composite triangles.
We can then flatten these triangles against a 2D axis by swizzling their coordinates. We then can do the much simpler test of if a triangle is intersecting an axis aligned rectangle, for each triangle. If any of the triangles succeed, the whole axis succeeds and exits. If all axis succeed, the test is a success and the rectangular prisms absolutely do overlap.
As always let me know if you think I’ve done it wrong, or if there was a simpler way to do this, or if you think I fucked up somewhere.
Heyo! I had a need to write a modified version of Unity’s LineRenderer and subclass, TrailRenderer, that create a 3D tube instead of a flat line. Great for growing yourself some procedural vines, or some such.
As a on-and-off user of this particular form of social masochism, it’s clear that there is an optimal strategy, which is to like absolutely everybody indiscriminately, save your SuperLikes for people who really stand out, and then actually make a judgement on if this is the sort of person you’d be interested in if you do match with them. Of course this strategy suffers from a potential Tragedy of the Commons (although worst case is everyone follows this strategy and matches with everyone else), and requires a premium option (as Likes can’t be a limited resource).
Recently, Tinder released a web version of their site, which got me thinking about ways to automate this pretty simple strategy. I spent about half an hour writing this little script, which does the following:
Checks the user for a bio
If no bio is found, we either like or dislike, depending on preference.
Checks the bio against several positive and negative keywords
If a positive keyword is found, we attempt to superlike the user
If a negative keyword is found, we dislike the user
If no positive or negative keywords are found, we like the user
Pretty simple, pretty easy. Find the JS below. To use, run it in the console of Tinder.com while you’re signed in, and leave it for however long you want. Enjoy your matches! Or getting banned.