This project is going to be a simple game in which the player positions a selection of objects around the screen, then lets the physics simulation take over to see what happens. Because I’ve largely completed the GUI part of the app, today was the first chance I’ve had to actually work on the actual game bit, which means I had to figure out how to the graphics into Unity.
I’ve decided to use Rage Spline for my sprites, so the graphics need to be created in a vector drawing tool such as Inkscape (free on all platforms) or Adobe Illustrator (expensive and on few platforms).
The version of Rage Spline I purchased is called Rage Suite, which isn’t available on the Unity asset store. It includes tools to import SVG files created by Inkscape, which I’ll be using because I live in Australia, a country where it’s cheaper to fly to the US to buy high-end Adobe products in person than it is to buy them locally.
There are a few rules that have to be followed if you want your vector drawings to export cleanly from Inkscape. Rage doesn’t support all the features of the SVG specification.
First of all, ensure Inkscape is set to optimise transforms. Open Inkscape, click on the File menu, choose Inkscape Preferences, select Transforms, and choose optimised from Store Transformation. This will “suggest” to Inkscape that it shouldn’t write out transform() instructions as part of the SVG file. It’ll still write out transform() under certain circumstances though.
When creating your image, keep it simple:
- Radial gradients will be converted to linear gradients when they are imported into Unity
- Only the first two colour stops of a linear gradient will make it into Unity.
- Effects like as blur will be ignored.
- Primitives such as rectangles or circles will import, but they will be messed up. All objects need to be converted into paths.
- If you move, scale, rotate or transform an object using Inkscape’s transform menu, it has a high chance of screwing up that object so that you’ll never be able to get it to import correctly into Unity.
There’s more to it than just keeping it simple though. Once you are happy with your image, it’s time to export. You’ll need to completely ungroup every object in the image because groups that have been moved always have a transform() applied. Ungrouping them will remove them and the transform.
It’s also a good idea to manually examine the XML for every object to make sure there are no hidden transform(). You can open the XML editor from the Edit menu. If you find any transform(), the stupidly easy fix is to move the object slightly – ie. press the left, then right cursor key to nudge it left, then put it back where it was, forcing Inkscape to get rid of the transform.
Once you’ve checked everything, you can regroup the image parts if you want. Just make sure that you don’t move anything, or Inkscape will put a transform() onto the group and you’ll have to ungroup again to get rid of it.
A lot of work, but as I understand it, the same restrictions apply to Illustrator.
Anyway, I created a marble in Inkscape, imported it, and now I’ve got the application auto-creating the marble object in a scene when the user hits play. Not much to look at, but there’s a lot that’s been completed behind the scenes.
Using Inkscape on a Mac
I should point out for future reference, that Inkscape on a Mac is a bit of a pain because it’s needs X11, which Apple removed from Mac OS last year. There’s plenty of guides online for setting it up using something like MacPorts (apt-get is so much easier on Linux).
There aren’t however many references to a bug in Inkscape that breaks Python, which Inkscape uses for it’s filters and extensions. Attempting to run something in Inkscape that uses Python will give you an error like:
The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension
Although annoying, it’s pretty easy to fix if you are lucky enough to stumble across reply #7 on this page.
Auto-saving and Unity
I made a silly typo this afternoon, which created a recursive loop in some code I was testing, and Unity got stuck in it. Unfortunately, Unity doesn’t have a proper auto-save feature, so when I force closed it, I lost about four hours of work because I’d forgotten to hit manually save since lunch time.
This reminds me of a similar annoying bug that Blender devs also won’t fix (yes, it’s a bug, not a feature), which lets you accidentally hit the shortcut key combination for Quit, resulting in the exiting suddenly, losing any work you’ve done since the last save.
Like Blender, Unity also has a sort of work around: Every time the project runs, a temporary save file is created called “__EditModeScene”. If you want to recover your work, you’re going to have to remember it’s there before you re-start Unity, or it will be erased.
I worked with ShiVa for over two years. It would crash on a regular basis because I was running it in a Windows VM on a Linux machine, but during the last 18 months, despite hundreds of crashes, I never lost any work. In the last two weeks, I’ve repeatedly been caught out by this Unity’s lack of auto-save, and I know I will continue to be caught out at random intervals because I will continue to forget to hit save when I’m in “the zone”.
Computers are supposed to automate repetitive tasks.







Thoughts on the 27″ late 2012/13 Apple iMac
For the past few years, I’ve not been a particularly happy PC user.
Although my PC was cheap, I’m fed up with a large do-it-yourself box of hot, noisy components that breed dust bunnies.
I’m a programmer, not a system builder.
Unfortunately, finding a replacement PC that has decent performance, is cool, quiet and hopefully smaller, has been a challenge. I use Linux Mint (a fantastic OS, by the way), and a docked laptop is probably the closest match to what I’m looking for.
The problem is that the majority of Windows compatible laptops that I could use just don’t meet my requirements. They’re either anaemically underpowered, or are stuffed to the gills with hardware that causes them to be hot and noisy.
Good luck trying to find a model that can output at 1440p for my Dell Ultrasharp monitor.
Due to circumstances beyond my control, last month I was forced to start using a low-end MacBook Pro as my daily driver, leaving my desktop PC to gather dust, which is something it’s good at.
After some time using it, I’ve decided that although it has an underpowered Intel HD3000 GPU, the CPU is more than adequate for the work I do, and it meets my cool and quiet requirements. If I could just buy a version of it with a better GPU that can output at 1440p, it would perfect…
Browsing through Apple’s website, I found the device I was looking for: A 27″ iMac with a quad core i5 CPU, a 1440p display, and a fast GTX675MX GPU.
Although not cheap, there really is no option for me. The closest Windows device that I could find is a 27″ Dell XPS One, which has faster CPU for less money, but the most important component, the graphics card, is a lot slower.
I’d always thought of Apple computers as overpriced, but in this particular case, the high-end 27″ iMac is reasonable compared to the alternative.
Rather than go through yet-another-boring-review, I’ve decided that I’ll just list the things I like or dislike about it, from the point of view of someone who’s relatively new to Apple computers.
Things I like
Things that I’m not impressed by
Things I don’t like
Overall, it’s a great machine, and I can recommend the 27″ models for anyone looking for a no-fuss desktop computer that’s easier to live with than a laptop. Although pricey, it’s not excessive considering the hardware inside.
I’m not so keen on the 21.5″ models though. When compared to the larger ones, the specs on the smaller iMacs are significantly weaker, yet the price is fairly high. If you are set on an all-in-one iMac, and were looking at the 21.5″ models, I’d definitely try to scrape up a little more cash.