PDA

View Full Version : Gradual monster genocide


Derakon
May 28, 2012, 20:52
This came up in the 3.3.0 Hobbit Rogue / Death (http://angband.oook.cz/forum/showthread.php?p=70036) thread: the suggestion that you might be able to gradually genocide an entire monster race by killing its members. So I figured I'd toss up some ideas on how this could work. Don't take this to mean that I'm volunteering to implement it though; I just thought it was a neat idea that could stand to be fleshed out a bit.

What we want is twofold: first, it should be possible to extinct a race by killing enough of its members. Second, the probability of a race being generated should be a function of its population -- as you kill more of the race, it becomes increasingly less likely that you'll stumble across its members.

Let's suppose that each monster race has a total population, a maximum population, and a "fecundity" rating that drives how quickly the race replenishes itself. Replenishment happens every 10k game turns (as with store refreshes) -- each replenishment, the population is increased by a percentage, up to the maximum population. For example, a race of population 1000 with fecundity 5% would get a new population of 1000 * 1.05 = 1050. Of course population goes down every time you kill a member of the race.

When we want to decide which monsters we should generate, we do what I tend to think of as a "weighted number line allocation" but which almost certainly has a better name. First we find all the monsters that are native to the desired depth. Let's say they're the Snaga (population 400), Novice Warrior (population 200), and Hippogriff (population 50). Thus we assign blocks on the number line to each race: the snagas get 0-400, the novice warriors 400-600, and the hippogriffs 600-650. Then we generate a random number from 0 to 650, and generate a monster or group of monsters of the corresponding type. Functionally this means that snagas are eight times more likely to be placed than hippogriffs are, and twice as likely as novice warriors.

We can make a first pass at deriving these values by analyzing the records in monster.txt. Monsters that appear in large groups can be presumed to have a somewhat larger initial population and a high fecundity. Monsters that are listed as common (the "rarity" field, second field on the W line) have high initial population. And of course, monsters that breed explosively have high fecundity. In fact, we can generally assume that explosive breeders have a fixed population for purposes of determining allocation -- it should be impossible to extinct them.

I propose that the current "rarity" field in the monster record be replaced by these values -- initial population and fecundity. We can presume that maximum population is some fixed multiplier of the initial population -- possibly 1 (i.e. all populations start out "fully stocked").

The way I've written this, I suspect what would happen when you reach a new depth is that first you'd start encountering lots of group monsters, since they'd have the population bonus needed to ensure placement. As you kill off the groups, their populations decline, and the less populous monsters start showing up more. Eventually you should theoretically reach some vaguely steady state, where the player kills some of race A, it stops being generated so often, it gets a chance to replenish, it starts showing up more, so it gets killed again, etc.

Either that, or replenishment happens too slowly to keep up with the player's kill rate, and eventually you kill everything at your local depth. But it'd be difficult to specifically try to extinct a single race through dungeon crawling, since you need that race to be generated in order to kill it, and its generation chance goes down as its population does. You have to drive down the populations of every native race in order to flush your real target out of hiding. Alternately, you could abuse summoning spells; they should pull a valid target so long as one exists. So if you really wanted to extinct all of the hounds, say, you could scum Dwar (who has a summon-hounds spell) and kill all his summons. Eventually he'd run out of valid targets.

Conveniently, if you ignore a specific race and kill everything else, then that race becomes more common by default. Have fun with those time hounds!

Magnate
May 28, 2012, 21:10
Apart from the slightly weird verbing (extinct is the adjective, extinguish is the verb), this sounds good to me. The code calls what you're talking about an "allocation table", i.e. two fields per row, one for m_idx and one for the number of chances to be selected (your number line).

This would play will with a more dynamic approach to OOD-ness: high populations could have more chance of showing up OOD than low ones. (In this context high would mean "as a proportion of max", to avoid too many OOD group monsters.)

debo
May 28, 2012, 21:20
I'm sure you guys already know this, but I think Nethack already has something similar. I know I've "manually genocided" entire species in that game before, but was never 100% sure of what that meant. Might be worth checking out the way they implemented the mechanic, though, if only for inspiration.

Derakon
May 28, 2012, 21:43
I found a wiki article on NetHack "manual genociding" (http://nethack.wikia.com/wiki/Extinctionism). It doesn't mention scaling allocation chance, which is the part of this I think is most important, since it rewards you for killing monsters you don't like (and penalizes you for avoiding them, in a way). In NetHack you just have to generate (not even kill, since NetHack has permanent levels) 120 of the chosen monster race, and then no more will be generated.

fizzix
May 28, 2012, 22:55
Questions/concerns:

1) Does the number of monsters affected by total population size or do just the ratios change? If monsters/level is affected can you kill off enough monsters so that you can generate level after level that is void of monsters but with the same floor treasure?

2) How do you handle group monsters? Will group size go down as monster population shrinks.

3) It seems that there is an incentive not to kill weak monsters so that they'll show up deeper in the dungeon. For example, if you exterminate the jackals you are more likely to get water hounds instead of jackals on dlevel 20 and that's less desirable.

4) Are summonses affected by population? Can you kill off all the dragons so Morgoth's summonses come up empty? (yes summonses is the correct plural)

5) Vaults, pits?

Derakon
May 28, 2012, 23:08
Questions/concerns:

1) Does the number of monsters affected by total population size or do just the ratios change? If monsters/level is affected can you kill off enough monsters so that you can generate level after level that is void of monsters but with the same floor treasure?I hadn't thought of this. I guess the right way to handle it is to make the amount of floor items be proportional to the amount of monsters on the level -- if you manage to kill off everything that could be generated at a given dungeon level, then you'll just turn up completely empty levels -- no monsters, no items, nothing. Maybe just some treasure in the walls.

2) How do you handle group monsters? Will group size go down as monster population shrinks.I would tend to think of group monsters as representing a small "tribe" or "pack" of that race; the size of the group reflects whatever group dynamics are in play for that race (e.g. how many orcs you can gather in one place before they start arguing about who gets to be chief), and the population of the race as a whole is really the number of groups. So I wouldn't bother changing the group size as a function of population. But I'm not married to that idea.

3) It seems that there is an incentive not to kill weak monsters so that they'll show up deeper in the dungeon. For example, if you exterminate the jackals you are more likely to get water hounds instead of jackals on dlevel 20 and that's less desirable.Jackals shouldn't show up much at dlvl 20 anyway because they'd be out of depth.

4) Are summonses affected by population? Can you kill off all the dragons so Morgoth's summonses come up empty? (yes summonses is the correct plural)My instinct is to say that yes, you can render a summoning spell null by extincting all value targets of the summons. That's already the case with unique monsters, after all. However, most summons can pull a wide variety of races (e.g. there's 21 zephyr hounds and 8 non-unique dungeon canines for S_HOUND to choose from), and the summons should select races based on the same algorithm used to generate monsters in the dungeon -- thus, nearly-extincted races would be unlikely to be summoned compared to their fully-populated kin.

In general I think that actually extincting a race should be very difficult. The main goal is to reward you for killing a given annoying race by making it less common that you will run into it later.

5) Vaults, pits?Think of pits as being like summoning spells, and vaults as being like levels in microcosm, then refer earlier in this post.

Gorbad
May 29, 2012, 02:18
Not too sure the positives outweigh the negatives, but hey that's what the forum is for.

Some questions:

1. Does genocide (provisional yes), destruction (yes) or banishment (no) count?
2. Would you then not end up with a disproportionate amount of (eventually) death molds, as you never kill these?

Derakon
May 29, 2012, 03:03
1. Does genocide (provisional yes), destruction (yes) or banishment (no) count?Hm, my guess is that none of these would count, as they all act by "removing the monster from the level", not by killing them. I guess the short answer would be, if you get experience for it, then it counts.
2. Would you then not end up with a disproportionate amount of (eventually) death molds, as you never kill these?Easily solved by making death molds have a low maximum population. They don't breed very often, as they require mycophiliac necromancers. :)

CliffStamp
May 29, 2012, 04:34
As another idea, which is related, consider that each time you see a unique and leave it and go to the next level, when it is generated again there is a chance that its speed and HP go up. For the new players this has little effect, however for power divers this will have a dramatic effect on game play as if you just just dive to dl 98 and avoid everything and just item/horde then you could end up with a bunch of extremely high powered uniques that are Morgoth speed + hp.

Magnate
May 29, 2012, 09:54
As another idea, which is related, consider that each time you see a unique and leave it and go to the next level, when it is generated again there is a chance that its speed and HP go up. For the new players this has little effect, however for power divers this will have a dramatic effect on game play as if you just just dive to dl 98 and avoid everything and just item/horde then you could end up with a bunch of extremely high powered uniques that are Morgoth speed + hp.This would be a good variation on the long-mooted "random uniques" idea. As well as totally random uniques (whose stats would naturally be better at deeper depths), you could have random abilities added to the standard uniques as they got deeper. I quite like the idea of playing poker with Wormy: if I leave him another few levels he might drop a really nice artifact - but if I leave it too long he might get manastorm ...

Magnate
May 29, 2012, 10:00
Hm, my guess is that none of these would count, as they all act by "removing the monster from the level", not by killing them. I guess the short answer would be, if you get experience for it, then it counts.This feels intuitively wrong. Genocide and destruction should certainly count - the very names imply death, not banishment. Banishment itself could be construed as banished elsewhere in the ecosystem, or outside it - so could count or not. For consistency I'd say it ought to count.

This is, I accept, a case where the 'right' answer is more hassle to implement. But it's not impossible - we can adjust populations and fecundities so that monster races aren't too badly hit by the occasional genocide or banishment. But if a mage wants to take the trouble to banish Zs at the start of every level, his/her reward will be the absence of Zs. I don't think we should spike that.

This is a good example of where one proposed change relies on or is affected by another. We've talked a lot about making changes to the banishment effect to make it less abusable. If we were to introduce this change to monster populations, the repeatable versions of these effects (spell, device, activation but not necessarily scroll) would need to be reined in a bit.

CliffStamp
May 29, 2012, 14:36
We've talked a lot about making changes to the banishment effect to make it less abusable. If we were to introduce this change to monster populations, the repeatable versions of these effects (spell, device, activation but not necessarily scroll) would need to be reined in a bit.

Genocide was intended to be a utility, never really a pruning effect. The simplest solution is just to make the use of it much more harsh. This would have no effect on the utility aspect, but would prevent it from being an item/scum tool. As just one example, if use of genocide had a chance of permanently draining stats and experience based on the number of monsters genocided. Or consider any genocide attempt on a non-LOS monster can be resisted based on the monster type/cl and if they pass it they are aggravated or make it distance based where it gets less effective (and more draining) if the monsters are far away.

fizzix
May 29, 2012, 16:36
Genocide was intended to be a utility, never really a pruning effect. The simplest solution is just to make the use of it much more harsh. This would have no effect on the utility aspect, but would prevent it from being an item/scum tool. As just one example, if use of genocide had a chance of permanently draining stats and experience based on the number of monsters genocided. Or consider any genocide attempt on a non-LOS monster can be resisted based on the monster type/cl and if they pass it they are aggravated or make it distance based where it gets less effective (and more draining) if the monsters are far away.

I'm not so sure I like punishing a player because there was a demon pit on the other side of the level and they just wanted to banish the two pit fiends that Pazuzu summoned.

In general though, I'm ok with a weakening of banishment/genocide but I also think that it needs to come with some corresponding weakening of monster summoning. This does happen if you can eliminate the summonses as previously suggested. Summons are too strong and they always have been. But that's why destruction and banishment are too strong as well.

A long time back I suggested an idea where banished monsters went into (limbo) and these would be given priority to be resummoned when they were called. It wasn't a very popular suggestion, but I thought I'd throw it out here again in this discussion.

CliffStamp
May 29, 2012, 17:10
I'm not so sure I like punishing a player because there was a demon pit on the other side of the level and they just wanted to banish the two pit fiends that Pazuzu summoned.


But this happens in Angband anyway if you play and ignore the level and just focus where you are right now. It is for example one of the most common causes of death, especially for the inexperienced where they take on a high level unique which is going to require multiple wear downs and teleport out right next to something while weakened -> Tombstone.

emulord
May 29, 2012, 21:16
Heres a way to balance genocide/destruction. Make monsters removed be considered a kill, but worth negative exp. That way you cannot spam genocide without first getting some way to grind your exp up. This prevents the whole "divers are invulnerable" problem and makes it a tradeoff.

Obviously uniques are teleported out still.

I don't agree with "increase power of uniques as they get deeper." It would be counter-intuitive because no regular monster has that effect. Also it would be very hard to balance. Gothmog isn't so bad with double resist fire but if he gets cold breath too for example? I don't like it.

Derakon
May 29, 2012, 22:31
Heres a way to balance genocide/destruction. Make monsters removed be considered a kill, but worth negative exp. That way you cannot spam genocide without first getting some way to grind your exp up. This prevents the whole "divers are invulnerable" problem and makes it a tradeoff.

That's...actually really clever! I like it.

myshkin
May 30, 2012, 03:18
That's...actually really clever! I like it.

Experience penalties have traditionally not been that big of a deal, although with a sufficiently large one, they might give a player pause (e.g. each monster banished generates a 0.1% chance of losing a level and an 0.2% chance of losing half a level -- measure these penalties to the lowest XP requirement for the previous level so as not to neuter them for clvl 50, and make them not recoverable by !RestoreLifeLevels). I might suggest some effect akin to GF_TIME as well; if you like, it can be the wrath of Eru.

Derakon
May 30, 2012, 04:01
The important thing with banishment is that it should be useful occasionally, but not abusable. Experience penalties become significant only when you're abusing the spell, so there you go, problem solved.

fizzix
May 30, 2012, 04:59
Been thinking about this a bit. Basically the idea of having a finite supply of slowly breeding monsters is to give both a positive incentive and a negative incentive to killing monsters that you might normally avoid. After all this is one of the reasons we kill many uniques. For there to be a positive incentive, it means that a normal play through will allow the opportunity to see a marked decrease in monsters provided you kill them off. A negative incentive implies that you are likely to encounter more of the monsters later if you don't kill them off. Just like Adunaphel keeps on hounding you until you silence her.

The way I see it, we need four variables. The current number of monsters, the breeding rate, an allocation weight, and a max population.

In the extreme case of a heavy breeder like lice you'd have a high max population, a high breeding rate, and a low allocation probability. In essence the number of monsters always remains constant regardless of how many you kill, and there is no change in allocation probability. I see most grouped monsters fitting this pattern besides Zephyr hounds. (because if you can't eliminate zephyr hounds, I've stopped caring.)

At the other end of the spectrum you have unique monsters which have a low max population (1), a 0 breeding rate, and a high allocation probability. You'll have something like 65536 lice and only one unique (ok 2^16 is overkill, but still it's going to be more than 1k), so if you want them to have the same allocation, the difference in allocation probs needs to have that same ratio.

For the positive incentive to be worthwhile you need a way for a player to make headway on the maximum population. That means extremely annoying monsters (think beholder hive mother) fall close to uniques on the spectrum. Low max pop, low or even 0 breeding rate, high allocation. If there were 5 beholder hive mothers total then killing one might be worth it, but probably not. Lucrative monsters could fit this pattern as well. Dragons and Wyrms could have a finite supply.

Now there's a bit of a problem because this doesn't quite work with the negative incentive. The negative incentive implies that you should have a reasonably high breeding rate so you kill off the hive mothers so they don't swamp the level. I'm not sure how to get both incentives to work. Maybe it's impossible?

I tend to favor the positive incentives over negative ones in this case anyway. If you were to tell me that if I kill 10 undead beholders I'd never see another one again, I probably still wouldn't bother, but some player might! If you were to tell me that if I didn't kill an undead beholder per level, level 99 would be full of them, I'd probably not want to play anymore. That goes double for time hounds, except I might actually kill the time hounds to prevent them from showing up later. Basically if I could eliminate all the possible dangerous monsters for Morgoth to summon, I just might, if only because then I can do something silly like punch him to death.

Breeding rates are tricky, because you don't want to unduly affect divers vs clearers. I'd recommend some bastard approach that breeds monsters based on number of killed. You can cause breeding to occur after you've killed 100 monsters or so. I think this is better than breeding after a set number of turns because that means if you didn't economize turncount (which really shouldn't be standard gameplay) you get hit with more annoying monsters deep to eliminate.

Ok, that's probably long enough for now.

CliffStamp
May 30, 2012, 17:56
The current number of monsters, the breeding rate, an allocation weight, and a max population.


It can be fairly complicated, but at a first pass it can also be fairly trivial. Monsters already have a rarity used for generation this can just be modified. A basic algorithm would be that when monsters are generated it decreases this rarity, as they are killed it increases it. Pick a balance point say that if you kill 50% of monsters the rarity would be unchanged.

There would always be some small chance that monsters would be generated even if you always killed everything (they wander in from outside) so a min limit would be set, similar a max limit if you ignored everything as you would assume that other things would kill the lice if they got completely out of hand.

But this while not a huge difference would be seen in you played in either extreme. If you killed every Z that you saw you would start to see less of them. If you ignored every graveyard then undead would start popping up more and more.

saarn
May 31, 2012, 05:55
How about a totally brain-dead approach:
Have an optional attribute for "nuisance monsters" that has a count and a second rarity. When your kill count for that monster type hits the value, the rarity drops to the second level.

For an RP kind of story behind this mechanic, some monsters aren't very common but there is a rogue pack loose in the dungeon and they are tracking @ down. When he kills the rogue pack, the frequency of encounters is reduced.

It doesn't sound as cool as the population dynamics discussed above, but it might be as good for game mechanics.

Rydel
June 3, 2012, 00:38
I'm not sure how to get both incentives to work. Maybe it's impossible?

This may be something that's best to work on a case-by-case basis for the monster. Some monsters, a single one can ruin your day, so you would design them for positive incentive so that taking the time to kill them on your terms means you are less likely to be surprised by them. Same for monsters that are fine when your healthy bun especially dangerous if you are wounded and trying to get away.

Other monsters aren't too bad on their own, but can be trouble in groups. These would work best with negative incentive, so its best to kill them when you see them alone or in small groups to keep those large groups from spawning.

This would require changes in the monster edit file since you would definitely have to have the breeding count, allocation weight, and max population in there instead of calculating them off the existing rarity value, but I suspect that's what you were thinking anyway.