Questions tagged [ai]

The design and/or logic of how an in-game entity makes decisions about its behavior.

Filter by
Sorted by
Tagged with
80 votes
5 answers
42k views

How does Dwarf Fortress keep track of so many entities without losing performance?

In Dwarf Fortress you can have hundreds of Dwarves, animals, goblins, etc in game at any one time, each with their own complex AI and pathfinding routines. My question is how does this not produce ...
Rory Harvey's user avatar
  • 1,422
11 votes
3 answers
3k views

How do I calculate paths for objects with limited acceleration?

For example, say I have a car and a car has a specific minimum turning radius and I want to drive that car from point a to point b, but the car isn't facing point b. How do I compute a path to point ...
xaxxon's user avatar
  • 484
13 votes
2 answers
16k views

How to calculate shot angle and velocity to hit a moving target?

I am developing a 2D Android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will ...
Guen's user avatar
  • 131
81 votes
9 answers
14k views

How does one prevent homing missiles from orbiting their targets?

I am developing a 2D space game with no friction, and I am finding it very easy to make a homing missile orbit its target. I am curious about anti-orbiting strategies. A simple example is a homing ...
John McDonald's user avatar
58 votes
9 answers
48k views

New to creating AI - where to start? [closed]

I am new to game programming and am trying to make a basic 2d top-down space game with 2 space ships that fight each other. I am doing well with the user controlled space ship, but have no idea how ...
jle's user avatar
  • 727
6 votes
2 answers
1k views

How can I maneuver an AI pirate ship for a sea battle?

I'm trying to picture in my head what would be required to make an AI controlled enemy do the following in a top down pirate sailing game: Approach the player ship Bring player in line with port / ...
Chris Morris's user avatar
13 votes
2 answers
10k views

Predicting enemy position in order to have an object lead its target

In my 2D game I have AI turrets that should assist the player by automatically firing towards enemies. I would like to make them fire intelligently and lead their target instead of just targeting an ...
Kryptic's user avatar
  • 305
8 votes
5 answers
8k views

How to lead a moving target from a moving shooter

I saw this question: Predicting enemy position in order to have an object lead its target. My situation is a little different though. My target moves, and the shooter moves. Also, the shooter's ...
Azaral's user avatar
  • 366
72 votes
1 answer
38k views

Difference between Decision Trees & Behavior Trees for Game AI

What are some differences between Decision Trees and Behavior Trees for AI Game Development? For what applications would you use one over the other?
Free Lancer's user avatar
  • 1,263
50 votes
5 answers
5k views

Looking for a good technique for character movement in hack&slash game

I'm making hack&slash game and I want my characters move like for example in Torchlight, Diablo, etc. Currently I generate set of nodes for all walkable areas of a floor. When I click somewhere ...
piotrek's user avatar
  • 1,388
26 votes
2 answers
26k views

Complex Game AI for Turn-based Strategy Games

I'm doing some research for a turn-based Strategy game project and looking for good resources on this topic. The game is a typical war game where countries can fight each other, deploy units and have ...
BadmintonCat's user avatar
26 votes
5 answers
8k views

Target Tracking: When to accelerate and decelerate a rotating turret?

Say I have a moving circular target defined as: Vector2 position; Vector2 velocity; float radius; And a rotating ...
Andrew Russell's user avatar
24 votes
9 answers
5k views

Is there a simple way to stop enemies standing in the same spot?

So: top-down game, my enemies chase the player, when they get within a certain distance they stand still and fire. If they're all coming from the same direction they all end up standing in the same ...
Iain's user avatar
  • 6,518
11 votes
3 answers
3k views

What should be created first in a video game? [closed]

When starting developing a video game, should one focus on creating the environment (buildings, trees, mountains etc) first or the A.I. (Playable character, NPCs etc)?
Angel Politis's user avatar
3 votes
3 answers
546 views

Ways to make my game world bigger without slowing users CPU

I've been developing my first game for a little while now, but I've found that I want to make the game world MUCH bigger. It's currently about 300*300 tiles, but has creatures and bad guys running ...
user avatar
26 votes
6 answers
6k views

Preempting Behavior Trees

I'm attempting to get my head around behavior trees, so I'm spiking out some test code. One thing I'm struggling with is how to preempt a currently running node when something of higher priority comes ...
me--'s user avatar
  • 942
21 votes
4 answers
7k views

How to implement behavior in a component-based game architecture?

I am starting to implement player and enemy AI in a game, but I am confused about how to best implement this in a component-based game architecture. Say I have a following player character that can ...
ghost's user avatar
  • 1,529
18 votes
2 answers
11k views

Driver AI in racing game

I'm curious how I could control cars in a racing game. Should my AI agent control its car with commands like "throttle on 0.35, steereing wheel on 0.5 right, brake on 0.0"? Or should I rather pre-...
dargemir's user avatar
  • 397
12 votes
2 answers
6k views

Algorithm to shoot at a target in a 3d game

For those of you remembering Descent Freespace it had a nice feature to help you aim at the enemy when shooting non-homing missiles or lasers: it showed a crosshair in front of the ship you chased ...
Sebastian Bugiu's user avatar
12 votes
3 answers
7k views

Moving around/avoiding obstacles

I would like to write a "game", where you can place an obstacle (red), and then the black dot tries to avoid it, and get to the green target. I'm using a very easy way to avoid it, if the black dot is ...
user's user avatar
  • 257
10 votes
2 answers
8k views

Enemy movement in straight line to player in chase game

I'm creating a game where the enemies spawn randomly on a map then move towards the player every frame at a random speed. The map has no obstacles so the enemies should always move in a straight line. ...
user4761's user avatar
  • 103
10 votes
1 answer
2k views

Finding the correct speed for AI to turn to reach goal

I have a ship that travels at max speed maxSpeed and can turn rotationSpeed degrees per second. The ship always moves in the ...
weichsem's user avatar
  • 515
10 votes
6 answers
14k views

Are there any games that contain a machine learning AI? [closed]

Can anybody here give a reference to commercial AAA games that implement a machine learning AI?
Michael IV's user avatar
111 votes
10 answers
9k views

What makes a computer opponent feel alive?

Are there any recommended blogs or whitepapers that talk about making the AI in an RPG game feel more real? (Specifically in turn based combat.) I know something must be out there, but I am only ...
user avatar
21 votes
6 answers
11k views

How to build a "traffic AI"?

A project I am working on right now features a lot of "traffic" in the sense of cars moving along roads, aircraft moving aroun an apron etc. As of now the available paths are precalculated, so nodes ...
Lunikon's user avatar
  • 321
19 votes
6 answers
1k views

What behaviors should go into making a "non-perfect" AI combatant?

When making an npc combatant, it's easy obvious what to do to get a robot deathmachine by optimizing combat tactics, timing and attack types, but harder (and more interesting in a fight) to get an ...
Kzqai's user avatar
  • 1,188
19 votes
1 answer
5k views

Behavior Trees :: Actions That Take Longer Than One Tick

From what I understand on Behavior Trees, each Behavior should be a short goal oriented Action that could be done in a few iterations. So for example, below is an image of a Behavior Tree: Now let ...
Free Lancer's user avatar
  • 1,263
16 votes
2 answers
2k views

Dynamic thruster balancing of space ship

The space ships in my game a meant to be player-built with an arbitrary amount of thrusters attached anywhere with any rotation. I currently have some dirty code to rotate the ship to a given angle (...
Kim's user avatar
  • 161
13 votes
2 answers
3k views

How to implement an intelligent enemy in a shoot-em-up?

Imagine a very simple shoot-em-up, something we all know: You're the player (green). Your movement is restricted to the X axis. Our enemy (or enemies) is at the ...
bummzack's user avatar
  • 22.6k
11 votes
3 answers
1k views

How do I make complex AI manageable? [closed]

In the past, I've used simple systems like finite state machines (FSMs) and hierarchical FSMs to control AI behavior. This pattern falls apart very quickly or any complex system. I've heard about ...
Tetrad's user avatar
  • 30.1k
11 votes
4 answers
5k views

Open Source AI Bot interfaces [closed]

What are some open source AI Bot interfaces? Similar to Pogamut 3 GameBots2004 for custom Unreal Tournament bots or Brood Wars API for Starcraft bots etc. If you could please post one AI bot ...
10 votes
3 answers
2k views

Can I jump from A to B?

I'm making some rudimentary AI for my side-scroller and I need to know whether an AI unit can reach point B from point A simply by taking a jump. Flight trajectory of my characters is a bit unusal as ...
Pythagoras of Samos's user avatar
10 votes
3 answers
3k views

Showing range on hexagonal grid

Here is the situation. I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range. My solution ...
user23673's user avatar
  • 101
8 votes
1 answer
8k views

What are the basics of implementing a Goal Oriented AI?

I am currently developing a nations / factions simulator on a map with in-depth resource system, population system, important characters system.. and this is where I finally met a real obstacle. You ...
Marc Jacob's user avatar
8 votes
5 answers
6k views

Implementing simple proportional navigation for a homing missile

I'm trying to implement the simplest possible form of proportional navigation, i.e, the missile turns in the direction that its bearing-to-target is changing, and once its bearing-to-target is ...
e100's user avatar
  • 319
8 votes
2 answers
7k views

How to find a safe path for an AI snake?

I have been working on a game in which a player can compete with a snake ai to get the most apples. The current path finding technique i use (A* Pathfinding) works fine. But I am struggling with ...
Eudy Contreras's user avatar
7 votes
4 answers
1k views

How to design a turn-based game which is easy for humans but difficult for AI?

Until recently, Go used to be of the last bastions of turn-based no information-hiding games where world-class human players could not be defeated by computers. But now this bastion has fallen, as the ...
Philipp's user avatar
  • 118k
4 votes
1 answer
18k views

How to utilize miniMax algorithm in Checkers game

I am sorry...as there are too many articles about it.But I can't simple get this. I am confused in the implementation of AI. I have generated all possible moves of computer's type pieces. Now I can't ...
engineer's user avatar
4 votes
1 answer
1k views

Space Invaders-type game: Keeping the enemies aligned with each other as they turn around?

OK, so here's the lowdown of the problem I'm trying to solve. I'm developing a game in PyGame that's a cross between Space Invaders and Columns. I'm trying to make the motion of the enemies similar ...
JesseTG's user avatar
  • 1,087
3 votes
3 answers
18k views

How do I write a "Connect Four" AI?

I've made a Connect Four game. The first move is made by the player and the second by the computer. Currently, the computer moves randomly; its moves are generated by C++'s random number generator <...
Connect four's user avatar
1 vote
2 answers
10k views

AI for solving a Match 3 game

Is there a known good way to have a "computer" opponent play a Match 3 game? It doesn't have to be fancy, or even considered fair. If the AI always takes the best move on the board that would be OK ...
user avatar
0 votes
2 answers
1k views

Programming an Artificial Agent in Open Arena [closed]

Does anyone know source example source codes and tutorials to start writing an intelligent bot for Open Arena?
Manni's user avatar
  • 129
123 votes
20 answers
46k views

Is it unethical to make a game AI that is secretly non-competitive?

In several games the AI is designed to give the player an easy time without their knowledge. This can be having a 0% chance to hit the first time you appear, enemy letting you sneak up on them by not ...
PStag's user avatar
  • 1,240
47 votes
9 answers
34k views

How does pathfinding in RTS games work?

[crossposted from stackoverflow] In a game such as Warcraft 3 or Age of Empires, the ways that an AI opponent can move about the map seem almost limitless. The maps are huge and the position of other ...
blankets's user avatar
  • 471
31 votes
6 answers
8k views

Who does the AI calculations in an MMO?

I am building an MMO and want to add NPCs. The thing is I don't know the basic design. What does the calculations, the clients or the server? I would understand the server calculating events and ...
Patrick Lorio's user avatar
23 votes
3 answers
4k views

Command Ordering Architecture of Dwarf Fortress

What is the most elegant way to implement a command ordering system for AI? for example in dwarf fortress when you mark a forested area for wood cutting, the dwarfs then would do the following ...
jedt's user avatar
  • 333
23 votes
6 answers
2k views

Spell casting - How to optimize damage per second

Imagine we have a wizard that knows a few spells. Each spell has 3 attributes: Damage, cool down time, and a cast time. Pretty standard RPG stuff. Cooldown time: the amount of time (t) it takes ...
aaronfarr's user avatar
  • 458
23 votes
3 answers
10k views

How to wire finite state machine into component-based architecture? [closed]

State machines seem to cause harmful dependencies in component-based architectures. How, specifically, is communication handled between a state machine and the components that carry out state-related ...
Pup's user avatar
  • 344
21 votes
3 answers
36k views

How to implement A.I. for checkers/draughts?

I saw this checkers game and I wondered how the A.I. was implemented. How should I implement an A.I. for checkers (draughts, dama, dame)? Are there any known algorithms? Very thnaks full to all. I m ...
Solid Soft's user avatar
19 votes
7 answers
8k views

How do I make A* agents avoid other agents?

I'm implementing a multi agent A* algorithm on a tile map. Agents move only in the X and Y axes. I avoid collisions between them by checking where the others are when calculating paths. It works fine ...
Krzysztof Antoniak's user avatar