vPet Engine is a commercial‑grade virtual pet platform from the mid-2000s, built to power entire communities. Adopt and care for pets, train and battle, run user shops and auctions, and grow your wealth with banking, lotteries, and a sprawling item ecosystem. Clubs, forums, mail, galleries, and daily rewards round out a social world designed to keep players engaged for months.
With thousands of polished assets and a highly modular codebase, it supports multiple game instances from one engine—complete with cooldowns, IP logging, and admin tools. It’s an ambitious snapshot of the virtual-pet boom, ready for restoration with modern security and a fresh coat of UX.
Name: vPet Engine
Version: 2.1
Developer: DADE
Released: September 21, 2006
Genre: Virtual Pet Simulation
Type: Browser-based pet management game
License: Commercial/Proprietary
---
Total Files: 3,889 (!!)
File Breakdown:
Total PHP Lines: 24,884
Database Schema: 4,185 lines, 109 TABLES!
Average File Size: 61 lines per PHP file
Key Files:
petgame.sql - 4,185-line database (HUGE!)config.inc.php - Configurationglobal.inc.php - Global includesheader.inc.php - Header/sessionfunc.lib.php - Function libraryindex.php - Homepage with image mapadopt.php - Pet adoption centerTechnology Stack:
---
vPet uses excellent file organization:
`
vpet_v2.1/
├── Script/ # All PHP code
│ ├── config.inc.php # Configuration
│ ├── global.inc.php # Global setup
│ ├── globals.inc.php # More globals
│ ├── header.inc.php # Header/session
│ ├── func.lib.php # Function library
│ ├── connect.php # Database
│ ├── custom.inc.php # Customization
│ ├── showpage.inc.php # Page display
│ ├── random_events.inc.php # Events
│ ├── ghetto_cron.inc.php # Cron jobs
│ ├── package_check.inc.php # Package validation
│ │
│ ├── index.php # Homepage
│ ├── login.php # Login page
│ ├── login.pro.php # Login processing
│ ├── register.php # Registration
│ ├── register.pro.php # Registration processing
│ ├── logout.php # Logout
│ │
│ ├── mypets.php # My pets page
│ ├── adopt.php # Adoption center
│ ├── getpet.php # Get starter pet
│ ├── user_pets.php # View user pets
│ ├── pet_desc.php # Pet description
│ ├── pet_names.php # Pet naming
│ │
│ ├── shopping.php # Shopping
│ ├── shops.php # Shop listing
│ ├── myshop.php # My shop
│ ├── usershop.php # User shop view
│ ├── makeshop.php # Create shop
│ ├── buy_item.php # Buy item
│ │
│ ├── bank.php # Banking
│ ├── open_account.pro.php # Open account
│ ├── bank_transaction.pro.php # Transactions
│ │
│ ├── battle_center.php # Battle center
│ ├── battle_1player.php # 1v1 battles
│ ├── battle_waiting.php # Battle matchmaking
│ ├── battling_1p.php # Battle in progress
│ │
│ ├── clubs.php # Club listing
│ ├── club.php # Club page
│ ├── club_forums.php # Club forums
│ ├── club_create.php # Create club
│ │
│ ├── forums.php # Global forums
│ ├── mail.php # Mail system
│ ├── gallery.act.php # Gallery
│ ├── auctions.php # Auction house
│ │
│ ├── games.php # Mini-games
│ ├── lottery.php # Lottery
│ ├── slots.php # Slot machine
│ ├── trivia.php # Trivia game
│ ├── scratch_n_win.php # Scratch cards
│ ├── penny_play.php # Penny arcade
│ │
│ ├── feed.act.php # Feed pet
│ ├── play.act.php # Play with pet
│ ├── heal_pet.act.php # Heal pet
│ ├── train_pet.act.php # Train pet
│ │
│ ├── admin/ # Admin panel
│ │ └── [Admin files]
│ │
│ └── [200+ more files!]
│
└── Pic/ # Images
├── Items/ # Item images
│ └── [GIF images]
└── vPets/ # Pet images
└── [GIF images]
`
Database Connection (global.inc.php):
`php
ob_start();
include "globals.inc.php";
$con=mysql_connect($db_server,$db_username,$db_password);
mysql_select_db($db_name,$con);
include "func.lib.php";
srand((double)microtime()*1000000);
$getGame = fetch("SELECT * FROM game_tables WHERE id = '$game'");
$game = $getGame[id];
$gameName = "$getGame[game_name]";
$pointVar = "$getGame[point_var]";
$getInfo = fetch("SELECT * FROM members2 WHERE username = '$HTTP_COOKIE_VARS[$userCookie]' AND password = '$HTTP_COOKIE_VARS[$passCookie]' AND game = '$game'");
$username = $getInfo[username];
$display_name = $getInfo[display_name];
$userid = $getInfo[id];
$points = $getInfo[points];
$rank = $getInfo[rank];
?>
`
Authentication (login.pro.php):
`php
$encrypted_password = md5($login_password);
$check = fetch("SELECT username,password FROM members2
WHERE username = '$login_username'
AND password = '$encrypted_password'
AND game = '$game'");
if ($check[username]) {
setcookie("username_$game",$check[username],time()+2678400);
setcookie("password_$game",$check[password],time()+2678400);
header("Location: $base_url/index.php?game=$game");
}
`
Multi-Game Support:
`php
// Supports multiple pet game instances!
$game = $_GET['game'];
// Each game has separate:
// - Point variable names
// - Game settings
// - Member tables (members2, user_pets2, etc.)
`
---
Core System (10 tables):
game_tables - Multi-game configurationmembers2 - User accountsmembers_profiles2 - Extended profileschecking2 - Action cooldown trackingonline - Who's online trackingip_log - IP address logginghits - Hit counterblocked_users2 - Blocked userscustom_designs - Custom page designscurrent_locations - User locationsPet System (20+ tables):
user_pets2 - Player petsvPets - Pet species/typespet_colors - Color variationsuser_pet_items - Pet equipmentpet_battles - Battle recordspet_moods - Mood systemnursery - Pet breedingadoption - Adoption centerfishable_pets - Catchable petssearchable_pets - Findable petsItems & Shopping (15+ tables):
items - Item databaseuser_items - Player inventorydaily_items - Daily freebiesfood_items - Pet foodtoy_items - Pet toysbook_items - Reading materialsbattle_items2 - Battle itemsshops - User-created shopsuser_shops - Shop inventorydiscounts - Sale pricingpenny_store - Penny storesales_log - Transaction loggingstock_market - Item tradingBanking (5 tables):
bank2 - Bank accountsbank_transactions - Transaction historychecking - Account checkingsavings - Savings accountsloans - Loan systemAuctions (3 tables):
auctions2 - Active auctionsauction_bids - Bid historyauction_log - Auction recordsBattles (10+ tables):
b2p_battles2 - Pet vs Pet battlesb2p_tables2 - Battle matchmakingbattle_challenges2 - Challenge systembattle_items2 - Battle equipmentbattles_1p - 1-player battlesbattle_log - Battle historyattacks2 - Attack movesClubs (10+ tables):
clubs2 - Player clubs/guildsclub_members2 - Membershipclub_forums2 - Club forumsclub_pages2 - Custom club pagesclub_status - Club activityclub_invites - Invitationsclub_ranks - Rank hierarchyCommunication (10+ tables):
mail - Private messagesmail_folders - Mail organizationforums - Global forumsforum_threads - Forum threadsforum_posts - Forum postsglobal_forums - Cross-game forumschat - Chat systeminstant_messenger - IM systembuds2 - Friends listnotices - System noticesGames & Activities (15+ tables):
lottery - Lottery systemslots - Slot machinetrivia - Trivia questionstrivia_answers - Answer trackingpenny_games - Penny arcadescratch_cards - Scratch-n-winsnake_eyes - Dice gamecompetition - Competitionsquests - Quest systemexplore_areas - Explorationfishing - Fishing minigamesearching - Item searchingtraining - Pet trainingdaily_five2 - Daily bonus #1daily_four2 - Daily bonus #2daily_three2 - Daily bonus #3Galleries (5+ tables):
galleries - User galleriesgallery_images - Gallery picsgallery_comments - Commentssafety_box - Storagecustom_codes - Custom HTML/CSSSupport & Admin (10+ tables):
support_tickets - Help deskstaff - Staff accountsadmin_log - Admin actionsbans - Ban systemwarnings - Warning systemreports - User reportsupdates2 - News updatesbirthdays - Birthday trackingreferrals - Referral systemvote_sites - Voting rewardsMiscellaneous:
messages2 - System messagesgame_pages - Custom pageslists - Various listsrules - Rules/TOSprivacy - Privacy policy---
Pet Adoption:
Pet Stats:
Pet Care:
Pet Actions:
Thousands of Items:
Item Sources:
Inventory:
Currency:
Banking:
User Shops:
Auctions:
Pet vs Pet (PvP):
Battle Items:
Attack System:
Battle Challenges:
Clubs (Guilds):
Communication:
Profiles:
Gambling Games:
Skill Games:
Pet Activities:
Daily Bonuses:
Cooldown System:
`php
$checking = "adoption";
$limit1 = 3600; // 1 hour cooldown
$limit = $timestamp - $limit1;
$findCheck = fetch("SELECT * FROM checking2
WHERE userid = '$userid'
AND check_what = '$checking'
AND timestamp > '$limit'");
`
Actions with cooldowns:
User Galleries:
Safety Box:
Multiple Pet Games:
`php
// Each game instance has:
$game = $_GET['game']; // Game ID
// Separate settings:
`
Cross-Game Features:
---
1. MD5 PASSWORD HASHING ✓
`php
$encrypted_password = md5($login_password);
$md5pass = md5($reg_pass1);
`
2. SEPARATE CONFIG FILE ✓
`php
// config.inc.php
$db_server = "localhost";
$db_username = "isiamovne_dsl";
$db_password = "fg54hj28fg";
$db_name = "isiamovne_dsl";
`
3. RANK-BASED ACCESS CONTROL ✓
`php
$rank_check = 1; // Require login
if ($rank < $rank_check) {
die(header(error("login.php","$noAccessError")));
}
`
4. IP LOGGING ✓
`php
$getIP = fetch("SELECT id,ip_addr FROM ip_log
WHERE userid = '$userid'
AND ip_addr = '$REMOTE_ADDR'");
if (!$getIP[id]) {
mysql_query("INSERT INTO ip_log
VALUES ('', '$userid', '$REMOTE_ADDR','$game')");
}
`
5. COOLDOWN SYSTEM ✓
1. MD5 IS DEPRECATED (MEDIUM)
2. NO SQL INJECTION PROTECTION (CRITICAL)
`php
// Direct variable insertion!
$findPet = fetch("SELECT * FROM user_pets2
WHERE adoption = '1'
AND id = '$id'
AND game = '$game'");
// $id comes from $_GET, unsanitized!
`
3. COOKIE-BASED AUTHENTICATION (MEDIUM)
`php
setcookie("username_$game",$check[username],time()+2678400);
setcookie("password_$game",$check[password],time()+2678400);
$getInfo = fetch("SELECT * FROM members2
WHERE username = '$HTTP_COOKIE_VARS[$userCookie]'
AND password = '$HTTP_COOKIE_VARS[$passCookie]'");
`
4. DEPRECATED MYSQL FUNCTIONS (MEDIUM)
`php
mysql_connect()
mysql_query()
mysql_fetch_array()
`
5. NO CSRF PROTECTION (MEDIUM)
6. NO XSS PROTECTION (MEDIUM)
`php
print "$findPage[page_info]";
// User content displayed raw
`
7. REGISTER_GLOBALS RELIANCE (HIGH)
`php
// Uses $HTTP_COOKIE_VARS (deprecated)
// Relies on register_globals behavior
`
8. NO INPUT VALIDATION (HIGH)
---
vPet Engine represents commercial virtual pet platform:
Release Context:
Virtual Pet History:
Technical Achievements:
Installation Guide:
`
vPet Engine V2.1 Installation Guide
`
Restrictions:
---
FULLY IMPLEMENTED:
User registration/login
MD5 password hashing
Multi-game support
Pet adoption system
Pet care (feed, play, heal)
Pet stats (level, hunger, attitude)
Inventory system (unlimited)
Item database (thousands!)
User shops
NPC shops
Auction house
Banking with interest
Pet vs Pet battles
Attack system
Club system (guilds)
Club forums
Global forums
Private mail
Friends list
Instant messenger
Chat system
Gallery system
Quest system
Lottery
Slot machine
Trivia game
Scratch cards
Dice games
Fishing minigame
Pet searching
Exploration
Training
Daily bonuses
Cooldown system
IP logging
Birthday tracking
Referral system
Who's online
Admin panel
Support tickets
News/updates
Custom pages
Custom designs
Premium membership
UNCLEAR:
⚠️ Pet breeding (nursery exists)
⚠️ Pet mood system (table exists)
⚠️ Stock market mechanics
MISSING:
None! Everything implemented!
What Works:
Minor Issues:
---
| Game | Tables | Lines | Complexity |
|---|---|---|---|
| Vallheru | 89 | ~10,000 | High |
| Voided Alliance | 21 | 747 | Medium |
| Vice Warz | 33 | 644 | Medium |
| vPet Engine | 109 | 4,185 | HIGHEST! |
| Game | Images | Notes |
|---|---|---|
| Voided Alliance | 203 | Previous leader |
| Vallheru | ~100 | Moderate |
| Vice Warz | ~100 | Moderate |
| vPet Engine | 3,468! | 17x more! |
| Game | Files | Main File | Organization |
|---|---|---|---|
| Voided Alliance | 44 | 7,321 lines | Monolith (2/10) |
| VA-RPG | 54 | 7,277 lines | Monolith (1/10) |
| Vallheru | 568 | Distributed | MVC (10/10) |
| vPet Engine | 410 | Modular | Excellent (9/10) |
Only Game With:
---
Breakdown:
The Virtual Pet Platform:
Technical Achievement:
Influence:
Challenges:
Revival Strategy:
Worth It?
---
vPet Engine is THE MOST COMPLETE GAME in the entire 79-game collection:
By The Numbers:
What Sets It Apart:
The Paradox:
Comparison:
vPet Engine perfected the 2006 pet site formula:
Core Loop:
Retention Mechanics:
Monetization (Premium):
This game could have been perfect, but:
`php
// EVERYWHERE in the code:
$findPet = fetch("SELECT * FROM user_pets2
WHERE id = '$id' AND game = '$game'");
// $id from $_GET - UNSANITIZED!
`
One Simple Fix:
`php
// Should be:
$id = intval($_GET['id']);
$game = intval($_GET['game']);
// Or use prepared statements
`
Impact:
Lesson:
"You can build the most complete, feature-rich game with perfect architecture, but one security flaw ruins everything."
---
Database Size: 4,185 lines SQL (109 tables!)
PHP Version Required: 4.4.2-5.6
MySQL Version: 4.1.19+
Browser Requirements: Cookies, JavaScript
Installation: Root domain only (no subdirectories!)
Images: 3,468 total (GIF, JPG, PNG)
Deployment Difficulty: 4/10 (SQL import takes time)
Maintenance Difficulty: 3/10 (excellent organization!)
Revival Difficulty: 6/10 (security fixes critical)
Records Held:
---
Analysis Date: December 11, 2024
Game #72 of 79 in the Vintage Browser RPG Collection
Status: Feature-complete, organization excellent, security critical
Verdict: The most ambitious and complete game - fix security and it's perfect
Nickname: "The Virtual Pet Giant" 🐾👑
Running many of the scripts in this archive on a live server presents a serious security risk. These projects were created before modern hardening practices and may contain vulnerabilities that can compromise your system.
We strongly recommend using this code for reference and analysis only, or in isolated local environments. By downloading these files, you accept full responsibility for their use.