View Single Post
Old February 11, 2011, 03:10   #9
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by Derakon View Post
I should note for the record that in my OSX builds of NPPAngband, all ghosts are named "Nobody". I'd guess this has something to do with the ghost files not getting written properly, but I never bothered to investigate.
Yes, this is the one part of the player ghost code taht is garbage. Because I intend to nuke that part of the code in the next month or two, I looked at it, didn't see an obvious problem, and shifted to higher priority items. In windows, it fills us the bones directory with 127 bogus templates. I don't know why.

Quote:
Originally Posted by Derakon View Post
In my ideal world, player ghosts' abilities would be based on the class of the character. Otherwise ghosts basically are semirandom unique monsters whose only connection to the dead character is the name. In a really really ideal world, you'd have a template for each class which would apply multipliers to various stats based on the level of the character at death. Then you'd end up with player ghosts that actually fight something like they did when they were alive.
That's exactly how they work in NPP! When a player dies, it saves a file with the player's name, the depth they died, and their gender, race and class. There are a bunch of ghost race templates (vampire, skepaton, Lich, ghost, skelaton, wraith etc...) in monster.txt. When a player ghost is generated, it looks for a character ghost template that died around the dungeon depth (prepare_ghost function). It reads the player gender, race, and text, and starts making changes to the monster (prepare_ghost_race, and prepare_ghost_class). A troll ghost would get a boost in hit points and the rgeneration flag, a race with resist poison would make a ghost resist poison, the combat damage dice and sides are adjusted with the race's fighting abilities, etc... Then it does the same thing for class. A mage ghost would get spells similar to the mage spellset, depending on the spell level and ghost template level. Priest ghosts get spells similar to their spellset...fighting abilities are adjusted again according to the class's fighting abilities.

Essentially, every single race/class combination will produce a different player ghost. And this player ghost will also be different the deeper in the dungeon it is created. This part was rather difficult to balance, but I think after many years it is finally there. Note there are no random numbers involved in these adjustments, so the ghost is the exact same when a player exits/saves the game, then re-opens the savefile.

If, when a player ghost monster is created, and there has been no player death in that part of the dungeon, it generates a ghost using the name of one of the maintainers of Angband or NPPAngband. Race and class for the maintainer templates are randomly chosen, and the ghost template is taken from there.
nppangband is offline   Reply With Quote