Skip to content

feat: Introduce three-tier expedition reward system #1399

Open
Geda173 wants to merge 5 commits into
lanedirt:mainfrom
Geda173:957-refactor-expedition-rewards
Open

feat: Introduce three-tier expedition reward system #1399
Geda173 wants to merge 5 commits into
lanedirt:mainfrom
Geda173:957-refactor-expedition-rewards

Conversation

@Geda173

@Geda173 Geda173 commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces the three-tier expedition reward system. Expedition finds (resources, ships, dark matter) now have three tiers of outcome, matching the original OGame behaviour:

  • Normal (89%): base reward, 1× multiplier
  • Rare (10%): 2–3× multiplier
  • Exceptional (1%): 5–10× multiplier

The same 89/10/1 weighting was already present for combat (NPC battle size) and delay factors, but each used its own copy of the algorithm. These have been unified under a new AppUtil::selectWeightedRandom() helper.

Expedition messages are now classified by tier: normal-find messages are selected for normal outcomes, and more dramatic messages for rare/exceptional outcomes. A number of new messages have been added to fill out the rare and exceptional tiers.

Type of Change:

  • Bug fix
  • Feature enhancement
  • Documentation update
  • Other (please describe):

Related Issues

Fixes #957

Checklist

Before submitting this pull request, ensure all following requirements as outlined in CONTRIBUTING.md are met:

  • Automated Refactoring: Rector has been run and no outstanding issues remain.
  • Code Standards: Code adheres to PSR-12 coding standards. Verified with Laravel Pint.
  • Static Analysis: Code passes PHPStan static code analysis.
  • Testing:
    • Relevant unit and feature tests are included or updated.
    • Tests successfully run locally.
  • CSS & JS Build: CSS and JS assets are compiled using Laravel Mix if any changes are made to JS/CSS files.
  • Documentation: Documentation has been updated to reflect any changes made.

Additional Information

Not all tier slots have final messages yet. The rare and exceptional tiers for resources, ships, and dark matter currently use placeholder or partially sourced text. Authentic OGame messages for those tiers still need to be researched and added to resources/lang/en/t_messages.php (and translated). The $numberOfVariations, $normalVariations, $rareVariations, and $exceptionalVariations counts on each message class will need to be updated accordingly.

@Geda173
Geda173 marked this pull request as ready for review April 26, 2026 11:49
Geda173 added 2 commits July 24, 2026 14:12
Resolve FleetDispatchExpeditionTest import/helper conflicts and satisfy the level-8 PHPStan config main introduced (null guards in two expedition tests and AppUtil::selectWeightedRandom).
Hoist the tiered getRandomMessageVariationIdForVariant logic into ExpeditionGameMessage so the three message classes only declare their tier counts, and derive the exceptional range from all three counts (the exceptional count was previously unused). Make AppUtil::selectWeightedRandom use random_int consistently with a leading empty-array guard, and align the lang tier comments with the normal/rare/exceptional vocabulary.
@github-actions

Copy link
Copy Markdown

Preview deployment

Preview environment for this PR is ready for functional testing. Use one of the test accounts below to log in.

Status URL Commit Last deployed
✅ Live https://pr-1399.preview.ogamex.dev 9999c2e 2026-07-24 12:26:40 UTC
Test accounts (click to expand)
Email (login) Password Role Class Planets Description
test1@ogamex.dev test admin Collector 2 Admin, high resources, mining focus
test2@ogamex.dev test player General 1 Military focus, ships & fleet
test3@ogamex.dev test player Discoverer 1 Exploration, probes & cargo ships
test4@ogamex.dev test player None 1 New player, no class selected yet
test5@ogamex.dev test moderator Collector 1 Moderator, balanced setup
test6@ogamex.dev test player General 1 Vacation mode enabled
test7@ogamex.dev test player General 3 Heavy defense across planets
test8@ogamex.dev test player Discoverer 1 Fleet focus, inactive (i) 8 days
test9@ogamex.dev test player Collector 1 Beginner, long inactive (I) 40 days
test10@ogamex.dev test player General 5 Endgame, 90 unread messages

This preview will be automatically destroyed when the PR is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Normal/Rare/Exceptional Variants for Expedition Rewards

1 participant