Crewmates incorrectly win because player die event is registered after game over event
Closed this issue · 9 comments
Issue:
When imposters win by killing, last death is registered after the game state changes to lobby, argo game mem reader thinks crewmates won the game. In the screenshots below you can see it says humans by task, but it actually is imposter by kill.
I have dealt with this for some-time and now I see you have the same issue, I cannot copy paste logs from the program so I'll post screenshots of the logs.
I think that is just a graphical thing, when the events are posted to screen. (To prevent cheating)
@CarbonNeuron but they said
In the screenshots below you can see it says humans by task, but it actually is imposter by kill.
That event in capture doesn't have anything to do with how that is executed. We are reading the end screen from memory, including the players
I'm not saying that the event is correct, it is definitely incorrect. I'm just saying the order events fire is not necessarily the cause of it.
I think that is just a graphical thing, when the events are posted to screen. (To prevent cheating)
- this is false - because I had to implement debounce timer to capture last death event when the game ends on my websocket - even before this game over event was introduced. I wrote this code specifically for this issue:
case PlayerAction.Died: {
deadPlayers = {
...deadPlayers,
[`${playerName}`]: true,
};
console.log(
`event:player(${connectionCode}) => Player died ${playerName}`
);
currentMatch = {
...currentMatch,
log: {
...currentMatch.log,
[`${deathLogCounter++}`]: {
player: playerName,
died: true,
exiled: false,
disconnected: false,
left: false,
},
},
};
if (gameEnded) {
console.log(
`event:player(${connectionCode}) => Calling endGame() again to update last death`
);
endGame();
}
break;
}
- Event thou memory is being read - for some reason my game shows how impostors won - and the mem reader is reading that humans won by task. I have noticed that a lot of things in among us memory get updated later than expected, e.g. impostor flag doesn't get updated as game starts for some reason, and other situations.
Could it be that default value is sitting at humans won by task?
If you are suggesting a fix then a PR is more appropriate. I don't really know how your code functions without context obviously.
I am not saying the event is correct. It definitely is not.
@ph0t0shop is more suited for this issue btw
I thought to mention this because it is obviously incorrect event, but because I calculate who won the game via player and task updates this is not an issue for me. I just thought it would be cool if I could just rely on the game over event 😃
This seems to be fixed in b0af867. Closing.