ajbdev / phpsc2replay

Automatically exported from code.google.com/p/phpsc2replay
0 stars 1 forks source link

Win Los Calculated incorrectly for more than 2 players #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If more than 2 players are involved a win does not get calculated correctly. 
Displays as -1 and 0.

In some cases -1 and 0's don't show up for the correct people. (-1 appears to 
indicate a loss)

Original issue reported on code.google.com by Lru...@gmail.com on 29 Aug 2010 at 7:00

Attachments:

GoogleCodeExporter commented 8 years ago
counting a win appears to be based on who left last, while this is not 
necessarily a bad thing, it's not very accurate.  

Original comment by Lru...@gmail.com on 29 Aug 2010 at 9:23

GoogleCodeExporter commented 8 years ago
Unfortunately it is the only way to figure out the winner. Winner detection 
code has been pretty much duct taped together and needs a rewrite anyway, but 
there's no other way to detect winners except tracking leaving players. For the 
values, -1 indicates a placeholder value, 0 indicates a player who left the 
game and 1 indicates a winner. 

The function isWinnerKnown() indicates whether the winner can be figured out 
from the replay. If it returns true, 1 indicates winners and 0 losers and 
values of -1 will not be present (except for spectators), if it returns false 
the winner can't be parsed and the values should not be used. 

Original comment by lauri.vi...@gmail.com on 1 Sep 2010 at 1:48

GoogleCodeExporter commented 8 years ago
well, if the user left before the end of the match then we can't determine the 
winners. Is it possible that there is a key somewhere that identifies if the 
replay can't determine the winner? 

-- Let me phrase the question,
is it possible that there is a key in the actual replay files that determine 
the winners?

On a separate note
I am trying to determine when a match took place, is it possible that this 
information is located somewhere within the files? possibly in the header 
information?

Original comment by Lru...@gmail.com on 2 Sep 2010 at 11:00

GoogleCodeExporter commented 8 years ago
For your first question, my hunch is that this information is not stored in the 
replay. Simply because it's unnecessary for the game itself (since it has the 
game engine implementation, it can infer the winner).
The second question, I'm not sure... Lauri probably knows more on that :-)

Original comment by zsol.z...@gmail.com on 3 Sep 2010 at 11:57

GoogleCodeExporter commented 8 years ago
http://www.teamliquid.net/forum/viewmessage.php?topic_id=117260¤tpage=3#45

apparently the date is stored in there :)

I'll look at updating the replay.details file to get this information some time 
tomorrow if no one beats me to it.

Original comment by Lru...@gmail.com on 4 Sep 2010 at 4:32

GoogleCodeExporter commented 8 years ago
The newest files in the repository provide the date/time functionality through 
the getCtime() function. As for a key in the replay file determining the 
winners, it is highly unlikely for the reason Zsolt outlined above.

The issue will remain open, however, since winner parsing for matchups other 
than 1v1 is still somewhat broken and needs fixing.

Original comment by lauri.vi...@gmail.com on 8 Sep 2010 at 9:05

GoogleCodeExporter commented 8 years ago
I would have put the VLFNumber reader in the MPQFile class. Thanks though :)

Original comment by Lru...@gmail.com on 8 Sep 2010 at 9:59

GoogleCodeExporter commented 8 years ago
The winner detection algorithm has been improved and it is now as accurate as 
it can be. Unfortunately since it is based on players leaving the game, games 
other than 1v1 may not show the correct winner.

Whether the winner is known or not can be found out using the isWinnerKnown() 
function.

Original comment by lauri.vi...@gmail.com on 26 Oct 2010 at 8:35