• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Aviv Cohn

"Programming Game AI by Example" - your opinion?

5 posts in this topic

I read that the book "Programming Game AI by Example" is a good beginner book for learning to program game AI.
 
But I also read that the code examples in the book are C++. This I guess won't be a problem because Java is similiar to C++ ([I]will it be a problem?[/I]), but I still don't have any idea about 3D game programming. I'm still studying 2D. Would the book be useful to me even if some of the examples (I assume) are for 3D implemetations? (are they?)
 
Also, your general opinion on the book would be great.
 
This question obviously is for anybody who read this book or some of it.
Thanks
Edited by AvivC
0

Share this post


Link to post
Share on other sites

I don't recall anything in the book focusing on 3D implementations,  if there were any they weren't emphasized on enough for me to remember. Most of what it focused on was implementing AI in a 2D game environment. Here's some of the things the book goes through:

 

  • A quick primer on on Math and Physics.
  • State machines.
  • Steering behaviors/Navigation.
  • Group steering behaviors.
  • Sports simulation.
  • Collision detection.
  • Graphs and a few graph search algorithms.
  • Pathfinding.
  • Scripting in Lua and writing an interface to invoke C++ code from Lua and vice versa.
  • Goal driven behavior.
  • Fuzzy Logic.

 

I really loved the book, as it helped me understand the basics with clear and detailed wording and source code, and helped me learn quite fast. It covers most of the basics really well. Looking back at it now, I'd say it doesn't cover some newer algorithms and techniques, an updated version would be very nice. To make the learning more fun for myself, I didn't use the provided 2D engine (I think there was one), but instead wrote a lot of the sample code from scratch to fit into my own 2D engine.

 

I wouldn't say Java is similar to C++, it might be but in a small way. One thing you're not dealing with in Java is memory management, and another thing you're used to in Java is having lots of libraries to do simple tasks in simple ways. C++ is beautiful and powerful, but sometimes the syntax can become hard to grasp, even when you want to accomplish something new, until you get used to it that is.

 

Something you should keep in mind when learning C++ is that you not only have to allocate memory, you also have to deallocate it, or else you'll get memory leaks.

 

In Java you would do something similar to this to allocate memory for an object:

SomeObject myObj = new SomeObject();

and then Java would automatically take care of deallocating it for you.

 

In C++, you have to deallocate memory yourself and ONLY when no other objects are using the one you want to deallocate.

At some point in time, you would have to call:

delete myObj;

I recommend reading a little bit about pointers and memory management and understanding them before you try following the examples in the book.

 

An alternative would be to write the book's examples and algorithms yourself in Java if you already have a 2D engine working. Both tasks would be a good challenge, but I personally recommend having good C++ knowledge in your toolkit as a game developer.

 

Sorry if I typed too much, I tend to do that a lot xD

1

Share this post


Link to post
Share on other sites

Thanks smile.png Would you say I need to teach myself some C++ in order to understand the examples in the book properly? (regardless of your opinion that I should know a little C++ in general. I'm asking specifically about the examples in the book).

 

I mean, the book is about AI design, not about low-level things like memory management. I should be able to ignore C++ stuff like pointers and memory than I don't entirely understand, and still be able to see the AI logic in the code. Am I wrong?

 

EDIT: Also, would you recommend reading the book all the way through?

Edited by AvivC
0

Share this post


Link to post
Share on other sites


Would you say I need to teach myself some C++ in order to understand the examples in the book properly? (regardless of your opinion that I should know a little C++ in general. I'm asking specifically about the examples in the book).

 

No, you should be able to understand the code examples without having to teach yourself C++. I was mostly talking about C++ specifics in case you decided to build upon or tweak the sample code in C++.

 


I mean, the book is about AI design, not about low-level things like memory management. I should be able to ignore C++ stuff like pointers and memory than I don't entirely understand, and still be able to see the AI logic in the code. Am I wrong?

 

No, you are correct. You don't need to know all the intricate C++ details to understand the AI logic.

 


EDIT: Also, would you recommend reading the book all the way through?

 

Yeah, even if you only planned on learning a specific area from the book, it still has good material that will maybe help you think of game AI problems in different ways and come up with your own solutions.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0