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

Improve organization of achivements, port skill achievements #2613

Merged
merged 8 commits into from
May 5, 2023

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Apr 10, 2023

Summary

SUMMARY: Content "Port over skill achievements, use consistent capitalization and category indicators in achievement names"

Purpose of change

Figured I can work on porting over a few more easy achievements that don't yet require many code changes to support (this turns out to be wrong, see below). Along the way I also decided it'd be good to add a general indication of what sort of achievement each is in the name (similar to Arcana and Cataclysm++ preceding the title with mod name), so they have a cleaner organization on the achievement screen.

Dependent upon #2719 to work right, that PR will need to be merged first.

Describe the solution

Ported over skill achievements, minus skills BN lacks. The level 7 achievements instead set to trigger on level 5 so it's a marker of mid-level skill to space them out better, picked a less masturbatory name for the level 10 computer skill achievement. Also corrected any typos from PR JSON I found along the way. Formatting is also now fixed up thanks to Kheir.

Also decided to go a bit easier on achievement names/descriptions that're just namedropping some random person outright, and accordingly rewrote a couple of descriptions in turn. Though The Doctor Is In might still be read as a reference (well, would if time travel was a skill), and Captain of The R-MCC Landship does reference a famous meme deathmobile by a one @EkarusRyndren but otherwise...

Also added the if statement in Character::practice that ensures the event triggers, to quote their reasoning:

Achievements do check for player being player, but that's being done on json level and technically can be omitted, so I'm not taking any chances. That might sound like an overkill but I'd rather have it this way, then having someone in the future scratching their head why some non-player event didn't trigger.

From what I found in JSON, it seems this is indeed important for it to work, but this needs Kheir's fixes to fix all the weird shit going on in the underlying code.

And in addition to all that, made capitalization consistent for achievement names, and added preceding category tags such as [Combat], [Skill], and so on, along with converting all names to use strings.

And also misc, updated one case of an achievement name making a pun that depends on the game name involving dark days.

Describe alternatives you've considered

Giving up and going to bed. :<

Testing

  1. Checked out Kheir's branch for fixing up achievement code and dropped my JSON changes into it.
  2. Compiled and load-tested.
  3. Started up a character with 9 unarmed skill, correctly start off with the level-5 achievement obtained. Confirmed that the level-10 achievement is visible too.
  4. Debugged in Fast Learner, Beast threshold, Apex Predator (so it doesn't take forever to skill-grind), and summoned a debug monster.
  5. Hammered at it a while until unarmed level reached 10, achievement get.
  6. Restarted test with a zero-skill debugged in Fast Reader, 9001 int, and 101 Crafts for Beginners.
  7. Read until level-up, confirmed I did not get an achievement just for obtaining level 1.
  8. Press-gang companion NPC into joining me, debugged their fabrication skill to level 9 and int to 9001, set my int back to normal and fabrication up to 5. Confirmed this does not adjust skill since done in dubug-only.
  9. Read The Art of Japanese Armormaking until they leveled up instead of me, confirmed this does not trigger any achievements I don't deserve.
  10. Kept on reading until I hit level 6, confirmed this retroactively unfucked the level-5 achievement previously softlocked by debugging.

With Kheir's prerequiste PR, the weird behavior I discovered during the original test is all entirely fixed up.

Additional context

Source PR: "Skill based achievements" by @nexusmrsep: CleverRaven/Cataclysm-DDA#41657

I've tested DDA and yeah, at present skill achievements softlock over there too.

Co-Authored-By: nexusmrsep <39925111+nexusmrsep@users.noreply.github.com>
@github-actions github-actions bot added JSON related to game datas in JSON format. src changes related to source code. labels Apr 10, 2023
@github-actions github-actions bot added the tests changes related to tests label Apr 10, 2023
@chaosvolt
Copy link
Member Author

So, after further testing, the problem has multiple facets to it:

  1. First, Game::Start_game needs a way to even check whether to send the correct events should you start with a given level of skill. I've included a change to game.cpp that does this, barring the additional complications below.
  2. When the above successfully triggers (it doesn't always, see point three), it correctly marks the event as triggers but for whatever reason when called this early the achievement itself isn't considered complete:
    image
  3. And finally we get to the other big flaw, and what I noted in the PR OP to be functionally the main root problem here: you don't even get the event triggering successfully if you start with MORE skill than required, it only triggers if you start with EXACTLY the target skill level. This can be trivially tested in both BN and DDA by starting as a black belt, with 8 in combat skills you'll start off having effectively softlocked the level 5 (BN) or 7 (DDA) achievements for those skills.

@chaosvolt
Copy link
Member Author

So I'm still looking at this and I feel like it'd legit just be better to say "fuck it" and go with the option where the level-5 achivements are self-hidden, avoiding the issue of chargen letting you softlock achievements by just only making them visible if you earn them via in-game means.

Reasons being:

  1. I already the mutation threshold achievements to self-hidden for the explicit reason that literally only one of them will ever be obtainable in normal gameplay, so having the rest there sitting there mocking the player seems kinda pointless. Therefore, hiding achievements for the sake of ensuring you can't be in a situation where the achievement shows as still being obtainable while in fact being unobtainable already has a precedent set for it/.
  2. Having them visible from game start doesn't really add any player-nudge value, the skill being on their @ screen is already all the nudge the player needs to try and level up a skill.
  3. As noted, DDA already happily uses skill achievements even with it being easy to softlock them just be starting with 7+ skill. If it's good enough for them, then surely adjusting it so the JSON at least makes the softlock itself a non-issue is still an improvement.

@scarf005 scarf005 changed the title [WIP] Improve organization of achivements, port skill achievements Improve organization of achivements, port skill achievements Apr 22, 2023
@chaosvolt
Copy link
Member Author

I've decided to go the route of having the level-5 achievements self-hidden for the above reasons.

@chaosvolt chaosvolt marked this pull request as ready for review April 27, 2023 15:52
chaosvolt added a commit to chaosvolt/cdda-arcana-mod that referenced this pull request Apr 27, 2023
Parallel with but not really dependent upon cataclysmbnteam/Cataclysm-BN#2613
@github-actions github-actions bot removed the src changes related to source code. label Apr 28, 2023
chaosvolt added a commit to chaosvolt/cdda-arcana-mod that referenced this pull request May 4, 2023
Set aside as a self-PR for when cataclysmbnteam/Cataclysm-BN#2613 is merged, using the new achievement format introduced there so that skill achievements don't shit themselves if you start with enough chargen skill to exceed the achievement's target skill level.
@chaosvolt chaosvolt requested a review from scarf005 May 4, 2023 09:00
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image
image
image
created a new world with event bus enabled, but i was unable to find any achievements. could you help me setting up achievement correctly?

@chaosvolt
Copy link
Member Author

chaosvolt commented May 4, 2023

created a new world with event bus enabled, but i was unable to find any achievements. could you help me setting up achievement correctly?

Oh that's weird. Make sure you've closed the game, re-opened, then created the new world after enabling event bus? o.O

Note that event bus is enabled by default in the options, too.

@KheirFerrum
Copy link
Collaborator

KheirFerrum commented May 4, 2023

created a new world with event bus enabled, but i was unable to find any achievements. could you help me setting up achievement correctly?

This looks like it might be due to fuckery in game.cpp. I had the same issue when I reverted some of Chaos' older commits to play around. Up to date branch has no such issues however, so perhaps your branch is out of date.

@chaosvolt
Copy link
Member Author

Let me update from upstream and see if that fixes it.

Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image
not sure why but Do-It-Yourselfer does not show which skill triggers it.


Followed given testing steps and confirmed they worked as written

image
image
image
image
image
image

LGTM

  • tip: setting int to 99999 makes upping a skill from 9 to 10 take less than a minute

@scarf005 scarf005 enabled auto-merge (squash) May 5, 2023 02:33
@scarf005 scarf005 merged commit 8cfacd4 into cataclysmbnteam:upload May 5, 2023
@chaosvolt chaosvolt deleted the more-easy-cheevos branch May 5, 2023 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. tests changes related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants