Git Product home page Git Product logo

leftovers-again's Introduction

Hi there 👋

If you're curious about my LED art and other projects, check out my portfolio site at metal-heart.org. I'm the art lead for Hypnodrome, an 11-person collective that builds large-scale LED art for festivals such as Burning Man, Portland Winter Lights, and Lusio.

If you're curious about my code, here are a couple repositories worth looking at:

  • lightdream-pocket: Arduino code for LED projects
    • Technologies: Python, Arduino
  • lightdream-artnet: Play back prerecorded Artnet light shows on a Raspberry Pi 4
    • Technologies: Python, C++
  • ffgl: Some code related to blog posts I wrote on creating effects plugins for Resolume Arena (VJ software)
  • leftovers-again: SDK for building AI opponents for competitive Pokemon matches.
    • A professor reached out to me about using this SDK in his college class on Game AI; I ended up running a tournament for them.
    • This repo was designed with beginner developers in mind, so I focused on giving clear instructions and guiding users through each step of the process for using this SDK.
    • Technologies: Node, CLI, web

leftovers-again's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leftovers-again's Issues

Clones problem

Hi again, I've been having a problem fighting a bot I programmed that has two of the same Pokémon (Dragonair) with identical Levels, EVs/IVs, and moves. When I KO one of them and the bot is about to send out the second, it either gets stuck on "Waiting for opponent..." or the bot forfeits with a "'dead' is true" error. Maybe the bot's getting confused somewhere? Oh, and it was set to switch to random Pokémon and use random moves.

Scrappy bot won't challenge more than 5 new opponents

I'm trying to run a scrappy bot with this package file on a local server with multiple other idle bots waiting.
package.json
The scrappy bot immediately challenged 5 of the waiting opponents, but wouldn't interact with any other opponents afterward unless they challenged the scrappy bot first. I expected the scrappy bot to keep challenging new opponents as it sees them.
This 5-challenge wall seems to stand whether the other idle opponents were already on the server, or if joined later, either all at once or one at a time. Even setting the "matches" parameter to a larger number had no effect.
How can I ensure that one bot stays up to challenge all opponents it sees?

Hidden Power damage calculation

Current damage calculator in game/damage.js doesn't check the hidden power type and always regard the move as normal type.
Quick fix suggestion:

if (move.name.indexOf('Hidden Power')!=-1){
        move.type=move.move.replace("Hidden Power ","");
    }

Wrong Pokemon data after mega-evolving?

Hey Dramamine! First of all thanks for all the work you've put into leftovers-again! I've came across this issue where the bot i've been working on isn't able to detect when the opponent's mon has mega evolved. It still assumes all data (like types, abilities and stats) from the non evolved version of the mon, obviously messing the (already messed up) AI I've been working on, haha. Also, the battle logs on the log folder doesn't show the Pokemon as its mega self too, it just indicates whether it can mega evolve or not (canMegaEvo) at some point in the logs. Now I'm not really sure if this is really an issue or I'm missing something terribly obvious here, but I'm inclined to believe it's the former.

PS: I attached an image showing the issue for your viewing pleasure ;)

image

generate.js script hangs after answering prompts

I'm running the script in git bash on windows, following the instructions in the FAQ. I'm using node v10.14.1.

After answering all the prompts (taking the default values or entering my own values), the script just hangs.

After investigating myself, one of the calls to fs.writeFile is missing a callback in the script. After that, it seems to work, and I get the goodbye.txt message, but it still hangs. I'm investigating this further, but thought I'd open up an issue in case I'm missing something more obvious.

How do I specify the bot's team? And how do I battle that team?

This looks to be a great program, but I'm having some problems. For testing purposes, I want to recreate the first battle between Red and Blue in Pokémon Yellow i.e. Pikachu vs. Eevee. I cannot figure out how to specify the bot's team and how to battle against it. I'm also having problems with it saying the bot will only accept battles and won't challenge users. Would anybody be so kind as to give me the exact code on how to do it?

Battles never make it past turn 7-10

I have just been tinkering around with the project, trying to get two bots to play each other, but every time their battles stop (that is, it just keeps waiting for users) around turn 7-10. I have tried different pre-written bots, and the same thing happens. I don't know where to even start looking for the error since I've only just found this project; I've tried changing the log level but don't notice any difference in the output. Any idea what might be causing this issue? I've attached an example battle log.
lastknownstate-battle-gen7randombattle-18.log

Keep getting Unexpected end of JSON input

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at BattleStore.handleRequest (C:\Users\rokaHakor\Desktop\Folder\node_modules\leftovers-again\src\model\battlestore.js:312:23)

Zoroark causing crashes

Running these:

npm run start:quick -- tiago-duarte --scrappy --matches=1
npm run start:quick -- stabby

I ended up getting this message

             |                  Electrode            | XXXOOO | OOXX?? |            Tentacruel                 | suckerpunch 
BEST POKEMON SELECTED AGAINST OPPONENT!
Found zoroark! replacing him!
TypeError: Cannot read property 'replace' of undefined
    at Pokemon.useCondition (/mnt/PERPETUAL_GAZE/leftovers-again/lib/model/pokemon.js:390:28)
    at Pokebarn.replace (/mnt/PERPETUAL_GAZE/leftovers-again/lib/model/pokebarn.js:89:15)
    at BattleStore.handleReplace (/mnt/PERPETUAL_GAZE/leftovers-again/lib/model/battlestore.js:210:17)
    at BattleStore.handle (/mnt/PERPETUAL_GAZE/leftovers-again/lib/model/battlestore.js:107:29)
    at Battle.handle (/mnt/PERPETUAL_GAZE/leftovers-again/lib/battle.js:121:18)
    at Listener.relay (/mnt/PERPETUAL_GAZE/leftovers-again/lib/listener.js:48:43)
    at WebSocket.handleMessage (/mnt/PERPETUAL_GAZE/leftovers-again/lib/connection.js:72:32)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at Receiver.ontext (/mnt/PERPETUAL_GAZE/leftovers-again/node_modules/ws/lib/WebSocket.js:841:10)

Other bot saw some Zoroark stuff too:

             |                   Primeape            | XXOOOO | OXX??? |            Espeon                     | dazzlingglea
             |                   Primeape            | XXOOOO | OXX??? |            Espeon                     | dazzlingglea
OK, found my zoroark.
             |                 Tentacruel            | XXOOOO | OXX??? |            Espeon                     | dazzlingglea
OK, found my zoroark.
 suckerpunch |                 Tentacruel            | XXOOOO | OXX??? |            Espeon                     | morningsun  
OK, found my zoroark.
 suckerpunch |                 Tentacruel            | XXOOOO | OXXX?? |            Electrode                  |             
Found zoroark! replacing him!
TypeError: Cannot read property 'replace' of undefined

Bot's Pokémon is maxed out despite .js file indicating otherwise

I created a simple test JavaScript file indicating a single Level 5 Eevee but when I fight it, its stats are maxed out as if it were Level 100 with maximum EVs and its Level isn't shown on the screen in Showdown. This also happens with the example bots that come with this program. I tested with the trapper file. Here is my code for the (Gen 1) Eevee:

Eevee
Level: 5
EVs: 1 HP / 1 Atk / 1 Def / 1 SpA / 1 SpD / 1 Spe
- Tackle
- Tail Whip

-damage on Type: Null breaks

I think this Pokemon was named explicitly to screw with javascript programmers.

The problem is handling this message: |-damage|p1a: Type: Null|168/394. Reproduce it like this:

const BattleStore = require('leftovers-again/lib/model/battlestore').default
const store = new BattleStore()
store.handle('-damage', ['p1a: Type: Null', '168/394'])

Tracing it down, it looks like PokeUtil:identWithoutPosition fails because it does a split on the : character.

The error:

/Users/brandonhorst/Projects/showdown-bot/node_modules/leftovers-again/lib/model/battlestore.js:227
      move.prevhp = mon.hp;
                       ^

TypeError: Cannot read property 'hp' of undefined
    at BattleStore.handleDamage (/Users/brandonhorst/Projects/showdown-bot/node_modules/leftovers-again/lib/model/battlestore.js:227:24)
    at BattleStore.handle (/Users/brandonhorst/Projects/showdown-bot/node_modules/leftovers-again/lib/model/battlestore.js:107:29)
    at new Replay (/Users/brandonhorst/Projects/showdown-bot/index.js:128:11)
    at Request.request [as _callback] (/Users/brandonhorst/Projects/showdown-bot/index.js:272:19)
    at Request.self.callback (/Users/brandonhorst/Projects/showdown-bot/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/Users/brandonhorst/Projects/showdown-bot/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)

Gen 7 server?

I am currently trying to set up a gen7anythinggoes bot. It says that that format does exist. I even copypasted the HTML ID of the Gen 7 Anything Goes in the official Pokemon Showdown format popup.

The main server git repo (by Zarel) seems not to work.

Is it possible to update your showdown server fork that is referenced in the docs?

Battles on cyberdyne.psim.us keep crashing

Like this

I tried it on different days, but no luck. When I click "Join Battle", it says the battle already has two players. I can play on play.pokemonshowdown.com just fine though.

Air Balloon not detected?

I don't know if this issue has been patched, but I can't get the opponent's active pokemon's item, even if it should be something revealed such as Air Balloon.

Error during installation

After being asked " What programming language are you primarily using, the program crashes showing this error:

(node:8272) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]:
Callback must be a function
    at maybeCallback (fs.js:124:9)
    at Object.fs.writeFile (fs.js:1244:14)
    at writePackage (C:\Users\NoInfoStealing Zone\Documents\GitHub\Bot Poke\node
_modules\leftovers-again\scripts\generate.js:128:6)
    at inquirer.prompt.then (C:\Users\NoInfoStealing Zone\Documents\GitHub\Bot P
oke\node_modules\leftovers-again\scripts\generate.js:182:3)
(node:8272) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
 id: 1)
(node:8272) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

How do I solve this?

Damage console.error when it's not supposed to?

I'm using the Damage object from /game/damage.js and when I call it, it send the current console error: "missing the stat I need: stats" for every stats that the pokemon should have. The problem is that the pokemon have the stats.
I modified the script to log the value inside the stat that it is trying to acess and after that I do an for (var index in mon.baseStats) just to see if all the stats are there.
What I got was this:

2016-10-03 20_03_13-npm

so maybe it shouldn't log this error?

EDIT: Sorry, I updated the libs and now it doesn't help anymore. I just don't know how to close the issue :(

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.