Skip to content

Version 11 Complete Refactor GameEngine & Automation + ADD NEW TRIBE & T4 HERO

Latest

Choose a tag to compare

@Shadowss Shadowss released this 23 Jul 08:50
· 179 commits to master since this release

Version 11 Highlights

Massive Code Refactor

  • Fully refactored Templates folder/system.
  • Added 🇫🇷 French and 🇷🇴 Romanian languages.
  • GameEngine fully refactored, file by file, with randomized equivalence testing (20k-30k cases per critical function).
  • Database.php (~450 methods) split into 14 domain traits under GameEngine/Database/ - zero call-site changes, validated via reflection parity.
  • Automation.php (~116 methods) split into 11 domain traits under GameEngine/Automation/ using the same method.
  • Village.php: production getters unified, one UPDATE per resource tick instead of two, side-effect-free constructor with explicit tick(), automation lock race (TOCTOU) fixed.
  • Building.php: build requirements rewritten as a declarative table, per-village instance caches, dead code removed (2,085 -> 1,829 lines).
  • Units.php, Market.php, Message.php, Profile.php and Chat.php refactored and hardened.
  • starvation() function in Automation refactored and split into multiple methods.
  • sendUnitsComplete() function fully refactored, reducing a 1711-line function into 26 separate methods.
  • checkAllianceEmbassiesStatus() in Database redesigned and split into multiple functions.
  • Medal system completely rewritten for easier maintenance and readability.
  • Removed obsolete and unused code/folders from both the game and Admin Panel.
  • Automation moved to a real cron job (currently triggered by page loads).
  • Database cleanup with configurable retention (battle reports, chat, stale rows).
  • SQL index audit for hot columns.
  • Static asset compression and browser caching (.htaccess).

⸻

New Playable Tribes

Four fully playable tribes added on top of the original three, across the data layer, game engine and templates:

  • Huns (tribe 6, units u51-u60) - Command Center (gid 44) replaces Residence/Palace, Makeshift Wall.
  • Egyptians (tribe 7, units u61-u70) - Waterworks, Stone Wall.
  • Spartans (tribe 8, units u71-u80) - Defensive Wall.
  • Vikings (tribe 9, units u81-u90) - Barricade.
  • New buildings integrated across gids 42-50 (incl. the Hospital family and Great Workshop) with per-tribe build requirements.
  • Unit-range formula (tribe-1)*10+1; Great Building training queue offset moved to +500 to avoid unit-ID conflicts.
  • Per-tribe Academy templates, troops.tpl unit cap raised 50 -> 90, statistics routing and CSS, profile/ranking/map tribe arrays, admin dropdowns, install feature flags.
  • Three-step registration wizard: visual tribe cards -> starting quadrant -> confirmation.

⸻

T4 Hero System

Travian 4-style hero system ported into the T3.6 engine, in phases:

  • Items backend (HeroItems.php) with equippable hero items and data layer.
  • Adventures backend (HeroAdventure.php) with adventure generation and rewards.
  • Auction house (HeroAuction.php) for player-to-player item trading.
  • Battle and speed integration (HeroBattleBonus.php + Battle.php hooks): item fighting strength, per-unit weapon bonuses, armor damage reduction, hunting horn and speed effects, artwork culture-point item.

⸻

Admin Panel

  • Complete frontend and backend redesign.
  • New Admin Panel design.
  • New homepage with server statistics.
  • New Server Info page.
  • New Natars Management format.
  • New debug log system.
  • New maintenance mode system (banned players remain banned after maintenance).
  • New server reset system.
  • Username rename moved to Edit User.
  • Added Edit Protection in Edit User.
  • Alliance editor added (frontend & backend).
  • Removed duplicate player pencils; user and alliance editing are now separated.
  • Improved punish system (troop deletion now works correctly).
  • Ban by IP support added.
  • Ban system redesigned:
    • In-game ban reason visible.
    • Moderator name visible.
    • Ban history included.
  • Unified log system:
    • Admin Panel logs tab.
    • Village logs.
    • Technology logs.
    • Troop logs.
    • Various game logs.
  • Account deletion page improved:
    • Displays deletion process status.
    • Allows cancellation of deletion.
  • Fixed Multihunter access during installation.

⸻

Gameplay Improvements

  • Vacation Mode added (requires 9 conditions).
  • Alliance rank and privilege management added.
  • Main Building instant demolition with 10 gold.
  • Account Statement added in Travian Plus section (received/spent gold history).
  • Winner registration check added.
  • Medal onclick support.
  • Complete Preferences system (frontend & backend):
    • Language
    • Time format
    • Large map
    • Reports
    • Auto-completions
    • Other player settings
  • Server Milestones system (first village, first artifact, WW progress...) with ranking widget and SVG badges.
  • Mead-Festival mechanic for the Brewery (Teuton-only, 72-hour timer) with correct catapult-confusion integration.
  • New Special Medal System:
    • Artifact Owner
    • WW Owner
    • WW Winner
    • Hero Level 100
    • Great Warehouse Owner
    • Great Granary Owner
    • Wall Master

⸻

Bug Fixes

  • Oasis regeneration fixed after attacks without conquest.
  • Parallel training exploit fixed.
  • Infinite gold exploit fixed.
  • Race conditions fixed for:
    • Market
    • Hero
    • Troops
    • Various game mechanics
  • Winner registration issues fixed.
  • Punish troop deletion fixed.
  • Huns can now build the Stonemason's Lodge (via Command Center >= 3) - engine and templates.
  • Master Builder gold finish now always deducts resources (was free with <= 2 queued jobs) and validates the building type instead of the slot number.
  • finishAll() no longer recomputes culture points from stale cached data (wrong CP was being persisted).
  • isCastleBuilt() strict type check - a WW at level 26 or a matching village ref no longer falsely blocks Palace construction.
  • Undefined-variable warnings on PHP 8 fixed (chat refresh wrote to the error log on every request).

⸻

Security Improvements

  • Full Admin Panel security overhaul.
  • Game mechanics security updates.
  • New CSRF protection system implemented.
  • Added protection against race conditions.
  • Improved validation across critical systems.
  • Server-side culture-point check on village founding was silently bypassed - fixed (client-side was the only enforcement).
  • IDOR in friend-list operations fixed: client-supplied user ID replaced with the session user.
  • Negative-amount guard on marketplace resource sending.
  • Repo-wide audit (342 PHP files, ~66k lines): systemic cache-invalidation gaps closed via a central invalidateCachesFor(), reflected XSS fixes (warsim.php, Preferences), hardened .htaccess, error_reporting bitmask and MD5-fallback guards.

⸻

New Systems

  • Full alliance editing system.
  • New account statement system.
  • New maintenance mode logic.
  • New reset server system.
  • New debug log system.
  • New logging architecture.
  • New Preferences system.
  • New Special Medal system.

⸻

Installer

  • New installation design.
  • Multihunter access fixed during installation.

⸻

Performance Improvements

  • Added caching in critical areas.
  • Dynamic table prefix support.
  • Better query handling.
  • Improved world generation.
  • Improved reset operations.

⸻

Refactor Progress

Completed

  • Templates system.
  • Admin Panel.
  • Frontend and backend redesign.
  • GameEngine (full sweep - all files audited, refactored where needed).
  • Automation functions + split into 11 domain traits.
  • Database split into 14 domain traits, with request-level caching and central invalidation.
  • Units, Technology, Village, Building, Market, Message, Profile and Chat refactors.
  • Medal system.
  • Logging system.

⸻

Miscellaneous

  • Added 🇫🇷 French language.
  • Added 🇷🇴 Romanian language.
  • Improved code readability and maintainability across the entire project.
  • Removed hundreds of lines of legacy and duplicate code.
  • Multiple internal optimizations and quality-of-life improvements.