Archive

Archive for the ‘Unity’ Category

Current editor issues in Unity 5

April 3rd, 2015 17 comments

Unity-5-logo

First, let me make something clear: I love Unity. I use it every day and it allows me to build my dream game. So don’t take anything I’m about to say as “oh you just don’t like Unity”. I love it to bits; it’s a fantastic tool.

Now that this caveat is out of the way, let’s dig into things which, from my point of view, ought to be addressed. Keep in mind that I spend an ungodly amount of time using Unity to create Ghost of a Tale. So anything that breaks my workflow is really frustrating to me.

As you’ll see those issues are mostly geared towards ergonomic and manipulation of game objects in the editor. To be fair, they don’t strike newcomers; they only become a hindrance for experienced users who rely on every little thing to make their development life easier.

Still, I don’t think that should detract from their pertinence. So here they are, in no particular order:

 

1) No lateral slider in hierarchy window:

If you need to dig into a complex hierarchy of game objects, you actually have to resize Unity’s window layout. Try to imagine Maya without a lateral slider in its outliner and you get the idea.

 

2) No drag-and-drop component reordering:

You can click and drag a component directly from one game object (in the inspector) to another game object (in the hierarchy window), but you can’t simply click-and-drag a component up or down on the same game object.

This means tediously clicking dozens of times just to move a newly added component to the top of a long components list.

 

3) No way to make an object unselectable in the scene view:

In any 3D application it is very important to see some items while not being able to interact with them by mistake. We need a way to mark some game objects as visible but unselectable in the scene view (while still being able to select them in the hierarchy of course).

 

4) Lack of true labeling system:

There’s no proper labeling system in Unity. Only tags. And only one tag per game object. No way to tell an item it is “Ground”, “Rock”, “Cold”. It can only be one thing.

That’s a big limitation. Being able to set and get game objects’ labels would be a tremendous advantage for development and gameplay purposes.

 

5) Base selection is not working:

[BaseSelection] is a simple line of code you can add within a component script to make a group (a hierarchy of game objects) behave like a prefab.

It’s super useful as not everything can be one unique prefab; sometimes you want an empty game object housing a couple of prefabs without actually turning the whole thing into a prefab.

So adding that line makes clicking anything in that group select the root node; same behavior as a prefab without actually being a prefab! Super cool stuff.

Except it’s broken. Basically it only behaves as expected during game mode. But if there are prefabs within the group then it doesn’t work outside of game mode (which defeats the purpose).

 

6) Number appended at the end of a duplicated game object:

This is kind of a recent behavior in Unity. At first I thought of it as a mere annoyance; Unity started renaming copies of duplicated game objects (prefabs or not) by appending a number to the copies’ name.

One thing to know: in Unity it’s never a good idea to rename a prefab in the scene. It’s perfectly possible, but not very wise.

Because if you do, then you’re never quite sure of which was the original prefab’s name. So you need to click on Select to select the prefab on disk to be certain that it’s the right one. Quite cumbersome.

And now, since Unity adds numbers to the name of a duplicated prefab, if you hit “Apply” on that prefab copy, the original prefab (the one on the disk, without the number in the name) will be affected. Without being renamed of course.

And once again renaming prefabs in the hierarchy and “unpairing” them from their original name is asking for trouble. I think this was implemented thinking it would help the user but that’s just not the case. There should at least be a way of opting out of this automatic behavior.

Update: I have stopped worrying and learned to love the numbers-at-the-end. More seriously Unity now uses “(1)” whenever you duplicate a game object and at least it visually stands out. The discrepancy between the original prefab name and the object name remains, but I guess I can live with it.

 

7) Game objects jumping places in the hierarchy:

Unity fairly recently introduced a new concept of hierarchy sorting, which is really neat. Basically, things are not sorted out by alphabetical order anymore. It means a game object stays where you put it in the scene’s hierarchy.

As I said, really neat. Except it’s still not working properly. Game objects (mainly prefabs) keep changing places when you save a scene, close Unity and reopen it. Which is tedious when you do this often.

Edit: I’ve now changed my way of working to bypass that bug and I don’t use prefabs at the scene’s root level anymore. So I don’t deal with that annoyance anymore.

 

8) Scene camera teleporting while Unity loads textures:

When moving through the scene view Unity will freeze once in a while to load up textures when a mesh with new textures enters frustum. Which is perfectly understandable.

The real problem though, is that the WASD + right-click input detection of the scene camera does not get notified of the freeze. Meaning that if the texture takes a second to load, then -when you get control back- your camera has actually teleported way away in the last direction before the freeze happened. Just as if you had kept moving at full speed in that direction for a second.

This aggravation would be gone if the editor’s movement input routine would just get suspended while the editor loads the new textures and until actual control is given back to the user.

 

9) No way to get the members of a layer:

A command like FindGameObjectsWithinLayers() would be extremely useful as there is currently no way to get the list of gameObjects contained within a layer. Which forces us to rely exclusively on using FindGameObjectsWithTags (cf. point 4 for limitations of the Tag system).

(Edit: I’m aware of the solution proposed here but while it does eventually let you find the members of a layer by recursively iterating through every game object in the scene and checking if their layer is the one you’re interested in, it can’t really be considered an efficient solution)

 

10) No way to access inactive game objects via code in an editor tool:

Let’s say you have deactivated game objects in your scene, at root level, and you want to access them via code for an editor-only tool? That’s not possible.

You could of course list all the game objects in the scene and find out which ones do not have a parent and are inactive, but that means you then have to manually filter internal Unity objects corresponding to that criteria by name like “” (whatever that one is!), “PreviewMaterials”, “HandlesGO”, etc… And that is a really dirty and dangerous way to do things. Especially when the goal is to manipulate (or even destroy) those objects.

There is a need for a command (or a flag) to find deactivated game objects (at least in the editor if not in-game).

Edit: There is actually an undocumented command called HierarchyProperty(HierarchyType.GameObjects) which will return a list of hierarchy-only objects including inactive game objects (as mentioned here: http://answers.unity3d.com/questions/27729/finding-the-root-gameobjects-in-the-scene-.html). Thanks to Thomas for the heads up!

 

Finally, please let me know if you can think of anything else or if you’re aware of a way to bypass any of those limitations.

And if I’m actually wrong about any of those points, do let me know! My goal is not to crack down on Unity but rather to streamline my workflow; so if any of these can be taken off the list I’m more than glad to do it! :)

Categories: Unity, update Tags:

Ghost of a Tale screenshot

February 22nd, 2015 No comments

Damn, it’s been a long time since I’ve last posted here! Of course nowadays Ghost of a Tale takes me most of my time. The workload is huge but the satisfaction of developing something personal makes it all worth the effort… :)

Here’s a WIP screenshot of the courtyard you get to discover once you escape your cell.

ScreenShot 2015_02_14 12;23;41001

And if anyone’s interested in following the game’s development, please head on to www.ghostofatale.com

 

Categories: "Ghost of a Tale", Unity Tags:

Character Sneak Peek: Frog

April 29th, 2013 No comments

So you thought the only “life” form on the Island of Periclave was the undead garrison of the Rat King? Think again… :)

The island is located in the middle of the great Lake Vaelias and the frogs have lived there for a very long time, despising the wars of the Hairy Ones with all their disgusting ears and tails.

When the rats built their citadel the frogs were driven back to their underwater caves and temple. But now… Now something has happened on the island.

… But, well, all this won’t matter if the campaign for “Ghost of a Tale” doesn’t reach its goal of course.

Categories: "Ghost of a Tale", campaign, Unity, update Tags:

Character Sneak Peek: Undead Rat

April 22nd, 2013 1 comment

Here’s a better look at one of the undead rats. This is one of the more heavily armored ones. They’re not very fast, but when they do hit you they can kill you with one blow. Compared to your small mousy self they are towering giants.

(Incidentally, this is the pose used for the figurine available on the campaign page)

Categories: "Ghost of a Tale", Unity, update Tags:

Character Sneak Peek: Mouse

April 21st, 2013 No comments

The crowdfunding campaign is still going on HERE and with 23 days to go the campaign is only at about a third of the budget. So if you would like to give “Ghost of a Tale” a chance to exist, please go to this page and see if you can help…

Here’s just a quick little turntable video to get a better view of the main character:

Categories: "Ghost of a Tale", Unity, update Tags:

Exporting tool

February 2nd, 2013 12 comments

I knew it’d be a chore, but it had to be done; I needed to write a tool that allows me to export models and animations from Maya to Unity into several frequently used folders very quickly. Similar to what I did with MayaCE3. So the process goes like this: I select any part of the model, choose a path in the menu and click export. And that’s it. A backup file is also created, in case I discover that my tiny innocuous changes have ruined everything!

ScreenShot010

I might make it public at some point if there’s enough of an interest for it. But truth be told I don’t even know if there’s a lot of Unity people coming to this site (after all, it used to be heavily geared at the CryEngine until not too long).

Also, I’ve been working very hard on a video of the beta that shows a little gameplay. I hope I can post it within a couple of weeks. The old video was grossly outdated anyway, since I switched to Unity 4. And I don’t count anymore how many times I’ve been asked to post a new video. So here’s a little screen-grab of the video for you, as a teaser… :)

video_capture

Categories: "Ghost of a Tale", Maya, Unity, update Tags:

Optimizing a bit

January 17th, 2013 4 comments

Recently I’ve been working on optimization; both in terms of programming efficiency (still have a lot to learn) and in terms of sheer framerate. Of course, the two are often linked. So far the game runs on my machine in 1600×1200 at about 40fps. But my graphic card is a couple of years old and it’s a professional one, definitely not optimized for running games. So I’d be very curious to see how well it can run on an up-to-date gaming PC.

In the process I’ve also discovered that Unity’s OnGUI functions are awfully slow to display HUD textures. Probably because they’re called multiple times per frame. So I reverted back to simply updating GuiTextures whenever I need it and it’s so much faster. I still haven’t decided yet on a look for the interface though. I thought it was going to be really tricky to implement a health bar a la Dark Souls; when you’re hit, your health goes down instantly, but a “shadow health bar” goes down more slowly behind, so you can see how much you lost. But it literally takes ONE line of code to implement this functionality in C#.

I also refined the player control scheme (camera, displacement and animation) and the little guy is super responsive. It’s really fun to just run around and jump all over the scenery.

Anyway, while I was play-testing I emerged from under a dark stone-arch and the sun’s rays appeared; so I took a picture… :)

GoaT_004

Categories: "Ghost of a Tale", Unity, update Tags: