Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Beginning 3D Game Development with Unity

Discussion in 'Community Learning & Teaching' started by k3D-Junkie, Jun 20, 2011.

  1. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    Hi Azel,

    I used 3d Max to create the models for the book, but chose to export them as .fbx prior to importing them into the project directories rather than letting Unity convert them. I suspect the problem is more with the fbx converters than the modeling programs.

    The flower, with the petal opening animation, took several different animation techniques before I got it to export. The test was to export it from Max as an fbx file, then re-import it to see if the animation was retained. Once it passed that test, it had no trouble in Unity.

    Another thing to be aware of in modeling in 3d Max for Unity is Mesh vs. Polygon. In Max, all hidden edges may be re-configured at any time- this seems to generate error messages on export. I've found that collapsing objects to Editable Meshes rather than Editable Polys is a good practice for export. In most game engines, all edges are visible. I always use tris (triangles) rather than polygons to keep count of my model size.

    Another issue is with skinned characters. Vertices can be affected by more than one bone. In Unity, you can specify the maximum number of bones that can affect a vertex. So if you rigged a character and some of the vertices are affected by, say, four different bones, then you import the animation into Unity but use a setting for only allowing two bones to affect vertices, the animation may look quite different in Unity.

    I think you will find that whatever modeling package you use, you will need to experiment and develop a 'best practices' workflow.

    Hope that helps!

    Sue
     
  2. Azel

    Azel

    Joined:
    Feb 11, 2011
    Posts:
    17
    I posted a "Thank you" a week ago, but I guess it did not post. So, I am posing again.

    Thanks Sue.
     
  3. pheo

    pheo

    Joined:
    Nov 12, 2011
    Posts:
    3
    Hi Sue,

    Thanks for writing the book and i learn a lot from the book.

    I have a few questions though regarding Chapter 5 on the First Build project.

    In this project, we have a game object Platform Group (having a child Platform) that moves between 2 target points the Trigger in between. A Rigidbody component was added to the Platform Group. The reason was explained in the text - for the trigger event to happen, one of the colliding bodies need to have a rigidbody component attached.

    My questions are:

    (1) Why can't I add the rigidbody component to the child Platform directly??? When I did that, the platform group actually moves up and up - apart from moving between the 2 targets. I don't understand the cause of it?

    (2) Why can't I add the rigidbody component to the Trigger instead (without adding the rigidbody component to the Platform Group)? When I added the rigidbody component to the Trigger alone, the trigger events did not happen.

    I am puzzled. Hope you could help to enlighten on this matter.
     
  4. pheo

    pheo

    Joined:
    Nov 12, 2011
    Posts:
    3
    This was written in the OnMouseDown method:

    for (var contents : String in stateArray[state]) {
    //split the contents into a temporary array
    var readString : String[] = contents.Split(",".Chars[0]);
    }


    I personally thought that was a bit long winded.

    Wouldn't var readString : String[] = contents.Split(","); will do?????
     
  5. pheo

    pheo

    Joined:
    Nov 12, 2011
    Posts:
    3
    I mean ... in contents.Split(",".Chars[0]);

    ",".Chars[0] is a nobrainer. It will certainly return ",". So why bother?
     
  6. MichaelHarte

    MichaelHarte

    Joined:
    Nov 28, 2011
    Posts:
    8
    hi Sue

    I have tried to download the assets from apress..the zip file of 3.2gb finally downloaded but when I try to unzip with winzip it says "please insert the last disk of the multivolume set" I spent several more hours downloading the file again but the same result. Can you advise as to a solution please.

    Best regards

    Michael Harte
     
  7. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    Hi Michael,

    I'd suggest contacting Apress support- as far as I can remember, I haven't heard of anyone having that problem before. Usually it's a bandwidth issue.

    Pheo- still trying to get some time to investigate your findings- I haven't forgotten you!

    Sue
     
  8. cybtec

    cybtec

    Joined:
    Aug 24, 2011
    Posts:
    7
    Hi Sue,

    I know you probably tired of this issue, but I've been through the thread and can't find a solution.

    I've been working throught the book and I have downloaded the book files twice. I upzipped the download 9781430234227.zip using 7zip and I get a single file name 9781430234227, no extinsion that I can't open.

    What am I doing wrong?

    Stuck!

    Cybtec
     
  9. MichaelHarte

    MichaelHarte

    Joined:
    Nov 28, 2011
    Posts:
    8
    Hi Sue

    I finally downloaded the support files and I am advancing through the book. On page 432
    you introduced a usefull expression contents.Split(",".Chars[0])
    Where does this come from..is it a unity Javascript expression. I assume there are others.
    I looked all over for contents.Split. I found Java has a split expression . Is there a list some where or can you suggest a companion book where I can study these and other expressions.

    Many thanks and Happy new year

    Michael.
     
  10. isaacwyatt

    isaacwyatt

    Joined:
    Jan 8, 2012
    Posts:
    2
    Hi,

    I just picked this book up. I started using Unity about a month ago as a hobby and then decided I wanted to get in depth with it as a 2012 project.

    I have regular code in C# for work, so Unity seemed like a great fit to my existing skill set.

    If you (Sue) have any suggestions that are game Design and Mechanics oriented, I'd love to hear about them.

    Best,
    Isaac
     
  11. Nomad72

    Nomad72

    Joined:
    Oct 25, 2011
    Posts:
    117
    Although I'm primarily interested in 2D development, and I use C#, I've picked this. I'm on Chapter5 and I've been quite impressed so far. The book goes into a lot more detail than I was expecting for a beginner book, but is written so that it's easy to follow. I'd highly recommend it to anyone wanting to get going with Unity.
     
  12. sonic220

    sonic220

    Joined:
    Jan 13, 2012
    Posts:
    35
    Hi Sue, first of all I'm really glad I brought your book, so far I've learned a lot about Unity
    I'm having a lot of trouble all of sudden and I need the help of someone for understand why, everything worked fine until I reached page 625, when I take one of the action object (the crowbar or the golden sleeve) Unity give me a warning, it says: coroutine cannot be execute because I've lost the reference of the object (I think that's because of some gameobject.active = false)
    Object goes to the inventory, but it became impossible to combine them! Even in the inventory, when I try to combine the golden sleeve icon with the crowbar icon, the crowbar with sleeve appears, but the other object just stay in the inventory (Unity give me an error of missing reference).
    The problem is not in the metadata, I've checked them 10 times, the keyatrock still works, and the inventory worked until now
    I really can't understand how to fix this, I know I'm not good explaining myself but I don't usually speak english
     
  13. sonic220

    sonic220

    Joined:
    Jan 13, 2012
    Posts:
    35
    Another problem I'm having is that the mouse over and mouse down function doesn't work if I'm too close to the object, if someone can help me I'll be really glad :D
     
  14. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi Sonic220,

    the first thing to remember is that the 3D objects and 2D icon objects are different objects, so if you pick the crowbar in the scene, that object is disabled and the crowbar icon object's state is changed so it will show in inventory

    so, it sounds like the 3D objects (crowbar and golden sleeve) are going out of scene correctly, enabled = false
    we can't just disable the render of the objects because the colliders will still be active

    "coroutine cannot be execute because I've lost the reference of the object"
    that sounds like a metadata problem where it is trying to do something to the 3D object instead of the 2D icon object (crowbar when it should be doing something to crowbar icon)

    but the icons turn up in inventory, yes?, so that part must be working

    when you try to combine them in inventory, the 2D crowbar with sleeve icon appears, so that is being read properly, but the other icons do not disappear, so the first place I would look is the metadata

    it is probably a leading or trailing space causing the rest of the data to not be read correctly

    or possibly you are telling it to take the 3D object out of inventory by mistake

    I know you've checked the data 10 times already, but can you copy and paste the data for both golden sleeve icon and crowbar icon here so we can look at it?
    It is reading the instructions to show the crowbar with sleeve as cursor, but is getting tangled where it is told to take the other two out of circulation

    re pick problem- not sure about that one- I will need test
    how close are you? (distance)


    Sue
     
  15. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi Isaac,

    Pg 29-30 has a bunch of my thoughts on the subject of game Design and Mechanics and approaching game creation in general. There's also a section on pg 899 (Is it Done Yet?) that sort of recaps several of the ideas.

    Biggest thing I find is that as creative individuals, we want to design before we find out what is even possible with the technology at hand. Maybe it is just an idea, or maybe it is something we've seen in someone else's game. When, after repeated pounding of heads against walls, we can't make the idea work, the whole project is in danger of not being completed.

    I recommend a lot of testing of ideas before anything is even put into writing. If you've got a bit of time to spare, I would suggest researching Bill Buxton on "sketching." His lecture is not about drawing, but the creation process in general.

    I see a lot of students with full blown design documents (after taking their first game design class) for their game. Given that they are not heading up a AAA title game studio with 50-100 artists and programmers at their beck and call, chances of being able to pull it off are pretty slim. And pulling together an all-volunteer team to help out opens up another can of worms. Think scope of casual games to get your feet wet.

    Another important concept is that of building things up gradually so that at any giving time, the game could conceivably called "playable." As you have more time (or budget) you can refine both art assets and functionality. Instead of starting with a grand plan/design and working on it from the start, break it up into levels of refinement. If you are working out the code for opening a treasure chest, all you really need to test on is a couple of boxes that will represent the finished meshes (base and lid). If your game at that stage had only primitive shaped objects, it would still be playable- the style would just be very different than something trying for "realistic" at that stage of completion.

    I could probably go on and on, but those are the main things I can think of right off the bat.

    Good luck with your project- Unity will allow you to start simple and then get as complicated as you wish, so you should have a great time with it!

    Sue
     
  16. sonic220

    sonic220

    Joined:
    Jan 13, 2012
    Posts:
    35
    The metadata were fine, in the end I've lost patient and I replaced my lookup.js and gamemanager.js with your code of completed chapter :D
    Now almost everything seems to work fine
    I've almost solved that problem, it was caused by the player collider, i've shrinked it and now I can take object even if the distance is less than 8
    I've gone further in the book and what seems wrong is the "reading message" part, seems like I can't close the message when the player is facing action objects, now the problem can't be the same because the MessageView is far away from the player, I think I'll just do some tests and see if I can come to something
     
  17. isaacwyatt

    isaacwyatt

    Joined:
    Jan 8, 2012
    Posts:
    2
    Thank you for the reply, Sue.

    I'll be sure to review the sections of the book you mentioned, and bear the constraints you described in mind.
    If you happen to think of any other texts that are (even at a very high level) excellent game-design tools, please share.

    Thanks again,
    Isaac
     
  18. dayunbao

    dayunbao

    Joined:
    Jan 27, 2012
    Posts:
    14
    Hi Sue,

    My name is Andrew. I've been working through your book for the last few weeks. I'm at chapter 10 right now, so I'm deep into the scripting. I don't have either an artistic or programming background, but have been learning 3DS Max and Java myself. Your book is very useful, but I'm feeling overwhelmed at this point. I'm thinking that I don't need to remember, learn everything or even understand right now, like you mentioned in the book, but do you have any advice for how to get the most from the book regarding the complexity of scripting?

    Thanks!
     
  19. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    Hi Andrew,

    Yeah, somewhere around that point, we realize we can no longer keep it all sorted out in our heads (me included). I think a lot of us use the "bookmark it and move on" method with a hard copy book. That way, we can quickly find the info we want to keep handy for reference. I have a bunch of bookmarks in my own book just because I know unless it is something I use regularly, I won't remember.

    Also, in chapter 10, you will start storing rules and conventions in a GameNotes text file. Since the naming and other conventions are pretty much arbitrary, it is very important to keep them at hand- no matter who decided what they will be for a given game.

    As far as scripting goes, think about it the way it is approached in the book. Start simple- what is the main purpose of the script? When you get that working, then start identifying and allowing for all the little issues that crop up. You might want to take breaks from the book to do some experimenting on your own. Set yourself a task and see if you can solve it. Then think of a way to make it more robust or more flexible or more reusable.

    In the book project, we needed to be able to pick an object and have something happen. Along the way, we discovered mouse-look was not compatible with picking objects in a 3D scene. So we altered the navigation mode.
    Then we decided that the player should not be able to pick an object if it was half a football field away. So we added a distance clause.
    Then we realized that we ought to have a different text message depending on the state of the object, and so on.

    Scripts are not born fully formed- there is a lot of thought and trial and error that goes into making them work. And there are usually several different approaches that will give the same result.

    If you are trying to learn Max, Unity scripting all at once, you have my admiration! Non of those are lightweight topics.

    Hang in there and feel free to ask questions!

    Sue
     
  20. Hordaland

    Hordaland

    Joined:
    Jan 2, 2012
    Posts:
    7
    Hey Sue,

    First off I wanna tell you it's a great book and it has helped me alot getting comfortable with using Unity. I've already gone through it once, making the game used as an example in the book. Now I'm working on my own game which uses alot of similar things. The state system, for example. However, this time around I'm having a problem with the states not working correctly.
    I have a door that has three states. 0 = closed and locked, 1 = closed, but not locked, 2 = open. Most of the doors in the game are unlocked from the start so the initial state on the door I'm struggling with is 1. Pressing it with the default cursor opens it, plays the opening animation and puts it into state 2. However, pressing it again the door won't close and I get an ArgumentOutOfRangeException-error*. Same thing happens if the door is in state 2 (open) initially. It plays the closing door animation and then stays closed, impossible to open.
    Where could I have gone wrong?

    The error:
    ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count.
    Parameter name: index
    1
    System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException (System.String name, System.Object actual, System.String message)
    System.Collections.ArrayList.get_Item (Int32 index)
    UnityScript.Lang.Array.get_Item (Int32 index)
    ObjectLookup.LookUpState (UnityEngine.GameObject object, Int32 currentState, System.String picker) (at Assets/Standard Assets/Character Controllers/Sources/Scripts/01SkreackSpel Scripts/Scripts/ObjectLookup.js:52)
    Interactor.OnMouseDown () (at Assets/Standard Assets/Character Controllers/Sources/Scripts/01SkreackSpel Scripts/Scripts/Interactor.js:103)
    UnityEngine.SendMouseEvents:DoSendMouseEvents()
     
    Last edited: Feb 1, 2012
  21. holyfingers

    holyfingers

    Joined:
    Feb 2, 2012
    Posts:
    4
    ***EDIT***
    Worked it out, poor typing/reading on my part, as is quite clearly written in the book the "=" on line 10 below should actually be a ":"



    Hi Sue,

    I'll join the chorus of folks here saying how useful the book is, as a 3d-artist with very little in the way of scripting/coding experience it seems almost tailor made for me.

    Having a wee problem with Chapter 6, page 292 though? Unity seems to be throwing this error:

    Assets/Adventure Scripts/Interactor.js(18,46): BCE0022: Cannot convert 'UnityEngine.Texture' to 'System.Type'.

    Code in question is here:

    Code (csharp):
    1. #pragma strict
    2.  
    3. // Pick and Mouseover Info
    4. var triggerDistance : float = 7.0; //distance the camera must be to the object before mouse over works
    5.  
    6. // Gain access to these objects
    7. var gamePointer : GameObject;
    8. var cam : GameObject;
    9. var originalMaterial : Material;
    10. var aoTexture = Texture;
    11.  
    12. function Start () {
    13.  
    14.     //search the scene for an object called "Main Camera" and assign it to the cam var
    15.     cam = GameObject.Find("Main Camera");
    16.     originalMaterial = GetComponent(MeshRenderer).material; //load the material into var
    17.     if (originalMaterial.mainTexture) { ///if a texture exists, do...
    18.         aoTexture = originalMaterial.mainTexture; //assign the materials texture
    19.         print (originalMaterial.name + ": " + aoTexture.Name);
    20.     }
    21. }
    22.  
    23.  
    24. function OnMouseEnter () {
    25.  
    26.     if (DistanceFromCamera() > triggerDistance) return;
    27.    
    28.     gamePointer.SendMessage("CursorColorChange", true); //colorize the pointer
    29.    
    30. }
    31.  
    32. function OnMouseExit () {
    33.  
    34.     gamePointer.SendMessage("CursorColorChange", false); //turn the pointer white
    35.    
    36. }
    37.  
    38. function DistanceFromCamera () {
    39.  
    40.     //get the direction the camera is heading  so you only process stuff in the line of sight
    41.     var heading : Vector3 = transform.position - cam.transform.position;
    42.     //calculate the distance from the camera to the object
    43.     var distance : float = Vector3.Dot(heading, cam.transform.forward);
    44.     return distance;
    45.    
    46. }
    Any thoughts? I've tried fiddling around with a few bits and pieces but, so far, to no avail, any help would be really appreciated and apologies if you've covered this somewhere else before.

    Cheers,

    Nick.
     
    Last edited: Feb 2, 2012
  22. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi Hordaland,

    Congrats on getting all the way through!
    "ArgumentOutOfRangeException" is usually about the number of elements in an array being wrong. I'm guessing your Interactor arrays aren't matching up with the ObjectLookUp arrays, or possibly your LookUp and Replies elements aren't matching in the ObjectLookUp


    Nick- that error doesn't sound familiar right off- I'll see if I can spot the prob as soon as I get a bit of time

    Sue
     
  23. holyfingers

    holyfingers

    Joined:
    Feb 2, 2012
    Posts:
    4
    Hi Sue,

    Managed to sort myself out, was straightforward user error! Edited my previous post with the correction.

    Thanks again,

    Nick.
     
  24. gameon

    gameon

    Joined:
    Mar 4, 2012
    Posts:
    2
    Hi Sue,

    I am teaching game development this semester and in need to show final game to my students, before we can embark on rather long journey. Is it possible to receive final compiled game as exe file(meaning game that you teach creating in the book)? Thank you in advance!
     
    Last edited: Mar 5, 2012
  25. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi Gameon,

    The book comes with the finished, compiled game in both Mac and PC version. It also comes with a bonus version where I've used more of the included assets to add to the game (to give more people ideas)

    Sue
     
  26. games

    games

    Joined:
    Feb 18, 2012
    Posts:
    61
    Sue, thank you, thank you, and thank you again!

    Love the book! Just starting, but it is on-topic with my current first-person based game and the information is invaluable.

    Really appreciate your work and all of the time you invest here on this forum.

    -games
     
  27. joedgrant

    joedgrant

    Joined:
    Mar 16, 2010
    Posts:
    23
    Hi Sue,
    Loving the book so far, but I've hit a snag in chapter ten and I can't clear it...I'm using unity 3.5

    aniLength = currentAnimationClip.length;// get it's length
    //wait the length of the animation, then play the looped animation if there is one
    yield new WaitForSeconds(aniLength);
    if (postLoop) aniObject.animation.Play(loopAnimation[currentState].name);

    It tells that aniLength is an unknown identifier?
    Even if I use the script from your scripts package with the book.
    //edit// I'm.. actually completely stuck on chapter ten... I Can't seem to get anything to work beyond the point where you add the anilength lines. I've gone over it and over it, and compared it to the shipped with scripts, and can't find where I've fubared it.

    Apparently the first use of anilength needs var at beginning. It's not there in the kindle edition example, or in your sample script? Has something changed between 3.4 and 3.5?
     
    Last edited: Mar 7, 2012
  28. gameon

    gameon

    Joined:
    Mar 4, 2012
    Posts:
    2
    Where is the file exactly? Supported files do not contain compiled game, at least I have found none, but maybe I was wrong... Anyway can you give a link or name the folder where game can be found?
    Thanks!
     
  29. Ajay1

    Ajay1

    Joined:
    Jan 20, 2012
    Posts:
    5
    Please tell me where can I get art asset for this book project please tell me. I downloaded this book so help me. I am a 10 years old child who wants to create his own game for fun so help me.
     
  30. joedgrant

    joedgrant

    Joined:
    Mar 16, 2010
    Posts:
    23
    Weirdness with chapter 11. The code written in the book for Objectlookup.js is very, very different from what you have in your examples


    You've put them together in your code, but call it as a function in the book?
    The one in the book gives a eof error.

    //edit I moved the function call up a bracket to put it in the loop, and adjusted the else. Seems to work now, but is still very different from the example code.
    //edit I've removed the code from the post, it was getting spammy.
     
    Last edited: Mar 12, 2012
  31. joedgrant

    joedgrant

    Joined:
    Mar 16, 2010
    Posts:
    23
    And... hit yet another snag. This is what happens when an artist tries to program, I guess. I've asked this in the scripting forum as well... Mostly because I've been hammering at this all morning. Been through the first 11 chapters in less than two weeks... really enjoying it so far.
    The kindle edition has a lot of missing code though, you might want to give it a go through.

    Anyways, I've gotten to the section where you create the inventory Grid, and I've gone over it and over it from the book and example code, and can;t find out where I've buggered it.

    Code (csharp):
    1.     function InventoryGrid () {
    2.         var xPos = -startPos - iconSize/2;//adjust column offset start position according to icon
    3.         var spacer = startPos - iconSize; //caculate the spacer size
    4.         var iLength = currentInventoryObjects.length;//length of the array
    5.         for (var k = 0; k < iLength; k = k + 3) {
    6.             //row 1
    7.             var yPos = startPos - iconSize/2;
    8.             currentInventoryObjects[k].guiTexture.pixelInset = Rect(xPos, yPos, iconSize,iconSize);
    9.             //row 2
    10.             yPos = yPos - iconSize - spacer;
    11.             if (k + 1 < iLength)currentInventoryObjects[k+1].guiTexture.pixelInset = Rect(xPos,yPos, iconSize,iconSize);
    12.             //row 3
    13.             yPos = yPos - iconSize - spacer;
    14.             if (k + 2 < iLength)currentInventoryObjects[k+2].guiTexture.pixelInset = Rect(xPos,yPos, iconSize,iconSize);
    15.            
    16.             xPos = xPos + iconSize + spacer;//update column position for the next group
    17.         }//close the for loop
    18.        
    19.     }//close the function
    It's giving me a 'guiTexture' is not a member of 'Object' error.

    //edit
    It works, more or less, if I remove the #Pragma strict at the beginning of the script.
    Now, I get Implicit downcast from Object to string... Is there a way to fix this?
     
    Last edited: Mar 12, 2012
  32. kstars

    kstars

    Joined:
    Nov 12, 2010
    Posts:
    2
    Hi, Sue!

    This is a very helpful walk-through book. I have a basic issue that maybe our hacks in the book have changed. I cannot strafe up or down with the Q/E keys any more, so if I want to fly over the flower in play mode, I can't. I know what we did with altering input project settings was to change the mouse look functionality a bit. In ch5 steps 18 19, I think the Input.GetKey("up") and Input.GetKey("down") were dropped. Was that intentional? Or do I just have to add an input project setting, as in step 22-26?

    Before I leave this note, in v3.5.0, I don't get the prefab disconnect messages. Also, I have not seen the FBX import remnants littered the project browser.

    Thanks!
     
    Last edited: Mar 14, 2012
  33. kstars

    kstars

    Joined:
    Nov 12, 2010
    Posts:
    2
    PS. Errata on pg 392 in the "Reading Animation Curves" blurb, there are two "Fig 7" list items.
     
  34. MichaelHarte

    MichaelHarte

    Joined:
    Nov 28, 2011
    Posts:
    8
    Hi Sue,

    having problem at chapter 14. ChestInside is being enabled after CheckState runs. I can't get the message out of the box.
    I pick the rock to get the key etc but as soon as I do, chestinside current state goes to 0 (result of checkstate being called each time)
    I think some of my metadata may be wrong..see p657, p664 Crowbar related. See also p642 lookup for ChestLid. Any ideas how to resolve this.(also see p579 (7) should it read Crowbar with Sleeve Icon,1 at end of line.

    Thanks

    Michael
    p.s I have been trying to resolve this problem for several days.
     
  35. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    Were the revised edits mentioned in this post from 9/24/11 ever uploaded?
     
  36. Hans Wittman

    Hans Wittman

    Joined:
    Mar 15, 2012
    Posts:
    30
    Hi,

    Great work on that book but i would specify that not everyone have the ability to become a real efficient 3d artist i have 15 years in the industry as a 3d artist and as a teacher in 3d animation and game art.

    There is a myth about the current generation that said you can do it if you really wish to do it! How many project i see here that will never see the light of day 95% could be a good probability surely not mentioning the casual 1 month game that people play in the bus while going home.

    I mean a real full fledged triple AAA title that sale pass the 100,000,00 copy and this ain't going to happen with low skills in the graphic department and i see legion of bad graphic design and 3d mesh that are not fit for the task.

    I know many are teen that are wanabe artist and just want to become the next Elder scroll creator or COD fps but unfortunately many will end up in a totally different business to earn their living.

    To become good enough to create a complete game and i mean a real game with all the bell and whistle then prepare yourself for a hell of a ride with very low income for many years, best case scenario is if you live at your parent home and can be feed for the 3 to 5 years that will required a full fledged title.

    I have been true all and finding good team mates is also a hellish task because there will always come a time when the most essential team mate to your team will tell you that he cannot continue for lack of money he get doing it!

    I always told my students that to become really comfortable with any 3D package at a point you can say that most task like modeling, rigging, texturing, animating etc. are like second nature take a minimum of 2 years with more then 25 to 30 hr a week.

    Imagine after that our wanabe game developer will have to learn how to do 2D graphic and GUI another 6 month to 1 year to learn this part really correctly to use it effectively everywhere in the work pipeline.

    And then the final blow, of course after those 3 years learning the 3D and 2D art aspect it is now time to learn the beautiful world of C programming or any other language, honestly to become a really good programmer you are going to need another 2 to 3 years doing only this.

    Of course i am not talking about a multinational studio where everyone is assign to a specific task, these guy's have the money to afford the best artists in their own specialty, but you the wanabe teen in the parent basement won't have that luxury and will have to learn everything from scratch before you even start doing a pong game for hell!

    Sorry for the long post but i just want to warn people that not everyone can become a game developer and that wasting 5 years of your precious time on something you will probably never finish is in my own opinion is a cruel defeat.

    Young we all do the same mistake we all think we can become whatever we truly want but reality always catch with us sooner or later.

    English is not my native tongue so i apologize for any orthographic errors.

    Best regards Hans
     
  37. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    Bump.
     
  38. Artifact-Games

    Artifact-Games

    Joined:
    May 19, 2010
    Posts:
    43
    Hi Sue,

    I followed the directions exactly on p. 657 (Chap. 14) and when I test the crowbar or golden sleeve on the ChestInside object, I get the following error:

    IndexOutOfRangeException: Array index is out of range.
    MiscText.RandomReply () (at Assets/Adventure Scripts/MiscText.js:12)
    (wrapper dynamic-method) MiscText.MiscText$RandomReply$ (object,object[]) <IL 0x00006, 0x0004c>
    Boo.Lang.Runtime.RuntimeServices.Dispatch (object,string,System.Type[],object[],Boo.Lang.Runtime.DynamicDispatching.DispatcherCac he/DispatcherFactory) <IL 0x0002e, 0x0012e>
    Boo.Lang.Runtime.RuntimeServices.Dispatch (object,string,object[],Boo.Lang.Runtime.DynamicDispatching.DispatcherCac he/DispatcherFactory) <IL 0x0000c, 0x00064>
    Boo.Lang.Runtime.RuntimeServices.Invoke (object,string,object[]) <IL 0x00039, 0x000f1>
    UnityScript.Lang.UnityRuntimeServices.Invoke (object,string,object[],System.Type) <IL 0x00018, 0x000a6>
    ObjectLookup/$HandleNoMatchReplies$89/$.MoveNext () (at Assets/Adventure Scripts/ObjectLookup.js:210)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnu merator)
    ObjectLookup:LookUpState(GameObject, Int32, String) (at Assets/Adventure Scripts/ObjectLookup.js:157)
    ObjectLookup:ObjectLookup$LookUpState$UnityEngine. GameObject$System.Int32$System.String(Object, Object[])
    UnityScript.Lang.UnityRuntimeServices:Invoke(Objec t, String, Object[], Type)
    Interactor:OnMouseDown() (at Assets/Adventure Scripts/Interactor.js:315)
    UnityEngine.SendMouseEventsoSendMouseEvents()
     
  39. Artifact-Games

    Artifact-Games

    Joined:
    May 19, 2010
    Posts:
    43
    Okay this is driving me crazy, which means after I write this I'm going to work on some 3D art. So, I've tested the included "Start" projects for Chapter 14 and 15 for chest functionality, and every time it returns the same error. The one about the Array index out of range (the metadata mismatch problem).

    In this case I start with the Chapter 14 "Start" project. On p. 657 in Chapter 14 it shows the metadata for the Inspector and Object Lookup scripts, which I've CAREFULLY typed in many times. When I finally get to step 6 which says to test the crowbar or sleeve I click play. The first thing that happens once I click play is the ChestInside object is disabled from the scene, and in the inspector the value of CurrentState changes to '1' (which means unable to use). Next, I pick up the crowbar and sleeve. Before I can try to use the crowbar or sleeve, the message must be taken out of the box and put into the inventory. However when this is done the CurrentState of the ChestInside object remains '1'. I could try picking with the crowbar or sleeve icon on the inside of the Chest, however since the ChestInside object is still disabled nothing would happen. So CurrentState somehow wasn't changed to '0' when the message was taken out. If I proceed to enable the ChestInside object in the Inspector, and I try using the Crowbar or Sleeve Icons on the ChestInside object, it returns the Array index is out of range.

    Sue unless you have a quick fix off the top of your head. Please try opening the included Chapter 14 "Start" project, and see if you can get through step six on p. 657 successfully? I've been trying for several days with different versions of Unity without success. I suspect there is missing metadata in one of the ActionObjects, an error in the ObjectLookup or MiscText scripts, or a combination of the two. It's enough to give a 'non-coder' a major headache.

    Thanks,
    Mike (another one)
     
    Last edited: Mar 21, 2012
  40. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi guys- sorry for being mia- deep in another project with a deadline coming up...forgot to check this thread for a while

    off the top of my head-

    replace private var with internal var - everywhere

    with the now default #pragma strict, declare all vars with their type inside functions included
    while Javascript can figure out type for you normally, on mobile that's not allowed, so just get in the habit

    so JoeDGrant's
    var xPos = -startPos - iconSize/2;
    becomes:
    var xPos : int = -startPos - iconSize/2;

    index out of range errors mean its being told to get an element number from an array that doesn't exist
    so if your LookUp and Reply arrays don't match exactly, that can be the problem
    in the scripts that are parsing those arrays, it is splitting them up with the commas- if you have a period by mistake, that would cause the problem

    edits not uploaded- bad me- I got busy this thread got quiet, so I never got around to it
    getting traffic again, so I'll dig them up

    with the latest Unity changes it looks like I just need to spend a week going through the book to see what needs updating- problem is I don't have a week right now

    I like the fact that Unity is not afraid to make changes that break older projects, but it makes writing (and supporting) teaching material a nightmare

    and yes, Hans, totally agree with you
    that's why in my book I consider a single person making a game will be producing a prototype that will help get serious investors or teammates
    and yes- I tell my younger students to get a well rounded education for when they burn out of the game industry,
    and the older ones to keep their day jobs and make games in their spare time

    back to grindstone...

    Sue
     
  41. Artifact-Games

    Artifact-Games

    Joined:
    May 19, 2010
    Posts:
    43
    Thanks Sue for sharing this great info! I understand you are very busy these days. I'm attempting to tackle each of the problems.
     
    Last edited: Mar 26, 2012
  42. saky

    saky

    Joined:
    Aug 12, 2011
    Posts:
    1
    Hello everybody,

    I want to thank Sue for her great book and for supporting this forum , I've always wanted to develop a game and at least I feel I can do it.
    I'm a software engineer more than an artist, and though I can't spend 30 or 40 hours per week working on this project I feel happy because I could begin with my prototype ... maybe someday I'll find some good teammates, but til then I will enjoy this experience.

    Greetings from Spain.
    Luis
     
  43. Artifact-Games

    Artifact-Games

    Joined:
    May 19, 2010
    Posts:
    43
    Greetings,

    Okay, so when I put #pragma strict on the GameManager script I get the following error:

    'GetComponent' is not a member of 'Object'

    and

    'guiTexture' is not a member of 'Object'.

    Does this have to do with the Interactor script or the currentInventoryObjects variable in the GameManager script? Which variable need it's type declared to fix this?

    Thanks!
     
  44. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    hi Psi,

    trying to track this down-
    something is going wrong with currentInventoryObjects array
    it's not storing the object type when it adds it to the array in the Start function
    but it is putting the object into the array
    weird

    Sue
     
  45. joedgrant

    joedgrant

    Joined:
    Mar 16, 2010
    Posts:
    23
    Just a note: Most of the for loops in the kindle edition are missing anything that comes after a <
     
  46. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    after a < ?
    yikes! could you guys ping the publisher on that?



    found something on looping with #pragma strict today
    you might try adding #pragma downcast

    it worked for a similar error I had with a renderer component
    though, I'm guessing this is deeper
     
  47. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    okay, got lucky on the #pragma strict issue

    if you are just getting warnings about downcasting, you can add #pragma downcast and that will suppress the warnings

    but after chasing down lots of links on #pragma strict, I found the following:

    "http://answers.unity3d.com/questions/124532/downcasting-array-to-int-without-pragma-downcast.html"

    the problem is that apparently, Javascript arrays, the ones that you can dynamically change the size of, never do store the type
    I had just assumed that they stored whatever type you put in them...

    so, I suppose we have 3 options
    1- get rid of the #pragma strict for this project since it wasn't designed for mobile anyway
    2- create a Unity array at the start with more than enough elements to store the objects and keep a var somewhere that tell you how many real objects are in it (that will be updated whenever you swap out a placeholder object for a real object)
    3- use lists as Michael in the link suggests instead of arrays

    haven't had a chance to test 2 3, but at least the mystery is solved!
     
    Last edited: Apr 3, 2012
  48. joedgrant

    joedgrant

    Joined:
    Mar 16, 2010
    Posts:
    23
    Heh. If you turn notes on in the kindle edition, I've been inputting them when I get the chance, so they should be be highlighted with the correct code in the note. I've sent a note to apress.
     
  49. k3D-Junkie

    k3D-Junkie

    Joined:
    Jun 14, 2011
    Posts:
    236
    thanks Joe!
     
  50. Newbquest

    Newbquest

    Joined:
    Apr 2, 2012
    Posts:
    24