[DEV] 2Moons/SmartMoons 3.0 - Next Gen Update (PHP 8.4, Twig Engine & Aerospace Design)

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • In-game images from the forum and notifications.
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • It looks really nice. I was trying to integrate Xterium's new design into my own system, but adding plugins and things like that is really tiring. I wish I had seen this project sooner and waited for it.
    • yurseli wrote:

      It looks really nice. I was trying to integrate Xterium's new design into my own system, but adding plugins and things like that is really tiring. I wish I had seen this project sooner and waited for it.
      Thank you very much, I really appreciate it.
      I held back for quite a while because in the past I tended to share everything too early. That usually meant projects were never truly finished. This time I wanted to approach it differently.
      Over the past months, I’ve gained a lot of experience and improved my skills significantly. Whenever I run into issues or errors, I use tools like ChatGPT or Gemini to analyze the problem. They help me understand what I’m doing wrong, and more importantly, why it’s wrong. That way I can improve my approach and avoid repeating the same mistakes in the future.
      As soon as the admin panel is running stable and the core game systems are fully functional, I’ll make the Git repository public.
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • SmartMoons ModularEngine – Plugin System für 2Moons CE


      Was ist das?

      Die SmartMoons ModularEngine ist eine Erweiterung für 2Moons Community Edition, die ein echtes, strukturiertes Plugin-System bereitstellt.
      Ziel war es, 2Moons von einem „Core-only“-System zu einer modular erweiterbaren Architektur weiterzuentwickeln –
      ohne ständig Dateien im Core anfassen zu müssen.




      Warum wurde das entwickelt?

      2Moons CE ist stabil – aber:
      • Neue Features müssen direkt im Core ergänzt werden
      • Seitenrouting ist hart kodiert
      • Cronjobs sind fest auf Core-Klassen beschränkt
      • Twig kennt keine Plugin-Namespaces
      • Admin-Seiten benötigen Core-Anpassungen
      Das widerspricht moderner Software-Architektur.
      Deshalb wurde eine modulare Engine gebaut.




      Was macht die ModularEngine konkret?

      Die Engine erweitert 2Moons CE um:




      ✅ 1. Hook-System (Erweitert)

      • HookManager::addAction()
      • HookManager::addFilter()
      • Twig hook('sidebar_end') Unterstützung
      Plugins können:
      • HTML in Navigation injecten
      • Inhalte in bestehende Templates einfügen
      • Logik verändern, ohne Core-Code zu überschreiben




      ✅ 2. Asset-Registry für Plugins

      Plugins können:
      • CSS registrieren
      • JavaScript registrieren
      • Seiten-spezifische Assets laden
      Beispiel:

      Source Code

      1. AssetRegistry::registerCss('relics.css', 'relics');
      2. AssetRegistry::registerJs('relics.js', 'relics');
      3. Assets werden nur auf relevanten Seiten geladen.








      ✅ 3. ElementRegistry Bridge

      Plugins können eigene Game-Elemente registrieren:
      • Neue Gebäude
      • Neue Technologien
      • Neue Schiffstypen
      • Neue Offiziere
      Ohne Core-Arrays zu überschreiben.




      ✅ 4. Sprachdateien pro Plugin

      Plugin-Struktur:
      • plugins/Relics/lang/de.json
      • plugins/Relics/lang/en.json
      • Zugriff über:
      • PluginManager::lang('relics_name')
      • Keine Core-Lang-Dateien mehr anfassen.





      ✅ 5. Manifest-System

      Jedes Plugin besitzt eine:
      manifest.json
      Beispiel:

      Source Code

      1. {
      2. "name": "Relics",
      3. "version": "1.0.0",
      4. "modules": [
      5. "RelicsModule"
      6. ]
      7. }
      Display All
      Module werden automatisch geladen, wenn sie GameModuleInterface implementieren.




      ️ Neue Core-Erweiterungen (Generisch – nicht feature-spezifisch)

      Damit echte Modularität möglich ist, wurden minimal notwendige generische Erweiterungen ergänzt:




      1. Plugin Page Router

      Vorher:
      game.php?page=X
      → includes/pages/game/ShowXPage.class.php
      Jetzt:
      • Wenn keine Core-Seite existiert,
      • wird geprüft, ob ein Plugin eine Route registriert hat.
      Plugins können eigene Seiten bereitstellen, ohne Core-Dateien anzulegen.




      2. Plugin Admin Router

      Vorher:
      Admin-Seiten waren hart im switch/case kodiert.
      Jetzt:
      Plugins können eigene Admin-Seiten registrieren.
      Keine Core-Admin-Dateien notwendig.




      3. Plugin Twig Namespace Support

      Twig kann jetzt Templates aus Plugins laden:
      @Relics/page.relics.twig
      Ohne:
      styles/templates/game/
      manuell zu erweitern.




      4. Plugin Cronjob Support

      Vorher:
      includes/classes/cronjob/X.class.php
      Jetzt:
      Plugins können eigene Cronjobs registrieren.
      Die Engine prüft:
      • Core Cronjob
      • Plugin Cronjob
      Kein Core-Eingriff nötig.




      Wie sieht ein Plugin jetzt aus?

      Beispielstruktur:

      Source Code

      1. plugins/
      2. └── Relics/
      3. ├── manifest.json
      4. ├── RelicsModule.php
      5. ├── pages/
      6. │ ├── RelicsPage.php
      7. │ └── RelicsAdminPage.php
      8. ├── cron/
      9. │ └── RelicsCronjob.php
      10. ├── templates/
      11. │ └── page.relics.twig
      12. ├── assets/
      13. │ ├── relics.css
      14. │ └── relics.js
      15. └── lang/
      16. ├── de.json
      Display All

      └── en.json
      Upload → aktivieren → fertig.




      Was kann man jetzt mit der Engine bauen?

      Mit dieser Architektur sind möglich:
      • Neue Gameplay-Systeme (z.B. Relikte, Artefakte, Tech-Trees)
      • Saisonale Events
      • Eigene Ranglisten
      • Neue Admin-Tools
      • PvE Systeme
      • Allianz-Erweiterungen
      • Alternative Galaxie-Logik
      • Monetarisierungs-Features
      • UI Overhauls als Plugin
      • Komplett neue Spielmodi
      Und das alles ohne Core-Dateien zu verändern.




      Ziel der Entwicklung

      Nicht:
      “2Moons umbauen”

      Sondern:
      2Moons CE zukunftssicher modularisieren.


      So kann:
      • die Community Edition sauber bleiben
      • jeder Entwickler eigene Module veröffentlichen
      • SmartMoons eigene Closed-Source Erweiterungen nutzen
      • die Community eigene Open-Source Plugins entwickeln




      Technischer Impact

      BereichVorherJetzt
      Neue SeitenCore-Datei nötigPlugin-Route
      Admin-SeitenSwitch erweiternPlugin-Registration
      CronjobsCore-KlassePlugin-Cron
      TemplatesNur styles/templatesPlugin-Namespace
      AssetsGlobal geladenPage-scoped
      SpracheCore bearbeitenPlugin-Lang




      Core-Stabilität

      Die Erweiterungen sind:
      • generisch
      • feature-neutral
      • nicht Relics-spezifisch
      • kompatibel mit 2Moons CE Struktur
      • minimalinvasiv




      Fazit

      Die SmartMoons ModularEngine bringt 2Moons CE auf ein modernes, modulbasiertes Niveau.
      Sie ermöglicht:
      • saubere Erweiterbarkeit
      • klare Trennung von Core & Feature
      • nachhaltige Weiterentwicklung
      • Community-Plugins
      • Closed-Source Erweiterungen ohne Core-Forks


      Cheers
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • So nun behebe ich noch einen Haufen Fehler und versuche mich an der 3D Galaxy..

      Erste fortschritte:

      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • So ich erstelle gerade ein Plugin, um zu sehen ob auch wirklich alles läuft.
      Keine Core Files werden angetastet, einfach unkompliziert über eine ZIP Hochladen und install klicken, zuletzt aktivieren.

      Das wird es werden:


      HIGH IMPACT – Spielgefühl massiv pushen


      1️⃣ Galaktisches Ereignis-System (Dynamic Universe Events)

      Ein Plugin, das regelmäßig globale Events startet:
      • ☄️ Meteoritenschauer (+20% Metall 24h)
      • ️ Solarsturm (Energie -30%)
      • Alien Invasion (NPC Flotten greifen random Planeten an)
      • Forschungstag (-15% Forschungszeit)
      • Dunkle Materie Anomalie (DM Drops durch Expedition)
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • Was hälst du davon wen man ein riesen plugin hat aber einzelne teile aktivieren kann schau mal ich hab noch paar ideen dazu :
      ⚫ Schwarzes Loch Drift – Alle Flugzeiten +40% für 12h
      Mutationswelle – Bevölkerungswachstum +50% für 24h
      Nebel der Stille – Spionage & Scans blockiert für 6h
      Supernova – Zufälliger Planet verliert 10% Gebäude-HP
      Händlerkonvoi – Handelskurse -25% für 12h (günstig einkaufen)
      Energiesurge – Alle Energieproduktion +60% für 6h
      ☠️ Piratenangriff – Handelsrouten werden zufällig geplündert
      Kältefront – Kristallproduktion +35% für 24h
      Dimensionsriss – Zufällige kleine Ressourcenpakete auf allen Planeten
      Erstkontakt – Alien-Fraktion bietet einmaligen Trade (Ressource gegen Ressource)
      Geniuswelle – Alle laufenden Forschungen -20% Zeit für 8h
      Totenstille – Keine Angriffe möglich für 4h (Waffenstillstand)
      Sternschnuppe – Erste 100 Spieler die einloggen bekommen kleinen DM-Bonus
      ⚡ Magnetpuls – Flotten in Transit verlieren 5% Treibstoff
      Planetenausrichtung – Alle Ressourcen gleichzeitig +15% für 6h
    • das ist richtig genial
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • Na hat der Spieler immer was auf des er sich freuen kann und ich würde maximal 1 oder auf einmal laufen lassen ! und des einstellbar im admin panel wie lange oder eben über cron
    • Aktuell seht ihr hier in den Videos meine Galaxienansicht.

      Es ist echt schwer, das so hinzubekommen, dass alles passt.

      3D Galaxy

      Und

      2D Galaxy
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • 0wum0 wrote:

      Aktuell seht ihr hier in den Videos meine Galaxienansicht.

      Es ist echt schwer, das so hinzubekommen, dass alles passt.

      3D Galaxy

      Und

      2D Galaxy
      Wouldn't rendering the entire galaxy simultaneously create performance issues for large datasets? It would significantly increase server load, like fetching a large amount of data.
    • yurseli wrote:

      0wum0 wrote:

      Aktuell seht ihr hier in den Videos meine Galaxienansicht.

      Es ist echt schwer, das so hinzubekommen, dass alles passt.

      3D Galaxy

      Und

      2D Galaxy
      Wouldn't rendering the entire galaxy simultaneously create performance issues for large datasets? It would significantly increase server load, like fetching a large amount of data.
      Rendering the 3D galaxy itself does not increase server load, since Three.js runs entirely client-side in the browser (GPU).
      When the galaxy view is opened, we are not loading all planet names, owners, or detailed metadata at once. The initial request only contains minimal structural data (e.g., positions, IDs, and basic system information).
      Detailed information such as planet names or ownership is loaded only when the player interacts with a specific object (e.g., on hover or click).
      This means we are using a lazy-loading approach:
      Initial load → lightweight structural data
      Interaction → request detailed data only for the selected system/planet
      Because of that, the server is not required to fetch and serialize the entire galaxy dataset in one go.
      In short: rendering performance is primarily a client-side concern, while server load is controlled by limiting data transfer and loading details on demand.

      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • Great work nice UI. I have given a small test and found some issues, a few recommendations below.

      1- implement google recaptcha ( otherwise people can abuse your login system, it is possible for someone to have infinite accounts with curl etc ).

      2- you need "false controll" , meaning when you use $db->selectSingle, if data is not found returns false, and if you try to access array on boolean it throws error, example page.

      sm.makeit.uno/game.php?page=playerCard ( going to throw error. ) One can fill your database with those errors just by auto refreshing page, because ticket system puts that in database.

      need something like
      # example
      $id = HTTP::_GP('id',0); // default value 0
      $sql = "SELECT * FROM %%USERS%% WHERE id = :id;";
      $user_info = $db->selectSingle($sql, [':id' => $id]);

      if (!$user_info) { return; } // or print msg

      $user_info['name'] // no problems.


      this page is also problematic
      sm.makeit.uno/game.php?page=changelog ( probably not implemented, i have that on my signature project, if you are interested)

      The post was edited 1 time, last by amamoslavida_ ().

    • amamoslavida_ wrote:

      Great work nice UI. I have given a small test and found some issues, a few recommendations below.

      1- implement google recaptcha ( otherwise people can abuse your login system, it is possible for someone to have infinite accounts with curl etc ).

      2- you need "false controll" , meaning when you use $db->selectSingle, if data is not found returns false, and if you try to access array on boolean it throws error, example page.

      sm.makeit.uno/game.php?page=playerCard ( going to throw error. ) One can fill your database with those errors just by auto refreshing page, because ticket system puts that in database.

      need something like
      # example
      $id = HTTP::_GP('id',0); // default value 0
      $sql = "SELECT * FROM %%USERS%% WHERE id = :id;";
      $user_info = $db->selectSingle($sql, [':id' => $id]);

      if (!$user_info) { return; } // or print msg

      $user_info['name'] // no problems.


      this page is also problematic
      sm.makeit.uno/game.php?page=changelog ( probably not implemented, i have that on my signature project, if you are interested)
      projenin kurulu bir demosu varmı koray
    • yurseli wrote:

      projenin kurulu bir demosu varmı koray
      imzadaki linkin kurulumu sıkıntısız olmalı, demo olarak hostlamıyorum. versiyon da pek iyi durumda değil açıkcası tonla problem var, özellikle UI sıkıntılı. sadece hobi project, zaman buldukça geliştirmeye çalışıyorum. belki işinize yarayacak birşeyler vardır (flight sim, maden toplama gibi ). git commit sayfasından yapılan değişiklere göz atabilirsiniz.
    • amamoslavida_ wrote:

      Great work nice UI. I have given a small test and found some issues, a few recommendations below.

      1- implement google recaptcha ( otherwise people can abuse your login system, it is possible for someone to have infinite accounts with curl etc ).

      2- you need "false controll" , meaning when you use $db->selectSingle, if data is not found returns false, and if you try to access array on boolean it throws error, example page.

      sm.makeit.uno/game.php?page=playerCard ( going to throw error. ) One can fill your database with those errors just by auto refreshing page, because ticket system puts that in database.

      need something like
      # example
      $id = HTTP::_GP('id',0); // default value 0
      $sql = "SELECT * FROM %%USERS%% WHERE id = :id;";
      $user_info = $db->selectSingle($sql, [':id' => $id]);

      if (!$user_info) { return; } // or print msg

      $user_info['name'] // no problems.


      this page is also problematic
      sm.makeit.uno/game.php?page=changelog ( probably not implemented, i have that on my signature project, if you are interested)
      Thanks for testing and the detailed feedback.
      1. You're absolutely right regarding bot protection.
        Rate limiting and captcha protection are planned before public release.
        Currently the server is not production-ready.
      2. Good point about defensive checks on selectSingle().
        Some pages still need proper null guards.
        This will be cleaned up in the next refactor phase.
      3. The changelog page is not yet implemented in CE.
        Appreciate the offer — might take a look at your approach.
      Thanks for the input.
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • amamoslavida_ wrote:

      yurseli wrote:

      projenin kurulu bir demosu varmı koray
      imzadaki linkin kurulumu sıkıntısız olmalı, demo olarak hostlamıyorum. versiyon da pek iyi durumda değil açıkcası tonla problem var, özellikle UI sıkıntılı. sadece hobi project, zaman buldukça geliştirmeye çalışıyorum. belki işinize yarayacak birşeyler vardır (flight sim, maden toplama gibi ). git commit sayfasından yapılan değişiklere göz atabilirsiniz.
      ben de woa üzerinde çalışıyorum xterium un şimdiki güncel tasarımını baştan giydirmeye çalışıyorum yeni özellikler modlar falan lazım oluyor güncel porojer oyüzden sorumuştum teşekkür ederim

    • 2MoonsCE / SmartMoons – Consolidated Changelog (2025–2026)



      All changes by 0wum0 unless otherwise noted
      Project: github.com/0wum0/2MoonsCE


      Stability & Defensive Programming

      - Added Database::selectSingleSafe() (returns null instead of false)
      - Added consistent null guards in PlayerCard, Report, BuddyList, Rights & Reset pages
      - Fixed multiple “array offset on false” warnings (PHP 8.3 strictness)
      - Added class_exists() router guards in game.php and index.php
      - Added file existence check in ShowChangelogPage
      - Fixed unserialize / empty checks (Rights & UserList)
      - Fixed shortly_number() strict typing + float casting
      - Fixed timezone selector array structure


      Login & Registration Hardening

      - Added honeypot anti-spam field
      - Added session-based math CAPTCHA (server validated)
      - Added IP-based registration rate limit (3/hour)
      - Fixed Session::init() double-start issue
      - Added optional “Remember Me” checkbox
      - Scoped main.css auth conflicts using :not(.auth-body)
      - Fixed controlled template escaping with |raw


      3D Galaxy Map (Three.js)

      - Implemented full 3D Galaxy Map
      - Added navJump (clamp g=1..9, s=1..499)
      - Added navHome quick navigation
      - Fixed flyTo snap-back (Orbit target sync)
      - Fixed selection ring rebuild + geometry disposal
      - Fleet line color system (own / ally / hostile / foreign)
      - Added JSON debug fallback logging
      - Added 8s loader failsafe timeout

      Rendering is fully client-side (GPU). Only structural data is loaded initially; detailed planet data loads on interaction (lazy loading).


      Plugin System v1.2

      - Implemented modular Plugin System
      - Added ElementRegistry
      - Added double-include guards
      - Fixed reslist['allow'] key corruption
      - Fixed additive exportLegacyPricelist()
      - Fixed hasNewElements() export blocking
      - Improved SQL runner error handling
      - Added Safe-Mode auto-deactivation on plugin crash

      New Plugins:
      - GalacticEvents
      - RewardPoolEngine
      - GalaxyMarkerAPI
      - CoreQoLPack
      - Relics & Doctrines


      Modular Gameplay Engine v2

      - Introduced GameModuleInterface
      - Added GameContext
      - Implemented ModuleManager
      - Core modules: ProductionModule & QueueModule
      - Plugin manifest module registration support


      Overview & UI Improvements

      - Complete Overview redesign (3-column layout)
      - News carousel with BBCode editor
      - Cinematic hero planet section with parallax
      - Quick action column restructuring
      - Resource bar redesign (responsive)
      - Compact number formatting
      - Fixed mobile sidebar overlay behavior
      - Fixed .no-js whitepage issue
      - Optimized header layout for mobile


      SmartChat (Reworked)

      - Replaced iframe chat with native SmartChat
      - BBCode support
      - Admin moderation + ban system
      - Toast notifications (filtered)
      - LocalStorage tracking
      - UTF-8 safe handling
      - FAB repositioned bottom-right
      - DB version bumped to 12 (idempotent migration handling)


      Forum & Community

      - Implemented in-game forum
      - Categories + posts + BBCode
      - Forum notifications
      - PlayerCard modal integration
      - Replaced Fancybox with custom modal
      - BBCode support in alliance pages


      ⚙ Admin Panel

      - Aerospace-themed redesign
      - Unified design tokens
      - Admin Debug Panel (plugins/hooks/modules)
      - Quick-edit popup
      - Twig attribute access fixes


      AJAX & Cronjobs

      - AJAX-based build/research/fleet actions
      - Fixed cronjob execution issues
      - Fixed statistics cron logging
      - Fixed officer timer & buy logic
      - Header queue timer re-init after AJAX refresh


      ⚔ Fleet & Combat Fixes

      - Fixed MissionCaseAttack strict array handling (PHP 8.3)
      - Fixed uninitialized string offset issues
      - Fixed fleet line positioning fallback
      - Fixed shipyard build errors
      - Fixed BuildFunctions edge cases


      Changelog Integration

      - Added in-game changelog page
      - Footer changelog link
      - Added menu_changelog language key (DE/EN/ES/FR)


      Initial

      - Project foundation based on 2Moons
      - Full PHP 8.3 compatibility pass
      - PDO migration
      - Strict Types enforcement


      [center]© 2026 — SmartMoons / 2MoonsCE by 0wum0[/center]
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️
    • The site will go live when it is running stably.
      SmartMoons – Community Beta
      Modernes 2Moons mit
      KI-Bots, PHP8.3 & 8.4, Twig
      UI/UX-Optik (clean + futuristisch)
      Jetzt testen & mithelfen
      Bitte
      /Bugs/Ideen per SupportTicket posten – ich bin dankbar für jeden Hinweis ❤️