An interactive web-based map for the Vampires! browser game. This application provides a zoomable, pannable grid view of the 100x100 city with all the buildings and locations.
- Interactive Grid Map: 100x100 tile city grid matching the game layout
- Zoom & Pan: Smooth zooming and panning controls
- Building Locations: All transit stations, pubs, shops, and banks marked
- Street Names: Proper street naming system (trees/animals in west, minerals/malaise in east)
- Player Location: Visual indicator of current player position
- Building Information: Click on tiles to see building details
- Game-like Styling: Dark theme matching the original game aesthetic
- Shop and guild location reporting system
- Discord Bot Integration: Automatic shop location reporting from Discord messages
- Slash Command Support:
/parse-shopscommand for retroactive message processing - Multi-user Credit System: Credits multiple contributors for collaborative reporting
Based on the Vampires! browser game:
- City Layout: 100 numbered streets crossed by 100 named streets
- Transit Stations: Located at Mongoose/25th, 50th, 75th; Zelkova/25th, 50th, 75th; Malachite/25th, 50th, 75th
- Buildings: Pubs, magic shops, banks, and hidden locations scattered throughout
- Navigation: Click and drag to pan, use zoom controls, click tiles for info
- TypeScript: Type-safe development
- React: Component-based UI
- Styled Components: CSS-in-JS styling
- Vite: Fast development and build tool
- Node.js/Express: Backend API server
- PostgreSQL: Database for location reports and leaderboards
- Discord.js: Discord bot integration for automated shop reporting
The application includes a Discord bot that automatically monitors a specified Discord channel for shop location updates. When users post shop listings in the configured format, the bot parses the information and reports the locations to the database automatically.
The bot recognizes these message patterns:
***Discount Magic - Beech & 80
Discount Scrolls - Hessite & 80***
Potable Potions - Unicorn & 37
Potion Distillery, right by Wulfenite & 90
Potionworks, right by Flint & 96
The Potion Shoppe - Gloom & 50
Credit: Harleigh, Lannair, Malice, MANTRA
The bot supports crediting multiple contributors for shop locations:
- Credit formats:
Credit:orCredits:followed by comma-separated names - Multiple reports: Each credited person gets a separate report for each shop
- Fallback: If no credits are found, reports are created under "Discord Bot"
Examples:
Credit: Harleigh, Lannair, Malice, MANTRA→ 4 people creditedCredits: Aydan, Joy, Seyda→ 3 people credited- No credit line → Reports attributed to "Discord Bot"
For 4 shops with 4 credited users = 16 total reports created (4 × 4)
The bot includes slash commands for additional functionality:
Process shop locations from a specific message by ID. Useful for:
- Retroactively processing older messages
- Re-processing messages that were missed
- Processing messages that are older than 12 hours
Usage:
/parse-shops message_id:1234567890123456789
Parameters:
message_id: The Discord message ID to parse (right-click message → Copy Message ID)
Features:
- Works on messages of any age (no 12-hour limit)
- Preserves original message timestamp and author information
- Supports the same credit system as automatic processing
- Provides detailed feedback on processing results
Note: You need "Developer Mode" enabled in Discord to copy message IDs.
To enable the Discord bot, add these environment variables to your .env file:
# Discord Bot Configuration
DISCORD_BOT_TOKEN=your_bot_token_here
DISCORD_SHOPS_CHANNEL_ID=1374842471057457312
DISCORD_GUILDS_CHANNEL_ID=1374842501839458334
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=city_crawler
DB_USER=postgres
DB_PASSWORD=your_db_password- Create a Discord Application: Go to the Discord Developer Portal
- Create a Bot: In your application, go to the "Bot" section and create a new bot
- Get Bot Token: Copy the bot token and add it to your environment variables
- Bot Permissions: The bot needs these permissions:
- View Channels
- Read Message History
- Read Messages/View Channels
- Use Slash Commands
- Invite Bot: Generate an invite link with the required permissions and add the bot to your Discord server
- Get Channel ID: Enable Developer Mode in Discord, right-click the target channel, and copy the ID
- Automatic Shop Reporting: Parses Discord messages and reports shop locations automatically
- Multi-User Credit System: Credits multiple contributors per message, creating separate reports for each
- Slash Command Support:
/parse-shopscommand to retroactively process specific messages - 12-Hour Time Limit: Only processes messages less than 12 hours old (automatic monitoring only)
- Street Name Recognition: Converts street names to coordinates using the game's street system
- Error Handling: Comprehensive logging and error handling for Discord operations
- Database Integration: Reports are stored using the same system as manual reports
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser to the displayed URL (usually
http://localhost:5173)
-
Install dependencies:
npm install
-
Set up your PostgreSQL database and run the schema:
psql -U postgres -d city_crawler -f backend/database/schema.sql
-
Configure environment variables in
.envfile (see Discord Bot Integration section above) -
Start both frontend and backend:
npm run dev:full
Or start them separately:
# Terminal 1 - Backend npm run dev:backend # Terminal 2 - Frontend npm run dev
-
Open your browser to the displayed URL (usually
http://localhost:5173)
- Mouse Drag: Pan around the map
- Zoom In/Out: Use the control buttons
- Center on Player: Return to player location
- Click Tiles: Select tiles to see information
- Hover: See coordinate and building tooltips
npm run buildThe built files will be in the dist directory.
This project is for educational and fan purposes. The original Vampires! game is created by RavenBlack.
Currently, the application uses localStorage for persistence, which works well for a client-side application but has limitations:
Current localStorage approach:
- ✅ Simple implementation
- ✅ No server required
- ✅ Fast access
- ❌ Data lost if user clears browser data
- ❌ No sharing between users
- ❌ Limited storage capacity
Potential database options:
Redis: Good for high-frequency updates and caching
- ✅ Very fast read/write
- ✅ Good for real-time features
- ✅ Built-in data expiration (useful for shop movements)
- ❌ In-memory (data lost on restart without persistence)
- ❌ Requires server infrastructure
PostgreSQL: Best for comprehensive data management
- ✅ ACID compliance and data integrity
- ✅ Complex queries and relationships
- ✅ User accounts and permissions
- ✅ Historical data tracking
- ✅ Robust backup/recovery
- ❌ More complex setup
- ❌ Requires server infrastructure
Recommendation: For production use with multiple users, PostgreSQL would be ideal for storing reported locations, user accounts, and historical data, with Redis as a cache layer for frequently accessed location data.
To clear test data during development, open browser console and run:
// Clear all reported locations
localStorage.removeItem('vampire_city_reported_locations');
location.reload();