Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2005
    Location
    Liverpool, UK
    Posts
    159

    Need to learn more about Game Design and Development using Unity.

    Hi,

    Having finished a simple iPhone app a while back, I am now working on a 3D platform game using Unity. It's still a work in progress since there are more stuff to add and optimise. This is where I've hit a wall.

    Working on the iPhone app, the scope was pretty small. I didn't have that much assets to worry about so most of the time I just had to drag and drop assets to the hierarchy. As long as the app runs well on the iPhone, I didn't even bother to properly arrange things. Even the code used wasn't really advanced.

    Now going through developing on the PC especially with more than one person, I've realised that we don't have a proper guideline or structure in Unity. Since the game ran smoothly on my PC, I thought I should be fine everywhere else but found out it's really sluggish on some PCs. So now, we're trying to cut down on lighting, polys and the game still runs slow.

    What I like to learn from game developers out there especially the experienced ones, what do you have to do when you first start developing a game? i.e.
    1. How do I know the limit of specs to use like the budget of polygons, lighting etc?
    2. Should I just create a game and optimise later?
    3. How do I optimise code and how to check where I should optimise? What kind of questions do I need to ask myself before actually implementing the game?
    4. In unity 3.0, there's a demo called bootcamp, and in its' hierarchy there are loads of game objects inside game objects. Does anyone understand why it should do this?
    5. I have tonnnes of scripts added to different gameobjects. Each has an Update() function. Will there be conflict is there's too many? Is there a main() function like in c++?

    I think the main thing I need to understand is what are the basics of structures or what am I missing? Hope someone can share their experience and show some insight Most of the stuff I learn in Unity is by trial and error but I like to know if there's anything I might have missed.

    I apologise for the long post.

    Here's a demo of what we have so far. Might be slow on some PCs.

    Thanks very much.
    -Hakimo

  2. #2
    Join Date
    Dec 2007
    Location
    Austin, Texas
    Posts
    499
    1) I personally go with some standards I was taught, but then again, these change from person to person.
    -not over 7000 polygons for a person
    -not over 1000 polygons on a single prop.
    -weapons not over 2000 polygons.
    This of course doesn't take into count combining the scene so that you can improve performance. These are also specs for computers and 3rd gen consoles, not hand helds.
    2) Optimize as you go along! It isn't hard to optimize code as you are working on it, so go ahead!
    3) This is a little more tricky. Anything with lots of for or foreach loops nested, or anything along those lines, you may want to figure out a better way of doing it. Often times, LINQ can combine multiple foreach loops into a single one, and that will improve performance at the same time as shortening code. Be especially wary of doing this every frame.
    4) That is nesting GameObjects, or Parenting. This is to have an object follow along with another object, or to just organize your Hierarchy view. This tool is very important, both transform for gameplay wise, but also for the bones of characters and things along those lines. It also can keep you from getting lost in hundreds of thousands of objects in your Hierarchy, because you can condense them under 1 object.

    5) They won't get into a conflict with each other. And now, there is not main() function, because Unity does that for you. If you want an initialization function on an object by object basis, the Awake() and Start() functions are always there. Also, if you want to do a lot of initialization before anything, make a loading screen or something, and have a gamecontrol script generate all the stuff needed for run time, there at the beginning, just like you'd do with a main function.

  3. #3
    Join Date
    Jun 2008
    Posts
    1,088
    I was trying out the demo and it looks very nice and I did not have any issues running the demo. As for optimization you seem to have the scene built fairly low poly, or seems to be. One thing I tried to take a look at to see if you were doing and LODs (Level of Detail) on any of the objects in the distance. This can help with graphics overhead as it basically reduces the geometry the further you get away and often times if done right you can't even tell. If you have this in the system then you have done a good job .

    As for the polycount, we have gone up to 15k for our Xbox 360 characters and but as m50 mentioned this is dependent on what else you have in the seen and how well you optimize the rest of your game. But since your game appears to use very little particles, physics, polygons, ect right now I would recommend looking into some code optimization and checking to make sure you are culling off areas that aren't being used. Rendering graphics that aren't necessary could be killing your performance if you have no occlusion culling set up.

    -Dane

  4. #4
    Join Date
    Apr 2005
    Location
    Liverpool, UK
    Posts
    159
    Wow, thanks for the feedback. I apologise for the late reply.
    M50:
    1. Thanks, that's what I found out as well that we need to budget how many polys used. Roughly I'm not that sure how many we're using. I have to check that on maya. In unity's stat window, the number of triangles says it's around 200k. For the PC Specs, how can find out the limitations? For the game I'm creating right now, how do I know the minimum rams, cpu, graphic cards etc? I'm completely clueless to write a solid requirement.

    2, 3. As for now, that's one thing I'm not entirely sure. The majority of my codes are just loads of IF Statements and most of the functions are just unity scripts e.g. OnTriggerEnter etc. What I lack(immensely) is coding techniques. I've always been bad at designing algorithms or making code simpler. Tried to look at examples but not sure when and how to use them. I'm still trying to look for more examples that's not too simple and yet not too complicated. Most of the stuff I find used the drag and drop feature too much, I need to find ones that use advance coding. Even now for example the pocket ipin I made, I load all the assets from the start. A forum told me not to load them all at once and learn memory management. I can hardly find any documents regarding memory management in Unity :P Btw, how do you use LINQ with Unity Script?

    4. Thanks I just found out about this cool function in Unity called mesh combine. The whole parent-children hierarchy works well with this.

    5. I have a loading screen but it's basically a dummy scene i.e. scene with texture that fills up the screen and loading text. I couldn't find a proper example to create a loading screen with progress bar.

    DaneC020:
    Thanks Dane. I haven't tried LOD but will look into it. Read about UniLod ages ago, but just found some youtube links. I'll let you know if I manage to integrate this. For now we're using occlusion culling. So far it's ok, but I'm trying to find better documents to use it intelligently.

    Thanks again for all your replies. Let you know if there's any updates
    Last edited by Hakimo; 12-14-2010 at 03:18 AM.

  5. #5
    Join Date
    Mar 2004
    Posts
    0
    Quote Originally Posted by m50 View Post
    2) Optimize as you go along! It isn't hard to optimize code as you are working on it, so go ahead!
    This is actually considered bad practice in most of the programming industry. A better strategy would be to make note of code that is used often (every frame, etc) and look there to optimize when you notice that things are not performing as well as you would like them to. I'm unsure if any of the great profiling tools available for .net are available for unity.

    3) This is a little more tricky. Anything with lots of for or foreach loops nested, or anything along those lines, you may want to figure out a better way of doing it. Often times, LINQ can combine multiple foreach loops into a single one, and that will improve performance at the same time as shortening code. Be especially wary of doing this every frame.
    LINQ may have implicit performance gains due the way you have to structure your code, but it's not a good idea to rely on it for optimization. Also, many of LINQ's method are deferred until use, so subtle performance drains may creep into your code if you're not keeping track of when and where your code is being executed. Many times the most innocent looking code can cause the largest performance drains in your application.

    2, 3. As for now, that's one thing I'm not entirely sure. The majority of my codes are just loads of IF Statements and most of the functions are just unity scripts e.g. OnTriggerEnter etc. What I lack(immensely) is coding techniques. I've always been bad at designing algorithms or making code simpler. Tried to look at examples but not sure when and how to use them. I'm still trying to look for more examples that's not too simple and yet not too complicated. Most of the stuff I find used the drag and drop feature too much, I need to find ones that use advance coding. Even now for example the pocket ipin I made, I load all the assets from the start. A forum told me not to load them all at once and learn memory management. I can hardly find any documents regarding memory management in Unity :P Btw, how do you use LINQ with Unity Script?
    Have you considered looking outside of unity for practice in programming? C# is a very popular language, and is used in many different industries (from embedded devices to enterprise-scale applications)... if you have an interest in anything besides unity, you might benefit from the many tutorials/books/guides that exist for other types of applications in the context of C#.

    LINQ is a library in the .net framework, as well as a few language features embedded into C# as of version 3. Unity uses mono (a multi-platform .net port) and if I'm not mistaken, supports the library and the C# 3 language features. If you're writing you're interacting with unity via C#, you can use LINQ just as you would in any piece of C# code... However, going over exactly what it is and does isn't something I can do justice in a single forum post.

    Also, when used in this context, the word "code" is most commonly used in its singular form

  6. #6
    Join Date
    Aug 2003
    Location
    Peabody, MA
    Posts
    919
    Quote Originally Posted by <> View Post
    I'm unsure if any of the great profiling tools available for .net are available for unity.
    Not sure about that but if you have Unity Pro, Unity itself does coming with an integrated profiling tool in the IDE.
    Ryan Zec

    My Blog: http://www.underthecode.com

  7. #7
    Join Date
    Dec 2007
    Location
    Austin, Texas
    Posts
    499
    It also has a debugging tool if you use Monodevelop.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •