It’s been pretty productive around here in the last week or so. After setting a more realistic scope for the game I’ve been focussing again on laying out the main gameplay area, this time in a more specific manner, getting buildings in their final positions, sorting out paths between them, listing locations that still need defined etc. I’ve also been spending a bit of time working on some tools for speeding this process up, and made my first foray into custom Playmaker actions…
The main area of Toryansé is a small, suburban train-stop, there are a few shops and houses a short walk from the station and a block of flats, surrounding it on all sides is forest. Certain parts of this forest will be explorable but a lot of it is in the background.
I found it surprisingly tricky to sketch in large areas of stylized vegetation, getting something that looks like a clump of trees, quickly, within a reasonable polycount while retaining some editability took a few attempts. At first I explored using point-clouds; the plan was to take an area of ground that needed treetops, generate a point-cloud from it, randomizing values for size, distribution etc. and then either mesh that using polygonizer or otherwise using it to deform a low-poly grid:
It worked to a certain extent but straight away it was clear that point-clouds were just too unwieldy, the time you save covering a lot of space quickly is completely negated by how little control you have over the specifics. Super difficult to direct in a meaningful fashion.
The next approach was similar but yielded much better results, rather than using clouds I started with a small number of hand-placed nulls, then meshed those:
At first I was worried that this was going to take as long as just making individual trees but, once you have a group working, it’s a simple case of duplicating and shifting them around. It also works very similarly to meta-balls in that you end up with a single mesh without intersecting geometry, with a polygon-reduction operator on top I was able to keep the poly-count really low. I’m now using this for hedges, moss, pot plants etc. as well.
Next up were telegraph poles / power lines; as I’ve touched on before, the environment takes elements from various different places. One very distinctive feature of Japanese suburban areas and back streets are the nests of overhead cables.
This approach is similar to one I used ages ago for animating the pages of a book, it’s driving a smooth curve, ones that has lots of points, with something simpler and more easily manipulated, in this case a linear curve with just three points. The first and last points are pinned to nulls at the poles, the middle point is pinned to a null which is in turn constrained halfway between the first two. What this means is you can go about placing your poles wherever you like and the wires should sort themselves out.
As this involves several live deformers in Softimage any curves will have to be meshed and frozen before being usable in-game. Out of curiosity I thought I’d see if it was possible to set up something similar in Unity itself. Luckily, someone had done most of the hard work for me and I got going pretty quickly using some of the code from here: Wikibooks: Cg Programming/Unity/Bézier Curves
I have a bunch of uses for editable curves and, as I use Playmaker for pretty much everything in the game, it would be really handy to have this as an action. It’s something that stresses me out a bit using Playmaker, that I’m regularly reliant on other people providing/maintaining actions for various tasks, so I though I’d see how tricky it was to put one together myself:
Again, someone had already done all the hard work for me here but it was still reassuring to get it all functional inside Playmaker, I even got the fancier spline version working:
You can grab both the actions on the Playmaker forum here: http://hutonggames.com/playmakerforum/index.php?topic=11193.0 or via Playmaker’s in-editor search.
As ever, comments, questions, crits and corrections are all more than welcome…