Creating "AI/bots" for games comes in three parts/flavors/divisions:
First, and the most critical to most games, is basic behavioral AI. This includes things like pathfinding, locating targets, attacking, and otherwise making an entity in the game interact with the environment in the game.
Second, you've got the more abstract parts, the "high-level decisionmaking". This is the AI's strategies and tactics, such as communicating with other AI, coordinating with squad members to circle an enemy, deciding when to change weapons or throw a grenade or pull back to reload, etc. In most cases, developers put in many crude heuristics here either because they don't have time to think of anything better, or for performance reasons. This will look like "if known nearby enemies > 2 and ammo < 20%, find safe point to fall back, reload". The developer thought up this quick rule of thumb and told the AI to do this, without having to code the AI with the intelligence and information the developer used when making up this rule of thumb.
Third, bot creation (for the usual "hacker" version/meaning of the term, as in e.g. bots used by AFK players to farm) is significantly different than making an "official" AI as a developer or writing a replacement AI using available scripting in some games. For most games, bots will involve various hack techniques for retrieving information about the game world (occasionall literally involving visual pattern recognition, which is a whole other ball of yarn (and separate type of "AI") you don't want to mess with just yet). Bots will also usually involve indirect control of the game character by using some third-party program to "send" keys to the game using OS functionality. This is probably not what you're interested in, and you'd need to learn at least some basics of the first two to be able to achieve anything here.
One thing that was rather popular a while ago is to just dive into a game like Robocode[1] and work up your way until you can code one robot that will on its own beat various competition-grade robots without user input to adjust for the opponent's strategies.
Learning the A* pathfinding algorithm is a good starting point as this is common in simple tile games. These two links should get you started:
[1]: http://www.raywenderlich.com/4946/introduction-to-a-pathfind...
1. Grab Unreal Engine[1]. It's $20 per month, but you can cancel after the 1st month if you don't want to receive updates.
2. Download the Unreal Tournament project[2]
3. Examine the bot code and start tweaking
[1] https://www.unrealengine.com/
[2] http://www.unrealtournament.com/
Unreal is an industry-grade game engine that is also quite accessible. AI can be scripted in Blueprint (a visual dataflow scripting language) or C++.
Unreal Tournament 2014 is 100% crowdsourced. If you own the Unreal engine you can download, play it, modify it and - if your modifications are good enough - feed them back in to the game itself. The community is apparently very welcoming.
AI programmer here...generally "bots" are just AI that is intended to take the place of a player (typically in a versus setting and not a co-op setting).
If anything bots are tougher to make then "normal" AI since their value is measured by their performance against humans. Also the less you cheat (perfect knowledge of the other players, perfect aim, etc) the better your bot. Having a non-cheating bot beat a human is a major achievement.
The bots for a strategy game like StarCraft is fundamentally different than the bot for an FPS. They use completely different techniques and it's much harder to cheat in strategy game (though ignoring the fog of war is the most egregious). Strategy game AI is more akin to chess AI - lots of search (minimax and stuff). It's a whole field onto itself and you can only learn by studying the AI for that type of particular game.
FPS bots (like counter strike) are much closer to traditional game AI (shooters and such). Books on "Game AI" are a good place to start. Basically the two major problems is where should I go (evaluating cover, analyzing line of sight, estimating where enemies are and trying to pick a good place to stand) and how to I get there (pathfinding and pathfollowing). What you do when you get there is generally pretty straightforward (shooting at the appropriate guy). If you have a cover system you need to be able to tell them how to use cover and this involves a lot of animation (syncing my animations and position up to the cover in the world). But in an FPS this is usually just a question of crouching or not.
The big difference for FPS bots (versus single player enemy AI) is that bots need to choose between conflicting goals (should I go get ammo, should I go get health, should I attack the enemy). If you have a strict hierarchy of behaviours your bots won't be competitive (enter fuzzy logic systems, utility theory and the like - normal behaviour trees won't cut it).
Have fun!
The best start I ever had to Artificial Intelligence was via UC Berkeley's CS188 course[1]. This course takes you through the very foundations of AI, from search to planning to basic probability theory. It's been imitated at universities around the world with its open lectures, slides, homework assignments and project code.
The projects are the very best part of this course. You start with a blank slate PacMan agent trying to pick up dots to something able to track & dodge ghosts without even seeing them (!). It's what inspired me to continue AI research 7 years down the road!
[1]: http://inst.eecs.berkeley.edu/~cs188/fa11/lectures.html
To create a good (i.e. actually useful) bot you want to start by spending a lot of time in whatever game you're targeting.
Most bots, or trivial helpers like macros, are written by the players that have spent a lot of time in a game and identified the elements most worthy of automation. The player's lack of in-depth technical knowledge then leads to the mass of crappy bots out there.
If you're coming from the opposite side, i.e. you have technological knowledge but don't know where to start, all you're missing is domain knowledge of an individual game or genre to figure out what you actually want to build.
Edit: it's also worth noting that game AI and bots are pretty different problems.
Google Ants[0] is an AI challenge that is over now, unfortunately, but you can still run through it.
"The AI Challenge is all about creating artificial intelligence, whether you are a beginning programmer or an expert. Using one of the easy-to-use starter kits, you will create a computer program (in any language) that controls a colony of ants which fight against other colonies for domination."
Here are some resources on AI programming
http://www.gamedev.net/page/resources/_/technical/artificial...
I highly recommend this book
http://codecombat.com/ may be a good starting point for writing simple AI logic.
You could start at the beginning. Some people are still unaware that the four ghosts from Pac-Man each have a different decision-making algorithm. The red ghost always targets the player. The pink ghost targets four spaces away from the player in the direction it faces. The cyan ghost uses a combination of player position, player facing, and the position of the red ghost to determine its target tile. The orange ghost targets the player when far away, and a home corner position when the player is close.
Those four strategies in combination, along with some global behaviors for pathfinding and behavior modes, are often enough to defeat an unaware player. (search: "Pac-Man dossier")
This introduces the concept of strategic archetypes. Human players have them, too. I, for instance, often favor stealthy sniper strategies. The various strategic archetypes often have a complex relationship web from who tends to defeat whom. The player that always tries to do an early rush to overwhelm slower opponents before they can mount a defense may be easily defeated by a trap-and-decoy opponent, whereas that player may lose to a gather-intel-then-send-ninjas player.
To create a competitive AI, first identify how humans play the game, identify the strategic archetypes, then model your bot to pursue archetypal goals. Then, most importantly, determine when to switch archetypes. An early rusher AI has no strategy for midgame or endgame, so perhaps that AI evolves into aggressive expansion, or an ambusher.
But also remember that the point of the game is for the humans to have fun. Avoid cheating, or overusing a game-breaking strategy. Your bot won't care if it loses, but a human may ragequit if he loses to a bot with a perceived unfair advantage.
Of course, there are some games with no human players. There's the "rock paper scissors programming competition" (rpscontest.com), where players submit algorithms, who then fight each other to the death for rank points. It is interesting to see new strategies rise and fall, including those who win by "cheating", such as by manipulating the match-generating program itself, setting the opponent's random seed, examining the opponent's heap or stack, or causing the opponent to be improperly disqualified for cheating.
There are plenty of books online. I would recommend creating your own project and finding something specifically you would want to do with that topic. For a class project my group and I did something simple, like a minesweeper bot. It also included a screen scrapper to scrap from windows and created our own minesweeper game including the AI part. It had about a 30% failure rate because it would get stuck on the 50-50 chances of it picking the wrong square. But that was a lot of fun. We did a bunch of statistics on it also.
This is a very broad topic because it can range from everything from 2D to 3D and different genre games.
I read and enjoyed this one. I would recommend it to start: http://www.amazon.com/Behavioral-Mathematics-Game-AI-Applied...
It covers basics like game theory and goes into some of the mathematics and some code examples.
Here are some good slides from Valve on how they did Left For Dead http://www.valvesoftware.com/publications/2009/ai_systems_of...
Good luck, have fun
I used this book for a Game AI class and the examples were easy to consume with a good focus on using the methods in real games: http://www.amazon.com/Artificial-Intelligence-Games-Ian-Mill...
A little pricey, but my favorite intro book for this subject.
Funny (and probably a bit off topic) fact : if today I have a coding job it's because when World of Warcraft was all the rage, after a while I started "botting" then wanting to make my bots better I learned to code and a few months later I was enrolling in an IT school. The rest is history as they say.
If you want to interface with games, I would highly recommend looking at Innerspace (company was named Lavish something). My knowledge is from 10 years ago, it might be discontinued though (I'm not botting anymore).
edit : oh btw if someone at Blizzard read this, I would totally pay for 10 accounts on a botting friendly WOW server. I can always dream ;-)
edit 2 : yup they are still in business : http://www.lavishsoft.com/
Not exactly AI, but the Processing language has a 'flocking' tutorial: https://processing.org/examples/flocking.html. There's also a version in ProcessingJS: http://processingjs.org/learning/topic/flocking/
And, from HN a few days ago, Red Blog games has some awesome, in-depth explanations of game-related programming: http://www.redblobgames.com/pathfinding/tower-defense/
Maybe implement Minimax [1] in your favorite language and apply it to a simple game like tic-tac-toe.
There were recently posts about a new Javascript based MMO AI strategy game called Screeps [1]. They are on Indigogo [2] at the moment. Maybe this can be a nice learning challenge...
[2] http://igg.me/at/screeps/x/9209812 (affiliate link, is that allowed? otherwise: https://www.indiegogo.com/projects/screeps).
I took a course on AI at University. The course had a lot of projects around video games. I liked the book we used:
http://www.amazon.com/Programming-Example-Wordware-Developer...
Our final project was super cool. We got into groups. Then each group modified the AI of the soccer team in the book. Then we had a tournament to see who's team was the best. Winning the tournament was one of my prouder moments at school.
Battlecode (https://www.battlecode.org/) is a programming competition run by MIT every January for programming an AI to compete in a game (the exact nature of the game changes every year. It's vaguely Starcraft-like, except completely played by AIs)
It's open to non-MIT students, as well.
They also offer lectures in January which will be streamed on twich.tv - these may be of some interest to you, even if you decide not to compete.
I'm currently working my way through this book Artificial Intelligence for Games [1] and am finding it very approachable for someone with no background in AI.
[1] http://www.amazon.com/Artificial-Intelligence-Games-Ian-Mill...
Take a look at wildfiregames 0ad, if you like RTS. 0ad is an open source RTS, where its easy to write your own AI in JavaScript.
A much bigger challenge would be an AI that is able to walk an avatar in Secondlife. First perhaps easy walk on the roads in mainland, later walk on arbitrary land, and the real challenge is walk inside buildings. A cat bot that does not fall into the lake, might even be a good seller.
I've personally did a school project some years ago writing an AI for Transport Tycoon Deluxe, at the time it was a straightforward api; IDK about tthe current status. At the time though, I quite enjoyed it, also because of the subject matter. Linky: https://wiki.openttd.org/AI:Main_Page
If i'd be on the same quest, i'd first read a lot of articles on gamesutra concerning AI. Here's a quick google search - http://goo.gl/aHZrXj
There are a lot of "handson" examples there from real existing games (with code) and interviews with game developers.
There's also some relevant material in this book, The Nature of Code: http://natureofcode.com/book/chapter-6-autonomous-agents/
I really recommend this article on behaviour trees, it gave me a good intro on how to start with the basic structure of AI - obviam.net/index.php/game-ai-an-introduction-to-behavior-trees/
You should check out CodinGame. I go on there from time to time to mess around with the challenges where you program the AI to do the task presented. Might be a fun way to get in the AI mindset.
What I learned working for Brian Reynolds (Colonization, Civ2, Rise of Natopms. etc...)
Step 1: int result = rand(100); switch (result) { //... do something simple }
Step 2:
Watch the AI until something dumb happens, improve the logic.
I would suggest learning how to use Sekuli to automate games.
Any resources for fighting game AI? (e.g. Mortal Kombat)
I would say that it's best to start with turn-based games, like Bridge or Chess or (shameless plug) Ambition (and if you take on Ambition, let me know how your AIs do). Some games, like Othello, aren't hard to beat. Or you could do one of the German board games if you want to take on a more heterogeneous environment than in, say, Checkers.
This will get you familiar with game AI as a topic. Then you want to take on RTS and FPS games, which are similar but have deadlines (frame rates) and more complexity in the environment. But it's important to get the basics down before taking on a complicated game.
Back in the day I really enjoyed Matt Buckland's AI books.
There's a few really good fun AI challenges that you can get stuck into - Even though they're ocmpetitions and over, you can still get the tools for them http://www.marioai.org/ http://www.sscaitournament.com/index.php?action=tutorial http://www.slideshare.net/coboslab/demolition-derby-2012-gec... http://www.cloudball.se/ http://www.computerpokercompetition.org/ http://aichallenge.org/index.php http://www.botprize.org/ http://aigamedev.com/open/coverage/ctf-report/ http://aibirds.org/ http://geneura.ugr.es/cig2012/competitions.html