• 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
unit187

AI programming quick start Q

8 posts in this topic

Hello,

 

I would be happy if someone would be so kind to answer my question.

I am quite interested in learning artificial intelligence for games, but I am not sure if I will like it and if I am ready to dive into it and invest monthes (for start) learning something I will not like.

So the question is, what approach should I take to do some basic AI programming and quickly achieve visible results to get the taste of it?

 

My programming background: some Python, mostly UI and tools developing inside Autodesk Maya. Never programmed games.

 

Thanks!

0

Share this post


Link to post
Share on other sites

@frob: +1'd because that Conditional-Action based architecture at the bottom of the link - very interesting idea, and I think I'll use that for my game since I haven't coded the AI for it yet.

0

Share this post


Link to post
Share on other sites

@frob: +1'd because that Conditional-Action based architecture at the bottom of the link - very interesting idea, and I think I'll use that for my game since I haven't coded the AI for it yet.

 

Your welcome.  I added that gpwiki article ages ago.  

 

That particular pattern has served me well many times.  In fact, I'm implementing yet another instance of it based roughly on those same ideas right at this very moment --- currently with 72 conditionals.  :-)

0

Share this post


Link to post
Share on other sites

Most game AI systems are implemented as simple state machines.

It is extremely rare for a game to use an advanced machine learning algorithm. They are great for many real-world problems where you need to make the decision mirror reality. Games to the opposite; you need to tweek and tune and manually adjust them.

Clicky

Thank you.

 

So, as I understand, AI in games often is a system of 'if... then' statements.

if a player has big gun and full health: do that

if a player has small gun and low health: do that

 

It seems to me that a programmer who does AI most of the time will code conditions. For example, AI needs to react somehow when a player runs away. The hardest part to code here is to code what does it mean to 'run away'. Is it correct?

And it leads me to the point that AI programmer must have the same knowledge as general programmer who can code a game, but specializes in AI.

Do I get it right?

0

Share this post


Link to post
Share on other sites

So, as I understand, AI in games often is a system of 'if... then' statements.
if a player has big gun and full health: do that
if a player has small gun and low health: do that

 

Basically correct.

 

The If/Then table was to make the example clear.  That only works well for small systems; it quickly grows to become unmaintainable.

 

 

In a major AI system is more likely to be driven by data, not by code.  Rather than complex If/Else trees it is more likely to be handled by an array of conditions, and the conditions are actually objects derived off a basic state class.  The programmer would create the framework for the rules.  The designers would likely have either a spreadsheet or a tool that lets them enter whatever data fields they want.  During the game load process the data would end up loading that data and creating whatever data-driven implementation the designers want.

 

If you have a copy of Final Fantasy 12 available, their AI system is completely exposed to the player.  If you don't have a copy of the game available, the Wikipedia article describes it as the AI "consists of three parts: a target, an action, and a priority. The target specifies which ally or foe to act on and the condition for applying the action. For example, the target "Ally: HP < 70%" causes the character to target any ally whose hit points have fallen below 70%. The action is the command to be performed on the target. The priority order determines which action to perform when multiple actions are triggered."

2

Share this post


Link to post
Share on other sites

Visit www.edx.org and checkout the AI online course (Starts 18th Feb and it is free). It should give you an idea if you like it or not.

0

Share this post


Link to post
Share on other sites

In a major AI system is more likely to be driven by data, not by code.  Rather than complex If/Else trees it is more likely to be handled by an array of conditions, and the conditions are actually objects derived off a basic state class.  The programmer would create the framework for the rules.  The designers would likely have either a spreadsheet or a tool that lets them enter whatever data fields they want.  During the game load process the data would end up loading that data and creating whatever data-driven implementation the designers want.
 
If you have a copy of Final Fantasy 12 available, their AI system is completely exposed to the player.  If you don't have a copy of the game available, the Wikipedia article describes it as the AI "consists of three parts: a target, an action, and a priority. The target specifies which ally or foe to act on and the condition for applying the action. For example, the target "Ally: HP < 70%" causes the character to target any ally whose hit points have fallen below 70%. The action is the command to be performed on the target. The priority order determines which action to perform when multiple actions are triggered."

 

Can you expand a little bit more on 'driven by data' thing? Because I still see this as IF-THEN (or Switch).

I mean, we have a class that gathers information and spits out data like how much health does a bot have, how many enemies are around, whats in the bot's inventory, etc. And then we operate with this data to make the bot do some action, for instance, if he has low health and if he has Health Potion in the inventory, he drinks it.

 

 

 

 

Visit www.edx.org and checkout the AI online course (Starts 18th Feb and it is free). It should give you an idea if you like it or not.

 

Eh, they ask for quite good math knowledge. I finished my formal education like 8 years ago and now am relearning math and steamrolling through it, but I don't have that high level yet. And yes, I know that AI is all about math. :)

0

Share this post


Link to post
Share on other sites

There are some good books on this,

http://www.amazon.com/Programming-Game-Example-Mat-Buckland/dp/1556220782/ref=sr_1_1?ie=UTF8&qid=1360368728&sr=8-1&keywords=ai+programming

that one got good reviews, I own it, but haven't gotten around to reading it yet.

 

Also gameinstitute has tutorials for game AI

http://www.gameinstitute.com/game-development/game-programming.php

 

GI does a 1 time payment to join, you get access to all there materials for the 99$ which is a steal, the programming aspects are in c++.

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