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):

x3003 commented 3 years ago

The achievement system looks pretty cool, but will you also see them (for example) on an extended board in the general's room and after finishing a chapter ?

AFADoomer commented 3 years ago

@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...

All of these work as expected for me...

I added checks so that achievements won't count on non-CxMy maps (other than the test maps) in 0c9d5edc011d4e4fbb06e57d0645fc7296fc97f4.

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

Also the 'gather 1000 coins' achievement won't workon my machine... Very strange.

AFADoomer commented 3 years ago

Using the give cheat resets the count on the coins and weapon types...

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

Yes, it seems that I was using it too often... Spawning 10 TreasureChest2 treasures does help at obtaining it. Are there any other culprits that could have given problems with Blast-resistant, Pesky Problems, Peaceful Solution?

AFADoomer commented 3 years ago

Not that I know of.

I just tested Blast-resistant by finishing C1M1 without throwing grenades, killed myself my taking a bunch of health and spawning rats to bite me, and spawned/removed scientists until 5 surrendered, and was awarded as expected each time.

Are you sure you didn't already earn these achievements?

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

Well, here are the nonempty achievement records that I have: N4M5gzmDOoM7gz2DPYM/gz+DQINBg0ODRINFg0aDRw== and g0iDSYNKg0uDTINNg06DT4NQg1GDUoNTg1ODVQ==.

AFADoomer commented 3 years ago

Use the current build and enter 'netevent printachievements' in the console 😁 .

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

Damn, logfile does not work properly in this devbuild for some reason, gives

Log started: 2021-06-14 00:00:15
]netevent printachievements
]logfile
Log stopped: 2021-06-14 00:00:26

Here's my list, and I can say that I definitely did not grab any Mayan artifacts in the achievement builds, nor did I kill 500 zombies, nor finished a level without manual reloads, that's for sure. It appears to me that the encoding/decoding system has a bug somewhere... image

By the way: 1) I fixed some formatting issues in the CSV (replaced the percent sign which ate the following letter with double percent, changed \c to \n in one instance, removed \n\n\n in zombie achievement), 2) AFAIK we don't have Keenawards or Cacowards on maps except, obviously, INTERMAP (but two or three Naziwards are definitely present).

AFADoomer commented 3 years ago

Hmmm... Have you ever cleared your achievements list? The parsing changed a couple of times, so you may have some garbage in the system, so to speak. Liquid Death is impossible to have awarded right now, so something's definitely off.

EDIT: And, yes, the log doesn't work properly with the widget-based log because ZScript can't write to the log, but the internal code can. I submitted a pull request to GZDoom a week ago to add that, but...

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

Then yes, there could be leftovers. Last time I deleted it was two days ago, when it still was a single string... I'll clear it right now and try again testing the achievements tomorrow.

AFADoomer commented 3 years ago

2) AFAIK we don't have Keenawards or Cacowards on maps except, obviously, INTERMAP (but two or three Naziwards are definitely present).

Crap... Didn't realize that... Maybe this should be changed so that there's one per Chapter? The current Naziwards are in C3M0_A and C2M3. Would be fitting to do the Cacoward in C1 and the Keen award in C3, given what both were awarded for. Thoughts?

MuadDib90 commented 3 years ago

When I try to print achievements @AFADoomer using your command "netevent printachievements", I get a VM abort:

VM execution aborted: string format failed. Expected a pointer for format % p. Called from AchievementTracker.NetworkProcess at boa.ipk3:scripts/eventhandlers/tracker.zs, line 514 Called from Console.Printf [Native]

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

@MuadDib90 There is a problem with displaying percent signs, could you please change the ones in Czech translation to word 'percent' for now?

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

@AFADoomer Retested from nonexistent CVARs, and I would say that there definitely is a problem. I warped to TEST_LDR, completed some achievements like Chevalier and 4077, then I warped to C1M0, and miraculously a lot of new ones have popped up in the list (shown in green at the bottom part of the attached screenshot):

achievements


Regarding Trickster: it is possible at least on

spoilers C1M2 (grenade-jump from (1300, 800), bypasses green key in the shark area) C2M1 (well, we probably need to exclude the red key from the 'necessary' keys on the list, as it is optional)

By the way, could it be possible to switch the achievements tracking off after the player enters a cheat (for example, kill the in-level tracker)? Is there a way in ZScript to gain access to information on whether a cheat has been entered?

MuadDib90 commented 3 years ago

@MuadDib90 There is a problem with displaying percent signs, could you please change the ones in Czech translation to word 'percent' for now?

Sure, done. :)

MuadDib90 commented 3 years ago

@AFADoomer I completed C3M4 without a mask on (also without god mode) and nothing earned.

AFADoomer commented 3 years ago

The encoding/decoding has broken at some point for all but the first variable. I'll have to redo it tonight. This causes achievements to not award because they incorrectly show up as already awarded.

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

@MuadDib90

Sure, done.

Could you please also do the ACHIEVEMENT1 one? The current version does not trigger a VM abort, but I'd remove the percent signs to be sure.

MuadDib90 commented 3 years ago

@MuadDib90

Sure, done.

Could you please also do the ACHIEVEMENT1 one? The current version does not trigger a VM abort, but I'd remove the percent signs to be sure.

As you wish. Done.

AFADoomer commented 3 years ago

Just updated the tracker in be5ce615c9753e0e85561bb5e6dea4ca41788fb4. System time for when you completed the achievement is now stored in the CVar.

Achievements probably all need to be cleared to make sure they show up correctly now... The number of achievements being stored per CVar was off by one from the proper value, so they may decode incorrectly now (and any that you completed will be dated in 1969 😁)

EDIT: I need ideas for in-game achievement display... and location.

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

@AFADoomer It was suggested a few times here on GitHub that we show the achievement list in conjunction with the map stats screen, maybe not on the blackboard itself but rather on a sheet of paper (we could use left/right arrows to switch between stats/achievements and up/down to scroll the achievements list). By the way, if/when we add some new achievements in the future, will the current storage method be backwards compatible (could the achievement records from a previous version be read by the code tailored to the new amount)?

MuadDib90 commented 3 years ago

EDIT: I need ideas for in-game achievement display... and location.

I was thinking about something similar to @Talon1024's message log? Slightly greyish background, and game is paused, so you have time to read all of that. But instead of displaying messages, we can display all achievements in similar manner as "tiles" in windows. Those achieved ones in color, those still unachieved in dark grey (but not much so you can still read it). And it is also srollable, so when new achievement will be added, it'll just display as next one in row or column. Maybe rows with 3 columns each?

So the achievements stats/table will be accessable only from in-game?


@Talon1024 also regarding message log, could it be done similary to objectives, as the key bound also exits the message log?

Tormentor667 commented 3 years ago

I would also recommend some ingame paper in the briefing room near the blackboard

MuadDib90 commented 3 years ago

And one other thing. Do we plan some extra explanations of achievements of what you need to do that pop-up after you move your cursor over particular achievement? Some are pretty obviour, but for example "chevalier" is not...

MuadDib90 commented 3 years ago

@AFADoomer boa_achievementrecord3 can't be cleared. At least it doesn't work on my device. The others can. And regarding that achievement board, which is very nice, can we have only 3 columns with scrolling down? For the time being it is hard to read properly. Also do you plan to add to right down corner of each achievement how much of it is achieved? Similary to that time counter of "get out" achievement.

Tormentor667 commented 3 years ago

I love the achiement board, I totally love it :) I'd keep the 4 columns though but the small font is indeed at the edge of being readable, I do understand @MuadDib90

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

@MuadDib90 The achievements are stored in the gzdoom-USERNAME.ini file. You can just erase manually the lines which contain these strings. Some (mostly subjective) comments on current situation:

Tormentor667 commented 3 years ago

Par times have already been added by @AFADoomer from YouTube playthroughs

AFADoomer commented 3 years ago

@MuadDib90 - You can clear boa_achievementrecord3 manually in the console by entering set boa_acvievementrecord3 "" in the console. It's being used to track achievements that span game/save sessions (play time and a couple of others), so normally shouldn't be reset.

You can clear individual achievements by entering netevent achievment x -1, where x is the index of the achievement (so Gunslinger is 0, Treasure Hunter is 28, etc.). Use 1 instead of -1 to force the achievement to be "accomplished".

MuadDib90 commented 3 years ago

I love the achiement board, I totally love it :) I'd keep the 4 columns though but the small font is indeed at the edge of being readable, I do understand @MuadDib90

So can we at least make the description texts like 1,5x or 2x bigger?

Tormentor667 commented 3 years ago

Just uploaded "Trophy Hunter" achievement graphic, needs proper renaming

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

@AFADoomer

The only ones that get reset are the total coin count, collecting all weapons, and Keen cartridge collection.

Then I would like to tell you that there is a bug, I've accumulated more than 140 save files (regular saves, not quicksaves) during my recent C2/C3 playthrough, but it was not marked as complete. I do not recall resetting the CVARs during the playthrough.

AFADoomer commented 3 years ago

Saves weren't being tracked across gameplay sessions (new game or clean restart not from a save file). They are now.

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

Implemented two of my suggestions in https://github.com/Realm667/WolfenDoom/commit/a397fbd1b8f43b48b8939e48db6886c9bf8b56b6; @AFADoomer, I think there are still some problems with current progress on the achievements across games and savegames, it does not end up in the configuration file for some reason (the achievement records work fine). Open INTERMAP and make a savegame near the board; pay attention to the current Gunslinger shot amount, say X (it was 0 for me). Type map c1m2, shoot 7 times, load the INTERMAP savegame. It will display X + 7, as expected. Close GZDoom, then load the INTERMAP save again. For me the Gunslinger amount again became zero.

MuadDib90 commented 3 years ago

I've finished Rastenburg without a gas mask, but did not achieved the 1915 achievement. What are the conditions again please? Also, could be good to add to the description of that achievement that you have to finish the Rastenburg map to achieve this...

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

@MuadDib90 You should not pick it up on the level at all for the achievement to be accomplished. I changed the string in the CSV: Finished the level with no gas mask! -> Finished the battle of Rastenburg with no gas mask!

AFADoomer commented 3 years ago

Achievement status not carrying across engine restart and save load should be fixed after a5581978969ca9b76b50477baefd5e99e31c2654. Hopefully this doesn't break anything else.

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

@AFADoomer This time, when I got to the achievement board on the INTERMAP, it was not shown + I got a VM abort on moving the mouse: achVM I fixed this in https://github.com/Realm667/WolfenDoom/commit/cd1cb930381221bce82b7266d2c1c71976221bda by searching for AchievementTracker in lines akin to https://github.com/Realm667/WolfenDoom/blob/ad269cfec30a38562b8aec07705f5ec982b71320/scripts/decorate/weapons/granate.zs#L136 and replacing EventHandler with StaticEventHandler. The opposite could also be done, but it is not necessary, since EventHandler is a subclass of StaticEventHandler.


After removing the VM abort everything seems to work properly. Thanks! No, the same problem as in https://github.com/Realm667/WolfenDoom/issues/724#issuecomment-866106134 still happens sadly...

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

@AFADoomer The problem still does happen (edited my previous post)... By the way, I also have a suggestion for the menu: would it be possible to show only icons in the list, so the player will be able to click on an icon ('badge'), and a message with the title, icon, description and time would appear (in a message box alike to what is shown now, but it will be shown alone and with a much larger scale than what we have on screen)? @Tormentor667, what do you think about this design?

MuadDib90 commented 3 years ago

@Username-N00b-is-not-available I have proposed a change about it. To show only 3 columns with addition of vertical scroll. That would be sufficient, imo. But @Tormentor667 wanted to keep it. :)

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

What if someone tries to play Blade of Agony on a calculator? Just kidding :-) IIRC there were some problems with vertical scrolling implementation in BoA (specifically with the help screens), but it might be unrelated. I'm not pushing this suggestion anyway, the important thing for now in this issue is fixing the achievement progress across play sessions. Total play time gets saved, all other achievements do not...

MuadDib90 commented 3 years ago

Yes, I wanted to report that, but I saw you already did.

AFADoomer commented 3 years ago

Save problem should be fixed in aaca3db3153550796757d3bbace37540a1de1216.

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

@AFADoomer This way does not work either... Clear achievements, launch a new game in C1, save near the achievement board, type map c1m2, fire 7 times, reload the save. Gunslinger still shows 0...

MuadDib90 commented 3 years ago

Shouldn't be the achievements accesable also within the game? (Now they aren't ifaik)

AFADoomer commented 3 years ago

@Username-N00b-is-not-available - Of course it does. You went "back in time" via a savegame.

Progress like that toward achievements gets reverted to whatever it was at the time of the save. The only progress variables that get saved to the CVar, ignoring savegames, are play time and save count - and the completion of the achievement itself.

Shockwave508 commented 3 years ago

Thing is, I've fired at least a few hundred pistol rounds, and Gunslinger still registers as 0/1000, even after finishing several missions. I've also abstained from using grenades and manual reloads during C1M1, yet Blast-Resistant and Automatic Weapons didn't unlock. Also did a few backstabs during my most-recent run, yet they didn't contribute to Assassin at all. Here's a screenshot of my progress after C1M3. Most other achievements are progressing as normal, otherwise.

As for Trophy Hunter, all three criteria boxes shouldn't be lit up from the start, unless you grab the appropriate items from certain missions. Got the Cacoward in C1M3, yet the boxes for Chapter 2's Naziward and some "K" trophy, presumably from Chapter 3, are also lit up, despite not being present in my INTERMAP save. Gold Digger doesn't seem to be incrementing normally either, even after several missions; do you specifically have to pick up coins to get this one to unlock, or is it just Gold in general? Also opened three supply chests so far, yet Treasure Hunter registers just one.

Screenshot_2021-06-26-11-18-18-043_com opentouchgaming deltatouch

MuadDib90 commented 3 years ago

Awards are uncentered. (Unless there is suppose to be yet something else??) 01 uncentered awards

Tormentor667 commented 3 years ago

Not supposed to be centered.