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
compass: add total number of pickups and killables #387
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to introduce a bit more intricate solution around O_PODS
, which are mutant eggs. If we have initialized items already at this point, we can check if item->data
is set to a non-zero value (see InitialisePod
). I think O_ABORTION
won't be accounted for either and needs to be handled under similar rules as O_BIG_POD
.
@Richard-L would you prefer this to be an opt-in feature or is it OK to include it as-is? |
@rr- I would say do it whichever way is easier to maintain and less workload for you. The only reason I could think of to make it optional was to maintain a "console perfect" list of settings, where the game's look and behaviour is really perfectly identical to the PS1 version. A blurry line of course. |
I would say it's OK to make it non-configurable. |
Before we go through with it, I'd like for some professional Tomb Raider player to confirm the expected numbers of reachable items and enemies in every level. Maybe Stella's walkthrough could help. |
Ya I agree. speedrun.com doesn't list kills or pickups. Thanks to Rapora9 from Discord for compiling this list from this 100% playthrough. I can try and cross check it with another playthrough. Especially since Atlantis can't be seen.
Also I think a few levels have a few unreachable medipacks but that seems more like a level design issue than something we should hardcode? |
Here's a list from speedrunner Footi:
Midas has an unreachable medipack. |
It's OK to count that medipack as pickupable IMO. |
I agree. We were just talking about it on Discord. I've also asked Footi for a list for the UB levels. |
Cool thanks. That number is probably messed up due to #250. Levels with unobtainable stats: Tomb Raider 1:
Unfinished Business:
|
Footi thankfully asked Anopob, the only guy who has done a UB max% run, for this numbers. Without guarantee:
|
So I did some digging on the pods stuff. The reason my code does not currently calculate the number of mutants correctly is because I do not include The solution might require some floor checking to find all pod triggers while making sure not to count multiple triggers for the same pod. The last case would be the broken UB Hive eggs that have triggers and explode, but they spawn an abortion mutant that isn't in the level files. But that seems like a level design issue like unreachable medipacks. |
I'm not sure about UB but yes, that's what I meant in my previous post about the Atlanteans.
Counting the triggers sounds nasty, but it's what we do for calculating the secret count. Since these functions are getting quite complex, could we move them to a function such as Offtop: To make the endgame level stats work, we'll probably have to store the results in |
Ya. Also not sure what to do about pickups right now. Enemies like Pierre and the mercenaries spawn items on death. Adding to the total mid level would be easy but idk if that's nice. For example, when you kill Pierre in Tihocan, the stats screen could go from 23 of 23 pickups, to 23 of 26. Pierre's code as reference:
|
Same for the Skate kid and the Baldie. I think it's OK to hardcode the amount of additional items with a proper comment. IIRC Baldie drops a Shotgun. I don't remember what happens if Lara already has it in her inventory – whether he drops Shotgun, Shotgun Ammo, or nothing (the worst case). |
Ya all the mercenaries do. Looks like skate kid dropped the Uzis even though I already had them and it didn't seem to give me any ammo. I checked a PS1 video and it looks like that behavior matches. I know custom games aren't the main focus, but I also didn't want to hard code extra items per level. And you can't just check if Pierre is in the level or something, since he runs away depending on the one shot trigger or not. Maybe I'll do floor parsing for this too and if those enemies are present and can die based on the trigger, add their items to the total. |
@walkawayy since Natla's Mines strips you of all weapons, how did you have the UZIs already, via cheat? I don't recall there being a secret where you get them. I think you only get them from skateboard kid. There is however the boulder secret after the lava pit, where you get the shotgun. You can see here that Footi's killing baldie with the shotgun he has from that secret. And when he goes to pick it up (pulls a switch first), it shows as the shotgun item instead of ammo, interestingly. https://youtu.be/D3qgf84dLDg?t=8353 I know that if you pick up the shotgun in Lost Valley, then the secret with it in Folly will show shotgun ammo. If you haven't picked up the Lost Valley shotgun, then it will be as a weapon instead. So perhaps do weapons only update into ammo if there's a level swap in between? Since Natla's Mines has two shotguns (depending on whether you kill baldie or not), it would seem to indicate so. |
Ok I think this is ready for review, but by new module do you mean moving this to a new .c file with those other functions @rr- ? |
Yes. And reduce the amount of global state. Perhaps introduce a new module-level struct that you pass around between the functions. |
src/game/stats.c
Outdated
|
||
static void Stats_CheckTriggers(FLOOR_INFO **floor_array); | ||
|
||
static void Stats_CheckTriggers(FLOOR_INFO **floor_array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good but I don't quite don't understand why do we need to create a copy of the floor data for the stats calc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the way doors work. There was a bug where the trigger check was missing triggers in a rare instance. See the screenshot below for a trigger that is part of the bigger room but is behind a closed door. When the doors are initialized, closed doors set the floor index to 0, so this trigger was never getting checked.
I'm checking on the floor_data pointer thing. The only two issues remaining I think are:
|
Let's make the order consistent with the end of the level stats, but in a separate ticket, not this one. The Great Pyramid secret fix works by changing tiles that trigger a secret. It makes sure that secret triggers placed in different rooms trigger unique secrets. So room 555 and room 666 shouldn't both trigger secret 2. In OG level data, they do. After the fix, room 555 triggers secret 2 and room 666 secret 3. Thus, level stats need to be recalculated after applying this fix. I'll need to think what to do with the extra allocation, as I don't like the way it's coupled with the stats now. Maybe tomorrow. |
Implement rr's patch from PR.
Remove unused includes. Rename end of level stat function. Remove unused variable and comments. Change stats shell errors to log errors.
Ok I made a new section near the bottom of the README. I was going to add an item to the Q&A, but tables can't be indented in Markdown. So, I put the table and section right under the Q&A. |
Thanks. Can we list all the numbers so that if we make a regression we have a single source of truth? |
Thank you. |
Resolves #362.
Prepared to get slammed, but as far as I know we have to manually define lists for objects that are killable and pickupable. Not sure if I missed any.
For killables, I had to remove some enemies like the Mummy from Qualopec who can't be killed. But Atlantis has an issue where Lara can kill more than there are killables, but idk what I missed.
For pickups, the different Scions behave differently. I excluded O_SCION_ITEM3 because that is the one you have to shoot.