An AI bot that plays the game of yinsh.
For the opening game moves, a lookup strategy is to be followed. Find databases of previously played games and check the best moves for placing the rings.
Some common strategies:
- Place the ring at the center
- Block the opponent rings
- One of the rings on the corners
- Rings on separate lines
- Rhombus Arragement
Follow depth limited alpha beta pruning minimax search for upto 6-10(?) plyies.
Detect the point when the end game strategy is to be followed (three rings remaining, probably).
The heuristic function that shall be used for the current project:
h(n) = w1*f1(n) + w2*f2(n) + ... + wk*fk(n)
where,
h(n) -> Heuristic at state n
f1, f2, ..., fn -> Feature values at state n
w1, w2, ..., wn -> Weights of respective features
Probable list of features:
Number of markers in a row of 4OR Number of rows of 4 markers [Both self and opponent] ✔️Number of markers in a row of 3OR Number of rows of 3 markers [Both self and opponent] ✔️- Number of rows that are not flippable in the next move ✔️
- Number of opponent rows that are not flippable in the next move [Both self and opponent] ✔️
- A ring sharing a row of opponent markers
- Number of blocked self rings (and opponent rings) ✔️
- Corner Occupancy
Play two bots with similar features, with the exception of one of the features. One of the bots shall learn and the other shall be learning.
The teacher bot shall be the winner bot from the previous game and the student bot shall improve its features, with respect to the teacher bot. Once the student bot shall start performing better, switch positions.
- Transitional changes for evaluating heuristics
- Random moves with some small probability
- Add ring for player
- Select ring and move to some position
- Select ring + move ring + remove k markers + remove specific ring
- Remove k markers + remove specific ring + select ring + move ring
- Remove k markers + remove specific ring + select ring + move ring + remove k markers + remove specific ring
- Complete get successor function
- More than k in row then we have a choice as to what to remove
- Now move ordering orders the moves when returning
- [] isFlippable calls updateRingPosition(). Can the calls be reduced?