While this may not seem like a real feat to many, I’m actually really excited about this. For the first time, picoEngine actually made an “informed decision” of what move to make. Granted, it is still making poor decisions, but they are at least no longer random.
Keeping in mind that the only evaluation criteria that I have given the engine is that of material difference, so currently, picoEngine is a hungry hungry hippo, because all it can do is attack any piece that comes within range. The downside to this is it will capture a pawn with it’s queen only to have you take back the queen with the defending pawn. So it is not a very bright engine, yet.
If I want to push it to the next level, there are several things I need to do. Currently, it is only searching 1 ply deep, meaning it checks each available move, and then picks the one move that gains the most points after it’s turn. In an ideal computer setup, you would want it to search multiple ply, as in what will it’s turn yield, and what will the evaluation read after the opponents turn. E.g., will they recapture the queen that you marched down there and stole their pawn with?
The commit is actually in two parts, and you are welcome to check them both out on my GitLab. One of the cool things about the current setup, is it does display the information in standard out, so you can actually see the decision being made first hand. The evaluation looks like this:
2019-02-19 13:40:13.611<–1:Move eval: f6g8 eval -10 places RNBQKBNRPPP–PPP———–Pn——————-pppppppprnbqkb-r
2019-02-19 13:40:13.611<–1:Move eval: f6e4 eval 0 places RNBQKBNRPPP–PPP———–PP—p————n—ppppppprnbqkb-r
Still needs some work, but definitely a step in the right direction!
Linux – keep it simple.
While certainly nothing fancy, I have added a quick material evaluation to picoEngine. Up till now, I’ve been using picoEngine with random moves on. It is an option that by default is off, but the end user can choose to play against the engine in random move mode, where the next move is chosen at random. By default it will now play in “Normal” mode, which tries to make an educated decision.
Of course, the engine does not have a brain, or any essence of being, and thus cannot really “choose” a move. Thus, by educated decision, I really mean a weighted decision. The simplest of all weights is that of material advantage. In this case, I’m using “deca-pawns”, where each pawn is worth 10 points, the nights 30, the bishops 30, the rook 50, the queen 100, and the king 1000 points, respectively.
I don’t intend for this to be the final say in making the decision for picoEngine. At this time, though, I’m really in a position to work out the details of making a decisive move, but to be able to “choose” the best move, it needs some criteria to choose from. Thus, I put in the smallest and simplest criteria I could think of so I could work on the real part of determining how picoEngine will cycle through the available moves in order to pick one to play.
Other good methods of evaluating the board are:
- Space – how much area you control.
- Development – leading or lacking thereof.
- Mobility – the freedom of movement that your pieces enjoy verses your opponent.
- Aggression – the ability to attack your opponent.
- Defense – things like the status of castling, or if your pieces are defended from loss.
And of course, materialism, which is the simplest to implement, as it is basically a count of remaining pieces. The problem with materialism as a goal is that such a machine can be easily tricked with things like a queen sacrifice, but it is a start!
Linux – keep it simple.