Comments (37)
I'm using Komodo 8 as a tutor if it matters.
from lucaschess.
I use direct prints (running in pycharm or sciteru) or debug when things get tough.
I've been able to replicate the problem, adding sensitivity (999) to tutor (Options/Configuration).
It is necessary to test this previous to menu, because it couldn´t be necessary.
from lucaschess.
I have replaced
line 778:
if (pointsBest - pointsUser) > 0:
with
difpts = self.configuracion.tutorDifPts
difporc = self.configuracion.tutorDifPorc
if self.mrmTutor.mejorRMQue(rmUser, difpts, difporc):
from lucaschess.
I can't test right now, but I still can't understand how this if related to the problem. Please take another look at the debug output. The things break on line 813. The bug is really unpredictable and I really don't know how to reproduce it properly.
BTW I have sensitivity 0 difference in points and 10 in percents.
from lucaschess.
This if determine if the tutor must work.
Previously:
- if difpoints > 0 then:
- if second opportunity (self.chance) then shows a menu:
-----> if you select tutor, then:
-----------> tutor routine test difpoints and difporc, in your case if difporc (10%) is greater than current difference, then exit, and doesn´t show tutor window.
from lucaschess.
Hello Lucas, hello Tico.
I think I've seen this problem before (or a very related one).
I think that if the position is mate and for any reason tutor finds a different mate, this problem appears.
I haven't got time to test your patch, but I have another one I think it can help.
In GestorEntMaq, line 765:
if not siElegido and self.siTutorActivado:
Change for:
mate = jg.posicion.siTerminada() and jg.siJaque
if not siElegido and self.siTutorActivado and not mate:
Then Tutor will never be offered if position is checkmate.
Please give me some time and I'll test the solution more and I'll provide some test cases.
Tico, could you confirm that the problem appears when the position is checkmate?
If not, could you provide a position (FEN) and configuration when the problem appears?
Greetings.
from lucaschess.
I have uploaded the last code.
from lucaschess.
Here's the FEN r1b2bnr/2p2kp1/p1ppp2p/4Pp2/3P4/4B3/PPP2PPP/RN1QK2R w KQ - 0 10
If I play (for instance) pawn to c3 without @lukasmonk's fix from #29 (comment), the click on Show tutor ignored.
If I play this move with the @lukasmonk's fix, no prompt is shown at all unless I play something really stupid like Qd1g4. I guess the difference in score wasn't enough to show the tutor prompt. I should have paid more attention to numbers.:))
from lucaschess.
BTW should it show There are XX best moves if Avaliable hints == 0? It shows now.
from lucaschess.
Another one. I don't know where it comes from.
Traceback (most recent call last):
File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEvent
File "Code\QT\Tablero.pyo", line 1284, in intentaMover
File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File "Code\Tutor.pyo", line 67, in elegir
File "Code\Tutor.pyo", line 160, in hazListaRM
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
from lucaschess.
BTW should it show There are XX best moves if Avaliable hints == 0? It shows now.
I believe it can help to the user, it is a minimal help.
from lucaschess.
Another one. I don't know where it comes from.
Traceback (most recent call last):
File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEventFile "Code\QT\Tablero.pyo", line 1284, in intentaMover
File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File "Code\Tutor.pyo", line 67, in elegirFile "Code\Tutor.pyo", line 160, in hazListaRM
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
This is a problem before changes.
from lucaschess.
This is a problem before changes.
nope, i had this with all your changes. not sure how to reproduce it.
from lucaschess.
I was able to reproduce last exception.
Play against engine of your choice starting with this FEN 1r3kN1/p5pp/2p1Qp2/3P4/2B5/P7/P1PP1PPP/RNB1K2R w KQ - 5 16
against Monkey.
you - e6e7, ignore tutor select my move
monkey - f8g8
you - d5c6
monkey - g8h8
take back twice (you get to the beginning).
play e6e7 again but press show tutor, you should get exception after this.
Traceback (most recent call last):
File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEvent
File "Code\QT\Tablero.pyo", line 1284, in intentaMover
File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File "Code\Tutor.pyo", line 67, in elegir
File "Code\Tutor.pyo", line 160, in hazListaRM
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
from lucaschess.
Wow Tico that was a detailed explanation!, I am able to reproduce the problem too.
This bug has something to do with "The tutor thinks while you think" feature. If you uncheck it, the problem dissapears.
BUT, I think you are running old code (my exception is slightly different from yours) please be sure you are using the last code from GitHub.
Lucas, I think this problem is caused when in the function hazListaRM, the list self.mrmTutor.liMultiPV contains old movements, then self.pgn(desde, hasta, coronacion) inside pb.pgnSP returns None (because the move is impossible in the current board) producing the exception.
I think there is a problem in tutor initialization when "The tutor thinks while you think" feature is on. Im also trying to fix this.
from lucaschess.
I found an easier way to reproduce the problem:
Play against engine of your choice starting with normal starting position against Monkey.
you - a2a4, ignore tutor select my move
monkey - a move
take back once (you get to the beginning).
play a2a4 again but press show tutor, you should get exception after this.
from lucaschess.
I found an easier way to reproduce the problem:
Play against engine of your choice starting with normal starting position against Monkey.you - a2a4, ignore tutor select my move
monkey - a move
take back once (you get to the beginning).play a2a4 again but press show tutor, you should get exception after this.
no exception here. tried Deepfish and Komodo
from lucaschess.
I believe it is fixed.
As fonkap indicated, problem is in relation to tutor working in background, it is not stopped when go back.
I have uploaded new code with the changes.
Thank you very much tico and fonkap.
from lucaschess.
Now it is working perfectly fine for me. Tested both my case and Tico's.
Thank you Lucas!
from lucaschess.
Yes! Perfect! 👍
from lucaschess.
Great help!
from lucaschess.
And another one ;)
Traceback (most recent call last):
File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
self.tablero.intentaMover(self, event.scenePos(), event.button())
File ".\Code\QT\Tablero.py", line 1284, in intentaMover
if not self.mensajero(desde, hasta):
File ".\Code\GestorEntMaq.py", line 816, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File ".\Code\Tutor.py", line 67, in elegir
self.listaRM = self.hazListaRM(posUsuario) # rm,nombre
File ".\Code\Tutor.py", line 160, in hazListaRM
nombre += " " + rm.abrTexto()
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
not sure how to reproduce it yet
from lucaschess.
I have reopen the issue until it is fixed.
from lucaschess.
Unfortunately I can't reproduce the exception. The only thing I know about it, it had Show tutor ()
in popup menu, I guess it means checkmate.
@lukasmonk, since the issue is hard to catch, I think you should release the current version 'coz it has important fixes.
Thanks.
from lucaschess.
problem is in relation to tutor working in background
Can it be similar to this traceback
Traceback (most recent call last):
File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
File ".\Code\QT\Tablero.py", line 1284, in intentaMover
File ".\Code\GestorWashing.py", line 682, in mueveHumano
File ".\Code\Tutor.py", line 67, in elegir
File ".\Code\Tutor.py", line 160, in hazListaRM
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'unicode'
i just got in Washing machine, when after two takebacks I tried to make a move? Sorry, the traceback is a bit crippled, I guess python optimized out all debug stuff out of *.pyo files.
from lucaschess.
In python, traceback doesn´t change when different level of optimization is selected.
Washing machine and takeback, are the main clues.
I have done some changes, but there is yet a problem.
from lucaschess.
I hope it is fixed now.
from lucaschess.
Now it's better! 👍
Something unrelated:
- Open
Opponent for young players
->Albums
-> select any. Click the close button (red cross in top-right corner)
TypeError: closeEvent() takes exactly 1 argument (2 given)
- Are you aware that
PRAGMA page_size = 8192
in your code does nothing 'coz (quote from manual):
The page_size pragma will only set in the page size if it is issued before any other SQL statements that cause I/O against the database file. SQL statements that cause I/O against the database file include "CREATE", "SELECT", "BEGIN IMMEDIATE", and "PRAGMA journal_mode=WAL".
Now program's option databases are created with default 1024 page size. Not a big deal, just for your information.
Speaking of 8192, isn't 4096 is better because it's equal to the most common file system cluster size?
from lucaschess.
- Fixed
- Fixed
Thank you very much.
from lucaschess.
- Fixed
you've missed Code/SQL/Base.py
from lucaschess.
Tools
-> Openings
-> Personal opening guide
First move (button under the chessboard) always
Traceback (most recent call last):
File ".\Code\QT\WBG_InfoMove.py", line 110, in procesarTB
File ".\Code\QT\WBG_InfoMove.py", line 292, in MoverInicio
File ".\Code\QT\WBG_InfoMove.py", line 240, in colocatePartida
AttributeError: 'WInfomove' object has no attribute 'partida'
Previous move (button under the chessboard) if no moves left
Traceback (most recent call last):
File ".\Code\QT\WBG_InfoMove.py", line 110, in procesarTB
File ".\Code\QT\WBG_InfoMove.py", line 303, in MoverAtras
File ".\Code\QT\WBG_InfoMove.py", line 209, in colocate
File ".\Code\QT\WBG_InfoMove.py", line 292, in MoverInicio
File ".\Code\QT\WBG_InfoMove.py", line 240, in colocatePartida
AttributeError: 'WInfomove' object has no attribute 'partida'
from lucaschess.
Fixed both bugs.
Thank you very much
from lucaschess.
Yep, exceptions are eliminated.
I have a question, should LC in the opening guide allow to make a new move if I return some moves back? Just to try another opening. Or it's possible only from the start pressing big Start position button.
BTW First move (button under the chessboard) doesn't remove highlight for current move (blue text) as Previous move does.
from lucaschess.
There are some bugs in relation to this.
I´ll try to fix.
from lucaschess.
Play
-> Play against an engine of your choice
. Make several moves. Cancel
(note: tutor is still pondering), Reinit
, (edit:) make a move, agree to see tutor suggestion.
Traceback (most recent call last):
File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
self.tablero.intentaMover(self, event.scenePos(), event.button())
File ".\Code\QT\Tablero.py", line 1284, in intentaMover
if not self.mensajero(desde, hasta):
File ".\Code\GestorEntMaq.py", line 822, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File ".\Code\Tutor.py", line 67, in elegir
self.listaRM = self.hazListaRM(posUsuario) # rm,nombre
File ".\Code\Tutor.py", line 160, in hazListaRM
nombre += " " + rm.abrTexto()
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'unicode'
from lucaschess.
I believe it is fixed now.
Thank you very much.
from lucaschess.
Tutor stops pondering if I press Help to move
. It resumes after next move. Is that OK?
from lucaschess.
Related Issues (20)
- Cannot compile on Ubuntu 18.04 HOT 2
- Ubuntu 18.04 installation error. HOT 21
- Linux Mageia: Error when executing xcython_linux.sh HOT 6
- Lucaschess not starting up : Ubuntu 18.04
- Lucaschess not running after upgrading to ubuntu 20.04 HOT 9
- It is unclear how to undue theme customisations HOT 2
- Please consider gradually transitioning the codebase into English HOT 1
- It's impossible to add external engines on Linux if their filename doesn't end with .exe HOT 1
- Piece styles as TTF HOT 5
- Live analysis output? HOT 3
- How to start the program on linux ? HOT 2
- Tutor regularly telling me my move is not the best move, and then recommends that same move to me. HOT 3
- Options windows, and especially the Initial Moves window, are rather small HOT 5
- The wait pointer shows when I have the tutor enabled and when *it is my move* HOT 1
- Wait pointer shows when it is my move
- pgn text copy error HOT 5
- search or past a position when browsing opening lines HOT 3
- Request options for making bin books with Polyglot book factory HOT 3
- Feature request: have a live analysis feature like in lichess HOT 1
- Setting up a position and then playing it (1) is rather complex, (2) changes the animations speed; more
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucaschess.