Skip to content

tildearrow/pokemon-showdown-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokémon Showdown Client with sound fixes

Introduction

this is a modified version of the official Pokémon Showdown client, with fixes mostly on the sound side.

quoting Zarel:

The main complicated thing we do with sound is loop music with an intro. This is unfortunately not supported by ANY sound library out there (I had to manually add support for it myself to soundManager!)

this fork formerly used Gapless-5 for music, which does exactly what is mentioned above (proper looping)........ except that it doesn't.

therefore, as of now I wrote a whole sound engine for the mere purpose of doing the aforementioned thing.

it also adds more music (of which you have to provide yourself), and specific songs for winning/losing/tie conditions.

oh and sound effects! (again, you have to provide the sound effects yourself).

Browser support

this fork of Pokémon Showdown currently supports, in order of preference:

  • Chrome 57+
  • Firefox 53+
  • Opera 44+
  • Safari 11+

support for WebAssembly is mandatory for the sound engine.

we discourage using Safari. reasons to be written soon.

Testing

you have to build the whole thing.

use ./build full. yeah. building just the main part won't work.

you need node and git, of course.

after finishing, go to testclient.html.

Test keys

For security reasons, browsers don't let other websites control PS, so they can't screw with your account, but it does make it harder to log in on the test client.

The default hack makes you copy/paste the data instead, but if you're refreshing a lot, just add a config/testclient-key.js file, with the contents:

const POKEMON_SHOWDOWN_TESTCLIENT_KEY = 'sid';

Replace sid with the contents of your actual PS sid cookie. You can quickly access this on Chrome through the URL bar:

image image

(This is the only supported method of logging in on the beta Preact client.)

Other servers

You can connect to an arbitrary server by navigating to testclient.html?~~host:port. For example, to connect to a server running locally on port 8000, you can navigate to testclient.html?~~localhost:8000.

NOTE: Certain browsers will convert '?' to '%3F' when reading files off of the local filesystem. As a workaround, try using a different browser or serving the files locally first (ie. run npx http-server from the directory this README is in, then navigate in your browser to http://localhost:8080/testclient.html?~~localhost:8000).

NOTE 2: this version mandatorily uses SSL/TLS for connections, regardless of server. therefore you have to use the SSL port, if any.

Limitations

Even with a test key, the following things will fail in testclient.html:

  • Registering
  • Logging into other accounts (you can still switch to other unregistered accounts and back, though)

Everything else can be tested.

furthermore, I am not sure if this is true anymore. maybe the registering thing, but I and this other tester are able to log in using their respective accounts without any problems.

Warning

you have to provide the songs and sound effects yourself. here is a sample of the tree:

audio/
  bgm/ <-- songs go here, in tildearrow's loop format (see below).
    silence_intro.wav <-- 0.5 seconds of silence, used when running in Safari
    silence_intro.ogg <-- same in .ogg format
    silence_loop.wav
    silence_loop.ogg
  cries/ <-- Pokémon cries go here
  draw/ <-- draw songs go here
  hurry/ <-- "you're in a pinch" goes here. same thing as before.
  lose/ <-- losing songs go here
  moves/ <-- attack sound effects go here
  win/ <-- win songs go here
  notification.wav <-- from http://play.pokemonshowdown.com/audio/notification.wav, used when running in Safari
  test_intro.wav <-- the test song, used for the "Sound test" option.
  test_intro.ogg <-- same in .ogg format
  test_loop.wav
  test_loop.ogg

to provide you with a head start, the silence, test (except wav) and notification files are included.

copy config/audio-template.js to config/audio.js and edit it. read the file for more information.

for the songs, the format goes like this: NUMBER_intro.EXT and NUMBER_loop.EXT. "ambient" versions that play when Dynamax is activated may be added as NUMBERa_intro.EXT and NUMBERa_loop.EXT.

for the files in cries, the format is: NAME.EXT. NAME is the name of a Pokémon. you may get these cries from here (be sure to convert them to Opus as it is the only format the engine is able to load!).

for the files in draw, lose and win, this is the format: NUMBER.EXT.

for the files in moves, this is the format: MOVE.EXT. MOVE is a Pokémon move name, lowercase without spaces.

for the files in hurry, provide:

  • hurry1_intro.EXT
  • hurry1_loop.EXT
  • hurry2_intro.EXT
  • hurry2_loop.EXT

preferably provide "You're in a Pinch!" in hurry1.

for all cases, EXT is wav and ogg.

tildearrow's loop format

this is my format for looping songs. it is very simple.

a song consists of two files, SONGNAME_intro and SONGNAME_loop (SONGNAME being the file name).

the intro file contains the beginning of the song, and the loop file contains the looping part. the extension/format can be any, but the ones that preserve exact length in samples are preferred.

License

Pokémon Showdown's client is distributed under the terms of the AGPLv3.

The reason is mostly because I don't want low-effort proprietary forks that add bad code that steals everyone's passwords, or something like that.

If you're doing anything else other than forking, especially if you want to some client code files in your own open-source project that you want to release under a more permissive license (like, if you want to make your own multiplayer open-source game client for a different game), please ask at staff@pokemonshowdown.com. I hold all the copyright to the AGPLv3 parts and can relicense them to MIT for you.

WARNING: This is NOT the same license as Pokémon Showdown's server.

Footnote

the test song is my saw wave rendition of bth.cracktro1 by blackthorne/TRSI.

About

The client for Pokémon Showdown

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 35.2%
  • TypeScript 31.7%
  • JavaScript 27.1%
  • CSS 4.1%
  • HTML 1.6%
  • NSIS 0.3%