How to make engine more tactical and less positional

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

How to make engine more tactical and less positional

Post by maksimKorzh »

Hi guys

I know this topic has been discussed before in some threads and I remember someone was mentioning LMR adjustments, but I can't find that post.
So could someone please kindly explain the general principals of which parts of a search actually influence the tactical vs positional playing style.
And another question is how to adjust the evaluation to force engine start playing in gambit style - something like over evaluating PST meanwhile underrating piece values?

Thanks in advance.

EDIT: by "tactical" I assume the playing style of Fritz5 - fritz12 (before it has absorbed Rybka's playing style)
Last edited by maksimKorzh on Tue Dec 08, 2020 8:45 pm, edited 1 time in total.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: How to make engine more tactical and less positional

Post by jdart »

If you over-value king safety relative to piece values in the eval, you can make the program more prone to making sacs for an attack. However, this will probably make it play more weakly on average against strong opponents because some of those sacs will be unsound.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: How to make engine more tactical and less positional

Post by MikeB »

To add to Jon' point regarding King Safety values , also increase the value of pawns 20%, minors 10%, leaves rooks the same and subtract 10% of the value for queens. It will play weaker, perhaps unsound but should be more interesting. Making those changes with SF against a weaker engine should be fun to watch.
Image
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: How to make engine more tactical and less positional

Post by Ferdy »

maksimKorzh wrote: Tue Dec 08, 2020 8:42 pm Hi guys

I know this topic has been discussed before in some threads and I remember someone was mentioning LMR adjustments, but I can't find that post.
So could someone please kindly explain the general principals of which parts of a search actually influence the tactical vs positional playing style.
:: Search ::

Futility pruning:
Increase futility margin so that even if the move looks bad it will still search that move.
For example when a move is a queen that captures a defended knight that guards the safety of its king,
that move looks bad at a glance, but with a high margin the search will continue and would probably see the tactics behind it if there is.

Null move pruning:
Decrease the depth reduction or add more conditions. Aggressive reduction may result to tactical blindness.

LMR:
Reduce the depth reduction or add more conditions. High depth reduction would drop the search to qsearch early which is not good for tactics.

Razoring:
If this position is not good with some conditions, prune it. For tactics, no don't easily prune it or at least increase the razor margin or add more conditions. Even if current position looks bad still continue searching.
Harald
Posts: 317
Joined: Thu Mar 09, 2006 1:07 am

Re: How to make engine more tactical and less positional

Post by Harald »

Just an idea, not tested:

- Do not use a very big evaluation function. Use a small one with only a few patterns.
Like just using piece square tables, passers, simple mobility and king safety pawn shields.
- Give a high value to an open center with no blocked pawns.
- Give the material a higher weight and the positional evaluation a lower weight.
- For a gambit style count the material value of the first 1 to 7 pawns as 100cp each.
The last (8th) pawn only counts as 50cp or less. Only in the opening/midgame.
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: How to make engine more tactical and less positional

Post by maksimKorzh »

Thank you guys.
Just to clarify - how do you think are these the similar patterns like those used in early Fritz versions? I know Fritz is not open source but maybe there exist some rare references from the authors?
OfekShochat
Posts: 50
Joined: Thu Oct 15, 2020 10:19 am
Full name: ghostway

Re: How to make engine more tactical and less positional

Post by OfekShochat »

sorry if im late. but generally, neural networks are more tactical. just because it is trained on things like, in nnue, more depth, that makes it more tactical because greater depth finds tactical things. or in leela's case, its more tactical because it is trained on game outcome
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: How to make engine more tactical and less positional

Post by maksimKorzh »

OfekShochat wrote: Thu Dec 10, 2020 8:12 am sorry if im late. but generally, neural networks are more tactical. just because it is trained on things like, in nnue, more depth, that makes it more tactical because greater depth finds tactical things. or in leela's case, its more tactical because it is trained on game outcome
Thanks Ofek, but I want to avoid neural networks at any cost))) I'm too dumb to deal with them ;) (recently I've been fighting to learn them but failed every time). Btw I saw your unfinished engine thread - pretty promising project and your C++ is not that bad at all)
OfekShochat
Posts: 50
Joined: Thu Oct 15, 2020 10:19 am
Full name: ghostway

Re: How to make engine more tactical and less positional

Post by OfekShochat »

Oh ok. Thank you so much! I have a problem with nns too for now. I need to convert my keras models to pb files but it doesnt work 😅
Madeleine Birchfield
Posts: 512
Joined: Tue Sep 29, 2020 4:29 pm
Location: Dublin, Ireland
Full name: Madeleine Birchfield

Re: How to make engine more tactical and less positional

Post by Madeleine Birchfield »

OfekShochat wrote: Thu Dec 10, 2020 8:12 am sorry if im late. but generally, neural networks are more tactical. just because it is trained on things like, in nnue, more depth, that makes it more tactical because greater depth finds tactical things. or in leela's case, its more tactical because it is trained on game outcome
maksimKorzh wrote: Thu Dec 10, 2020 10:28 am Thanks Ofek, but I want to avoid neural networks at any cost))) I'm too dumb to deal with them ;) (recently I've been fighting to learn them but failed every time). Btw I saw your unfinished engine thread - pretty promising project and your C++ is not that bad at all)
From my experience, neural network based engines are much more positional than handcrafted engines, because neural networks are able to encode subtle positional concepts in their neural networks that handcrafted evaluations cannot, because we humans simply do not know what those subtle positional concepts, and play especially closed and semi-closed positions very well positionally. Based on that alone, I would argue to stay well away from neural networks if you want a tactical engine.

Leela based neural networks also tend to commit a lot of tactical blunders due to its MCTS search missing precise lines, an issue that alpha beta engines also have if they prune too aggressively, and in general, an issue that all type B strategy engines face.