|
If you're an artist or designer, you may find that your ability to code seems opposite to your main talents -- I have certainly found this myself! My main passion is game design, but without code, you can't make a game, right? With tools like Unity and Playmaker (a visual scripting system for Unity) this isn't necessarily the case.
After working part time on a couple of games, Zombie Outbreak Simulator and Class 3 Outbreak for a few years with Binary Space's programmer/CTO Saxon Druce, I was looking to add more titles to my game designer belt, but at the same time I wanted to keep things small-scale and achievable.
I had been playing a lot of iOS games while we ported Zombie Outbreak Simulator to iOS, and Tiny Wings in particular had me completely enthralled. From a gamer standpoint, I loved the feeling you got of being in the zone, getting perfect jump after perfect jump. From a business standpoint, I loved that it was essentially one level and extremely simple gameplay, hence quick development time.
After toying with a few ideas for games, I ultimately decided to try a version of Tiny Wings that was first person, in 3D. Using just Unity, I struggled through some basic physics code to get a ball rolling around on its terrain engine (I can hear you laughing) and after a week or so, I was quite happy with the result.
However, being the most hopeless coder of all time, progress was slow and infuriating. Not only was I trying to get my head around 3D physics and vectors, but also Unity itself, AND JavaScript! There are some creatives that can bash out some script without much problem, but I'm not one of them, and to learn this side of game development would set me back arguably years of study and practice, which at the ripe age of 32 I'm not willing to do!
Enter Playmaker
Somehow -- I think while looking through Unity's Asset Store -- I found Playmaker. Playmaker is a visual scripting system / state machine manager, which uses states (which house actions, each a snippet of pre-written code) and transitions to develop a game. A highly simplified example: You can attach a finite state machine, or "FSM", to a character with the states "fighting," "idle," and "walking."
Within each of these states, you can include animation actions, raycasting/shooting actions and movement actions. You transition between each state using events, i.e. within the idle state, you would add an action that waits for a left mouse click. This left mouse click triggers a transition event to the shooting state. Each action in a state is essentially a pre-made piece of code that you can tweak and fit together to create a state machine, and eventually an entire game.
 Playmaker's Test Lab example scene, which controls simple opening/closing doors
You can see from the above image how, for the non-technical, these visual state machines are so powerful. When I look at a block of code, I see a wall of text, and try in vain to understand what it does, when it triggers, and what it's doing at any given point. With Playmaker, I can glance at an FSM and see what it does in almost an instant.
I can also see not only what it is doing in real time in the visual editor, but also in the game view, where each object will display which state it is in. I can't tell you how good this is for debugging and just general understanding of what your FSM and the game in general is doing. Add to this things like debug rays, break points, and more, and you get a very clear understanding of what's happening.
Using Playmaker, I've just completed my first (mostly solo) creation, Unknown Orbit, where you can float, jump and fly around a surreal, 3D planetary system as a comet. Part-time, this game has taken me about a year. Full-time, I imagine it would have taken six months, and now that I've learned Unity and Playmaker to a greater level, I think the game could be recreated in a few months if not less.
 Unknown Orbit
Here's a quick example of an FSM for Unknown Orbit, where the player picks up snowballs. On the left are the states and transitions that control when we move between states. The middle pane is currently showing the actions inside the "destroy self" action. In this FSM, when the player flies into a snowball and picks it up, an event is broadcast called "Add snow".
 The state machine attached to a snowball pickup in Unknown Orbit (click for larger version)
The comet object hears this broadcast via a "global transition", and enters a state that increases the radius of the comet's ice core.
 The state machine attached to the ice/snow object in Unknown Orbit (click for larger version)
|
http://img507.imageshack.us/img507/4826/tutorialinputball3.png
Playmaker definitely requires programming for anything slightly complex with custom classes, etc.
http://www.mediamolecule.com/blog/article/littlebigplanet_the_road_to_7_million_
levels/
These console "mod tools" aren't successful just because they foster exploratory creation through instant feedback (i.e. no waiting for your experimental changes to compile), but because they spread out the space in which the problem is articulated: usually by providing 1:1 contextual triggers for in-game events. Yet, a degree of indirection supports the construction of mechanisms, traps, and even computers!
http://www.youtube.com/watch?v=ZiRgYBHoAoU
I mention all this as I forsee a convergence between development tools, mod tools and open source. In the future Independent developers should not have the unnecessary burden of having to build and debug a 3D engine from scratch, to handle collisions and a stereo soundscape, they should be able to adapt AI routines written by others and published altruistically as open source, common models of trees and buildings should be done once and made available to all rather than needlessly replicated. If someone makes a virtual Paris for a racing game, some of that work can be reused for a detective game, etc.
Right now there may be two developers at different companies struggling to build two Eiffel towers!
"In the future Independent developers should not have the unnecessary burden of having to build and debug a 3D engine from scratch, to handle collisions and a stereo soundscape, they should be able to adapt AI routines written by others and published altruistically as open source, common models of trees and buildings should be done once and made available to all rather than needlessly replicated. If someone makes a virtual Paris for a racing game, some of that work can be reused for a detective game, etc"
The problem for this is most game assets are custom made for that game or even that specific level. How would you like to be playing GTA5 and see the same gun from Fallout New Vegas, while this might be cute to some, I personally would feel like they were shorting me a gun model. And the 2 different developers could just buy an eiffel tower model if they were that terrible at modelling.
Love Playmaker and hope to see more systems expand on this idea.
I'm glad for things like this, because it provides a nice bridge for artists who know the logic of what they want done, but don't know the language the program "speaks" to make it happen.
As a more serious encouragement:
The key thing I've learned being an english nerd turned engineer, curiosity, perseverance, and a measure of pure bloody-mindedness are the three greatest traits to cultivate in making the leap to any STEM-like discipline. They turn a person's thoughts from "that... is too much for me" to "I can almost pretend I understand it" to "I think I got it" to "Old hat old bean". Keep at it and be grateful for the kindness of teachers, friends, and mentors.
Keep it up and many thanks for sharing!
I learned flow graph scripting in engines like CryEngine and Unreal before I ever did anything in actual scripting. Now that I have a fairly good grasp of scripting using C++ (and could probably move to other syntax fairly easily), I wonder if this would be a good way to make the leap from scripting to actual coding.
The only thing is that I feel that the game engine should already handle so much of the coding side of things already. The wonderful thing about using an engine like Unreal is that, for the types of games it's built for, you can literally get started making a game in it with almost no tweaking necessary (and usually it's to the small stuff, like camera distance from the character, UI placement, etc.). If you are at a point where you have to program the physics yourself from scratch, I feel that's already a problem for game production.
While custom tweaks to an engine are always going to be needed for certain games of course, and any engine should let you edit just about anything, I do think that the idea of a "game kit, just add content" is probably a better route if you have a specific genre in mind. I'd love to see the same thing for, say, RPGs, RTS games, and that sort of thing in addition to just shooters.
I haven't looked into ShiVa but I guess that's another "general purpose" engine. If I liked coding in LUA, I'd probably try ShiVa ... but since I prefer coding in C# and am very happy with Unity, I don't look much further ;-)
I still enjoy using PlayMaker because as you mentioned, it's visual coding, and designing around states really helps to keep things organized, manageable, and understandable at a glance.
As far as for teaching myself Unity and PlayMaker, I found it very helpful to port a couple of the 2D games created in the "The GameMaker's Apprentice" book (for the GameMaker engine) to Unity & PlayMaker!
The 2D art assets were already created on the book's CD, so it was then just a matter of learning how to create the sprites, collision objects and physics back in Unity and getting PlayMaker to mimic GameMaker's code blocks - in some cases I even created custom PlayMaker objects to more closely match the functionality of GameMaker.
Turned out the be a great way for me to learn PlayMaker and Unity.
Seeing how easily I was able to port the GameMaker games to Unity made me appreciate the power of using Unity & PlayMaker together - what a powerful combination!
Let me know what you think!
My logic bricks are undeniable
Blender wins again
http://www.youtube.com/watch?v=H3lEgMqm1eg
My logic bricks are undeniable
Blender wins again
http://www.youtube.com/watch?v=H3lEgMqm1eg
I find it a lot easier to debug but if any of you are interested in seeing it in action below is a link to a demo video that I made for people who are doing tutorials in uScript that I'm running out of Sydney.
http://www.youtube.com/watch?v=Pp-LI7wvRWo
As you can see it is very similar to UDK's Kismet, but I've found just as flexible as Playmaker and again, a lot easier to debug.