b0n541 / jskat

JSkat is a free software implementation of the game Skat in Java.

Home Page:https://www.jskat.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cards of the declarer are not made available to the opponents in ouvert games

saescha opened this issue · comments

I am developing an AI just for fun in a fork. Now I wonder, how can the AI react to open cards in a ouvert game? I could not find any method in the knowledge class.

Actually this method is supposed to hand over the ouvert cards of the declarer to the knowledge of every AI player:

https://github.com/b0n541/jskat/blob/develop/jskat-base/src/main/java/org/jskat/player/AbstractJSkatPlayer.java#L232-L234

Apparently my IDE is telling me that this method is never called. Can you confirm?

Maybe this needs to be done here

https://github.com/b0n541/jskat/blob/develop/jskat-base/src/main/java/org/jskat/control/SkatGame.java#L983

in case of Ouvert games or the ouvert cards should become part of the game announcement. That's how it's done on the International Skat Server.

Yes https://github.com/b0n541/jskat/blob/develop/jskat-base/src/main/java/org/jskat/player/AbstractJSkatPlayer.java#L232-L234 seems never to be called. also I think this implementation does not work. getSinglePlayerCards() creates a new CardList and adds the cards from member singlePlayerCards to it. So adding cards there will not change the singlePlayerCards list in the knowledge object.

Further refactoring is needed to move out discarded cards of the declarer from the GameAnnouncement which should not be handed over to the other players.

Finally managed to fix the issue. Sorry for the delay.

You might want to have a look at the pull request before I merge this to develop because the way of doing game announcements has been changed and all AI player need to be adjusted?

#165

Thank you. The PR is big :-) and I still didn't dig deep into the code base at all . I need to see, if I find time. I will merge this change to my fork and check in my IDE, if I will understand the refactor there. And I will do some manual testing. But I don't want to block your merge, as this may take weeks until I have time.

The important change is that the AI player needs to separate in the game announcement the game contract (suit/grand/null game plus modifiers like hand, ouvert, ouvert cards, schneider, schwarz) from the discarded cards that go back to the Skat. The game contract information (including ouvert cards in ouvert games) is then further shown to the opponent players. I suggest to have a look at the already available AI players that have been adjusted. The important classes are called GameAnnouncement and GameContract.