Search Unity

New book! C# Game Programming Cookbook for Unity3d

Discussion in 'Community Learning & Teaching' started by psychicparrot, Jul 7, 2014.

  1. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Hey guys!

    My new book has just hit the US and Canada (soon to hit the UK in late July, although you can get the Kindle version or ebook) and I'm really looking forward to seeing what you guys do with it.

    You may have seen my last book, Game Development for iOS with Unity3d, which was more of a general guide to developing Unity games for iOS (covering planning, game doc writing and management etc. as well as some example code). This one is quite different to that - it's a C# code-heavy cookbook, focussing on .. tell you what, rather than me trying to re-word the bumpf, I'm just pasting the bumpf here..!.. enjoy!..

    C# Game Programming Cookbook for Unity 3D
    presents a highly flexible core framework to create just about any type of game by plugging in different script components. Most scripts function within the game framework or in your own structures. The techniques and concepts discussed in the book give you a solid foundation in game development.

    The first ten chapters set up the flexible, reusable framework based in C# and suitable for all game types. The book also explains scripting of generic, reusable, and common functionality.

    The remainder of the text adds game-specific code to the framework to create four example games: a top-down arena shooter, a futuristic racing combat game, a tank arena deathmatch game, and a classic arcade-style vertical scrolling shoot ’em up. The games encompass artificial intelligence (path following, target chasing, and line-of-sight patrolling behaviors), game state control, wheel colliders, and weapon inventory management.

    Reducing your recoding, repurposing, or adaptation time, this book provides script-based components that you can use to jump start your own projects. The book’s modular components can be mixed and matched to build various kinds of video games for the Unity game engine.



    It's published by CRC Press and you can buy it from most online book stores (Amazon, Chapters etc.) .. the image above links to the Amazon US site.

    Really looking forward to seeing what you do with it. Thanks for all the community's support and encouragement for my Unity books so far :)

    Jeff.
     
    ApteryxK and zeh like this.
  2. galent

    galent

    Joined:
    Jan 7, 2008
    Posts:
    1,078
    Awesome looking book Jeff. I'm going to get that one... as soon as my wife's business stops draining my available funds :)

    Congrats on another published book!

    Cheers,

    Galen
     
  3. zeh

    zeh

    Joined:
    Feb 2, 2013
    Posts:
    28
    Thanks Jeff. I'm only in the beginning of it but so far it seems much better and more honest than all other Unity books I've read.
     
  4. zDemonhunter99

    zDemonhunter99

    Joined:
    Apr 23, 2014
    Posts:
    478
    That looks amazing. I was planning on buying it in a day or two to supplement my learning. Do you cover Mathf and Camera in your book (because that's what gets me confused)?

    Thanks.
     
  5. Ostuni

    Ostuni

    Joined:
    Jul 14, 2014
    Posts:
    2
    I am really enjoying your new book. I was wondering if you have a place set up for questions and discussions?
    Thanks,
    John
     
  6. jforrest1980

    jforrest1980

    Joined:
    Jul 20, 2013
    Posts:
    26
    Picked it up today. Will be writing a review.
     
  7. peterdeghaim

    peterdeghaim

    Joined:
    Apr 10, 2014
    Posts:
    154
    looks great! will definitely check it out!
     
  8. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197
    Picked it up last week, no chance to look at it yet.
    I bought the print edition - sure wish it included a digital copy as I would be half way done reading it by now.
    And, I'm not paying the same price again for the ebook edition. Sigh.
     
  9. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Thanks for the comments, guys!

    Hope you lot find some useful bits in it :)
     
  10. dietlime

    dietlime

    Joined:
    Aug 11, 2014
    Posts:
    42
    Hi! I studied C++ and C#, and so basic topics would be worthwhile-rehash, but what I'm really looking for is unity-specific API tutorials that teach by example the most important functions of the engine and how implement them.

    Most of what I'm seeking to learn is fairly basic, and based on the description I'll probably buy your book.

    Anyway, my current long-term goal is a custom character controller, specifically a land-based vehicular one. That is, rotation rather than (or in addition to) strafing, a capped acceleration variable paired with "throttle", stopping inertia. I'm hoping for a turret-style view-port independent of the tank heading guided by mouse vector. Potentially the ability to detect and refuse motion across terrain dynamically based on angle, and possibly some kind of inverse-kinematics across traversable terrain. Animation systems incorporated.

    I'm as far as learning essential animation tools and have rigged some dummy robots over the last few days with unity-compatible Blender animations.

    Pivotal, I would like to start learning from the beginning the limitations of Unity's network functions, so as I learn and implement it, I can respect those limitations from the beginning.

    So I definitely see a lot I can use in your list there, if not directly related to my goals but for future goals. My question is, does this book cover at least basic character controllers from the ground up?
     
  11. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    started reading this book... thanks, good job, but there are typos I think, for example:
    The easiest way to have your scripts talk to each other is to have direct references to them in the form of public variables within a class. They are populated in the Unity editor with a direct link to another script.
    Here is an example of direct referencing:
    public void aScript otherScript;

    why keyword "void" is there?
     
  12. dietlime

    dietlime

    Joined:
    Aug 11, 2014
    Posts:
    42
    That wouldn't by a "typo" (an errant keystroke error) but a syntactical error; if the code works it probably isn't either.

    When used as the return type for a method, void specifies that the method doesn't return a value.

    void isn't allowed in the parameter list of a method -(inside the parenthesis). A method that takes no parameters and returns no value is declared as follows:

    public void SampleMethod()
    {
    // Body of the method.
    }

    If you're brand spanking new to C in any of it's forms: the void would be replaced by a data type if the method was designed to return one.

    Also, I think C# has some rule about any function outside a class being declared as void.



    Can't wait for my copy of this one to arrive, paired with a C# & unity book that will help me review the basics and learn how to organize them in Unity this book should serve as a great example of OOD use; which is something that is difficult to find in full and documented.
     
    Last edited: Aug 17, 2014
  13. ApteryxK

    ApteryxK

    Joined:
    Feb 8, 2015
    Posts:
    40
    Exactly what I was looking for.
    http://forum.unity3d.com/posts/2136020/
     
  14. Wasiim

    Wasiim

    Joined:
    May 2, 2015
    Posts:
    228
    So was it an error? because i came across the same thing @Andevity did just now and i was really thankful he came across it too.