Kill counter

Discussions of the development process of the game.
Post Reply
Damrelia
Posts: 1
Joined: Tue Apr 06, 2021 2:06 pm
android_version: 4.1 - Jellybean

Kill counter

Post by Damrelia »

I propose to add a counter for each killed monster in the info box next to the monster :)
User avatar
Nut
Posts: 777
Joined: Mon Oct 27, 2014 12:14 pm
android_version: 8.0
Location: Glade

Re: Kill counter

Post by Nut »

Yes, sounds like a good thing.
Welcome to the forum!
Your name reminds me of Damerilias, the beautiful flowers from Remgard :)
Nut
_____
Conina *, Lara: Lvl 44, Anwyn: Lvl 52, Nut: Lvl 61
eor
Posts: 105
Joined: Mon Oct 23, 2017 5:45 pm
android_version: 4.4 - Kitkat

Re: Kill counter

Post by eor »

I really like this idea. Could it be tied into the achievements "quest"? (i.e.; Arulir Assassin: 5000 killed,etc.)

It could be a nice diversion between releases to grind for "assassin" badges or achievements.
Embrace the Shadowbunnies :shock:
Einsame Hirte
Posts: 23
Joined: Sun Jan 24, 2021 8:22 pm
android_version: 11 - Android 11

Re: Kill counter

Post by Einsame Hirte »

I've just about got this working and ready to pull if the team wants to use it. It shows up as "Previous kills" in the monster info box. Question about the string handling, though. I've added the appropriate fields to monsterinfo.xml with the default text, but should I also add it to strings.xml? Or is that generated programmatically somehow? (Never mind. It looks like it doesn't belong in strings.xml; I guess the translation stuff pulls it automatically).

And is this the appropriate place for source code discussions? Or better on github?
User avatar
rijackson741
Posts: 3781
Joined: Tue Aug 20, 2013 2:04 am
android_version: 10 - Android 10
Location: Somewhere in Dhayavar

Re: Kill counter

Post by rijackson741 »

Either, although IMO I prefer the discussion here.
Level:69, XP:6092391, PV:584, FQ:81
HP:229, AC:212, AD:57-75, AP:4, ECC:16%, CM:1.5, BC:188, DR:3
Gold: 237559 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1, WoB:1
HH:1, WA:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, AP:L:1, FS:DW:2, S:DW:1
Einsame Hirte
Posts: 23
Joined: Sun Jan 24, 2021 8:22 pm
android_version: 11 - Android 11

Re: Kill counter

Post by Einsame Hirte »

Okay, I just made the pull request. Here's the (longer) text from the earlier one, since it's probably easier here. Any feedback appreciated.

kill count stats by monster name instead of ID #35
This patch fixes the "Most commonly killed monsters" display to prevent duplicate entries where more than one MonsterType has the same display name. It adds an additional hashmap to count on a per-name basis, while leaving the existing counter alone so that savegame files aren't affected. I tested it on the two versions of the "Iqhan chaos master" (red and purple).

This is both my first experience tweaking Java code and my first attempt to contribute to AT, so please let me know if I went to far in changing existing classes or refactoring existing code for clarity that should have been left alone - I could have minimized existing code changes by calculating on display only, but that would involve re-allocating an object each time and that's discouraged per the wiki. I think this approach is cleaner and will better support another patch I'm working on (adding kills to monster info display).

In particular, I'm not sure how the team feels about making Monster.monsterType public, but it enables playerKilledMonster() to pass the MonsterType object directly to the GameStatistics.addMonsterKill method (instead of just the string ID), which allows it to get the both the monster ID and name without an awkward double-lookup that would have required adding an argument to pass the WorldContext anyway. I know the extra cycles are insignificant these days, but trying to keep it efficient is a hard habit to break. Would it be better to add a Monster.getMonsterType() read-only property rather than simply making the variable public?

A note on potential wierdness due to this patch - I wouldn't go so far as to call it a bug. Because monster names are sourced from translations, it's possible that some monsters share the same name only in certain languages. This could potentially cause confusion if the kill counts change when the game language preference is changed.

Finally, one other potential concern. There is a killedMonster parameter in ConversationController.canFulfillRequirement that looks at kills on a per-monsterType basis. I haven't checked to see exactly how this is used, but it could potentially be confusing if the player sees a body count in one place (based on kills per monster name) and can't complete some conversation item based on a unique version of that monster. I don't think I've seen any actual gameplay situations where this would be a problem, though (i.e., a quest character saying "come back after you've killed kill 50 purple Iqhan chaos masters.")

Monsterstatus killcount #36
Adds "Previous kills" to the monster info activity. This is based on my previous killed_by_name branch and counts monsters based on having the same display name rather than same internal ID. See comments to pull request for that patch.
Post Reply