Tuesday, November 18, 2014

30Daydev Day 1+2: Going through Unity Basics + Making a SpriteSheet

Whew, these two last days I had big Internet problems, almost impossible to be connected for more than a couple of seconds at a time, but I continued studying Unity3D manual and small bits of live training videos I could glean out of this Traitorus Internets... at least it looks like working since some minutes, hopefully I'll keep it like that!

Real difficulty number one: Unity3D requires importing frames of animations as a Sprite Sheet only, I was surprized there was no other way, like single frames batch import in Construct 2.

So how to create a Sprite Sheet out of single frames exported from Brashmonkey's Spriter, and without being able to download any Sprite Sheet software or looking up the question online? Well I had to invent a way, never created a sprite sheet on my own, so I tried to create one with Construct 2, basically included frames of animations I made in the past (Leia from a paused Construct 2 project: Chivalrous -platformer-) and exported as HTML5. Unfortunately, the result was 3 separate Sprite Sheets for a running animation... and I needed one single sprite sheet.

Leia running - 8 first frames from 20.
Meanwhile, Internet came back a bit so I could download the first sprite sheet tool I could find on Google: TexturePacker, tried it and discovered it needed an importer (free) for the Unity Editor. And obviously Internet escaped again, leaving me face to face with a TexturePacker that transformed two of the 20 frames into a red filled silhouette at a PNG export step, and in a wrong order of frames... damn TexturePacker!

So I decided to just get some inspiration from TP for the size of the sprite sheet, 1024*2048 pixels, sounded cool, I used that, and following Unity's set of features, I imported my own spritesheet, and sliced it with a 2 pixels offset on the Y and Z, alligned top left, (while keeping the max size of the import to 2048, following the steps from the live training in the "Character Controller" video by Mike Geig, cool guy btw, like how he explains things.)



What else, oh! I figure out how to export PNG from Krita, I had difficulties just before, it was just a matter of getting the right settings (8 bit depth, RGB etc.) Later on I could download a more recent version, I was using 2.8.1 and found out there was the stable 2.8.3, I would have thought the updating was automatic, but apparently no... so, no big deal, the thing's solved :)

I'm still learning how to animate a Sprite but I'm getting close the the heart of the cool stuff (so many steps to do simple things! But I guess it will be worth it since it may allow more control, probably,) so that's it for now. Maybe I'll spend the night continuing to study stuff since the Internet seems to be back to life at night only :)

Almost sure I forgot some other details but in general, this is it for now. Let's see if I can get a demo level working by the end of the first week :)

Karim.

No comments:

Post a Comment