Hot answers tagged

240 votes

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

Game AIs are almost always non-competitive, because if the AI would really try its hardest to win, it would often be unbeatable. An AI is not bound to human limitations like reflexes, accuracy, ...
user avatar
  • 112k
111 votes
Accepted

What is unit slotting?

Slotting is a technique which is used to confront the player with an overwhelming number of enemies and still give them a chance to win. Instead of having all enemies attack at once, there is a ...
user avatar
  • 112k
79 votes
Accepted

Why use convex polygons and not concave ones in path-finding?

A convex polygon has a very nice property: The shortest path between any two points in the polygon, or anywhere on its edges, is just the straight line between those points, and that line segment lies ...
user avatar
  • 114k
68 votes

How to make AI detect a target behind a wall, who is only partially exposed?

This isn't common in all shooter games, but some do go to this level of detail. In Splinter Cell games, for instance, AI can detect Sam's individual body parts. When an AI is performing a detection ...
user avatar
  • 114k
50 votes

Efficiently pathfinding many flocking enemies around obstacles

This sounds like a use case for Flow Fields. In this technique, you do a single pathfinding query outward from your player object(s), marking each cell you encounter with the cell you reached it from....
user avatar
  • 114k
47 votes

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

A game's AI is a part of a game's overall design. At the end of the day, the AI you create needs to complement the game design. If your game is designed around creating a challenging, competitive ...
user avatar
  • 25.8k
42 votes
Accepted

What should be created first in a video game?

The first step is to create a minimum viable product. A MVP is the absolute minimum which can be considered a playable game. It doesn't need any graphics yet except for some placeholders. It should ...
user avatar
  • 112k
35 votes

How feasible is it to integrate a personality system such as the MBTI into a game?

Firstly, you should know that the Myers-Briggs Type Indicator is a proprietary system - if you wanted to use exactly this system in your game you'd need to license it from the foundation that ...
user avatar
  • 114k
33 votes
Accepted

AI for auction bids in the Monopoly game

To determine an auction bid, you need the AI to be able to estimate the value it expects to be able to earn from that property. First then, we need an estimate for how many rounds the game is likely ...
user avatar
  • 114k
27 votes
Accepted

Command Ordering Architecture of Dwarf Fortress

At first you see that your commands are in the form of a list, so your first instinct might be to recreate that structure, and each dwarf will run through that list in sequence. What I suggest though ...
user avatar
  • 14.6k
26 votes
Accepted

When to use a blend tree vs state machine for animation

I've worked quite a bit with Mecanim in Unity, and feel I have a quite good understanding of how it works. Like you say, blend-trees are almost definitely the way to go for doing locomotion. Blend-...
user avatar
  • 606
26 votes

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

As a preface, I'm going to correlate ethics with cheating. If you feel cheated, you feel something unethical has happened to you. In a nutshell, to make your AI's behavior acceptable, make the ...
user avatar
  • 10.3k
23 votes

How to make AI detect a target behind a wall, who is only partially exposed?

If you really want to detect any exposed part of the player, the extreme approach is to simply render the scene from the gun's perspective using replacement shaders, such as the player rendering as ...
user avatar
  • 331
21 votes

A* pathfinding for dynamic obstacles and player made blockages?

I haven't looked at specific implementation of A* by Aaron but with a normal A* you could include the 'block tower' as passable terrain but update the heuristic so that the 'cost' is much higher than ...
user avatar
  • 542
19 votes

How do I make A* agents avoid other agents?

Rather than solving your problem, here's a way to take the lemons and make lemonade. Many years ago a friend of mine was working on a very well-known FPS which had precisely the problem you describe: ...
user avatar
18 votes
Accepted

How do I make A* agents avoid other agents?

You can start by letting the pathfinding fail. On failure, choose a random time in the future to re-try pathfinding. Some low level networking protocols work that way, and quite well. What you have ...
user avatar
18 votes

What is unit slotting?

It's, I guess, about how the enemies run toward the player. Slotting implies that, to let the player survive and give her a chance to continue surviving, enemies coordinate themselves to not attack at ...
user avatar
  • 2,614
18 votes

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

Yes. An AI should stay at the level that it was set to. A chess AI will beat all of us every time, and it's up to us to tune it to something we find enjoyable. I would never want the AI to dumb ...
user avatar
  • 425
17 votes
Accepted

How do I tell if my enemy can see my player?

The dot product of two vectors can tell you if they face each other or not. First vector can probably be the enemies view direction the second one should be a vector pointing from player's position to ...
user avatar
17 votes
Accepted

Driver AI in racing game

We can say that at some level the game is following a pre-computed path. Since the tracks of the racing game are (usually) a pre-computed path anyway. Even if we are talking about generating the ...
user avatar
  • 18.5k
17 votes

AI for auction bids in the Monopoly game

DMGregory gave you a lot of ideas on how to value property. However, your starting point should back up a bit: Design your game engine from the ground up to permit running all-AI games that simply ...
user avatar
13 votes

How can City-sim simulate hundreds of characters?

Like so much of gamedev, the answer to how city sim games accomplish this seemingly-impossible feat is: they probably don't. They're just faking it well. ;) Sims like these will typically operate on a ...
user avatar
  • 114k
12 votes
Accepted

Good way to handle offscreen AI?

A very simple approach is to use "AI Level of Detail." Roughly, this means that you update AI more frequently the closer it is to the player/camera. You can also reduce the complexity of AI ...
user avatar
12 votes

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

I would say no. You see for me games are first and foremost entertainment products. They want to deliver an experience to a specific audience. So it all depends on what experience and to what audience ...
user avatar
  • 2,965
11 votes

Command Ordering Architecture of Dwarf Fortress

If you can make sequences pretty general, there's not much of a spaghetti code. In case of deliveries e.g.: WorkTask operates with a WorkPlan. Workplan says what kind of resource unit must pick, from ...
user avatar
  • 10.1k
11 votes

AI multithreading

Implementing logic by threads is almost always a very bad idea. Multi-threaded programming is difficult! You will run into race conditions and deadlocks resulting in impossible to reproduce bugs. ...
user avatar
  • 112k
11 votes

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

Try to be competitive at a sport with your date, or with your kids. In both cases, you may end up playing that sport alone because you have not made it fun for them. The term Artificial Intelligence ...
user avatar
  • 15.5k
10 votes
Accepted

How do I calculate paths for objects with limited acceleration?

I haven't worked through the full equations for this yet, but here's some visuals to help wrap our heads around the problem. It boils down to some geometry: (Car icons via Kenney) From any given ...
user avatar
  • 114k
10 votes
Accepted

What are the basics of implementing a Goal Oriented AI?

Planning You have a world that has some state, and the agents can do actions that affect that state. Now, you can think of the world state as a node, and the actions are the links. You would not ...
user avatar
  • 18.5k

Only top scored, non community-wiki answers of a minimum length are eligible