How smogon/pokemon-showdown works
Pokémon Showdown combines a multiplayer game server with a reusable battle simulator and Pokédex library. A player connects to the server, joins chat or a battle room, and uses a selected format and team; the simulator resolves battle turns, while server subsystems handle chat, ratings, tournaments, and community features. The graph includes documented capabilities whose implementations were not sampled, but omits uncertain links between them. Edges are limited to relationships shown in excerpts or the source index; dashed edges mark workflow links not verified in the sampled evidence.
Main entry points: chat.ts Chat and commands · dex.ts Pokédex access · index.ts Server startup · teams.ts Team management
Components 22
Game server
- Server startup
server/index.ts - Socket connections
server/sockets.ts - Chat and commands
server/chat.ts - Rooms
server/rooms.ts
Battle simulation
- Team validation
sim/team-validator.ts - Team management
sim/teams.ts - Battle engine
sim/battle.ts - Random teams
data/random-battles/gen9/teams.ts
Game data
- Formats and rules
config/formats.ts - Pokédex access
sim/dex.ts - Species data
sim/dex-species.ts - Format metadata
sim/dex-formats.ts - Move data
data/moves.ts
Community features
- Ratings and challenges
server/ladders.ts - Tournaments
server/tournaments/index.ts - Moderation
server/punishments.ts - Private messages
server/private-messages/index.ts - Moderation log
server/modlog/index.ts - Chat plugins
server/chat-plugins
Runtime services
- Configuration
server/config-loader.ts - Database utilities
lib/sql.ts
Other components
- Player
Connections 30
- Player → Socket connections: connects to
- Server startup → Socket connections: starts
server/index.ts - Server startup → Chat and commands: initializes
server/index.ts - Server startup → Rooms: initializes
server/index.ts - Server startup → Team management: initializes
server/index.ts - Server startup → Ratings and challenges: initializes
server/index.ts - Server startup → Configuration: loads
server/index.ts - Chat and commands → Moderation: uses
server/chat.ts - Chat and commands → Ratings and challenges: uses
server/chat.ts - Chat and commands → Private messages: uses
server/chat.ts - Chat and commands → Chat plugins: loads
server/chat.ts - Chat and commands → Moderation log: uses
server/chat.ts - Chat and commands → Pokédex access: uses
server/chat.ts - Tournaments → Formats and rules: looks up
server/tournaments/index.ts - Tournaments → Ratings and challenges: uses
server/tournaments/index.ts - Private messages → Database utilities: uses
server/private-messages/index.ts - Moderation log → Database utilities: stores in
server/modlog/index.ts - Formats and rules → Format metadata: defines formats for
config/formats.ts - Formats and rules → Team validation: configures validation
config/formats.ts - Pokédex access → Species data: constructs
sim/dex.ts - Pokédex access → Format metadata: constructs
sim/dex.ts - Pokédex access → Move data: loads data from
sim/dex.ts - Team validation → Pokédex access: reads data from
sim/team-validator.ts - Team validation → Team management: validates
sim/team-validator.ts - Battle engine → Pokédex access: reads data from
sim/battle.ts - Battle engine → Team management: uses
sim/battle.ts - Random teams → Pokédex access: reads data from
data/random-battles/gen9/teams.ts - Random teams → Team management: uses
data/random-battles/gen9/teams.ts - Rooms → Battle engine: hosts battles
- Player → Chat and commands: uses