Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (731)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (798)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Gaming AI: The Art of Being Not Too Smart  (Read 4357 times)
0 Members and 1 Guest are viewing this topic.
Offline lifemakers
« Posted 2016-12-12 23:39:53 »

Most games these days have some kind of AI — Artificial Intelligence — for human players to fight against. But just how strong should your game's AI be? Make it too strong and you discourage players; make it too weak and the game will be boringly easy to win.

A popular solution is to put up an easy/medium/hard/insane switch at the start of the game so the players can choose for themselves. But that means burdening the player with a choice they may not be prepared to make. How on Earth am I supposed to know if the "easy" is not too easy for me? Or if the "hard" is even worth trying at my level of skill?

Truth is, people don't want a uniformly smart or uniformly silly opponent. Instead, what they want is an opponent who is engaging. An ideal opponent should match your individual skill: sensing how good you are, it should be playing more or less at your level. Sometimes it would deliberately yield (but never own up, of course!) and sometimes it would challenge you, but overall it would let you progress: not too fast and not too slow — at just the right pace.

In a word, the perfect AI is as smart as needed to keep you interested in the game... for arbitrary values of "you" Smiley

That's the approach we're taking with our new shuffleboard-like game, BATTLE OF THE PUCKS. The goal of the game is to shove one of your pieces so as to drive the enemy's pieces off the board without losing any of yours. And for this kind of game, the AI can be pretty straightforward: it simply runs simulations of a number of randomized shots and chooses the shot that scores best. Already at a few dozens simulations per move, the computer player is virtually unassailable for humans.

However, In BotP, the game's AI spends more of its spare cycles on measuring the optimality of your moves than on calculating its own. Again, the way it does this is by running multiple simulations of the human opponent's every move and its randomized variations:

- If the human didn't score, just how inapt their move was — how far was it from the nearest move that would score? Beginner players' moves tend to be farther off the mark than those by seasoned players.

- If the human did score, how difficult it was — how many of the move's randomizations would have resulted in the same or similar score? If you make a move that scores a ton, but any slight deviation from it would have lost badly, then it might be that you were just lucky — but a more reasonable conclusion is that you play this game very well.

Taking a weighted average of several of your last moves, BotP constantly adjusts its depth of foresight and precision of strikes to match the level you play at. As you master the game, your AI opponent becomes stronger too — never too easy but never too formidable.

It also matters how to weaken a too-strong AI. Perfect unfailing precision is boring, but so is perfect randomness. If you simply add a random fuzz to every AI move, it won't be very engaging: that might feel mechanically stupid, not humanly stupid. Instead, we're giving our game's AI a character of its own that regular players will soon learn and relate to: a variable-but-remembered preference for certain openings, certain directions, certain ways to hit. We humans like entities that we can relate to: entities with their own faces, their own quirks, their own weaknesses that we can learn — and exploit!

Finally, even with the best adaptive AI, it is important to avoid monotony. Having determined the optimal level of smartness, sometimes the program would make a move well above or well below that level. Surprises make the life worth living! Sure, that sudden superstrong move of your opponent — erasing half of your army with a single hit — was a bummer... but, hey, wasn't it beautiful! And soon after that, the AI's amazingly inapt misstrike when you least expected it, just when you were prepared to lose the game... but went on to win... ooh.  

Yes, I want to Play Again!

Wanna try? BATTLE OF THE PUCKS is now available for pre-release testing! Please comment or PM us if interested.  







Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
Archive (336 views)
2017-04-27 17:45:51

buddyBro (534 views)
2017-04-05 03:38:00

CopyableCougar4 (977 views)
2017-03-24 15:39:42

theagentd (1012 views)
2017-03-24 15:32:08

Rule (992 views)
2017-03-19 12:43:22

Rule (972 views)
2017-03-19 12:42:17

Rule (968 views)
2017-03-19 12:36:21

theagentd (1069 views)
2017-03-16 05:07:07

theagentd (990 views)
2017-03-15 22:37:06

theagentd (759 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!