Code Monkey home page Code Monkey logo

battlesim's Introduction

battlesim v2.0 changes:
-Built on Desert's gym-sim modification and fixed a small situational bug. Gym mode can be turned on/off by opening "battlesimlib.py" and changing gymmode =True or =False. If =False it will be attacker vs attacker.
-Individual runs are now run with the command 'python singlesim.py'
-Added a batch CSV mode, where you can get the results of all battles that you put into a CSV very quickly. Run it with 'python batchsim.py', directions will be printed to the command line.
-fixed a bug where some events wouldn't show in log
-fixed a bug where pokemon couldn't tie (can test with identical pokemon for example)
-added the option to have attacker always dodge as long as they were not "busy" during the whole 700ms dodge window. So they will miss a few dodges if they used a long-duration move right before the dodge window for example. Dodges are realistic / 500ms.
-added the option to remove randomness, so that attackers always use charge moves on their 2nd opportunity, and they always wait 2000ms in between attacks instead of random(1500ms,2500ms).
-changed ASCII UI so that attacker is on the bottom left, defender on the top right

how to use:
-individual run, with graphics or log: in cmd prompt, navigate to this folder and type 'python singlesim.py'
-batch run: in cmd prompt, navigate to this folder and type 'python batchsim.py'
-if you move stuff out of the folder, it might not work anymore.
-there are lots of settings that can be changed at the beginning of each file. Open with a text editor and you can change these:
	-in 'battlesimlib.py' graphical = True turns on the ASCII-art battle version.
	-in 'battlesimlib.py' showlog = True shows the log of the battle. It will automatically be on if graphical = True so in that case the value of this variable makes no difference.
	-in 'battlesimlib.py' gymmode = True makes the mechanics work so that the first pokemon chosen is attacker, second is defender, and they battle with real pokemongo mechanics. If False, both pokemon will battle as if they are gym-attackers, simulating a PVP battle.
	-in 'battlesimlib.py' dodgeCMovesIfFree = True means the attacker will dodge ONLY the defender's charge moves. If the attacker was busy during the whole dodge window (like if they used a long charge move at just the wrong time) they will miss the dodge.
	-in 'battlesimlib.py' turnOffRandomness = True makes the defender always use their charge move every other time that they have enough energy. In reality, they just randomly use it 50% of the time when they have enough energy. So turning this on makes the mechanics incorrect but simpler. ALSO, real gym defenders wait between 1500ms and 2500ms randomly between attacks. If turnOffRandomness = True, they will ALWAYS wait 2000ms. Again this is not how gym battles actually work.

battlesim's People

Contributors

caribbean-apple avatar

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.