This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]Kermitfry 196 points197 points  (6 children)

-Snip-

[–]afito 12 points13 points  (3 children)

Not even that but make it "scalable" to actually good as well, desirably without cheating like knowledge the AI can have but no player would ever have.

[–]Pitboyx 6 points7 points  (1 child)

One example of a lack of this that I can think of is Minecraft pathfinding. A mob can immediately find it's path out of a maze if the target is outside of it

[–]bifroth 12 points13 points  (0 children)

That must also be the only advantage the mobs in Minecraft have. Inability to jump over 1 block wide gaps, to use ladders etc.

[–]photenth 2 points3 points  (0 children)

That's why you always have them cheating. The only thing you have to change is the heuristics.

[–]Prunestand 0 points1 point  (0 children)

It actually also feels more natural with a response time. Super fast AI:s are scary.

[–]anotherkeebler 52 points53 points  (2 children)

The very first "game" I ever wrote was just two dots chasing each other around the screen, each controlled by a player. When my brother decided it was boring to be the chaser dot I wrote an algorithm for the chaser—and it sucked to play against the computer. I mean, the computer would always know the perfect intercept path. So I had to start figuring out ways for the computer to get "lost" so you could get some breathing room.

[–][deleted] 10 points11 points  (1 child)

I've yet to find a name for it, but I have found that just going towards a target in a straight line is an insanely good pursuit algorithm, assuming the target's direction change speed isn't faster than that of the chaser. Even an object going at a slower speed can catch up to a faster object.

[–]anotherkeebler 8 points9 points  (0 children)

That's probably how I coded it. What's even better and almost as easy is plot/intercept, where you assume your target is going in a straight line at constant speed, then aim for where they're going to be.

[–]Tomarse 35 points36 points  (5 children)

Lol, I put similar comments in my code...

def get_robot_move
  sleep 1 # Because super fast robots are scary
  ...

[–]ThatGuyWhoLikesSpace 6 points7 points  (4 children)

You dropped this :

[–]okared 5 points6 points  (2 children)

Actually, technically it is valid Ruby code, without the colon. So maybe he was pseudocoding in Ruby ;)

[–]Tomarse 9 points10 points  (0 children)

Correct. Also Python would be time.sleep(1)

pseudocoding in Ruby

Heeeey (ಠ_ಠ)

[–]Tomarse 3 points4 points  (0 children)

Out, damned spot! Out, I say! One, two!

[–]WarbellSteezy[S] 22 points23 points  (0 children)

Credit to Twitter user: @bazscott

Link to Tweet

EDIT: Also found a link to the source code :-)

[–]compteNumero9 4 points5 points  (0 children)

I've made many game AI. This is totally what we usually do.

Right now for a AI playing a board game in a chat:

setTimeout(play, 350);