Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(achievement): credit users for logic, art, writing, and testing #2683

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

wescopeland
Copy link
Member

@wescopeland wescopeland commented Sep 7, 2024

This PR makes it so that developers and team accounts can credit users for logic, art, writing, and testing on achievements. There are no player-facing UI elements added as part of this PR.

Achievement credit works by leveraging the achievement_authors table. Note that only achievement-related tasks are credited as part of this PR. For game-related tasks, a separate PR will be required which will need to leverage a different table.

A sync script, only for logic credit, has been provided and can be executed via:

sail artisan ra:sync:achievement-authors

Art credit is not synced as part of this script, as it's impossible to determine when a badge change occurs if the person making the change was actually the artist.

I think what may be preferable is if there's no art credit on an achievement, assume the achievement's user_id is the artist.

New functionality has been added to the management app for manually doing CRUD operations on achievement credit:

  • On game view/edit pages (/manage/games/1), when rows are checked, a new bulk action appears for adding credit.
  • On achievement view/edit pages (/manage/achievements/9), a credits table now appears, allowing authorized users to add, edit, and delete credit.

Screenshot 2024-09-07 at 2 58 52 PM

Screenshot 2024-09-07 at 2 59 07 PM

Screenshot 2024-09-07 at 2 59 12 PM

Screenshot 2024-09-07 at 2 59 24 PM

@wescopeland wescopeland requested a review from a team September 7, 2024 19:04
app/Models/AchievementAuthor.php Show resolved Hide resolved
app/Helpers/database/achievement.php Outdated Show resolved Hide resolved
app/Platform/Commands/SyncAchievementAuthors.php Outdated Show resolved Hide resolved
app/Platform/Commands/SyncAchievementAuthors.php Outdated Show resolved Hide resolved
app/Helpers/database/achievement.php Outdated Show resolved Hide resolved
app/Models/Achievement.php Outdated Show resolved Hide resolved
app/Platform/Concerns/ActsAsDeveloper.php Outdated Show resolved Hide resolved
@wescopeland wescopeland added the deployment/command Includes an Artisan command that needs to be run before/during deployment label Sep 12, 2024
$expectedPhraseTwo = "logic";
if (str_contains($payload, $expectedPhraseOne) && str_contains($payload, $expectedPhraseTwo)) {
if (str_contains($remainingPayload, $expectedPhraseOne) && str_contains($remainingPayload, $expectedPhraseTwo)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be easier to just check the $words collection for the expected phrases? Is there some benefit to reconstructing the input string?

if (in_array($expectedPhraseOne, $words) && in_array($expectedPhraseTwo, $words)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Updated in latest.

@suspect15
Copy link

Are achievement authors going to be given credit for each of the categories by default or is the intent only to give credit to people other than the author?

@wescopeland
Copy link
Member Author

Are achievement authors going to be given credit for each of the categories by default or is the intent only to give credit to people other than the author?

When someone uploads an achievement to the server, they are by default given Logic credit. Credit for other tasks is implied.

Subsequent logic credit is automatically given if a different developer comes in and updates logic for the achievement.

Other forms of credit, such as art, must be manually granted. This is to err on the side of caution, as oftentimes the uploader for a new badge is not the artist of the badge, but doing it on a non-developer's behalf.

@ladynadiad
Copy link

Would there be a way to ensure that things like art can be done in a whole batch? It's rare for one artist to do just a few badges and would get annoying fast to have to do credits for a whole set when we have plenty of sets with 100+ achievements. A way to edit multiple at once would be a godsend. Maybe something like an option to apply the same art/writing/testing credit to all achievements or to select achievements it applies to?

@wescopeland
Copy link
Member Author

Yes, but not in this PR. The scope of this PR is already quite large; let's build that in a follow-up.

@Hexadigital
Copy link
Contributor

Would it be possible to include a category for Design credit? While I think this would normally line up with the current authorship/creator field, that's not always the case - I've seen some games where a user/player has put together an entire set plan, challenges and all, and posted it in the comments on the game page - and sometimes the developer who picks it up uses that as a guideline.

I don't remember the specific games at the moment, though it might be easy to find by looking for game wall comments containing Google Sheets links.

@wescopeland
Copy link
Member Author

Yes. That is a minor change. Added in latest:

Screenshot 2024-09-26 at 8 38 44 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment/command Includes an Artisan command that needs to be run before/during deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants