All Projects → Synedh → showdown-battle-bot

Synedh / showdown-battle-bot

Licence: MIT license
Socket Battle Bot for Pokemon Showdown (http://pokemonshowdown.com/)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to showdown-battle-bot

Aiowebsocket
Async WebSocket Client. Advantage: Flexible Lighter and Faster
Stars: ✭ 263 (+1284.21%)
Mutual labels:  socket, websockets, asyncio
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-5.26%)
Mutual labels:  socket, websockets
echo-server
Echo Server is a container-ready, multi-scalable Node.js application used to host your own Socket.IO server for Laravel Broadcasting.
Stars: ✭ 36 (+89.47%)
Mutual labels:  socket, websockets
Real Time Public Chat
This program show how to create a public chat using javascript
Stars: ✭ 45 (+136.84%)
Mutual labels:  socket, websockets
Monocle
PoGo mapper and notifier
Stars: ✭ 122 (+542.11%)
Mutual labels:  pokemon, asyncio
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (+84.21%)
Mutual labels:  socket, websockets
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+1573.68%)
Mutual labels:  socket, websockets
Python Mocket
a socket mock framework - for all kinds of socket animals, web-clients included
Stars: ✭ 209 (+1000%)
Mutual labels:  socket, asyncio
Kalm.js
The socket manager
Stars: ✭ 155 (+715.79%)
Mutual labels:  socket, websockets
Socketcluster Server
Minimal server module for SocketCluster
Stars: ✭ 70 (+268.42%)
Mutual labels:  socket, websockets
PokemonBattleEngine
A C# library that can emulate Pokémon battles.
Stars: ✭ 92 (+384.21%)
Mutual labels:  pokemon, simulator
socketwrapper
Async/Sync networking library including UDP, TCP and TLS/TCP socket classes written in C++ 17.
Stars: ✭ 33 (+73.68%)
Mutual labels:  socket, asyncio
pokengine
An online Pokémon battle system for the web
Stars: ✭ 45 (+136.84%)
Mutual labels:  pokemon, simulator
asynchronous
A D port of Python's asyncio library
Stars: ✭ 35 (+84.21%)
Mutual labels:  socket, asyncio
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+900%)
Mutual labels:  websockets, asyncio
Sockjs
SockJS Server
Stars: ✭ 105 (+452.63%)
Mutual labels:  websockets, asyncio
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+3284.21%)
Mutual labels:  websockets, asyncio
Socketshark
A WebSocket message router based on Python/Redis/asyncio
Stars: ✭ 51 (+168.42%)
Mutual labels:  websockets, asyncio
Vibe Core
Repository for the next generation of vibe.d's core package.
Stars: ✭ 56 (+194.74%)
Mutual labels:  socket, asyncio
Web Socket
Laravel library for asynchronously serving WebSockets.
Stars: ✭ 225 (+1084.21%)
Mutual labels:  socket, websockets

showdown-battle-bot

Socket battle bot for the pokemon simulator Pokemon Showdown. Developped in Python 3.5.X

Requirements

  • python 3.5.X
  • requests
  • asyncio
  • websockets

Supported formats

  • gen7randombattle
  • gen7monotyperandombattle
  • gen7hackmonscup
  • gen7challengecup1v1
  • gen6battlefactory
  • gen7bssfactory

(More upcoming)

Installation

pip3 install -r requirements.txt
./main

How does that works

The bot works in three parts : I/O process, game engine and AI.

I/O process is about sending and receiving datas from Showdown's servers.
Showdown use websockets to send datas, therefor I use them too. Then all I had to do is to follow the Pokemon Showdown Protocol. Tricky part is about connection, the protocol is not very precise about it. To be simple, once connected to the websockets' server, you receive a message formated this way : |challstr|<CHALLSTR>. Then you send a post request to https://play.pokemonshowdown.com/action.php with the <CHALLSTR> but web-formated (beware of special characters) and the ids of the bot. In the answer, you have to extract the assertion part. Finally, you have to send a websrequest this format : /trn <USERNAME>,0,<ASSERTION> where <USERNAME> is the one you gave previously and <ASSERTION> the one you extract just before. For more informations about it, check the login.py file.

Game engine is about simulate battles, teams and pokemons.
For each battle, an object is created and filled with informations sent by Showdown's servers. For the unkowns informations (enemy's team), moves are filled thanks to a file take from source code where moves and pokemons are listed. See data forlder for more informations.

Bot's brain, the AI.
At the moment I write theses lines, the AI is static. It means if you put the bot in the same situation X times, it will act the same way X times. On each turn, a player (here, the bot) has the choice between switch and use a move. To choose the move, the bot "just" calculate the efficiency of each move based on base power, stats, typechart, items and abilities. To choose a pokemon to switch, the bot will parse every of its pokemons and calculate its efficiency based on speed and moves power (same calculus as the above one). All the difficulty of building the bot is to choose between use a move and switch. What I mean here is : I (the bot) know that this pokemon is dangerous, but is it enough dangerous to switch, or attack is more interresting ? Today, this choice is manual. There is a value beyond wich the bot switch. In the long term, I would like to modify this behavior to allow the bot to evolve, based on its previous experiences, but that's hard and I miss some knowledge.

More informations (FR only) : https://drive.google.com/file/d/0B7f94AM8vUSONWIyX1cwOWNVQ1k

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].