Questions tagged [game-ai]

Artificial intelligence techniques applied to video games.

Artificial Intelligence in video games is often used to provide behavior for Non Playing Characters or NPCs. The topic is very broad, depending on the game type it can cover:

  • Environment Understanding
    • Visual Stimuli detection
    • Auditory Stimuli detection
    • Space analysis
  • Navigation
    • Path finding
    • Path following
    • Steering Behaviors
  • Knowledge Representation
  • Behavior Selection techniques
    • Finite State Machine
    • Fuzzy State Machine
    • Goal Oriented Action Planning
    • Behavior Tree
  • Multi-Agent communication
    • Group or Squad coordination
  • Tactics and Strategies
  • Animation selection
  • Feedback systems
  • Scripting systems

It generally does not cover topics such as machine learning and parameter optimizations. Since game designers usually want to give a specific experience to the player, we usually rely on techniques that allow designing the behavior rather than having them learned and have little to no control over the decision making.

89 questions
3
votes
1 answer

Implementing and using MinMax with four in row (connect4) game

I'm trying to implement the MinMax algorithm for four in a row (or connect4 or connect four) game. I think I got the idea of it, it should build a tree of possible boards up to a certain depth, evaluate them and return their score, then we just take…
shinzou
  • 5,850
  • 10
  • 60
  • 124
3
votes
2 answers

Alternative to enumerators in AI

I'm working on a server for a multi-player game that has to control a few thousand creatures, running around in the world. Every creature has an AI with a heartbeat method that is called every few ms/s, if a player is nearby, so they can…
Mars
  • 912
  • 1
  • 10
  • 21
3
votes
2 answers

Problems making enemy follow moving player

Okay, so I want to make a javascript/html canvas game where the player is being followed by some enemies, and after a little bit of 'research' her is the most important part of my Monster (enemy) class: this.UpdateAngle = function() { this.dx…
user4205678
3
votes
2 answers

Gamedev: how should I manage the AI using lua scripts?

My game is in C++ and I want to make AI being managed by lua scripts, but I have no idea how should the scripts look like and the integration in C++. Should the script be like if (whatever_happening) do_something if (....) ..... etc And in…
user1873947
  • 1,781
  • 3
  • 27
  • 47
3
votes
2 answers

Efficient collision detection

I am using python and pyglet in a 2d game but I have come across a problem in collision detection. My code to check for collision looks like this: def distance(self,target): return math.sqrt((self.x-target.x)**2 + (self.y-target.y)**2) def…
user1237200
  • 149
  • 4
  • 13
2
votes
2 answers

Advice on writing a solver for Vexed levels

Vexed is a popular puzzle game, with many versions available (some of them GPL free software). It is very suitable for small screen devices; versions are available for Android, iOS, etc. I discovered it on the PalmOS platform. Just for fun, I'd…
steveha
  • 74,789
  • 21
  • 92
  • 117
2
votes
2 answers

Peg Solitaire / Senku solution algorithm

I need to program a solver for the game of Peg solitaire / Senku There's already a question here but the proposed answer is a brute force algorithm with backtracking, which is not the solution I'm looking for. I need to find some heuristic to apply…
Petruza
  • 11,744
  • 25
  • 84
  • 136
2
votes
1 answer

Policy network for the game 2048

I'm trying to implement a policy network agent for the game 2048 according to Karpathy's RL tutorial. I know the algorithm will need to play some batch of games, remember the inputs and actions taken, normalize and mean center the ending scores.…
2
votes
1 answer

Hidden Markov Models instead of FSM in a first person shooter game

I have been working on a course project in which we implemented an FPS using FSMs, by showing a top 2d view of the game, and using the bots and players and circles. The behaviour of bots was deterministic. For example, if the bot's health drops to…
Karan
  • 11,509
  • 8
  • 34
  • 38
2
votes
3 answers

Enemy appear behind player chance 1 on 5

I've written a script that makes the enemy appear behind the player, with a 1 in 5 chance every 3 minutes, I've changed the 1 in 5 chance to a 1 in 1 chance for testing purposes, but I'am unsure if it works. I know how to place the enemy behind the…
MaxSchulz
  • 21
  • 3
2
votes
2 answers

Storing player turn in Zobrist hash

I'm currently implementing a Transposition table in a Chinese Checkers minimax algorithm. In Chinese Checkers, no pieces are captured, and the board is functionally 81 spaces large. Players take turn moving pieces across the board. Part of the…
user3760657
  • 397
  • 4
  • 16
2
votes
2 answers

How do I generate a waypoint map in a 2D platformer without expensive jump simulations?

I'm working on a game (using Game Maker: Studio Professional v1.99.355) that needs to have both user-modifiable level geometry and AI pathfinding based on platformer physics. Because of this, I need a way to dynamically figure out which platforms…
2
votes
1 answer

Create a simple 2D AI C++

I would like to receive some insight as to how I can make an AI, that can walk smoothly around the map(between window size). Like, if the AI reached that defined spot, then it will walk to another spot. Here is what I have tried, First, I get a…
Student
  • 432
  • 2
  • 10
  • 30
2
votes
3 answers

AI Pathfinding in Lode Runner

I'm implementing a version of Lode Runner (this version), but I'm not sure as to how reproduce the effect of minions working cooperatively to corner the player, can it be done using A*, or is there a better approach? Is there a better algorithm for…
C. Porto
  • 631
  • 3
  • 12
  • 26
2
votes
1 answer

Game Programming Newbie -- In Game Objects as Required

I've done some volunteer game programming in LPC for a MUD in my past and everything there was easy. If I wanted a new item I would just use a function to load (for example an NPC) as many times over as I wanted. Now I want to program my own little…