Open A-Beille opened 1 year ago
Stockfish is a UCI chess engine, so you can send the eval command to get the Evaluation.
@A-Beille
My implementation as below
Win% = 50 + 50 * (2 / (1 + exp(-0.00368208 * CP)) - 1)
This is the percentage of your ELO bar. if current move is black then white Elo = 100-blackElo. with this you can render the elobar.
Read more here - https://lichess.org/page/accuracy
the thing is that here, you get a percentage. If you put 0 centipawns, then the winning rate in percentage is 50%. But that's not what I want: I want to calculate the evaluation from the centipawns given by the engine (like an eval bar)
Thats is correct. You need to apply the calculation on the UI after winning chance, of course when CP =0 win chance=50% because this is also 50% for opposite color.
assume that move is black, and black winning is 50% -> white winning = 100-black winning change
if you get CP = -300 for example. winning chance calculate about 27%. then black = 27%, white = 73%. with this you can easy implement the UI.
Hope that make sense
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: A_Beille @.> Sent: Sunday, 17 September 2023, 5:54 am To: nmrugg/stockfish.js @.> Cc: Truong Nguyen @.>; Comment @.> Subject: Re: [nmrugg/stockfish.js] Evaluation (Issue #77)
the thing is that here, you get a percentage. If you put 0 centipawns, then the winning rate in percentage is 50%. But that's not what I want: I want to calculate the evaluation from the centipawns given by the engine (like an eval bar)
— Reply to this email directly, view it on GitHubhttps://github.com/nmrugg/stockfish.js/issues/77#issuecomment-1722303875, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJA3ITSYLDTWIJ27NSW5Z3X2X7XLANCNFSM6AAAAAA2FAFWKM. You are receiving this because you commented.Message ID: @.***>
Hi, I recently started using this package, and I want to create an evaluation bar of the position using it. How can I manage to do what I want to? Thanks you !