MarshP / dcss-morgue-analyser

A Python program to analyse your DCSS morgue folder, collate metrics, spot patterns and give hints.
The Unlicense
2 stars 0 forks source link

Possible enhancements #4

Closed oschwab closed 7 years ago

oschwab commented 7 years ago

Hi,

My own python script for stats can give me these information :

-------------------------------------------------
Number of games played : 109
--------------------------------------------------
Killed most by : 
gnoll (10 times)
orc priest (9 times)
orc wizard (7 times)
adder (6 times)
hobgoblin (5 times)
Sigmund (5 times)
jackal (5 times)
adder's poison (5 times)
Natasha (4 times)
worm (3 times)
Grinder (3 times)
ice beast (3 times)
centaur (3 times)
ogre (3 times)
Olivier's ghost (3 times)
red ugly thing (2 times)
orc (2 times)
Joseph (2 times)
bat (2 times)
rat (1 times)
hellwing (1 times)
Josephine (1 times)
the fiery rage of Trog (1 times)
Terence (1 times)
Duvessa (1 times)
giant gecko (1 times)
iguana (1 times)
wraith (1 times)
shock serpent (1 times)
ooze (1 times)
Robin (1 times)
eight-headed hydra (1 times)
giant frog (1 times)
Crazy Yiuf (1 times)
Toriamy's ghost (1 times)
killer bee zombie (1 times)
orc warrior (1 times)
Maud (1 times)
goblin's poison (1 times)
Erica's acid (1 times)
wyvern (1 times)
giant cockroach (1 times)
hound (1 times)
Menkaure (1 times)
Olivier's ghost's poison (1 times)
centaur warrior (1 times)

Killed most in : 
Dungeon:2 (31 times)
Dungeon:1 (24 times)
Dungeon:3 (17 times)
Dungeon:4 (12 times)
Dungeon:5 (9 times)
Dungeon:9 (6 times)
Lair:7 (1 times)
Dungeon:10 (1 times)
Dungeon:7 (1 times)
Dungeon:8 (1 times)
Orcish:2 (1 times)
bailey:(/na) (1 times)
Lair:1 (1 times)
Dungeon:6 (1 times)
Dungeon:12 (1 times)
Lair:6 (1 times)

Best game : 61742
--------------------------------------------------
--------------------------------------------------
Statistic for : Merfolk Ice Elementalist
Number of games played : 57
Killed most by : 
orc priest (7 times)
gnoll (6 times)
Sigmund (4 times)
hobgoblin (3 times)
Grinder (3 times)
orc wizard (3 times)
adder's poison (3 times)
bat (2 times)
jackal (2 times)
ogre (2 times)
Olivier's ghost (2 times)
Natasha (2 times)
ice beast (2 times)
adder (2 times)
centaur (2 times)
Duvessa (1 times)
Terence (1 times)
goblin's poison (1 times)
giant gecko (1 times)
killer bee zombie (1 times)
ooze (1 times)
worm (1 times)
Menkaure (1 times)
the fiery rage of Trog (1 times)
rat (1 times)
giant frog (1 times)
Crazy Yiuf (1 times)

Killed most in : 
Dungeon:2 (19 times)
Dungeon:1 (16 times)
Dungeon:3 (8 times)
Dungeon:5 (8 times)
Dungeon:4 (6 times)

Best game : 1470
--------------------------------------------------
Statistic for : Deep Elf Necromancer
Number of games played : 7
Killed most by : 
orc wizard (1 times)
gnoll (1 times)
Toriamy's ghost (1 times)
orc priest (1 times)
hound (1 times)
worm (1 times)
iguana (1 times)

Killed most in : 
Dungeon:4 (3 times)
Dungeon:3 (2 times)
Dungeon:2 (1 times)
Dungeon:1 (1 times)

Best game : 511
--------------------------------------------------
Statistic for : Minotaur Berserker
Number of games played : 30
Killed most by : 
gnoll (3 times)
Joseph (2 times)
Natasha (2 times)
red ugly thing (2 times)
adder (2 times)
hobgoblin (1 times)
orc warrior (1 times)
hellwing (1 times)
Josephine (1 times)
ogre (1 times)
Olivier's ghost (1 times)
Maud (1 times)
orc priest (1 times)
Erica's acid (1 times)
wyvern (1 times)
centaur (1 times)
wraith (1 times)
giant cockroach (1 times)
shock serpent (1 times)
orc (1 times)
Olivier's ghost's poison (1 times)
Robin (1 times)
eight-headed hydra (1 times)
centaur warrior (1 times)

Killed most in : 
Dungeon:2 (7 times)
Dungeon:9 (6 times)
Dungeon:3 (3 times)
Dungeon:1 (2 times)
Dungeon:4 (2 times)
Lair:7 (1 times)
Dungeon:10 (1 times)
Dungeon:7 (1 times)
Dungeon:8 (1 times)
Orcish:2 (1 times)
Lair:1 (1 times)
Lair:6 (1 times)
Dungeon:6 (1 times)
bailey:(/na) (1 times)
Dungeon:12 (1 times)

Best game : 61742
--------------------------------------------------
Statistic for : Human Necromancer
Number of games played : 13
Killed most by : 
jackal (3 times)
adder's poison (2 times)
adder (2 times)
orc wizard (2 times)
hobgoblin (1 times)
orc (1 times)
worm (1 times)
Sigmund (1 times)

Killed most in : 
Dungeon:1 (5 times)
Dungeon:2 (4 times)
Dungeon:3 (3 times)
Dungeon:4 (1 times)

Best game : 151
--------------------------------------------------
Statistic for : Centaur Hunter
Number of games played : 2
Killed most by : 
orc wizard (1 times)
ice beast (1 times)

Killed most in : 
Dungeon:3 (1 times)
Dungeon:5 (1 times)

Best game : 781
`

We could consider merging it into your project.

MarshP commented 7 years ago

That's exactly the sort of info I want to produce, but is way ahead of where I am. If you want to work them onto your fork, I'd be happy to pull.

oschwab commented 7 years ago

Please have a look to the source code. https://gist.github.com/oschwab/44457ef480825ad1acb4a097ae45aa7c

We can discuss then how you see the thing :)

If you want to test it, put the py file on the root of dcss install folder.

MarshP commented 7 years ago

Jealous, though I guess one day I'll be able to make my code as clean.

Suggest you simply add yours as a module, add an import, then we can run functions as required. Also avoids mixing in the code with the original two files, which I intend to rip apart and make into clean, functional code this weekend :0)

oschwab commented 7 years ago

OK that's fine , there's just one point to fix later : morgue file parsing ; My actual strategy (reading file one by one and construct global stat from each read) or yours (concatenate the whole morgue in one file) ?

If we leave as-it-is then it means that morgue files might be parsed twice (maybe not really an issue).

Here's the plan on my side : I'll create a python class , that you can use from your side , or from my side in the main() of the py file.

MarshP commented 7 years ago

Your way is best. I definitely want to parse one at a time, because then I can refer to specific stats -- Spellcasting in file 01 etc. -- but I just didn't/don't know how to. That's the only reason for the big concatenate. I was planning to learn how to make a "MorgueFiles" class and have each file be an object with a attribute for each menaingful stat. It's on my "to learn" list!

oschwab commented 7 years ago

Just did it during my lunch break

https://github.com/oschwab/dcss-morgue-analyser/blob/master/dcss_morgue_analyser/death_stats.py

oschwab commented 7 years ago

Files are integrated in fork. next step is to call them from main program.

MarshP commented 7 years ago

Niiice. Unfortunately parenting took my weekend over and I didn't get a chance to do anything. Hoping I'll get to look in on this in the week.