The goal of this project is to build a Pokemon showdown client that offers a better user experience than the default client.
By building in Go with Wails, we get the following benefits:
This projects seeks to be an improvement over the default showdown client. However, before it can surpass the default client, it must reach feature parity. The Roadmap below provides a general outline of the big milestones of this project.
Milestones will be as follows:
Sliggooey is a play on words of Sliggoo, the pokemon, and "GUI" (If you're not in the know, many people pronounce GUI as "Gooey" rather than "gee yoo eye").
This project is built in Go 1.18 with a Svelte-Typescript front end with Wails version 2
Contributions are welcome and appreciated. Make an issue, a PR or hit me up on Twitter if you have an idea for a feature to add (or just want to help this get to version 1.0). Not sure where to start? Check out the todo doc.
See the Pokemon Showdown websocket protocol and api reference here: Showdown Protocol
This Project uses Taskfile for automation. It can be installed with go install github.com/go-task/task/v3/cmd/task@latest
task dev
(do this for first time setup too - it will populate frontend/dist, frontend/wailsjs, and create the build/directory)npm run dev
from the frontend
directorywails dev
, the front end is also accessible from localhost:34115
in your browsertask gen
task build
task
or just read the Taskfile.yml
The websocket client sits in the Go backend. this allows it to be multi-threaded and more performant than if it were a front-end client.
the front-end should be display only. Anything that requires parsing should be handled in the backend. This helps keep the front-end focused on style and usability over code and maintainability. (the less Typescript the better! Lean in to what svelte and wails provide hard). Typescript was chosen to align with Go's stricter typing. It should never be difficult to tell what should go in our out of an IPC call to Go.
If the contents of a message need to go the front end, then should be prompted by emitting a wails event.
Sending messages is done through a direct function call.
Backend events are emitted to permanent components in the front end. If a component can be created or destroyed dynamically, a permanent front end component must receive the event and propagate it to the volatile component over a custom ui topic.
loginFail
loginSuccess
formats
pm
newRoom
roomMsg
popup
challenged
challengeEnd
Examples of how to get images of pokemon... from the showdown server
Pokemon Sprites Pokemon Spritesheet
Have to do math based on pokedex number or something similar to get the right spot
40 by 30 pixels in size
how to extract sprite from sprite sheet (12 sprites per row, 0 based index thanks to missingno #0 - sliggoo is #705. 59th row (30px per row 58 x 30 = 1740px), 10th column (40px per column 9 x 40 = 360px)
<img style="width:40px; height:30px; background: url(https://play.pokemonshowdown.com/sprites/pokemonicons-sheet.png) transparent no-repeat scroll -360px -1740px;">
Generation 5 animated sprites (not available for all gen 6+ pokemon)
Generation 4 and below have no back fill of new pokemon sprites