Unity 3.5 is live!

14. February 2012

 

Released in Beta back in December, Unity 3.5 is now out of beta!  This release is a pretty epic one to boot.  New features include:

  • Flash export.  Compile your game to SWF format
  • Google Native client targeting ( Chrome C++ )
  • Path finding built in
  • A new particle system, editable in Edit Mode, group-able, modular with a built in curve editor
  • Built in LoD support
  • Asset cache server
  • Multithreaded rendering ( PC, Mac, 360 only )
  • HDR support
  • Directional light maps
  • Select and edit multiple items in Inspector
  • Webcam texture ( huh? )
  • Microphone support on all platforms
  • iOS improvements including iAd, Compass, Gyro, Camera, Microphone and push notification support
  • Android improvements include Mouse/Joystick support, Camera, Microphone, Gyro/Compass, Android 3.2 ( Honeycomb ) and Android 4.0 ( Ice Cream Sandwich ) support

 

 

And much much more.  The full list of changes is available here.

News




PlayN 1.1 released

13. February 2012

 

On the PlayN discussion forum PlayN 1.1 was just announced.  Complete release notes are available here.

 

 

Key new features include:

  • add HTML Canvas backend ( in addition to the WebGL and deprecated DOM HTML5 back ends ) as a fallback for browsers that don’t support WebGL *cough* Internet Explorer *cough*
  • iOS support… probably the biggie of this release
  • removed GAE dependencies ( this was a pain in the butt previously )
  • Android properly supporting mp3
  • various other bug fixes

 

As was mentioned in this earlier post iOS support isn’t complete, yet.

 

 

Good job PlayN team!

News, Programming




Creating a spritesheet using Daz Studio and The GIMP

13. February 2012

 

 

I have been playing around a bit with Daz 3D Studio since it was recently made freely available. At first I struggled to find an actual use for the program, then I realized how exceptionally easy it made creating animated sprites. The following tutorial will walk through creating the following walk cycle using Daz Studio:



The above image is actually a web animation generated from this spritesheet that we will create. All told, the process will take about 5-10 minutes, most of it will be you waiting for your computer!  If the above image isn’t animating, that means your browser ( most likely Internet Explorer ) doesn’t support the keyframes CSS attribute.  Trust me, it works. Smile

 

 

You are going to need a couple things to follow along this tutorial, all of which are (currently) freely available.

 

You will need:

 

 

 

Install all of these products.  Now we fire up Daz Studio.

 

We are going to use the default human, feel free to drag and drop and design your guy however you want.  That said, do not move the person from the default screen location.

 

Once your guy or gal is dressed/decorated however you want, its time to add some animations.  On the left hand panel, select Content Library, Walks then start-(N) and drag it down to the beginning of the timeline.

 

Like so:

 

imageimage

 

If done correctly, if you press play your character will now have a walk cycle.  You can drag down as many animations as you would like to capture, just add them one after another in the timeline.  In this example we are just going to do the single walk cycle animation.

 

Now comes the key part, you don’t actually want your character to be moving like it does currently, you want him to remain stationary.  First lets frame things into the left.  Click the view selector box to rotate to the left view.

 

image

This is the guy you are looking for, click the red section labeled left.  Now ideally your window should look something like this:

 

image

 

 

Now we need to strip out the movement part from the animation.  To do so, first we need to convert to Studio keyframes.  This is done by right clicking in the blank gray area above the timeline and selecting Bake to Studio Keyframes, like so:

 

image

 

You will get the following message:

 

image

 

Simply click Yes.  Now we can edit out your animation.  What we want to do is remove movement along the Z-axis.  In order to do this, select Parameters along the right hand panel, then you want to select the Hip ( the root of all animations ).  You can do this by either clicking it within the scene Window, or selecting it from this drop down:

 

image

 

 

Now that you have the Hip selected, in the Parameters panel ALT+Left click the zTranslate panel:

image

 

This process should reset it’s value to 0.  Now if you press play on the timeline, your animation should now be stationary.  Now its time to render our images out.  To do so in the menu select Render->Render Settings…  like so:

 

image

 

The following window will appear:

 

image

 

If not already done, make sure at the bottom right it is set to “Show Advanced Settings”.  Now drag the quality/speed slider down to 3 ( or it will take forever, for little visible gain ).  Now you want to scroll the options down a bit.  First we want to set our image render resolution.  I personally went with 128x96, but you can use whatever you want.

 

image

 

 

Now scroll the options down a bit more and select the Render To: drop down.  You want to select Image Series like this:

image

 

 

Now we want to select where to render it to.  Leave Start and End Frame at the defaults ( the entire animation ), file in a name and leave it as PNG so we get transparencies.  Switch the location from Library to Folder and pick a directory you want it to save your renderings to, like so:

image

 

Now click the green “Render” button.  You will get a warning like the following:

image

 

Simply click OK.

 

Now we wait… there is absolutely no indication it’s actually doing anything, but Daz Studio is now rendering your sprites.  The only real indicator it’s doing anything is the spinning “busy” mouse icon.  Let it do it’s thing, it took approximately 4 minutes on my PC.

 

Once it is completed, in Explorer navigate to the directory you told it to render to.  If all went well, your directory should be populated with 51 PNG images.  Here’s mine:

 

image

 

 

Now that we have our sprites, we need to make them into a sprite sheet.  If you haven’t already, install The GIMP and the sprite sheet plugin I linked earlier.  Now load up The Gimp.

 

In GIMP select File->Open As Layers…

image

 

Navigate to the folder you saved your images to, then CTRL+A to select them all ( or CTRL + Click to select them one by one ).  When finished press Open:

image

 

If everything worked correctly, your layers list should look like this:

 

image

 

Now select the Filters Menu->Sprite-Sheet->Create From Layers…  If this menu option doesn’t show up, you haven’t installed the spritesheet plugin correctly.

 

image

 

Gimp will now merge all of the layers together into a single sprite sheet in a new window like so:

 

image

 

 

Simply save this file and you are done.  My end results are this.  You may want to do some editing, like making your spritesheet square instead of one wide and short image, but this can be accomplished in a few minutes of copy and paste.  All told, one remarkably fast way to generate a walk cycle sprite animation.  Rendering other angles or different animations is simply a matter of repeating the process from a different angle or dragging and dropping different animation sets.

 

Of course, you can also create your own animations quite simply in Daz.  You can also import your own meshes and props, although I haven’t really experienced this part yet, so I do not know how painful the process is. 

Art , ,




Cool thing of the Week: Week 6

10. February 2012

 

 

Sculpting is all the rage in 3D these days, and for good reason.  You can quickly and fairly easily make incredibly detailed models in a very intuitive manner.  Many professional studiossculptris_logo have slotted a sculpting application like Autodesk Mudbox or Pixologic ZBrush in their workflows.  Only one catch… got 800$?  In the world of 3D, that’s rather affordable, but in the world of my wallet, that’s a bit more harsh!  Of course Blender, Maya, Max et al. all have sculpting features, but they simply don’t approach the abilities of a dedicated application.  Fortunately for us, there exists a free option, Sculptris.

 

 

 

 

 

image

 

 

Sculptris began life as a hobby project of Tomas Pettersson, in an attempt to make a free version of ZBrush.  Thing is, he did a damned good job, so good in fact that Pixologic hired him on.  Even cooler for all of us, Pixologic made Sculptris on of their official products and continued to offer it for free!

 

So essentially, you can think of Sculptris as ZBrush lite, but don’t go thinking it’s a demo version or a toy, it is a remarkably capable and streamlined application.

 

If you have never used a 3D sculpting app before, its rather like modeling with virtual clay.  With Sculptris you start with either a flat plane or a 3d sphere, then start pushing, pulling, smoothing, creasing away until your model takes shape.  It really is a remarkably fluid way to work.  Tools are kept to a minimum, in Sculptris you model using: Crease, Rotate, Scale, Draw, Flatten, Grab, Inflate, Pinch and Smooth.  That’s it, and frankly, that’s about all you need.

 

Once you are done shaping your 3D model, now it’s a matter of texturing.  You click the Paint button, choose the texture size you want it to create and it goes to work for a few minutes.  Once your texture map is generated, you can now paint in 3D using the same interface.

 

 

Sculptris is Paint mode ( click for larger image )

image

 

 

Performance is good as is feedback.  I have never experienced a crash, although I have experienced some oddity using Sculptris on my laptop in power saving mode ( the buttons are all in the wrong location and the top menu bar disappears ), but then, using Scultpris in power saving mode isn’t particularly a brilliant idea, so I wouldn’t worry too much.

 

You can of course also import your own models, this is especially useful for creating displacement maps for your lower polygon work.  Sculptris supports importing OBJ ( wavefront, format, but nearly ubiquitous at this point )  as well as GoZ format ( ZBrush format ).  You can also export in the same two file formats.  Be careful though, your exported files aren’t going to be “light”.  Consider the model in the screenshot, it was imported as a 200K OBJ, and after a few minutes in Sculptris when it was exported  it was 14MB in size.

Cool Thing of the Week, Art




Handling CTRL+C in Node

8. February 2012

 

The last week or so I’ve been looking at using Node for server side game programming and I have been quite impressed.  I have found a few things quite frustrating ( the documentation is extremely sparse and tooling support is… iffy ) but code wise everything has worked about exactly how I expect it.

 

That said, I ran into my first glaring bug and it is an annoying one.  In my current code, I want to write out some memory to file when my code exits, I imagine a fairly common event.  At first it seems like a remarkably simple thing to do.  Every node application has a process object, and process has an exit event.  Therefore handling on exit should be as simple as:

 

process.on('exit', function () { //handle your on exit code console.log("Exiting, have a nice day"); });

 

*Should* being the operative word.  Reality is, this doesn’t work.  The event simply does not fire on CTRL+C.   Hmmm.  So I decide to throw process.exit() at the end of my script and BAM, the on exit event is fired.  So it appears that contrary to the documentation, the CTRL+C event doesn’t raise an exit event, or so I thought.

 

Alright, no big deal, I’ll just trap the SIGINT event raised from CTRL+C and handle exit then.  Ohh… that didn’t work out well.

 



C:\Users\Mike\workspace\NodeDev\src>node server.js

node.js:218
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: No such module
    at EventEmitter.<anonymous> (node.js:403:27)
    at Object.<anonymous> (C:\Users\Mike\workspace\NodeDev\src\server.js:5:9)
    at Module._compile (module.js:434:26)
    at Object..js (module.js:452:10)
    at Module.load (module.js:353:32)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:472:10)
    at EventEmitter._tickCallback (node.js:209:41)



Hmmm…

 

So off to Google I go!  After a few minutes I discover this tidbit.  Basically it’s a known issue, SIGINT isn’t raised on Windows and they claim it isn’t possible, which considering Python handles it just fine, I find a bit difficult to believe.  So, it is a currently unsolved issue, but hopefully it will be resolved in the future.

 

Considering that CTRL+C is the defacto way to shut down Node, I really hope this is resolved soon.  In the meanwhile, does anyone out there know an effective workaround?

 

 

Update

 

Stack Overflow came to my rescue on this issue.  User pimvdb posted this work around:

 

var tty = require("tty"); process.openStdin().on("keypress", function(chunk, key) { if(key && key.name === "c" && key.ctrl) { console.log("bye bye"); process.exit(); } }); tty.setRawMode(true);

 

It feels like a bit of a hack, but then, I suppose it is!  Hopefully this issue gets fixed in node eventually, but for now, here is an effective workaround.

Programming