Development Diary #7: More Progress…

I’ve recently been fiddling around with various interface elements, at this stage I’ve settled on an “in context” approach with only relevant interactive options appearing when required, as opposed to the old school verb box…

Ideally, I want to be able to build my scene in 3d, set the relevant Playmaker template for items, doors etc. click a few check-boxes and hit play. Certain elements are common to most point-and-click games and at first it seems pretty straight forward to just have objects to collect and other characters or scene elements to interact with, as I tried to nail these down though, more and more variations seemed to appear. What I need is a setup that allows me to add various actions as I need them and accommodate one-off custom options as well. My current solution uses two templates, the first covers the mouse-overs and pop-ups and the second covers the button actions on each of these…

Each interactive Item compares itself with a global variable called Hovered_Object which is updated with a Mouse Pick every frame the cursor is moving, (you could probably just use a standard OnMouseEnter!) when they match it sends an Over event to any child FSMs, the individual buttons then handle the scaling. Over Idle only checks for a not-equal response, this stops the FSM changing state while hovering the cursor and means we always fire the next event off at the correct time. Upon the mouse moving off the Item, after a short Wait, we check for mouse overs on any objects tagged as Buttons, this ensures that the user has time to move the cursor between the item and Buttons without throwing a Mouse Off event. Button Over Idle again only checks for not-equals while the mouse is over a Button. If the cursor moves off a Button we make one last check to make sure the user hasn’t moved the cursor back over the original Item before sending the Off event to the child FSMs and we end up back at Idle

Each Button has its own FSM:

The Idle state is empty as the Button template relies on the parent Item to trigger the initial Over event. Scale Button Up handles the scaling, checks for a mouse-over on just itself and also for a Click event (in this case a Finger Gestures Tap). Clicked then scales the button to zero and sets a global Click Type variable. Each button is assigned a string variable in the inspector that corresponds to its function, the relevant actions can then be selected via a String Switch, this way I can use the same template for all buttons. At some point I’ll probably be adding more Click events to cover various inputs, I also might add a broadcast event to Clicked so all buttons disappear simultaneously, having everything set up in one template means these kinds of changes can propagate to all the various button types instead of me having to add it to each one individually.

•••

Another relatively new addition to my set-up, and one I feel like mentioning, is Shader Forge, a visual, node-based shader editor for Unity. Below is the tree for the basic, flat toon-shader I’m now using on nearly everything in the game:

For anyone, like myself, with a background in 3d (or 2d-compositing or motion graphics!) the above should look reasonably familiar, it’s very similar to the nodal graphs you find in common 3d packages and entirely removes the need for writing shader code directly, replacing it with a process that I for one find infinitely more intuitive. In the same way I’ve found Playmaker so freeing creatively when setting up interactions etc. I now feel equipped to solve my own shader issues and, more importantly, play around and experiment with setups until I get what I want!

Just as an aside; I do occasionally hear a similar set of criticisms regarding both Shader Forge and Playmaker when I bring them up, that these kind of tools add unnecessary overhead, that they limit your control over the code, encourage “bad” working practices etc. As far as I’m concerned it’s plug-ins like these that make good on Unity’s promise of democratising game development, they open up avenues between a bunch of different creative disciplines and shorten the distance between code-centric developers and those of us who are more visually minded (you can see it working already in the post-production industry with tools like ICE in Softimage, or whatever the equivalent will be now T-T). For me, seeing the number of illustrators, animators and designers getting involved in games in the last couple of years is super exciting! Olly Moss, Scott Benson, David OReilly, Heather Penn… and those are just a few grabbed from my Twitter feed, I would imagine a similar trend can be seen in all sorts of other areas too. Most of these folks seem to be starting/joining small studios and partnerships with other developers but as the technical barriers to entry diminish, it’d be great to see games becoming accessible in the way short-films and comics have. Hopefully we’ll see lots more small-scale, single-artist creations appearing, as well as collaborations between all sorts of disciplines not usually associated with games! The more tools we have that make it not just easier, but even just possible at all for more people to make more things, the better!

Anyway, with most of the mechanical bits and pieces starting to come together, I’m hoping to get something playable together in the next few weeks. There are various conventions and meet-ups coming up before the end of the year and it would be great to try and get the game entered for one or two…

As ever, comments, questions, crits and corrections are all more than welcome…

Nick

3D-artist and fledgling Unity Dev. Currently working on a wordless point-and-click adventure game...