Skip to content

StevenG916/phpsgex4

Repository files navigation

phpSGEx 4.0

A PHP browser strategy game engine — build your own Travian/OGame/Ikariam-style game. Fork it, configure it, play with friends.

Originally created by Aldrigo Raffaele (raffa50). This is a modernized fork of the phpSGEx 3.0 Alpha codebase.

Quick Start (Docker)

git clone https://github.com/StevenG916/phpsgex4.git
cd phpsgex4
make up

That's it. Open http://localhost:8080 and you've got a running game.

Default admin credentials are in .env (auto-created from .env.example on first make up).

Other commands

make logs    # Watch application logs
make shell   # Shell into the app container
make db      # MySQL CLI
make reset   # Nuke everything and start fresh
make down    # Stop all containers

Manual Installation (No Docker)

Requirements: PHP 8.2+, MySQL/MariaDB 10+, Apache with mod_rewrite

  1. Copy files to your web root
  2. Copy .env.example to .env and edit database credentials
  3. Visit http://yourserver/ — the installer will run automatically
  4. First registered user becomes admin

What Is This?

phpSGEx is a game engine, not a finished game. It gives you:

  • Multiple map systems — OGame-style galaxies or Travian-style flat grid
  • Buildings, research, units — all configurable through the admin panel
  • Combat — send armies to attack other players
  • Alliances — diplomacy, shared vision, war/NAP/ally pacts
  • Messaging — in-game mail with BBCode
  • Plugin system — extend with custom controllers and features
  • Admin panel — configure game speed, resources, races, and more
  • Multi-language — EN, IT, DE, ES, BG, NL, RU

You configure the game data (what buildings exist, what units do, resource rates, etc.) and your players handle the rest.

What's New in v4

  • Docker supportdocker compose up and play
  • PHP 8.2+ — modern PHP with typed properties, enums, match expressions
  • Security overhaul — Argon2id passwords, prepared statements, CSRF protection, XSS escaping
  • Auto-setup — database initializes automatically on first boot
  • .env configuration — no more hardcoded credentials in PHP files

Configuration

All configuration is in .env. Key settings:

Variable Description Default
GAME_NAME Server name shown to players My Strategy Game
GAME_MAP_SYSTEM 1 = OGame-style, 2 = Travian-style 2
ADMIN_USERNAME Initial admin account admin
ADMIN_PASSWORD Initial admin password changeme_admin_password

Game balance settings (resource rates, build times, etc.) are configured in the admin panel at ?pg=acp\Configs.

License

Licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).

phpSGEx was originally created by Aldrigo Raffaele (raffa50) and released under a Creative Commons ShareAlike license. This fork keeps the same terms: you are free to use, modify, and redistribute it — including running your own private game servers — as long as you credit the original author and license any derivative work under the same terms.

Contributing

Pull requests welcome. See PROJECT_PLAN.md for the roadmap and what needs work.

About

Multi-game PHP engine with web installer — OGame, Travian, Ikariam support

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages