Realm667 / WolfenDoom

"WolfenDoom - Blade of Agony" | Important: This is only meant for development and testing purposes. You are NOT ALLOWED to use material from this repository for your own projects. Important: This repository is for development and testing purposes, you are NOT ALLOWED to use the copyrighted material for your own projects without our permission!
http://boa.realm667.com
253 stars 27 forks source link

[3.1] Achievements System #724

Closed Shockwave508 closed 3 years ago

Shockwave508 commented 3 years ago

After seeing what the SWWM GZ mod had done with its Achievements system, I've wondered if the BOA team plans on implementing something similar one day?

Examples of possible Achievements would have to do with mission/episode completion, getting 100% kills/secrets/treasure in every playable mission, certain in-game actions (what kind, I don't know), or even tackling the game on Blazkowicz Job/Mein Lieben difficulties.

EDIT by AFADoomer: List of current achievements (those in bold are planned but not yet implemented; need more supporting work, πŸ”΄ still need icons, 🟑 are incomplete or need re-work, 🟒 are complete):

Tormentor667 commented 3 years ago

Could be interesting, but a shitload of work

AFADoomer commented 3 years ago

I could code it in (just extending the map stats handler, probably), but, yes, it would be a lot of work... Mostly in developing the list of achievements, the associated thresholds for completion, and (ideally) unique icons for each acheivement.

Tormentor667 commented 3 years ago

I could help with developing a list of achievements and also with developing unique icons. The coding part would be up to you though. I am sure it would be a lot of fun and replay value for the mod though. So, if you are up to it, count me in (as much support as I can give).

DoomJedi commented 3 years ago

Quite some people offered Steam release - mainly for achievements system. So this would answer alot of prayers.

Username-N00b-is-not-available commented 3 years ago

I have quite a cold attitude towards achievements in general, but if thought over properly they could add a lot of replay value, maybe even more than the pre-packaged addons. Personally I think the achievements should be tough challenges (possibly a bit luck-based), mostly map-specific ones, so the process of hunting them does not become boring. I wouldn't consider adding trivial ones at all, they are widely regarded as developer laziness and mocked (Call of Dooty WAD series immediately comes to mind here). Purely statistical things like 'Kill 1945 enemies' or 'Pick 40 medikits up' would also be of little interest to players (sans traditional Doom speedrunning max challenges). I am thinking of some shortcuts/timed challenges/'unintended' ways of progression/etc. I sadly won't be able to help with implementing/testing them, as I have my exams currently, but would try to come up with some ideas.


Some questions on implementation details:

  1. The achievements should probably be disabled if addons are loaded β€” but is there a way to check that via ZScript?
  2. Will the achievements be stored in savegames, as opposed to Steam where you gain the achievement on the account once and for all?
  3. What is the intended design of the achievement list? I would like to suggest a menu operated by up/down arrow keys, with achievements that have been obtained (and only them) displayed in one or two columns. This will likely mean we will have to strip off the 'Mission Summary' caption from board_hd.png into a separate graphic and add a similar 'Achievements' one.
Username-N00b-is-not-available commented 3 years ago

Here are some ideas on the achievements, well, mostly obvious ones, but we need something to start with. All achievements are obtained during single levels, but are remembered during the whole episode playthrough. Do not give any awards for CK levels (maybe except special CK achievements?).

List - Perfectionist: Finished a level with 100% kills, secrets and treasure. Yes, items are included too. There are not too many of them, and on many maps it is quite easy to get 3x100% (if you know the maps well, of course). - Speedrunner: Finished a level in half its par time. For this we would need some par times obviously (Romero-style ones). Or name it 'Timestealer', like in Stronghold? - Slickster: Finished a level without some of the required keys. Should not be that difficult for a player, actually, but will require some research on the maps' geometry. Need to compile lists for required keys for each level. Not sure it can be done in every episode (looking at C2). - Impenetrable: Took no damage during a level. Overlaps with the instagib addon. Maybe use the Stronghold 'Godlike' name? - Disgrace: Finished off a boss enemy using kicks. Could be fun with super soldiers. - Pacifist: Finished a level without killing any Nazis at all. Only count human enemies (those who inherit BasicGuard and NaziBoss?). Harming them may or may not be allowed (I prefer the first). Should be possible to complete on lower skills on levels like C1M6 (not too many human enemies), C2M1 (if you take the quick route at the end), C3M0_B, but let us not limit players to these ones :-) - Clear Shot: Killed an enemy from a very long distance. Set the minimum distance threshold to 6000, 8000 or even 12000? Needs balancing, it should be a very large distance, the target actor should be barely visible through the Kar98k scope. The player just has to find a good sniping position. Let's use 3D distance here. - Watch Your Step: Destroyed three enemies with a single deployable mine explosion. Well, at least it would give this pickup a purpose. No mines in C1. - Chevalier: Defeated a magical skeleton in a fair fight. In other words, kill a Loper using only the primary attack of the Firebrand. No other weapons, no grenades, no powerups such as Adrenaline or Totale Macht, no Ascher intervention. The alternative fire should only be allowed for buffing the melee damage, not for ranged attacks. - How it was in 1915: Survived in a hazardous environment without any special gear. Finish C3M4 without picking up the gas mask. Inspired by Scuba Steve's feedbacks on the map.
AFADoomer commented 3 years ago

I haven't done much work on the implementation for this at this point, but all of those sound reasonable. My plan was to encode achievement completion in a cvar so that they would be resident across all playthroughs for that player.

Username-N00b-is-not-available commented 3 years ago

It would sadly be very easy to counterfeit that CVAR by modifying it in the configuration file or even from the console.

AFADoomer commented 3 years ago

Not if I do a basic seeded algorithm to scramble it... still could be reverse-engineered if someone digs through the scripts, but if they want to go to those lengths, they could fake it regardless.

Tormentor667 commented 3 years ago

I think adding various "generic" achievements should be added as well, as some kind of "appetizer" - firing a certain amount of bullets, killing a certain amount of enemies, generic stuff of all kind.

DoomJedi commented 3 years ago

As alot of stuff are breakable in this mod - I think finishing a level without breaking any scenery is a cool achievement. Same we can go for "breaking all scenery in a level" - "Elephant in china shop" achievement.

Finishing without use of grenades? Brutal achievement? How many enemies he killed in brutal death (burn, rpg etc) Maybe achievement about how many enemies he caused to surrender to him? Zombie killer with over 500 kills? Passing the game without use of any secrets? Passing BoA without use of sniper scope? ...Or RPG? We can make achievement for passing the level C3M1 after alerting all enemies at the start of a level? Same for C2M1? "Stealth is for losers" achievement? Less than N reloadings per level achievement? Passing BoA with no manual reloads?

I think we might need "under-achievements" too? Like "anti-medals" of Skulltag? For many self-kills in a level using your own weapons? "Meaningless death" achievement for many death not from enemy but from environmental dangers, including falling damage, lava etc...? under-achievements for being killed with melee attack or simple pistol? Killed by critters? Those are always funny as "danger". Maybe for too many saves and reloads?

AFADoomer commented 3 years ago

Most of those are good ideas. I think they will be pretty easy to implement.

Keep in mind that I need to be able to put a "hook" into the code somewhere to measure something for each achievement; anything with damage to Nazis (or inheriting classes), use of specific weapons, secret counts, reloading, etc. is relatively easy already.

Stealth checks will probably require some work; I'm not sure how the "Stealth is for losers" one would work; maybe more than 50% of total map ticks spent with enemies alerted?

I already added a "Naughy, naughty..." achievement that is given for using the 'give' cheat, so the anti-medals idea is good, too. For meaningless deaths: at least one death from lava, poison, and drowning?

Each of these also will need a unique icon. I was originally considering doing military-style medals for each, but the icons become meaningless then because they are too small... If I can get help with ~24x24 icon images that fit our style (they can really be ~32x32 to allow for shadows, etc.), that would be very useful.

Tormentor667 commented 3 years ago

I can take care of the graphics as soon as I know which achievements we will go fot

DoomJedi commented 3 years ago

How about average speed (moving speed) achievement? Average kill rate achievement? Average kills per minute of play or whatever? How about not picking at all ammo/health dropped my enemies, only standart pickup? How about for picking ammo/health only from dead enemies, no normal pickups? Accuracy achievements? Percentage of bullets found the target.

MuadDib90 commented 3 years ago

I can take care of the graphics as soon as I know which achievements we will go fot

I'd like to (try at least) help in this field too. :)

Username-N00b-is-not-available commented 3 years ago

Did not test the system in game, but the code seems solid, and the 'security system' is just the right level (to not be editable by hand, at least). Thank you very much for the implementation, @AFADoomer! If you don't mind, here are some questions:

  1. The CVAR is currently defined as user-scope, and is therefore saved into savegames, but not into the config file (I can be wrong here). Does it mean that the player's achievements are reset to zero after restarting GZDoom (but can be loaded from a savegame)? Would this behaviour lead to problems when loading savegames from two different sessions, and could changing user to nosave help with the situation?

No, the value is saved across sessions as expected. Achievements are independent of session, save, etc. The values get saved on map unload (level exit, typically) unless you are restoring from a savegame (so if you get am achievement, the quickload, you might lose it if you don't get it again. Might change this) - AFA

Good to know, thanks! --N00b

  1. Google Books says that 'slikster' without c is not used in books: https://books.google.com/ngrams/graph?content=slickster%2Cslikster&year_start=1800&year_end=2019&corpus=26&smoothing=3&direct_url=t1%3B%2Cslickster%3B%2Cc0, is this spelling a reference to something? Also when writing the idea on this achievement I meant that the player should miss some, not all of the keys, and still complete the level. I also have severe doubts on the latter being possible to accomplish, but the former definitely is possible.

It's not a word used routinely in English; I just used what you suggested πŸ˜„ . I'll probably change the text title to "Slick Moves" or something that would be more readily understood - AFA

Fair point, what about 'trickster' then? --N00b

  1. If the 'Watch Your Step' achievement is implemented, I think it would be better to raise the bar to 4 or 5 enemies. 3 could have been good for my proposed system where the achievements are restricted to a savegame.

It's implemented already, but the value is easy to change. That said, it's not easy to get this at all, because the enemies run away from mines, so even 3 may be too high. - AFA

Ah, yes, now I see (the corresponding ACH_ constant does not have a comment). Should be possible with dogs and patrolling three-guard companies in C2M6_B (the ones which related to a bug I reported). --N00b

  1. As for the par times, it would be nice to have a playtester (or two) play through the levels as quickly as possible and tell us the time results, but we can also estimate the times based on pagb666's playthrough, for example.

Agreed... Using the times for those playthroughs was my thought as well. -AFA

  1. Will achievements like 'Sharpshooter' be taken from the player when the corresponding statistics get out of the interval, or they will stay in the list?

No, it's a one-time award. The 100 shots minimum was completely arbitrary, so can be raised... You also pretty much can't use the shotgun or machine guns if you actually want to get this achievement, unless you want to dump a bunch of ammo into a tank from close range. - AFA

For the tank shotgunning, maybe we could add a distance check, e. g. the player should be at least 512 units away? So that: player misses: increment shots[consoleplayer][1]; player hits, enemy is close: disregard this shot at all; player hits, enemy is far away: increment both shots[consoleplayer][0] and [1]. Then the initial 100 shots would also be adequate, I think :-) --N00b


@DoomJedi Thank you for lots of good suggestions! (I chuckled a bit on reading about the слон Π² посудной Π»Π°Π²ΠΊΠ΅.) I would only like to comment on points from your last message about items: it is impossible to determine by looks of an item if it was dropped from an enemy or set in map editor/spawned via scripts, and there are also lots of cramped spaces and narrow corridors in BoA where you cannot avoid picking items up, so trying to accomplish these achievements could become really frustrating. But for a small single level (e. g. C1M1) the one about avoiding normal pickups can be possible.

I can't think of a good way to measure this one, though. Because of how inventory pickups are processed (initial pickup gets converted directly to the player's inventory item, so is never actually destroyed), there's not a good way to automatically detect when an item is picked up if it wasn't in the player's inventory already - AFA

Tormentor667 commented 3 years ago

Some achievement ideas:

Just tossing around, pretty sure that you can give better names for them, and no need to add them all, just ideas :)

MuadDib90 commented 3 years ago

Hi, here are some of my drafts. Size 32x32 as @AFADoomer wanted. This is just for discussion, and to get an idea, and also as a starting point.

The idea behind it is a frame in which is a some icon, that represent the achievement. The green background means it has something to to with "not to do something" or "be it a peaceful way". Yellow to orange background means it has to do marginally something with killing, but does not necessary means you have to kill to achieve it. And the red one, naturally, has to do something with killing in either way to complete an achievement.

Perfectionist Perfectionist Gunslinger Gunslinger Clear Shot Clear Shot

MuadDib90 commented 3 years ago

Some achievement ideas:

* Unlock Operation Eisenmann (collect all Eisenmann Files)

* Unlock Operation Astrostein (collect all Mayan Artifacts)

* Full Arsenal (collect each weapon at least once)

* Chief Physician (use 20 fieldkits)

* Treasure Hunter (open 20 treasure chests)

* Gold Digger (collect 1000 gold)

* Stay Dead (kill 50 soldiers which revived and attacked you sitting)

* Gib'em all! (make 100 soldiers gib/explode)

* It's neat (find all 3 Keen cartridges)

* Wolfenaddicted (play Blade of Agony at least 10 hours)

Just tossing around, pretty sure that you can give better names for them, and no need to add them all, just ideas :)

As for my opinion, I am really against all achievements, that could be achieved only by reguraly playing the game. That breaks the idea behind it. You have to do something in addition to achieve it - that's the point. But that is just my point of view. :)

AFADoomer commented 3 years ago

They do serve the purpose of showing the player how achievements work, though.

I like all of these suggestions, and most are easy enough to implement... I don't know that we have a good way of tracking total gameplay time right now, though.

MuadDib90 commented 3 years ago

They do serve the purpose of showing the player how achievements work, though.

Well, I can understand this, if there are 2 achievements that are there only for that purpose; and are in a good way executed. Otherwise it is what I said. - Again, no hard feelings, only my point of view.

Username-N00b-is-not-available commented 3 years ago

Incrementing a counter in WorldTick calls does not seem to be a good solution from the performance perspective :-) , but maybe we can add level.maptime to the counter on map endings, similarly to MapStatsHandler.

AFADoomer commented 3 years ago

Probably the actual WorldUnloaded call. Need to try to rework how the level exit calls are run anyway, since they only work for crossing lines and 'using' NPCs, not exiting via scripts or console.

Tormentor667 commented 3 years ago

Perfectionist Perfectionist Gunslinger Gunslinger Clear Shot Clear Shot

They are not bad, but I would go for a different style though, something similar to our "Objective Accomplished" graphics. I have already something in mind, but didn't have time yet to start with them. Will do this week though :)

MuadDib90 commented 3 years ago

OK, I'll wait. :)

EDIT: @Tormentor667 I can't stop thinking about it. :D I am really eager to see what you have in mind. Because I can't really image how do you want to use that objective star other than as a fully icon for completed achievement...

Shockwave508 commented 3 years ago

I'd like to throw my hat in the ring for an achievement suggestion: Finishing C1M5 (Operation: Paris) without making use of the Nebelwerfer even once. I admittedly hunkered down during every one of my runs and repeatedly spammed this weapon until Allied reinforcements arrived at Wave 7.

Username-N00b-is-not-available commented 3 years ago

@Shockwave508 Would it be a serious achievement for the player? Surely the Nebelwerfer may be way more fun to use than the machine guns, but the turrets spam bullets pretty quickly, so it is hard to get overwhelmed even at the frontmost position if you do not forget to crouch. (I did not even know about that the Nebelwerfer can be shot prior to #800, and had no problems with completing C1M5. I have always considered this battle really easy, especially compared to what we have later on.) This is not an objection, I would not be against such an achievement, just asking.

Tormentor667 commented 3 years ago

@AFADoomer just for the record, graphics max size is 32x32 because that's the max amount of pixels for that, right? Or is more possible in case of an higher resolution?

AFADoomer commented 3 years ago

Correct. If they need to be bigger, they can be, but the text will be disproportionately small.

Tormentor667 commented 3 years ago

Right then I will stick to 32x32 graphics. Will do them this weekend.

MuadDib90 commented 3 years ago

@AFADoomer @Username-N00b-is-not-available what are the plans for achievement? Some sort of table where you could see which of them are completed? Where will this be accessible? Do we need some accounts system for it? (If I overlooked these information, I apologize for duplicity.)

AFADoomer commented 3 years ago

I don't know. A table would be cool... I had planned a boring on-screen list.

This will also let me convert the cacoward, Keen award, etc. to be saved like achievements and make them spawn only if picked up in play, too.

Tormentor667 commented 3 years ago
ac_gunslinger ac_iamironman ac_impenetratable ac_liquiddeath ac_longplay ac_naughtynaughty ac_pacifist ac_perfectionist ac_peskyproblems ac_sharpshooter ac_slikster ac_spamspam ac_speedrunner ac_stingy ac_watchyourstep ac_apeacefulsurrender ac_asin1915 ac_assassin ac_autoweapons ac_beammeup ac_blastresistant ac_chevalier ac_clearshot ac_demolitionist ac_disgrace ac_feeltheburn
Tormentor667 commented 3 years ago

Finished all, let me know if I missed one, if someone wants to create icons as well, here is the PSD file :)

achievements.zip

MuadDib90 commented 3 years ago

Finished all, let me know if I missed one, if someone wants to create icons as well, here is the PSD file :)

achievements.zip

:laughing::laughing::laughing: OK... I can't compete with this it seems, I give up...

EDIT: you did 26... but in CSV are 33 achievements in total.

Tormentor667 commented 3 years ago

Can someone tell me which ones are missing?

Username-N00b-is-not-available commented 3 years ago

@Tormentor667 The ones missing are mostly the ones which have not even been thought over and implemented yet... Also there are 34 of them planned currently (@AFADoomer enumerated them starting from zero).

Tormentor667 commented 3 years ago

I only count 26 in the top post

Username-N00b-is-not-available commented 3 years ago

@Tormentor667 See this file: https://github.com/Realm667/WolfenDoom/blob/7b5702b0868b4bc0d019ddbe9e8cc7cbdb456def/scripts/eventhandlers/Tracker.zs#L378

Tormentor667 commented 3 years ago

The problem here is: Without knowing what the achievements to, I can’t create icons for them

AFADoomer commented 3 years ago

Of the ones that are implemented, we're missing an icon for:

And the icon for Gunslinger needs to be updated to 1000, not 100 (ACHVMT00.png).

EDIT: Updated top post with consolidated info.

MuadDib90 commented 3 years ago

Guys, shouldn't we use present time instead of past time, when describing achievements?

So for example intead of \cFSharpshooter\n\cCMaintained 75% accuracy or higher after firing more than 100 rounds! there would be better to have Maintain.

Reason? If achievement is completed, it is OK, but if there will be a table with them, where you could read, what they are about, read it "as completed" sounds odd... On the other hand, when they are completed, read it as "what had to be done", isn't odd at all.

EDIT: also will there be (in the table) some kind of pointer/index of how much this or that achievement is completed?

AFADoomer commented 3 years ago

These strings are all shown when the player gets the achievements, so past tense is correct... But, you are right, we'll need other future tense strings if we want a list of what to do to accomplish the achievements.

A note for anyone trying to debug the achievements: If you want to clear all achievements, there are four cvars that you have to set to a blank string (""):
boa_achievementrecord0 boa_achievementrecord1 boa_achievementrecord2 boa_achievementrecord3

MuadDib90 commented 3 years ago

Someone has already mentioned somewhere on github (I think), when using "give all" cheat to obtain one particular achievement, when starting the game next time, I get a crash.

Report is enclosed.

report.txt

EDIT: And it seems to be engine (gzdoom) related, not BoA. As I made a new .ipk3 and also deleted user specific INI text file - crash persists. EDIT2: This is way more trickey then I first thought. I downloaded newest gzdoom dev_built, made a new BoA ipk3 and crash problem persists... damn. What could happend there? :confused:

Tormentor667 commented 3 years ago

Just for the record: I will take care of the missing achievement graphics this ecening

MuadDib90 commented 3 years ago

Sure πŸ‘ Also think the problem mentioned above might be in connection with some recent commit. I can't start it at all. @AFADoomer

(Can someone check this please? @Talon1024 @Username-N00b-is-not-available @Tormentor667 )

Tormentor667 commented 3 years ago

Just uploaded all missing achievement graphics and fixed the gunslinger

Username-N00b-is-not-available commented 3 years ago

@MuadDib90 Can't confirm, I don't get this crash. @AFADoomer Currently you can get Perfectionist at INTERMAP, not sure if it makes sense. Also the Blast-resistant achievement does not seem to trigger (I tested it on C1M1), neither does Pesky Problems (C1M2). After trying to trigger these I went to C1M4 and managed to get Clear Shot, so my CVARs were not broken at the time. Peaceful Solution does not trigger either, I've already spared 8 scientists and 1 mechanic...

MuadDib90 commented 3 years ago

Everything new again. Now it worked.

Tried C1M1 for some achievement hunting with god mode activated, and after finishing level it did not warped me to intermap, but rather kicked me to welcome screen with this line in console:

Attempt to save pointer to unhandled type NativeStruct(Font) (but those brackets were sharp, the code doesn't allow them to display them here)

AFADoomer commented 3 years ago

Resolved that problem in 20603beda3ffed9b07f6bc5d0d1dd46c74f69a70.

EDIT: Meaning the "Attempt to save pointer..." one... I can't reproduce the crash mentioned above, and the two achievements mentioned work for me also.