Questions tagged [ai]
The design and/or logic of how an in-game entity makes decisions about its behavior.
810
questions
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 ...
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 ...
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 ...
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 ...
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?
69
votes
2
answers
16k
views
What is unit slotting?
I was watching the "Devs Play" S01E05 where JP LeBreton sat down with John Romero and played through Doom, while Romero would explain some of the game/level design choices they made.
There are loads ...
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 ...
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 ...
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 ...
42
votes
1
answer
4k
views
Why use convex polygons and not concave ones in path-finding?
I read in Unity's path-finding documentation that they use convex polygons because there won't be any 'obstruction' between 2 points. Then they add their vertices as nodes along with starting and ...
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 ...
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 ...
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 ...
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 ...
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 ...
23
votes
4
answers
9k
views
How to make AI detect a target behind a wall, who is only partially exposed?
I'm making an FPS game where, even when a target's whole body is behind a wall or box, but its finger or foot exposed, the AI should be able to detect it and shoot its finger.
So far the way I've ...
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 ...
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 ...
23
votes
1
answer
23k
views
Behaviour tree code example?
http://altdevblogaday.org/2011/02/24/introduction-to-behavior-trees/
Obviously the most interesting article I found on this website. What do you think about it ?
It lacks some code example, don't ...
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 ...
22
votes
3
answers
8k
views
Efficiently pathfinding many flocking enemies around obstacles
I'm working on trying to improve the pathfinding for my game's enemies. Right now, they basically just constantly move towards the player's exact position by calculating the angle between themselves ...
22
votes
10
answers
7k
views
Available AI middleware [closed]
A useful list of AI middleware. Please provide URL, free/open-source or licenced, and brief description of abilites.
Format:
*Package* (License)
Link
Pros
Cons
...
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 ...
21
votes
4
answers
24k
views
How can I implement a "20 Questions" algorithm?
Ever since childhood, I've wondered how the 20Q electronic game worked. You think of an object, thing, or animal (e.g. potato or donkey). The device then asks you a series of questions such as:
Is it ...
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 ...
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 ...
21
votes
6
answers
8k
views
Collision 100% avoidance implementation
I'm an absolute beginner with game development and all I know about collision avoidance/resolution, I learnt it on or through this site in the past week... so don't hesitate to correct me if what I'm ...
20
votes
8
answers
13k
views
Imperfect pong AI
So I'm starting to learn Java and some OpenGL while using the LWJGL. To start off easy, I'm writing a clone of the Atari Pong. I got set up correctly the game screen, collision detection, and all the ...
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 ...
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 ...
19
votes
6
answers
3k
views
AI control for a ship with physics model
I am looking for ideas how to implement following in 2D space. Unfortunately I don't know much about AI/path finding/autonomous control yet.
Let's say this ship can move freely but it has mass and ...
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 ...
18
votes
2
answers
6k
views
Why is reinforcement learning not widely adopted as an AI tool for agents in well-known games?
Reinforcement learning has shown remarkable success in game-playing agents, as seen in the achievements of AlphaGo and OpenAI's Dota 2 AI. There are a few tools, such as Unity ML Agents, to integrate ...
18
votes
5
answers
3k
views
Do higher-level 'Pure AI' concepts (such as Neural-Nets or Genetic Algos) ever get implemented successfully in commercial games?
Although graphics is my main area of focus, I've been dabbling with Game AI concepts for quite some time now; from simple A* path-finding to intricate Perceptrons..
My question is this; Does anyone ...
18
votes
8
answers
2k
views
How to demo Advanced Game AI as a portfolio piece?
Basically every Game company wants to see a portfolio that exhibits your skill set. If you're specializing in AI though, what and how should you show off your skills.
Some thoughts
Is nice graphics ...
18
votes
3
answers
910
views
How can I maintain a rectangular formation when units are added or removed?
I've got bots in a rectangular formation with rows and columns. A problem arises when a bot is added or removed from the formation. When this happens, the bots have to rearrange themselves so that the ...
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-...
17
votes
3
answers
4k
views
How feasible is it to integrate a personality system such as the MBTI into a game?
Specifically, how difficult would it be for an indie developer to implement a system similar to the MBTI so that the player character's dialogue, actions, and choices will change, according to the ...
17
votes
6
answers
1k
views
Making the AI take different paths to each other
I have a top down 2d game where the AI spawn at the edges of the map and run towards the center.
I'm using A* and a node mesh to do the pathfinding.
Right now, the AI spawn at a point on the edge of ...
17
votes
4
answers
5k
views
Are square or hex grids better for pathfinding?
Is there any significant difference between using a square or hexagonal grid for the area searched by a path finding algorithm. In other words, is square or hexagonal better, and if so why.
16
votes
3
answers
2k
views
How is AI most commonly implemented in popular games?
I'm no gamedev, I'm just a curious coder of not-games. I wonder, how does AI work in popular modern games, say, FPSs? Is it based on hard-coded rules? How much does it have in common with other kinds ...
16
votes
2
answers
1k
views
AI: Learning vs. Strategizing
I have a theory on AI that I would like to write a "whitepaper" about. The distinction I want to explore in AI is learning vs. strategizing. My question is, where can I read other material about this ...
16
votes
2
answers
1k
views
Good way to handle offscreen AI?
For example sake:
Let's say there are 10 rooms in the world.
And let's say the world is inhabited by 10 entities.
And each entity has it's own "daily routine" where it performs
certain actions in ...
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 (...
15
votes
1
answer
20k
views
When to use a blend tree vs state machine for animation
Im an experienced game dev hobbiest making my first game with 3d animated characters (in Unity) and am struggling to figure out when to use blend trees vs animation state machines. I understand both ...
15
votes
1
answer
3k
views
How do I tell if my enemy can see my player?
Given a player and an enemy with position, and given the direction vector of each, how can I tell if one can "see" the other?
In other words, how do I test if one position with direction is in front ...
15
votes
3
answers
683
views
How can I simulate limited AI vocabulary for a word game?
I've got a small handful of competitive word games in progress, and while the preference is for (mostly asynchronous) play against other human opponents, I'd like to provide players the option of ...
15
votes
3
answers
4k
views
Useful resources for beginning AI [closed]
What resources are available, including both free articles/ebooks and physical books and things, for game developers looking to begin simple AI programming/design?
Note: I know of this question, but ...
15
votes
3
answers
1k
views
AI to move custom-shaped spaceships (shape affecting movement behaviour)
I'm designing a networked turn based 3D-6DOF space fleet combat strategy game which relies heavily on ship customization. Let me explain the game a bit, since you need to know a bit about it to set ...
15
votes
2
answers
3k
views
Is precomputed pathfinding still relevant?
Context
Old Lucas Arts (ScummVM era) point and click graphic adventure games used precomputed pathfinding. Here's a rough outline of the technique.
Step 1
The floor in each room was divided into ...