Page 1 of 2

Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 9:29 pm
by Fagris
While trying to grind for the ChaR I noticed the game stats counts the iqhan master twice thus wasting a precious space of the monster count top 5. :!:
I assume this could be due to their robes in red and purple?

While we're at it, could this top5 be expanded to top7 or even Top10? this would be an enhancement of course, no bug ;)

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 10:22 pm
by rijackson741
Hmm. Yes, there are two NPCs with the name "Iqhan chaos master", and different internal IDs. The name is just a label you see in the game, and is ignored for most purposes. Seeing them show up twice is a little annoying, but fixing it would be a lot of work.

Yes, we could extend the list. Every kill is recorded in the savegame.

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 10:51 pm
by Fagris
thanks for the quick reply.
Just wanted add, Same issue with Iqhan chaos evoker as the second "entity"of this monster made it to the top 5 as well :-D
understood there will be no change here given the effort and as it's a kind of 'corner case'

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 11:08 pm
by Antison
It's not a "corner case", because it's not really a bug. Think of it this way: You got two baseball teams playing a game. Each one is playing in a different uniform, but both sets of players are considered "players". Just because they wear different clothes doesn't make them different things.

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 11:18 pm
by Fagris
Sorry but I don't get your logic.
where is the point of having same titled monsters 2 times in the game stats. 4 of 5 slots are occupied with 2 types of monsters, Chaos master and evoker respectively. there is no benefit / sense for me as player in this behaviour.

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 11:27 pm
by reizy
rijackson741 wrote: Thu Mar 25, 2021 10:22 pmbut fixing it would be a lot of work.
Is changing the label realy a big deal?

Re: Game stats: iqhan master shows Up twice

Posted: Thu Mar 25, 2021 11:54 pm
by rijackson741
The name is the same so that not every monster with that name is quite the same. It's deliberate, to give variety (and there's a lot of such NPCs), so changing the name is not an option. Changing the ID to be the same is also not an option, because that's impossible unless the multiple NPCs become only one. So the only option would be to change the code to look at not only ID, but also name. In which cases would we do that? So sorry, but it is not so simple to fix this.

Re: Game stats: iqhan master shows Up twice

Posted: Sat Apr 03, 2021 11:22 pm
by Einsame Hirte
I haven't looked at the code, but how about generating the kill-count display based on the cumulative kills for monsters with the same labels? I have no idea how the data is stored, but I have to think it should be fairly straightforward to iterate through the kill-count array/list/database/whatever and sum up counts for each unique label, then generate the list based that.

Re: Game stats: iqhan master shows Up twice

Posted: Sun Apr 04, 2021 9:28 pm
by rijackson741
The only thing that's tracked is the internal ID, which is always unique. There are many cases where the name is the same, but there is more than one internal ID (for example, there are nine versions of Burhczyd). The only real option would be to change the name so that the names of killable monsters are always unique.

Re: Game stats: iqhan master shows Up twice

Posted: Mon Apr 05, 2021 5:27 pm
by Einsame Hirte
Right, but the player doesn't know or care that there are multiple internal versions of the same monster. They just want to know the total number of times they killed the same name. So, just create list that tallies the kills for each name (in php or perl you'd use an associative array with the monster name as index; I guess in Java you'd use a HashMap), then sort that list by descending kills and take the top 5.

I'm no good at java, but here's the idea in pseudocode...

Code: Select all

for each monsterId in killedMonstersByID
{
	killsByName{monsterId.name}+=monsterId.kills
}

int i=0
for each monsterName in sortByDescendingValues(%killsByName)	
{
	if (i++ >= 5) break;
	addToOutputString(monsterName, killsByName{monsterName})
}
Looking at getTop5MostCommonlyKilledMonsters() in model/GameStatistics.java, I think it would be just an extra three or four lines. I've been meaning to get my feet wet in Java and Android development, and this would be a good exercise. Anyone mind if I try to contribute a fix like this?