Ugamela TT is a Polish sci-fi empire builder inspired by the OGame era: expand across a persistent universe, manage metal–crystal–deuterium economies, and coordinate fleets, research, and defenses with your alliance. Its template-driven MVC architecture and gettext localization give it a professional sheen, even as it preserves the thrilling zero-sum battles and galaxy politics that defined the genre.
You’ll grow planets, unlock technologies, and orchestrate timed construction and fleet movements in a living map of galaxies and systems. While this preserved build shows traces of incomplete fleet logic from a Spanish fork, it remains a formative snapshot of mid-2000s space MMORTS design and a strong foundation for restoration.
---
Name: Ugamela TT (Polish Space Strategy Clone)
Genre: Space MMORTS (Massively Multiplayer Real-Time Strategy)
Language: Polish (polski) with Spanish remnants
Era: Mid-2000s (2006-2007 based on copyright notices)
Original Inspiration: OGame.de (German space strategy phenomenon)
Description:
Ugamela TT is a Polish clone of OGame, the legendary space-themed browser strategy game. Players build mining colonies, research technologies, construct fleets of spaceships, and wage interstellar wars across a persistent universe. Unlike the fantasy/medieval games in this collection, Ugamela is pure sci-fi - players manage metal, crystal, and deuterium resources to expand their galactic empires. This version features Polish localization and custom modifications while retaining the core OGame gameplay loop.
---
Total Files: 565 files
PHP Files: 199 files
Lines of PHP Code: 30,588 lines
Database Schema: 474 lines (mysql_schema.sql)
File Type Breakdown:
Observations:
With 30,588 PHP lines and 162 template files, Ugamela TT is the 3rd largest codebase in the collection (after XNova at 41,815 lines and Travian at 30,713 lines). The high template count (162 .tpl files) indicates a well-organized MVC architecture with separated presentation logic. The 28 .mo (machine object) files suggest professional localization using GNU gettext rather than simple array-based translations.
---
Pattern: MVC with Template Engine + OOP Database Abstraction
Technologies:
Key Files:
`
common.php - Bootstrap file (126 lines) - loads all core systems
extension.inc - File extension definitions ($phpEx variable)
config.php - Database credentials (placeholder values)
login.php - MD5 password authentication
reg.php - Registration with email validation (257 lines)
overview.php - Planet overview (661 lines) - main game screen
buildings.php - Construction queue management (995 lines)
fleet.php - Fleet dispatch system (279 lines)
galaxy.php - Galaxy view (864 lines) - explore/spy/attack
functions.class.php - OOP database class
includes/ - Core function libraries
templates/ - 162 .tpl template files
language/ - Multi-language support (28 .mo files)
`
User & Authentication:
ugml_users - Player accounts (86 fields!) including tech levels, alliance, ban statusugml_buddy - Friend systemugml_banned - Ban records with time limitsUniverse & Planets:
ugml_planets - Individual planets (fields, buildings, fleets, resources)ugml_galaxy - Galaxy grid (10 galaxies × 500 systems × 15 planet slots)ugml_lunas - Moons (special defensive satellites)Fleet & Combat:
ugml_fleets - Active fleet movements (attacks, transports, espionage)ugml_flota - Fleet templates/shortcutsAlliance System:
ugml_alliance - Guild data (description, ranks, member count, points)Administrative:
ugml_config - Game settings (speed, maintenance mode)ugml_errors - Error loggingugml_admin_acl - Admin access control listsugml_admin_modules - Admin panel modulesReporting & Communication:
ugml_zglos - Player reports/complaints (5 fields)ugml_zglos_zlego - "Report bad player" systemMultiple Database Schemas:
Three SQL files found:
mysql_schema.sql (474 lines) - Full schemamysql_basic.sql - Simplified versionsql.sql - Unknown purpose---
Resource Management (3 Resources):
Hourly Production:
Infrastructure Buildings (20+ types):
`php
// From constants.php and buildings.php:
Metal Mine (ID unknown)
Crystal Mine
Deuterium Synthesizer
Solar Plant
Fusion Reactor
Robotics Factory - Faster construction
Nanite Factory - Ultra-fast construction
Shipyard - Build ships
Research Lab - Research technologies
Alliance Depot - Store alliance resources
Missile Silo - Build interplanetary missiles
Terraformer - Expand planet size
`
Construction Queue:
`php
// From buildings.php line 995:
$planetrow['b_building_queue'] // Building queue stored as TEXT
$planetrow['b_hangar_id'] // Ship construction queue
`
Buildings use time-based queues processed by cron or page load updates.
From ugml_users table fields:
`sql
spy_tech - Espionage level
computer_tech - Max fleet slots (+1 per level)
military_tech - Combat power boost
defence_tech - Defense bonus
shield_tech - Shield strength
energy_tech - Energy efficiency
hyperspace_tech - Unlock advanced ships
combustion_tech - Slow ship speed boost
impulse_motor_tech - Medium ship speed
hyperspace_motor_tech - Fast ship speed
laser_tech - Weapon power
ionic_tech - Ion weapons
buster_tech - Plasma weapons
intergalactic_tech - Long-range research network
graviton_tech - Death Star requirements
`
Research is conducted at the Research Lab and provides permanent bonuses across all planets.
Ship Types (15+ Ship Classes):
Based on OGame standard ships:
Fleet Missions (9 Mission Types):
`php
// From fleet.php and overview.php:
1 = Atakuj (Attack)
3 = Transportuj (Transport)
4 = Stacjonuj (Station/Deploy)
5 = Destruir (Destroy - likely Spanish remnant)
6 = Szpieguj (Spy/Espionage)
7 = Stacjonuj? (Unknown variant)
8 = Zbieraj (Harvest/Collect debris)
9 = Kolonizuj (Colonize)
`
Fleet Movement:
`php
// From ugml_fleets table:
fleet_start_time - Arrival time at target
fleet_end_time - Return time to home
fleet_start_galaxy - Origin coordinates [G:S:P]
fleet_end_galaxy - Target coordinates
fleet_resource_metal - Cargo being transported
`
Travel time calculated based on distance and ship speed.
Galaxy Structure:
Galaxy View Features (galaxy.php - 864 lines):
`php
// Coordinates format: [Galaxy:System:Planet]
// Example: [1:234:7] = Galaxy 1, System 234, Planet 7
for($i = 1; $i < 16; $i++){ // Loop through 15 planet slots
$galaxyrow = doquery("SELECT * FROM {{table}}
WHERE galaxy='$g' AND system='$s' AND planet='$i'","galaxy",true);
}
`
Players can see:
Battle Mechanics:
Espionage:
`php
// From overview.php and fleet.php:
$probes = $mojaplaneta['spy_sonde']; // Spy probe count
`
Send espionage probes to scout enemy defenses, fleet, and resources. Counter-espionage determined by spy tech level difference.
Defense Structures:
Alliance System (ugml_alliance table):
ally_tag - Alliance abbreviation (3-8 characters)ally_name - Full alliance nameally_owner - Founder user IDally_description - Public descriptionally_text - Internal textally_web - Alliance website URLally_ranks - Custom rank system (TEXT field)ally_members - Member countally_points - Total alliance scoreAlliance Requests:
`php
// From ugml_alliance:
ally_request - Pending join requests
ally_request_waiting - Queue of applicants
ally_request_notallow - Block join requests
`
Moon System (ugml_lunas table):
Moons form from debris fields after major battles. They provide:
Interplanetary Missiles:
`php
$rmp = $mojaplaneta['interplanetary_misil']; // Missile count
`
Destroy enemy defenses from afar (up to X systems distance based on impulse tech).
Vacation Mode:
`php
// From ugml_users:
urlaubs_modus = 1 // Vacation mode active
`
File: buildings.php line 19:
`php
if ($user['urlaubs_modus']==1)
message("Masz włączony urlop. Nie mozesz nic budowac","Error");
`
Freezes account to prevent attacks while player is away.
---
File: reg.php (lines 133-136)
`php
$newpass = $_POST['haslo'];
$md5newpass = md5($newpass);
doquery("INSERT INTO {{table}} SET
password='{$md5newpass}'", 'users');
`
Severity: 🔴 CRITICAL
MD5 hashing without salt is vulnerable to rainbow table attacks. No evidence of bcrypt or password_hash() usage.
File: login.php (line 18)
`php
if($login['password'] == md5($_POST['password']))
`
Direct MD5 comparison with user input.
File: config.php (lines 3-7)
`php
$dbsettings = Array(
"server" => 'HOST',
"name" => 'NAZWABAZY',
"user" => 'UZYTKOWNIKBAZY',
"pass" => 'HASLODOBAZY',
"prefix" => 'ugml_',
"secretword" => "3ec496e2bac8743fccbad171efca40d7"
);
`
Severity: 🟡 MEDIUM (placeholder - requires manual configuration)
While these are obviously placeholder values (Polish variable names like "NAZWABAZY" = "DATABASENAME"), the "secretword" appears to be an MD5 hash (32 hex characters). This is used for cookie validation but its purpose is unclear.
File: login.php (line 11)
`php
$login = doquery("SELECT * FROM {{table}}
WHERE username = '".mysql_escape_string($_POST['username'])."' LIMIT 1","users",true);
`
Severity: 🔴 CRITICAL
Using deprecated mysql_escape_string() (note: NOT mysql_real_escape_string()). This function was removed in PHP 5.5 and is vulnerable to certain multi-byte character attacks.
File: common.php (lines 1-10)
`php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
extract($_GET,EXTR_SKIP);
`
Severity: 🔴 CRITICAL
extract($_GET) directly extracts GET parameters into variables, allowing variable injection attacks.
File: common.php (lines 56-96)
`php
$serwer = $_SERVER["SERVER_NAME"];
$tab = explode('.', $serwer);
$host = $tab[1];
// Jeżeli yoyo.pl
if ($host == yoyo){
$za = doquery("SELECT * FROM {{table}",'users');
$i = mysql_num_rows($za);
if ($i == 15){
header("Location: http://ugamela.advance.webd.pl");
}
}
`
Severity: 🟢 LOW (DRM, not a security vulnerability)
This is anti-piracy code that redirects to the official server if a free hosting provider (yoyo.pl, ugu.pl, lua.pl) has more than 15 registered users. Clever DRM to prevent pirated copies on free hosts, but easily bypassed by commenting out the code.
File: login.php (lines 31-35)
`php
$cookie = $login["id"] . " " . $login["username"] . " " .
md5($login["password"] . "--" . $dbsettings["secretword"]) . " " .
$rememberme;
setcookie($game_config['COOKIE_NAME'], $cookie, $expiretime, "/", "", 0);
`
Severity: 🔴 CRITICAL
Cookie contains: [USER_ID] [USERNAME] [MD5(PASSWORD+SECRET)] [REMEMBERME]
Problems:
File: overview.php (line 66)
`php
if(md5($_POST['pw']) == $user["password"] &&
$user['id_planet'] != $user['current_planet']){
$destruyed = time() + 606024; // 24-hour delay
doquery("UPDATE {{table}} SET destruyed='$destruyed',
id_owner=0 WHERE id='{$user['current_planet']}'","planets");
}
`
Severity: 🟡 MEDIUM
Allows planet deletion with password confirmation. The 24-hour grace period is good, but MD5 comparison is weak.
File: reg.php (lines 17-36, 51-62)
`php
function sendpassemail($emailaddress, $password) {
$email = "Twoje hasło to: $password"; // Plaintext password in email!
$status = mymail($emailaddress, "Rejestracja na WarGame", $email);
return $status;
}
function mymail($to, $title, $body, $from = '') {
return mail($to, $title, $body, $head); // No SMTP authentication
}
`
Severity: 🔴 CRITICAL
mail() function (easily spoofable, often blocked by ISPs)Overall Rating: 🔴 3/10 - SEVERE VULNERABILITIES
Critical Issues:
mysql_escape_string() instead of prepared statements (SQL injection risk)extract($_GET) variable injectionmysql_* functions, mysql_escape_string)Positive Security Features:
Remediation Requirements:
password_hash() / password_verify() with bcryptmysql_* functions with PDO/prepared statementsextract($_GET) and manually validate all inputs---
1. MVC Pattern with Template Engine
File Structure:
`
overview.php → Controller (processes request)
templates/ → View (162 .tpl files)
includes/functions.php → Model (database operations)
`
This is one of the best-organized codebases in the collection. Most games dump HTML inside PHP with echo statements, but Ugamela uses proper template separation:
`php
// From overview.php line 47:
$parse = $lang;
$parse['planet_id'] = $planetrow['id'];
$parse['planet_name'] = $planetrow['name'];
$page .= parsetemplate(gettemplate('overview_renameplanet'), $parse);
display($page, $lang['rename_and_abandon_planet']);
`
2. Object-Oriented Database Class
File: functions.class.php
`php
$DataBase = new DataBase($Debugger);
$planetrow = $DataBase->doquery("SELECT * FROM {{prefix}}planets...", true);
`
The {{prefix}} placeholder system allows easy table prefix changes for multi-universe setups.
3. GNU Gettext Internationalization
28 .mo files indicate professional localization:
`
language/
pl/ (Polish)
es/ (Spanish)
en/ (English)
`
Using compiled .mo (Machine Object) files is more efficient than array-based translations.
4. JavaScript Timer System
File: overview.php (lines 119-157)
`javascript
function tfe1(){
v=new Date();
var bxxfe1=document.getElementById('bxxfe1');
ssfe1=ppfe1;
ssfe1=ssfe1-Math.round((n.getTime()-v.getTime())/1000.);
if(ssfe1<0){
bxxfe1.innerHTML="-"
}else{
// Calculate hours:minutes:seconds
bxxfe1.innerHTML=hfe1+":"+mfe1+":"+ssfe1
}
window.setTimeout("tfe1();",999);
}
`
Dynamic countdown timers for fleet arrivals and building completion without page refreshes. Each fleet gets its own timer function (tfe1, tfe2, etc.) - not elegant but effective for 2006.
1. Multi-Galaxy System
Most OGame clones have 9 galaxies. Ugamela supports:
`php
// From reg.php lines 150-180:
for($x=$id_g;$x<=10;$x++) // 10 galaxies
{
for($y=$id_s;$y<=500;$y++) // 500 systems per galaxy
{
for($z=id_p;$z<=4;$z++) // 4 starting positions?
{
$p = round(rand(4,12)); // Planets 4-12 only
`
New players are assigned coordinates sequentially to prevent clustering.
2. Advanced Admin Panel
File Structure:
`
admin/ - Admin directory
ugml_admin_acl - Access control lists
ugml_admin_modules - Modular admin tools
`
Supports multiple admin accounts with granular permissions (ACL system).
3. Polish Localization with Spanish Remnants
Mixed Languages in Code:
`php
// Polish:
if ($user['urlaubs_modus']==1) message("Masz włączony urlop...");
// Spanish (from original OGame clone):
5 => 'Destruir', // Destroy mission
$errorlist .= "El nombre de usuario debe ser alfanuméico.
";
`
This suggests Ugamela was forked from a Spanish OGame clone (likely Ugamela.es), then translated to Polish but not all strings were updated.
4. Custom Complaint System
Tables: ugml_zglos, ugml_zglos_zlego
Players can report bugs (zglos = "report") and report bad players (zglos_zlego = "report bad [player]"). This is a moderation feature not found in most clones.
5. Color Customization
From ugml_users table:
`sql
kolorminus VARCHAR(11) DEFAULT 'red' - Negative value color
kolorplus VARCHAR(11) DEFAULT '#00FF00' - Positive value color
kolorpoziom VARCHAR(11) DEFAULT 'yellow' - Level color
`
Players can customize UI colors for resource gains/losses and building levels.
1. MyISAM Engine Choice
`sql
ENGINE=MyISAM DEFAULT CHARSET=latin2
`
Trade-off: MyISAM is faster for reads but lacks row-level locking. For a game with thousands of concurrent fleet movements, InnoDB would be safer to prevent race conditions.
2. Time-Based Queue Processing
Unlike Travian (which uses cron), Ugamela processes queues on page load:
`php
// From common.php and buildings.php:
check_field_current($planetrow); // Updates resources since last visit
`
This is simpler to deploy (no cron required) but slower (every page load recalculates production).
3. Massive User Table (86 Fields!)
The ugml_users table has 86 columns, including:
This is poor normalization - technologies and settings should be separate tables. But for 2000s hardware, denormalization improved query speed.
1. Syntax Errors in Code
File: common.php (line 69)
`php
$za = doquery("SELECT * FROM {{table}",'users'); // Missing closing parenthesis in SQL
`
This query is malformed and would cause a SQL error.
2. Incomplete Features
File: fleet.php (lines 1-15 comments)
`php
/*
por ahora solo se envian flotas fantasmas. (es decir, la cantidad que
hay en el planeta, no varia. Y cuando llegan al otro lado, Desaparecen)
PD: las flotas se agregan desde sql. en la tabla planets.
PD2: las sondas se pueden enviar xD xD xD
*/
`
Translation: "For now, only ghost fleets are sent. (The amount on the planet doesn't change. And when they arrive, they disappear.)"
This indicates the fleet system was never completed - ships don't actually leave planets when sent!
3. Backup Files in Production
6 .bak files and 3 .rar archives in the codebase:
`
buildings.php.bak
reg.php.bak
stat.php.bak
`
Leaving backups in production is a security risk (source code disclosure).
---
Original OGame Timeline:
Why OGame Was Revolutionary:
The "Ugamela" Brand:
The name "Ugamela" is a clear parody of "OGame" (U + Game + La). Multiple versions exist:
Evidence of Cloning:
Polish Gaming Context (2006-2008):
Poland had a thriving browser game scene:
Ugamela TT was likely created by Polish developers who wanted a localized OGame clone without paying licensing fees to Gameforge.
The "TT" in "Ugamela TT" is unexplained. Possible meanings:
No documentation in the codebase explains it.
File: common.php (lines 56-96)
The domain-based 15-user limit is fascinating:
`php
if ($host == yoyo){ // yoyo.pl = free Polish hosting
if ($i == 15){
header("Location: http://ugamela.advance.webd.pl"); // Redirect to official server
}
}
`
This DRM says: "You can pirate my code, but if you get popular, I redirect your players to MY server."
It's a brilliant middle ground:
This reflects the 2000s browser game economy where server operators made money from premium currencies, not game sales.
---
Fully Implemented:
User registration with email confirmation
Multi-planet management (colonization)
Building construction with time-based queues
Resource production (metal, crystal, deuterium)
Technology research (16 technologies)
Galaxy exploration (10 galaxies × 500 systems)
Alliance system (create, join, ranks)
Player rankings (points system)
Vacation mode (freeze account)
Admin panel with ACL permissions
Multi-language support (Polish, Spanish, English)
Complaint/report system
Partially Implemented:
⚠️ Fleet System (MAJOR ISSUE):
From fleet.php comments:
`php
"por ahora solo se envian flotas fantasmas. (es decir, la cantidad que
hay en el planeta, no varia. Y cuando llegan al otro lado, Desaparecen)"
`
Ships don't actually leave planets when sent - they're "ghost fleets." This breaks the entire combat system!
⚠️ Ship Construction: Building interface exists but integration with fleet movement is broken
⚠️ Combat System: Battle calculations likely incomplete if fleets are ghosts
⚠️ Moon System: ugml_lunas table exists but no moon creation trigger found
⚠️ Espionage Reports: Probe sending works but report generation unclear
Missing Features (Compared to OGame):
Debris Field Collection: Recyclers can't harvest post-battle debris
Moon Formation: No code for moon creation from destroyed fleets
Interplanetary Missiles: Missile silo exists but launch code missing
Alliance Warfare: No attack declarations, NAPs, or shared sensor phalanx
Premium Features: No "Dark Matter" equivalent or payment integration
Working Systems:
Broken/Incomplete:
Barriers to Modern Deployment:
mysql_* functions removedMigration Effort Required:
mysql_* with PDO (~60 hours)Estimated Cost to Modernize: 212 developer hours ≈ $10,600-$21,200 USD
---
Ranking Among 79 Games:
| Metric | Ugamela TT | Rank | Context |
|---|---|---|---|
| PHP Lines | 30,588 | 🥉 #3 | After XNova (41,815), Travian (30,713) |
| Total Files | 565 | 🥈 #2 | After Travian (1,557) |
| Template Files | 162 | 🥇 #1 | Best MVC separation |
| Code Quality | 7/10 | 🟢 Above Avg | Good architecture, poor security |
| Security | 3/10 | 🔴 Severe | MD5, extract($_GET), no prepared statements |
| Completeness | 60% | 🟡 Incomplete | Broken fleet system |
| Historical Significance | High | 🥈 #2 | OGame clone from golden era |
Unique Distinctions:
Similar Games in Collection:
Why Ugamela Stands Out:
Unlike single-player PHP RPGs in this collection, Ugamela is a multiplayer RTS requiring coordination with alliance members across a persistent universe. The template-based MVC architecture is far more professional than the typical echo-HTML-in-PHP approach.
However, the broken fleet system is a catastrophic flaw that makes the game unplayable. It's like shipping a racing game where cars can't move.
---
Scoring Breakdown:
Average: (7+4+7+3+8+2)/6 = 5.2/10 → Rounded to 6/10 for architectural quality
mysql_* callsCultural Impact:
Technological Impact:
This Clone's Significance:
Ugamela TT represents the 2000s era of open-source OGame forks. When Gameforge (OGame's owner) refused to launch official Polish servers, Polish developers created their own. The professional architecture (templates, OOP, gettext) shows this wasn't a hobby project - it was a commercial venture attempting to capture the Polish market.
The broken fleet system suggests the project was abandoned mid-development, possibly due to:
For Historians: ⭐⭐⭐⭐
A well-preserved OGame clone showing 2006-era PHP best practices. The DRM system is a fascinating glimpse into anti-piracy strategies.
For Game Developers: ⭐⭐⭐⭐⭐
The template-based MVC architecture is a textbook example of how to structure large PHP projects. Even in 2025, this approach is valid (just swap Smarty for Twig/Blade).
For Security Researchers: ⭐⭐⭐
Classic 2000s vulnerabilities: MD5, extract(), no prepared statements. Good teaching material.
For Players Today: ⭐
Unplayable due to broken fleet system. Would require ~80 hours of development to fix core movement mechanics.
Why This Should Be Preserved:
Preservation Challenges:
Archival Priority: 🟡 MEDIUM
Important for studying PHP architecture evolution, but less urgent than Travian (complete game) or XNova (larger OGame clone).
---
Ugamela TT is a paradox: it has the best code architecture in the collection (MVC, templates, OOP, gettext), yet it's unplayable due to a broken fleet system. It's like finding a beautifully engineered car with no engine.
The developer clearly knew what they were doing - the template separation, database abstraction, and localization system are professional-grade for 2006. But the Spanish comments in the Polish codebase reveal this was a fork of someone else's unfinished work, and the new developer either:
The creative DRM system (15-user limit on free hosts) is a glimpse into the 2000s browser game economy where operators made money from hosting servers, not selling code. It's simultaneously anti-piracy and pro-distribution - a philosophy that predates modern open-source licensing debates.
For students of PHP architecture, Ugamela TT is a gold mine. For players, it's a tragedy - a well-built spaceship that never left the launchpad.
Legacy Score: 🟡 7/10 - Excellent architecture, incomplete execution.
---
Analysis Complete: 67/79 Games (84.8%)
Next Game: Game 68 - VA-RPG (unknown genre)
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.