Answers.Body: <p>Yes. You can download the source code for Stockfish <a href="https://stockfishchess.org/files/stockfish-10-src.zip" rel="nofollow noreferrer">here</a>. Once you have done that you need to work out where the evaluation functions are and change them according to your requirements. Then recompile and run.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-12T18:19:50.620Z
Answers.Text: For example, types.h contains the generic values of the pieces, which are easily adjusted. psqt.cpp is where you can edit how much standing on e5 or d5 is worth. It assumes symmetry, though, so d5 and e5 will be the same (and those values would apply to d4 and e4 for the other color) unless you make more substantial changes. When two values are listed for something, often one is for the middlegame and one is for the endgame.
Answers.UserDisplayName: D M
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-12T17:51:26.057Z
Answers.LastActivityDate: 2019-05-12T17:51:26.057Z
Answers.UserDisplayName: Brian Towers
Body: <p>I am curious of the games that would arise if I changed the initial  value of a knight to -1 or make standing on e5 worth -10 points.  </p>
  
  <p>How would I go about to create such an engine? Is it possible to alter an  existing engine in such a way and let it play against itself? </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-12T17:27:23.637Z
Comments.Text: Depends on the engine. Did you have one in mind?
Comments.UserDisplayName: D M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-12T17:29:40.340Z
Comments.Text: No, and I have no (concrete) idea about the internal workings of engines. I only know some programming (Python, C++). Would you have any suggestions?
Comments.UserDisplayName: B.Swan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-12T17:43:28.280Z
Comments.Text: Knowing that you know some programming is helpful, since it means you could modify those values in any open-source engine.
Comments.UserDisplayName: D M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-12T19:08:01.887Z
Comments.Text: Some engines might allow you to do that via the UCI configuration.  Check with your favorite engines.
Comments.UserDisplayName: Qudit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-13T15:25:17.927Z
Comments.Text: I have managed to do it, when setting the knight value to the same, but negative, they surprisingly become the strongest pieces on the board and wreak havoc while the opponent refuses to capture them.
Comments.UserDisplayName: B.Swan
Tags: <engines>
Title: Is it possible to manually alter initial values in a chess engine?
ThreadText: # Is it possible to manually alter initial values in a chess engine?
  
  (Asked by: username_0 on 2019-05-12)
  
  I am curious of the games that would arise if I changed the initial value of a knight to -1 or make standing on e5 worth -10 points.
  
  How would I go about to create such an engine? Is it possible to alter an existing engine in such a way and let it play against itself?
  
  **Tags:** engines
  
  > **Comments:**
  > **username_1**: Depends on the engine. Did you have one in mind?  
  > **username_0**: No, and I have no (concrete) idea about the internal workings of engines. I only know some programming (Python, C++). Would you have any suggestions?  
  > **username_1**: Knowing that you know some programming is helpful, since it means you could modify those values in any open-source engine.  
  > **username_2**: Some engines might allow you to do that via the UCI configuration.  Check with your favorite engines.  
  > **username_0**: I have managed to do it, when setting the knight value to the same, but negative, they surprisingly become the strongest pieces on the board and wreak havoc while the opponent refuses to capture them.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-05-12. Score: 3 | Accepted answer
  
  Yes. You can download the source code for Stockfish [here](https://stockfishchess.org/files/stockfish-10-src.zip). Once you have done that you need to work out where the evaluation functions are and change them according to your requirements. Then recompile and run.
  
  > **Comments:**
  > **username_1**: For example, types.h contains the generic values of the pieces, which are easily adjusted. psqt.cpp is where you can edit how much standing on e5 or d5 is worth. It assumes symmetry, though, so d5 and e5 will be the same (and those values would apply to d4 and e4 for the other color) unless you make more substantial changes. When two values are listed for something, often one is for the middlegame and one is for the endgame.  
  
  ---
  
  