Comments (6)
How about using MJAI protocol to communicate between AI <--> Program
? It has some advantages.
- There are mahjong AI using MJAI protocol. You can use it, or refer it to make new AI.
- MJAI occam: https://github.com/cppmahjang/mjai-occam
- MJAI manue: https://github.com/gimite/mjai-manue
- MJAI silica: https://github.com/wistery-k/mjai-silica
- Also, you can use maujong AI plugin (Akagi, Sigma, etc) via transmau.
- Ruleset of MJAI server and tenhou.net are very similar.
- You can debug your AI at local MJAI server. (without access to tenhou.net)
- Protocol is simple JSON. It is easy to read (+ easy to debug).
And some disadvantages,
- There are no English manual.
- Source codes and libraries about MJAI are written as in ruby.
from tenhou-python-bot.
@0xrgb That does not help.
The point is that AI/AI developer does not need to understand whatever the underlying protocol the game server uses.
Instead, the connector should expose simple and easy-to-understand methods to retrieve the current state of the game.
So the connector should handle communication to server (here I/O with tenhou.ai) and AI should be referring connector to see the current state of the game, and to give a move back to connector.
from tenhou-python-bot.
Thank you for MJAI, I tried to implement my own implementation of mahjong server in earlier versions of the bot, but abandoned this idea because it took too much time to support it.
I think it is a good idea to add another client (https://github.com/MahjongRepository/tenhou-python-bot/blob/master/project/mahjong/client.py) that will work with MJAI (like current client that is working with tenhou).
For AI developer it will mean that he had to run bot with another console attribute and in terms of AI plugin it will be no difference to work with tenhou or MJAI.
Soon I will have time to finish refactoring and do release with 0.3 version which will include stable AI API (it means that current AI will be changed most likely). I think it is had to be done, because people starting to use this bot code to build their own AI.
from tenhou-python-bot.
New version 0.3.0 was released and I tried to simplify new AI development as much as I could. All what you need is create a new package inside game.ai
with main.py file that will contains class:
class ImplementationAI(InterfaceAI):
version = 'my ai'
def discard_tile(self, discard_tile):
# your code here
pass
You can find more details here: https://github.com/MahjongRepository/tenhou-python-bot#implement-your-own-ai
Please, let me know if I missed something that will be useful for you.
from tenhou-python-bot.
This interface contains all available AI methods: https://github.com/MahjongRepository/tenhou-python-bot/blob/master/project/game/ai/base/main.py
from tenhou-python-bot.
Meantime I will work on the mjai client integration, because it will allow to run bots locally. If you have any thoughts how to run it (maybe you already have a script how to run mjai) I will be happy to hear them.
from tenhou-python-bot.
Related Issues (20)
- Crash
- Crash
- Crash HOT 1
- Crash HOT 1
- Strange random
- Generate seeds before the game HOT 1
- Daburi is not chiho
- Don't calculate double yakumans
- Bot doesn't open honitsu hand believing it's atodzuke yakuhai
- hand builder doesn't account for open sets when calculating shanten
- Refactor estimate_hand_value_or_get_from_cache
- Allow same-shanten chi to get yaku
- riichi logic refactoring
- TypeError: can't pickle _thread.RLock objects HOT 2
- Crash [Live dora tiles can't be less than 0] HOT 1
- Open hand for tempai in oorasu when cost is enough to win
- [Question] Why and when socket connections was automatically? HOT 2
- [Question/Need help] How to watch a game based on python-socket communication with tenhou.net HOT 7
- Build pluggable AI HOT 2
- Tenhou Support Receives Bot Complaints HOT 3
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 tenhou-python-bot.