GithubHelp home page GithubHelp logo

floriankutz / talonbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a-malone/showdownbot

1.0 3.0 0.0 134.31 MB

Lance: A Competitive Pokemon Battling Bot

JavaScript 99.50% Shell 0.05% HTML 0.15% TypeScript 0.30%

talonbot's Introduction

TalonBot: A Pokemon Showdown AI

Disclosure

Credit goes to the Percymon and LANCE projects built in Node.js, on top of which this AI is built. Percymon is a Pokemon battling AI that runs on the Pokemon Showdown client.

Imgur

Setting up the repository

To set up the server, you need to first install dependencies:

npm install

This project requires Node.js >= 4.x, as it requires ES6 class support.

In order to actually play games you must register an account on Pokemon Showdown. Once the log-in information has been obtained, you need to create an account.json file containing information. The format of account.json is as follows:

{
    "username" : "sillybot",
    "password": : "arbitrary password",
    "message" : "gl hf"
}

The battles themselves take place entirely on the Pokemon Showdown server, so it's best to have a second account with which to use the built-in spectate feature offered by Pokemon Showdown in order to monitor the AI.

The message field indicates the message that will be sent when the bot first connects to the game.

Finally, to start the server, issue the following command:

node bot.js

By default, the server searches for rated OU games when the option is toggled in the web console, which is bound to localhost:3000 by default. There are several command line options that can be supplied:

--console: Only start the web console, not the game playing bot.
--host [url]: The websocket endpoint of the host to try to connect to. Default: http://sim.smogon.com:8000/showdown
--port [port]: The port on which to serve the web console. Default: 3000    
--algorithm [algorithm]', "Can be 'minimax', 'mcts', 'samcts', 'expectimax', 'greedy', or 'random'. Default: samcts
--account [file]: File from which to load credentials. Default: account.json
--nosave: Don't save games to the in-memory db.
--nolog: Don't append to log files.
--startchallenging: Start out challenging, instead of requiring a manual activation first.

talonbot's People

Contributors

rameshvarun avatar harrison8989 avatar a-malone avatar floriankutz avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar pixl avatar

talonbot's Issues

Mirror move shenanigans can't be replicated

In one battle the ai used Mirror move resulting in these log lines:

|move|p2a: Spearow|Mirror Move|p2a: Spearow
|move|p2a: Spearow|Hyper Beam|p1a: Lickitung|[from]Mirror Move

The spearow had to recharge but the volatile was missing. I belive the replication has let spearow use mirror move and then Hyper Beam, and the execution of the secound Hyper Beam let Spearow recharge.

TODO: Debug the replication of that move and fix the issue

Disable not working

So, the idea is that battleroom replicates the server-side battle-object as close as possible. That's why whenever we update our state by running a move, all randomness is removed by overwriting the stuff. However, we don't do it with disable

  • Overwrite the functionality of disable before executing it in battleroom.updatePokemonOnMove

  • Be aware, that the disabled move is random in Gen 1. Look a few lines ahead and see in the next line, what is disabled.

  • Add the disabled move to the target if unknown before disabling it

  • Update the turns left in the same fashion as sleep turns

Add neural network to teamsimulator

Right now the calculator that gives the probabilities for the opponent chosing any options is mocked by giving the same probability for every option. Not good. Add a neural network and find a way to train it properly.

Implement Mimic shenanigans

TalonBot let its Pokemon used Mimic without knowing any of the moves my pokemon has. The AI crashes. Implement all the shenanigans that come with that move.

One PP less than expected

I used 8 Hydro Pumps from my Tentacruel. After the eight the AI crashed because it thaught that the pp were 0. Therefore it seemed impossible for me to use that move again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.