artificial intelligence - Evaluation function of an abstract strategy game -


i'm coding abstract strategy game c# & xna. ai, i'm using negascout , depth of 5. following description of game:

the game consists of board of 6x7 hexagonal locations, 42 hexagonal tiles, , 6 pieces (1 king & 5 pawns) each player (max 2 players).

during first phase of game, players alternately place random tile on empty location of board. each tile can have maximum of 6 arrows pointing @ edges. arrows can double-pointed. arrows mean direction/s of movement tile. double-pointed arrow makes piece move/jump 2 locations if there's valid location. players not allowed place tiles in opponent's row if there still empty locations left on board.

once phase complete, next player in turn places king on 1 of 6 tiles of row nearest him. next, movement of pieces commences. pieces moved according arrows on tiles. game won capturing or blocking king.

ok, move generation function.

  1. tile placement stage a) place tile on nearest row. tile rotated find optimal rotation. b) once nearest row full, place tile on empty location surrounded locations on sides (ie no edge of board). rotate tile find optimal rotation. c) if no locations found, add remaining empty locations, trying find optimal rotation.

  2. king placement stage a) locate location best tile , place king there. b) place remaining pawns on remaining empty locations on row.

  3. movement stage a) if king attacked, try attack attacking piece if piece not defended. b) add moves player's pieces being attacked. c) add opponent pieces player can attack. d) add locations player can move to.

now evaluation function.

  1. tile placement stage score = no. of tiles current player placed far + current player's tiles on nearest row - no. of tiles opponent placed far - opponent's tiles on furthest row (nearest opponent).

  2. king placement stage score = current player's tiles on nearest row - opponent's tiles on furthest row (nearest opponent).

  3. movement stage score = current player's pieces' value - opponent's pieces' value.

the weighting of tiles 100 every valid location arrow points to. weighting of pieces follows:

piece value = piece type (king = 10000, pawn = 1000) + mobility + defended - attacked - enprise - blocked

where: mobilty = no. of locations node can move (free or occupied opponent) * 1000 defended = no. of current player pieces surrounding piece can move location * 1000 attacked = no. of opponent pieces surrounding piece can move location * 1000 blocked = (king = -10000, pawn = -1000) piece cannot move because arrows point invalid locations , piece has no chance of moving again in game.

quite long, here come problems:

  1. when placing tiles, ai places tile using wrong rotation (ie. places tile in location arrows point no valid locations). occurs in 'home' row.

  2. when moving pieces, ai ignoring king safety. moves king , captured in 4-6 moves.

anybody, chess ai experience, has ideas , suggestions on how improve ai, in particular move generation , evaluation functions?

thanks ivan

btw... if interested in trying out mail, let me know , i'll upload setup on website.

quite long, here come problems:

quite long, indeed.

when placing tiles, ai places tile using wrong rotation (ie. places tile in location arrows point no valid locations). occurs in 'home' row.

in other words, have bug in code. there's no way answer question, extensive preamble. question should in separate, concisely-phrased question includes copy of relevant code.

when moving pieces, ai ignoring king safety. moves king , captured in 4-6 moves.

same above. question can't answered based on extensive preamble you've written.

my advice more concise questions, post details relevant problem, , not combine multiple questions single post.

anybody, chess ai experience, has ideas , suggestions on how improve ai, in particular move generation , evaluation functions?

this overly vague question closed. if want advice code, have provide code in order give helpful answer goes beyond blind speculation!


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -