Carrara and Unity Game engine

uvavoo_c19d1341b6uvavoo_c19d1341b6 Posts: 16
edited December 1969 in Carrara Discussion

Thought I would start a thread regarding Carrara and the Unity Game engine as there appears to be some interest shown in another place.
If you are unaware of Unity, take a look at their website. Unity is free (there is also a paid pro version with more features).

http://unity3d.com

To set the ball rolling, here are a few tips which I have found out.

Carrara – Use the right size

To get Carraras weird idea of what a metre is into unity you need to scale to 255%.
Remember in unity 1 unit = 1 Metre. Not so important for static meshes, but important for physics and characters to get scaling correct in Carrara, rather than adjusting scaling in Unity.

BEST METHOD.
WHEN WORKING ON STATIC OBJECTS. Work in metres throughout. Then group all objects together and do an overall scale of 255%.
WHEN WORKING WITH BONED OBJECTS (CHARACTERS). Create mesh. Then scale up to 255% before adding bones.


The size of the your GameObject's mesh is much more important than the mass of the Rigidbody. If you find that your Rigidbody is not behaving exactly how you expect - it moves slowly, floats, or doesn't collide correctly - consider adjusting the scale of your mesh asset. Unity's default unit scale is 1 unit = 1 meter, so the scale of your imported mesh is maintained, and applied to physics calculations. For example, a crumbling skyscraper is going to fall apart very differently than a tower made of toy blocks, so objects of different sizes should be modeled to accurate scale.

If you are modeling a human make sure he is around 2 meters tall in Unity. To check if your object has the right size compare it to the default cube. You can create a cube using GameObject->Create Other->Cube. The cube's height will be exactly 1 meter, so your human should be twice as tall.

If you aren't able to adjust the mesh itself, you can change the uniform scale of a particular mesh asset by selecting it in Project View and choosing Assets->Import Settings... from the menubar. Here, you can change the scale and re-import your mesh.

If your game requires that your GameObject needs to be instantiated at different scales, it is okay to adjust the values of your Transform's scale axes. The downside is that the physics simulation must do more work at the time the object is instantiated, and could cause a performance drop in your game. This isn't a terrible loss, but it is not as efficient as finalizing your scale with the other two options. Also keep in mind that non-uniform scales can create undesirable behaviors when Parenting is used. For these reasons it is always optimal to create your object at the correct scale in your modeling application.

Modelling
The direction the model must be facing.
3rd Person character must face to the left in Carraras scene.


Polygons, Bones and all that jazz
Use one Skinned Mesh Renderer
Your character should use only a single skinned mesh renderer. There is usually no reason to use multiple meshes for a character. Unity also has optimizations related to visibility culling and bounding volume updating which only kick in if you use one animation component and one skinned mesh renderer in conjunction. If you care about performance, multiple skinned meshes per character is not an option. If you use two skinned mesh renderers for one character instead of one, the time spent on rendering the character will most likely double!

Don't Use Many Materials
You also want to keep the number of materials on that mesh as low as possible. There is only one reason why you might want to have more than one material on the character: when you need to use a different shader (e.g. if you want to use a special shader for the eyes). However, 2-3 materials per character should be sufficient in almost all cases. If your character is carrying a gun, it might be useful to have the gun a separate object, simply because it might get detached.

Reduce Amount of Bones
Medium Desktop games use bone hierarchies with 15-60 bones. The fewer bones you use the faster; with 30 bones you can achieve very good quality on Desktop platforms and fairly good quality on Mobile Platforms. Unless you really have to, we strongly recommend you use fewer than 30 bones if you are developing for Mobile Platforms and around 30 bones per character on Desktop platforms.

Polygon Count
How many polygons you should use depends on the quality you require and the platform you are targeting. Anything between 300-1500 triangles on Mobile Platforms and 500-6000 triangles on Desktop Platforms is reasonable. If you want lots of characters on screen or want the game to run on old machines, you will have to reduce the polygon count for each character. As an example: Half Life 2 characters used 2500-5000 triangles per character. Next-gen AAA games running on PS3 or Xbox 360 usually have characters with 5000-7000 triangles.

Comments

  • swordvisionsswordvisions Posts: 0
    edited December 1969

    Thanks for the useful information about Carrara to Unity. I might have to experiment with it a little. I usually use Blender to create assets for Unity

  • ShannonHoppeShannonHoppe Posts: 0
    edited December 1969

    Awesome Richard! Thanks for the good info.

  • PLahodaPLahoda Posts: 12
    edited December 1969

    Thanks Richard. I almost thought I am alone using Carrara+Unity.

    Is there any way to transform the procedural shaders of Carrara into Unity ?

  • aonynaonyn Posts: 4
    edited December 1969

    Hi All,

    I also use Carrara and Unity.
    One tip I have is that my luck has been better using .dae over .fbx.
    At first, I struggled with fbx files in some cases, and one day tried .dae, and have not had issues since.

    One example issue I had with fbx was the coordinate system is not the same as unity (IIRC I tried different settings)
    So once you bring it into unity, you have to compensate, and just makes things more difficult than necessary.
    DAE solves this.

    Also, yes you can use procedural shaders from Carrara, if you get the Baker plugin from inagoni, and bake your shader channels to textures.
    For some things, you may want to write some custom unity shaders to handle some of the channels you generate, for example, I have a set of custom shaders to handle things such as specular maps instead of a specular color value.

    For the unity side of shaders, I recommend getting Strumpy Shader Editor from the asset store (It is a free download)
    It allows you to create unity shaders in a visual node tree environment, and is fast and easy to use.

    Regards,
    Dave

  • aonynaonyn Posts: 4
    edited December 1969

    Oh, and another thing I have found, if you have animation, it works best to put all animated components inside of a single static parent.
    When in unity, you can translate the parent around safely, and the parts obey local space scope as expected.
    The same can be achieved in unity by placing the imported mesh into a "Container" empty game object.
    I generally just use a parent node in Carrara though.

    I hope these additional tips help someone.
    Thanks Richard Szydelko for starting this thread and for your tips.

    Regards,
    Dave

  • 3DAGE3DAGE Posts: 2,026
    edited December 1969

    PLahoda said:
    Thanks Richard. I almost thought I am alone using Carrara+Unity.

    Is there any way to transform the procedural shaders of Carrara into Unity ?

    You can export as OBJ,. Carrara can convert procedural shaders to texture maps at that point
    or,...
    You can apply a procedural shader to a plane,. then export that as an OBJ just to get a texture map of the procedural.
    or,..
    You can get the "Baker" plugin,. which will convert procedural shaders to texture maps, and much more.

  • ManStanManStan Posts: 0
    edited December 1969

    I've always wanted to work with the unity game engine but it just seemed far to complex for me to understand. :(

    Years ago I worked up a western RPG, but I am clueless where to go from there.

  • 0oseven0oseven Posts: 388
    edited December 1969

    Thought I would start a thread regarding Carrara and the Unity Game engine as there appears to be some interest shown in another place.
    If you are unaware of Unity, take a look at their website. Unity is free (there is also a paid pro version with more features).

    Ive looked at Unreal http://www.unrealengine.com/udk/

    Looks impressive but daunting - not too much success getting daz characters into it but checking the Unity website it does seem to have more going for it.

    I thought it might be good for general "Movie Making" and wondering what your opinion is on that ?
    I will download if you think it would be useful for the above purpose - actually I was surprised to see a lot of discussion about Carrara in their forum.

    http://search.unity3d.com/uss1/?q=carrara&app=All

  • 0oseven0oseven Posts: 388
    edited December 1969


    Carrara – Use the right size

    To get Carraras weird idea of what a metre is into unity you need to scale to 255%.
    Remember in unity 1 unit = 1 Metre. Not so important for static meshes, but important for physics and characters to get scaling correct in Carrara, rather than adjusting scaling in Unity.

    In Carrara I work in Metric as default - would that dispense with need of rescaling as above ?

  • uvavoo_c19d1341b6uvavoo_c19d1341b6 Posts: 16
    edited December 1969

    Wow a lot of responses over the weekend.
    @ooSeven. Yes even if you work in metric you will have to do the scaling.
    3Dage explained this to me once. I can't remember the exact details. Maybe he can explain it again.
    Basically create a cube 1metre x 1 metre, export then import to unity. Create a cube in Unity (default 1metre x 1 metre) and compare it to your Carrara import, they are not the same!
    Not used unreal engine, so can't comment, although I have heard it is much more difficult to use than Unity.

  • 0oseven0oseven Posts: 388
    edited December 1969

    Thanks for the reply

    This what got me interested in exploring Unity. http://youtu.be/MKC-gFtM5pE

    Its 3 part Daz to Unity video. You probably have seen it -others may not.
    Ive always been deterred from using other software in conjuncion with Carrara because of the "usual" asset/formats interchange problems.

    is there hope with unity ????

  • aonynaonyn Posts: 4
    edited December 1969

    0oseven said:
    Thanks for the reply

    This what got me interested in exploring Unity. http://youtu.be/MKC-gFtM5pE

    Its 3 part Daz to Unity video. You probably have seen it -others may not.
    Ive always been deterred from using other software in conjuncion with Carrara because of the "usual" asset/formats interchange problems.

    is there hope with unity ????

    Hi 0oseven

    In regards to your question "Is there hope with unity?"

    Yes, I use carrara and unity together, working professionally, making realtime visualization apps (with numerous finished apps under my belt over the past several years).

    Our art pipeline honestly is mostly Maya (used by our art team - I am first a coder with art background).

    When I work on my own art assets, it is Carrara that I use mostly, along with hexagon. The way I have to handle Maya output and Carrara output is different, but I have had equal success using assets from both. At least one app I can think of offhand, I did all the assets myself, and all was output from Carrara. (It was a very simple flight simulator).

    I would gladly share some links so you could see the results I have had, but I would have to get permission from my boss to do so (under NDA).

    I hope this helps to answer your question.

    Regards,
    Dave

  • 0oseven0oseven Posts: 388
    edited December 1969

    Hi thanks for info.
    I'm a bit of a flight sim fan so that would be interesting to see.

    Regards Unity I note the video tut relied heavily on decimating daz "characters" to get them into unity. Is that necessary in your experience ?
    (need the daz studio decimator plugin of course)
    Is it reasonably easy to animate daz characters in Unity - I mean using bvh files etc. ?

    I know a bit of Java - nothing of python but anyway don't really wish to spend time learning either so as I'm not a coder how "necessary " is it to using Unity ?

  • uvavoo_c19d1341b6uvavoo_c19d1341b6 Posts: 16
    edited March 2013

    As regards DAZ characters, the polygon count is probably too high for games. You will be able to get them into the game and the game will run, but framerate will be affected. Remember game engines render in real time. Efficiency and optimisation is the name of the game in game design. Daz characters are in the region of 80,000 polygons, even the latest games running on high end platforms do not go that high, certainly far too high for mobile platforms such as iphone and android. (see my first post for recommended polygon counts).

    There are lots of prebuilt characters available in Unity's own Asset Store (accessible from within Unity) as well as environments, plug ins etc, specifically designed for use in Unity.

    As far as scripting goes, depends on what you want to do. If, for example you created, say a building and you just wanted to walk around. Scripts already exist that come with Unity. (This would entail using a character controller with a couple of prewritten scripts and a camera attached.

    To create a more sophisticated game such as, say a Tomb Raider style game, you will need some scripting skills. However there is an awful lot of help in the Unity community in the form of Tutorials, pre-existing scripts to do common things etc.

    Unity can use Javascript or Csharp or a language which is similar to python called Boo.
    It is worth noting that there are plugins to Unity which allow you to create scripts visually using node based systems (available on Unitys Asset Store). Some are free. worth trying if you really don''t want to get into the wonderful world of scripting!

    I would recommend also this site, which has some great tutorials.

    http://www.3dbuzz.com/training/topic/unity?resetFilters=True

    There are also resources such as the link below, which, in this case has all the necessary resources and scripts to easily build a first person shooter game (all you need to do is build your environment). This is excellent and even includes AI editor for your baddies (AND IT IS FREE). The designers (Tornado Twins) have many useful tutorials etc also.

    http://www.fpscontrol.com/features

    Post edited by uvavoo_c19d1341b6 on
  • GKDantasGKDantas Posts: 6
    edited December 1969

    Great thread! I am working in a game using Unity and Carrara also. For now I just create a scene using Carrara modified trees and other stuff in the scenario.
    Theres a problem using Vic ou other DAZ3D character, you need a special license from DAZ3D to do that. In the past they created a special session in the store for thsi kind of thing. The problem using DAZ3D stuff is that you are selling the mesh with your game, so is very very problematic.
    I am building all things in Carrara myself, after draw the ideas by hand or in a tablet.
    A real cool thing also is that Terrains in UNity works almost the same way as in Carrara, so I am creating the elevation maps in Carrara, editing in PaintShop and adding to Unity.

    terrain_unity.jpg
    1364 x 488 - 102K
  • magaremotomagaremoto Posts: 314
    edited December 1969

    I think this gonna be interesting for carrara and Unity users
    http://www.marmoset.co/skyshop

  • holly wetcircuitholly wetcircuit Posts: 0
    edited December 1969

    I think this gonna be interesting for carrara and Unity users
    http://www.marmoset.co/skyshop

    OOOOOoooooOOOOoooohh! :bug:

  • dcalderonedcalderone Posts: 0
    edited December 1969

    Appreciate the advice as i'm looking for the best and most efficient game engine that is compatible with Daz3D

    Dr Calderone
    www.livinginthecloud.org

  • edited December 1969

    Unity has been absolutely facinating me for the last month or so.
    Got a little guy running around a terrain, very fun.
    Will be adding some more functionality soon but it's a long road for sure...

    The vision is parallel construction; while building one scene in C why not build a similar level in Unity.
    I find the interface/setup familiar; takes some time to get a handle on but similar for sure.

    I have come to the conclusion that it's a completely different (but similar) thing as Daz.
    I will use the asset store; just like being a Platinum Club member.
    New tools; new functionality.
    Moving from Carrara would be OK for modeling I guess but I don't really have the time/interest for that.
    Speed is very important and sure, buying assets/scripts is a shortcut but sometimes it's worth it.

    GameDev1.png
    1052 x 722 - 1M
  • DartanbeckDartanbeck Posts: 6,943
    edited December 1969

    Absolutely, I agree.
    I may love to model, but that doesn't mean that I want to make everything myself - just the things that either I really want to create on my own, or things that I cannot find in the marketplace. But when you get a cool setup like PC membership, or similar, it can be really fun to build up the library of assets and get creative!

  • edited December 1969

    Just for you Dan, check out this clip; shows your Woodlands scene...
    Building a paralled environment in Unity where you can collect mushrooms...

    http://youtu.be/QJKVhwdc-lc

  • DartanbeckDartanbeck Posts: 6,943
    edited December 1969

    AnAlias said:
    Just for you Dan, check out this clip; shows your Woodlands scene...
    Building a paralled environment in Unity where you can collect mushrooms...

    http://youtu.be/QJKVhwdc-lc

    Sweet!!!

  • dcalderonedcalderone Posts: 0
    edited December 1969

    That's awesome, as I was thinking it was going to be Unity or blender. I'm curious if the environment was from DAZ in that video. I'm sure it can be done. Any quick tips on importing your assets (animated or not) into Unity from DAZ. I honestly haven't tried using DAZ in the game workflow, but I love all the options you have regarding pre-created poses n stuff. Gratzie Mucho for the great info, just another reason why i'm spending way to much money of DAZ :-P

  • edited December 1969

    I’m curious if the environment was from DAZ in that video.

    The environment is from Daz,
    Carrara EnvironKit - Woodlands; Dan is the artist for this package; that's why I posted the clip; so he can see that people actually USE what he made :) Well worth it I find, even just for the lighting...I had built some sets that were similar but not as complex so this is nice to have. The dragon is the Subdragon and the motions are purchased clips.

    Any quick tips on importing your assets (animated or not) into Unity from DAZ.

    I looked at this but seemed like too much work. I will just buy similar assets from Unity Asset Store; similar to Daz. That way these assets are already optimized for game use and I don't have to spend hours tweaking shaders; it just works. I bought a camera rig and some environment props to get me going and will buy more as time goes on; it's a journey... this is in pre alpha; it won't be released for awhile. Like I said I will build the scene in Daz (for the video) and then based on the scene will re-create this in Unity (using their assets) so after watching the video you can then play the game/level that matches. Should be fun.
    Good luck with your project.

  • DartanbeckDartanbeck Posts: 6,943
    edited December 1969

    AnAlias said:
    I’m curious if the environment was from DAZ in that video.

    The environment is from Daz,
    Carrara EnvironKit - Woodlands; Dan is the artist for this package; that's why I posted the clip; so he can see that people actually USE what he made :)

    Tee Hee Hee!!!
    The idea of Woodlands actually came from my own, personal style of workflow - so I use it all the time.

    To make it a professional product, I did some things a bit differently that my own, cheating ways... But in doing so, I now find myself conforming to what I've done in Woodlands. But I use the Base scene as a starting point for many scenes that have nothing to do with Woods just for the lighting and atmospheric effects - because I like how quickly it renders for animations! In this one I'm only using the Base sky with one of the clouds systems turned on:

    Dragons_Attack_Vanguard_FC1x.png
    1280 x 720 - 874K
Sign In or Register to comment.
Rocket Fuel