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

best book to teach programing using unity?

Discussion in 'General Discussion' started by BowhillGames, Feb 5, 2015.

  1. BowhillGames

    BowhillGames

    Joined:
    Feb 5, 2015
    Posts:
    3
    Hi I am currently looking for the best book around that teaches programming in unity for beginners the Will Goldstone book has a lot of good reviews but its from 2011 what's the best one out there to get started? for programming beginners preferably with javascript being the language of choice?
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This book is awesome, and totally free. It's been made by people who have spent a lot of time working with the engine. I read through from front to back when I started, and frequently refer to it.

    Even more awesome is it's frequently updated as new versions come out.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    Chances are newer books may have the language listed under a different name. That's because Unity doesn't actually use normal JavaScript, they use a variation of it called UnityScript. Think of it as JavaScript modified to include .NET concepts.

    http://www.amazon.com/Beginning-Game-Development-Unity-All/dp/1430248998/

    I highly recommend C# though as any book covering it will be accurate (C# is the same both inside and outside of Unity) whereas JavaScript books won't really work for learning UnityScript.

    http://www.robmiles.com/c-yellow-book/
     
    Last edited: Feb 6, 2015
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,617
    I think it's worth pointing out that "learning programming" and "learning Unity" are two different things. I don't want to discourage anyone from jumping straight in to Unity, but I do want to encourage people to also learn programming in and of itself. On that note, I hear great things about The Yellow Book, which I believe is available electronically for free.
     
  5. christinanorwood

    christinanorwood

    Joined:
    Aug 9, 2013
    Posts:
    402
    I've found this book by Terry Norton to be very good. I have the Kindle Edition.
     
  6. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    no.

    ...anyway, so you want to learn programming? That's awesome. I could blah blah blah all day, but you know what language you should play with first? Yep. C. Why? OMGWTFPANCAKES... because it's pretty much what every modern language is based on. It forces you to learn about computer memory and stuff, which is important because you'll be working with object references and object declarations... and it will make NO sense AT ALL until you understand what the difference between a reference and a value type is, and you won't understand that until you understand what a pointer is... etc. So the best answer is:

    http://c.learncodethehardway.org/book/

    Because by golly gosh after 2 weeks of following those examples everything else will just seem like totally obvious and simple.

    After that you can learn whatever language you want with relative ease.

    THEN head to the Learn section of Unity and grab the example projects and lo and behold, you will understand the code and be able to figure it out yourself.

    ...so there you go, there's really no book that can teach you how to program games in Unity that is worth anything, because if you find one it will just show you how to do some simple FPS or something and guess what? That's all you're going to be able to do.

    Honestly, a comprehensive book on Beginning Unity3D in JavaScript would be roughly 1,000 pages long, if it had to teach you the basics of the language first and then move into Unity specific concepts and then how to use the IDE, etc.

    Was this post useful? No? Okay, you can have your money back.
     
    Last edited: Feb 6, 2015
    waritphankrawee and ChubbyCloud like this.
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Rubbish. Absolute rubbish.

    If you want to learn programming for programming's own sake then go for C. Go for assembly. Learn how a CPU processes instructions. Learn about memory management. Go get a PhD in computer science.

    If you wanted to learn to drive a car would you go become a mechanic first?

    The whole point of modern languages is that they do a lot of the low level tasks for us. Some very clever people built some compilers that do some incredible things. A different set of people built the Unity engine that takes out much of the low level tasks in game programming. The high level tasks are left for us.

    So if you want to make games, start learning with Unity. Or start with C# and the yellow book. But don't start with learning a language as low level as C, unless you plan to build an engine or language of your own.
     
  8. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    Ha. It takes like what, 3 weeks to get the basics of C down? I have a C compiler on my android phone. Once you got it down, you understand how to program a computer.

    Your "high level stuff" is really just nice features built on top of C principles. You can't just say it's useless to understand what is going on. For example, "go learn assembly"... well, sorry.... but assembly for which processor? C runs on everything, everything is based on C. C#? Why is it called that? C became widely used, then C/C++ was IT for a long time...... then the powers that be acknowledged it was getting unwieldy, so C#.

    C/C++ are still widely used. It's not like I'm saying learn some ancient dead language. I wonder why people are so terrified of C.

    Ha, and even if you want to learn JavaScript it's the same foundation. It's a no brainer.

    I'll probably learn JavaScript just cause in a month or two, and you know what? I'll think in terms of basic logic, operators, etc. And read up on how JavaScript manages objects, etc. And it will be pumpkin pie. I just think how things add on to C and it all makes sense.

    If thats rubbish, well o.k. then.
     
    Last edited: Feb 6, 2015
    sootie8 likes this.
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    Not for someone with no prior knowledge of programming.
     
    unity_gB2BlBzYSdzxKg likes this.
  10. R-Lindsay

    R-Lindsay

    Joined:
    Aug 9, 2014
    Posts:
    287
    So in order to learn C# and Unity on my Windows machine, the absolute best advice is to go learn C on Linux writing a TCP/IP client?
     
    Amon likes this.
  11. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    Hahaha. You guys are the funniest ever.

    I would recommend downloading any C compiler, even get CppDroid for Android mobile and just have fun with it. I always like to make Mad Lib programs that randomly choose words and construct and output funny sentences.

    I wouldn't try to construct anything nontrivial in C. That's not the point. The point is to "get it". Once you get it, well you got it.

    Better than muddling through.
     
    Last edited: Feb 6, 2015
  12. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    I initially learned C/C++ (using GCC) as my first attempt into modern game development (I had worked with older languages prior). I do consider the time I spent with them to be worthwhile, but the languages themselves did not make me a competent programmer.

    C is actually a relatively young language. There are quite a number of languages that existed prior and are still in use today.

    http://en.wikipedia.org/wiki/Timeline_of_programming_languages
     
    Last edited: Feb 6, 2015
  13. BowhillGames

    BowhillGames

    Joined:
    Feb 5, 2015
    Posts:
    3
    Hi guys

    thanks for all the feedback I should probably point out I have previous experience in using unity from a design perspective so I know the interfaces very well, this is more a exercise in becoming confident in programming I have some very minor experience in using objective-c and Xcode from a maintenance perspective not building something from scratch. and I chose JavaScript as I will soon be using learning the basics in my work life anyway.

    @Ryiah if what you say is true, I think you are right learning c# will probably be a better use of my time from a game development standpoint and thank for your book suggestions.
     
  14. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    If you are still interesting in JavaScript, you'll probably want to keep a link to the wiki article explaining the differences. As I said they are essentially the result of adapting JavaScript to work with the .NET (and Mono) framework. Some are pretty simple but others may be less so.

    http://wiki.unity3d.com/index.php?title=UnityScript_versus_JavaScript
     
  15. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,384
    The best thing to do is to ascertain the key commands that unity provides, these are the absolute essential parts to learn about and master first, which every project you start will need and use the most.

    GameObjects, Prefabs, Finding and connecting components, communication between each and every GameObject, prefab etc!

    If you start there, I'm sure, by how you post, that you are serious and will dedicate the needed time and patience to learn the absolute essentials first, that you will be a productive and effective Unity User/Programmer/GameMaker...
     
    Kiwasi likes this.
  16. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    http://en.wikipedia.org/wiki/List_of_C-based_programming_languages

    Python, Java, PHP, Perl are listed, and JavaScript is similar because I can read JavaScript and I've never written a line of it. And of course, anything with the letter "C" in it. I appreciate the thought behind a timeline of programming languages, but my recommendation isn't so much about historical value as much as it is about syntactical and structural similarity and building a deep level of confidence that extends beyond the working environment, having compiled a lower level language and having a small level of under-the-hood knowledge goes a long way to building confidence.

    "this is more a exercise in becoming confident in programming" - OP

    I guessed that was the case, hence my recommendation, now confirmed.

    But really, nobody is saying C was the first programming language. Obviously, reason dictates there had to be a B and an A, since there's D and F. C++ was based on wanting to bring experiences with Simula to C by some crazy Danish guy with a bad comb over. Haha. Of course if you have ever cracked a book on Objective-C you know it was based on SmallTalk. I know these things. But, I don't think any language is as concise and clean as C, written in a black text editor panel, outputting to a console window that is still relevant to computing today in any meaningful capacity.

    Granted, you can still use Visual Basic if you want to. Nothing wrong with that. And to be honest, if you're using .NET a programming language is really just a means to an end. Still, there's not really any getting away entirely from the broad reach of C's influence and there is, in my estimation, no other way to explain Classes, Object References, etc. other than to explain everything in terms of how it is stored in memory and the confusion about what a NullReferenceException is can be entirely abated if everyone were to write a few programs in C using pointers.

    @BowhillGames - Honestly, if you already have a foundation than I'm confused about your initial question.

    You don't actually program in Unity. Unity tech. has provided a lot of libraries you can use for things, but it's not an IDE like XCode or Visual Studio. Unity is more like a resource manager/test environment/debugger/build manager and exporter wrapped up in a GUI that you already have experience with. You'll be writing code in separate files but with the right settings, you won't have to think about compiling. That's Unity, pretty much.

    You write the code, the code is saved to files in the directories, Unity auto-magically compiles them behind the scenes as that little wheel thing twirls in the bottom right-hand corner, then you can test run the game in the editor.

    I don't want to sound like I'm talking trash about Unity because I think it's actually really awesome, but it is possibly a bit convoluted how it all comes together and I think that throws some people off, especially people who like to understand the nuts and bolts.
     
    Last edited: Feb 6, 2015
    sootie8 likes this.
  17. R-Lindsay

    R-Lindsay

    Joined:
    Aug 9, 2014
    Posts:
    287
    Javascript may look like C, but there are a lot of differences between Javascript (actually ECMAScript) and other similar languages. I haven't looked at UnityScript, but I remember that in ECMAScript functions are first class objects, functions define scope, inheritance is prototype based and not class based, and so on.

    I get what you are saying, you should learn about some of the fundamental principles like what is the difference between the heap and stack. But you can just youtube search this, you don't really need to learn C to do it. Besides the examples are just as likely to be in C# or Java as they are in C.

    In my humble opinion I would consider it more beneficial that newbies spend time understanding OOP, generics, and the like, than how to implement their own garbage collector.
     
    Kiwasi and Ryiah like this.
  18. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    That's certainly another way of doing it, but for some reason it didn't work for me. No matter how much I read about OOP and generics and all that high level stuff, it just sounded like "there's something missing from this explanation". For me, I found C# to be nonsense, even worse than the trouble I had with C++. Then I went back and did the pointer stuff, etc. Compiled the scripts using makefiles, just like the mean guy on that website recommended and after that suddenly C# felt like such a relief! I think newbies can't appreciate just how powerful and concise (and relatively easy) these languages are to work with.

    When you think about it... nobody should really have trouble learning C# unless they have a weak foundation to begin with. It's almost like programming in spoken language.

    I got it! I think that teaching programming in Python and Basic and stuff like that, as a first language, actually harms. Kids should be taught the tough syntax first, and gradually evolve to more powerful, more fully featured languages with endless libraries, etc. It's how we do everything else in education. Basics first. I think it's very little different than learning how to use a calculator before you learn your multiplication tables.
     
    Last edited: Feb 6, 2015
  19. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    I think you need to understand that most people simply don't approach programming in this manner. You're closer to someone who is learning programming solely for the sake of being able to grok it.

    Most people though simply want to make a game.
     
    Last edited: Feb 6, 2015
    Kiwasi likes this.
  20. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    I still don't get how people make games without knowing how to code. I mean, I know it happens. Copy n Paste. But, still. Tis a shame.
     
  21. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    This is a very ignorant viewpoint. You're assuming that someone who is not intimate with the inner workings of hardware and software is incapable of being a good programmer. That's blatantly untrue.
     
    Psyco92, Kiwasi and Amon like this.
  22. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    I don't see how you get that, but I do somewhat slightly agree with that. I see it as difficult to be a good programmer if you don't understand what the machine does. Not necessarily because you will be bad if you learn the high level abstractions only, but because machines tend to break, even soft machines. And when things go awry it's always nice to be able to take off the control panel and go "oh, it's just a bad switch" so-to-speak. Not knocking high level languages, they're great. I don't think everybody needs to know exactly how computer memory works. There's always going to be a level of "okay, that's all I need to know". But, again, when the programmer becomes a user who doesn't know the difference between:

    Code (CSharp):
    1. Object NewObject;
    2. NewObject.DoSomething();
    and

    Code (CSharp):
    1. Object NewObject = new Object();
    2. NewObject.DoSomething();
    It causes problems and they might not know why. After all, this works fine:

    Code (CSharp):
    1. Int Num;
    2. Int OtherNum;
    3. Num = 3;
    4. OtherNum = ++Num;
    So what's the difference? They're both variables, just of different types, right?

    And don't even get me started on:

    Code (CSharp):
    1. Object NewObject = new Object();
    2. Object NewerObject = NewObject;
    3. Destroy(NewerObject);
    4. NewObject.DoSomething();
    "You see, a class is like a blueprint and an Object is like a factory..."

    Ok. So when I throw something in the trash, the entire factory is wiped off the face of the earth? Hahaha.

    Could there possibly be a simpler explanation in terms of computer memory? :rolleyes:
     
    Last edited: Feb 6, 2015
  23. BowhillGames

    BowhillGames

    Joined:
    Feb 5, 2015
    Posts:
    3
    there are a lot of tools out there that allow people to create games and applications with out knowing how to code you just need to have a good grasp of logic and understand the ordering of things I can think of GameSalad is a very popular one and even some unity plugins such as PlayMaker and Uscript. these allow users to create full games and applications with out code but that being said u usually have to make some kind of compromise in design.
     
  24. Crystal_Dorsey

    Crystal_Dorsey

    Joined:
    Dec 8, 2014
    Posts:
    12
    For game programmers who have no/very little prior experience with programming languages, the book by Alex Okita called 'Learning C# Programming with Unity 3D' is the best bet. It covers the basics of programming and explains in very simple terms how C# is used to make a game in Unity3D.
     
  25. quocanh261997

    quocanh261997

    Joined:
    Mar 8, 2016
    Posts:
    1
    You're a complete psycho, go play somewhere else
     
  26. Azmar

    Azmar

    Joined:
    Feb 23, 2015
    Posts:
    246
    Don't be ignorant to wise words. As a person with a soon to have university degree in computer science (myself), it is easy to spot another person who is also has a degree in a programming field. This guy knows what he is talking about, and trying to give real advice to people who are wanting advice. In my opinion he is correct, you should program at a much lower level language to truly understand memory management, data structures, or how easy it is to "shoot yourself in the foot" with these languages. C# and unity are amazing, you can easily not care about anything and it will do it all for you, but weeks later you will complain and ask why your game runs at 10fps. But with a lower level language, your program will barf and explode on you.

    If OP truly wants to learn programming, he will have to go to a lower level language and learn real programming / software design techniques. Not read a book in C# that teaches you how to move a ball across the scene and the final chapter being a side scroller platformer.
     
    Psyco92 likes this.
  27. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Your first post is necroing a year old thread to call someone names?

    There are valid arguments on both sides of the discussion.
     
  28. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's fine I've removed the problem.
     
  29. Azmar

    Azmar

    Joined:
    Feb 23, 2015
    Posts:
    246
    I didn't even realize it was a necro thread lol