Author Topic: Monster generation  (Read 48261 times)

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Monster generation
« Reply #45 on: February 08, 2014, 09:34:50 PM »
I think that the situation is completely different with pen&paper RPGs. The main aim is to tell a story, but this is also a game -- which means that good decisions should be rewarded, and bad decisions should be punished. You know what you would do in the given situation, and you can compare the players' action to this. If your players do something bad or good, you should punish or reward it, in some meaningful way. If one of your players does something surprisingly stupid, they should face the consequences, and if they do something surprisingly ingenious, you should reward them. If they have some special powers, allow them to use these powers if they make sense. For example, if a player decides to learn the Climbing Trees skill before going to the quest, you should decide whether it makes sense from the story's point of view -- you should not put trees in the dungeon only because some player wanted this skill, but if the quest was in a forest, then make this useful.

Regarding HP: it is better to fight rats with 100 HP, than to fight dragons with 110 HP. As far as I know, that's mostly what happened in IVAN. Normally your strength and endurance would grow at some pace, say, at level N you would have endurance N and strength N. Monsters were based on your endurance, so their power would be also N, and match your strength. With a +E endurance-boosting item, your endurance would be N+E and thus monsters would be N+E too. They would be good match for you if you progressed normally, that is, you had endurance N+E and strength N+E. But you have only strength N. And thus, you die, only because you thought that the +E item would help you.

I don't believe in the mixed systems described. Bad players will be annoyed by boss battles being too tough, and good players will be annoyed by boss battles being too easy.

Regarding "the game challenging to every player": I do not agree that in an auto-tuning system "the game is challenging to every player". It is rather "the game tries to feel challenging to every player". I could play such a game without thinking, and still win, because the game would tune, and I would not feel challenged then. Also, I could not brag that "I have won XXX", because everyone can win XXX. I think it is better to have difficulty levels,and allow the players to switch them at any point of the game. This also solves the problem, because everyone will pick the difficulty level that feels good for them. If you can win as a Bard only on the Easy level, you are still better than those who cannot win as a Bard at all.

What I did in Hydra Slayer and HyperRogue is, I have played the game myself, and based the difficulty on that. So you will win the game if you play at least as good as me, and lose if you play worse. And do this for all reasonable playstyles (in Hydra Slayer, the game is very different depending on which race was chosen, so play all of them; it was not possible to on test all the combinations of artifacts you are likely to find, but I do not think that matters a lot). In your example, the developer would have to play as the Illusionist and Thief too to balance them, not only the Cleric.

The problem is when the player wants to try some playstyle that was not intended by the developer. For example, they want to win as a wizard without using spells. If the player wants to do this for a challenge, then let them have it, don't make it any easier to them by "auto-tuning", otherwise it defeats the purpose, IMO.

If the "wizard without spells" just wants to have fun, no challenge, then it is great for them if the game is able to tune its difficulty for this. But then, why not remove the difficulty altogether? I like to play campaigns in Battle for Wesnoth for the story, but I play them on the easiest difficulty level, because it seems to me that harder difficulty levels just force the player to save-scum more often (and thus "feel" more challenging), instead of giving real challenge. (Of course it is possible that I am just a bad player and experts do win these campaigns at hard levels without save scumming.)

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: Monster generation
« Reply #46 on: February 09, 2014, 04:38:18 AM »
Well, we'll just have to agree to disagree on that one. :)

EDIT:
I wrote a lot in support of the system I'll be using, but it doesn't really matter. If the OP wants to use it they will, and if it's not your cup of tea I doubt anything I can say is going to bring you over to the dark side.  ;D
« Last Edit: February 09, 2014, 02:31:16 PM by Pickledtezcat »
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: Monster generation
« Reply #47 on: February 11, 2014, 01:45:06 AM »
Gotta agree with Z on this -- it's generally the player's role to match one's level to the dungeons encountered, not the other way around. It seems unavoidable that one would either run into perverse side effects of attempting to gauge the player's "potential" if the game is even moderately complex.

Paul Jeffries

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 257
  • Karma: +1/-0
    • View Profile
    • Vitruality.com
Re: Monster generation
« Reply #48 on: February 11, 2014, 11:26:44 PM »
I'll pile in on the side of Z as well.  Auto-adjusting difficulty is the sort of thing that sounds great on paper, but is next to impossible to successfully implement for the simple reason that the computer has no way of distinguishing between a novice playing to the best of their ability and an expert who is coasting (while you, as a human DM, probably could).  If an expert can get the same results by coasting as they can by playing well then they have no incentive to play well and by extension no incentive to become an expert (or possibly even play the game) in the first place.

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: Monster generation
« Reply #49 on: February 12, 2014, 12:20:23 AM »
Well how would we gauge a player's ability as a DM? By spiking difficulty at certain times and seeing their response to that. setting difficulty would simply be a matter of returning an xp pool that is bigger or smaller than the players. (0.7, 0.9, 1.1, 1.3 etc). If the player deals with the difficulty spike with out any problem you can set this as the new base level. If on the other hand they nearly die you can ramp back down to the earlier level. If they do actually die you could save info about that event in a config file for next time they play. The game would keep on spiking the player trying to equal but not exceed their ability threshold.

Games, like stories should have a narrative, development, progression. There needs to be time for you to develop your character. Just because the game is procedurally generated shouldn't mean that it is totally random. I'd like to challenge the player and yes they should die if they don't play well. But they shouldn't die even though they played well (or not that often).

Rogue was a very difficult game because all games were like that then. Go and play even a Disney game from the 1980s. They were hard as hell. Certain people, like me, were prepared to play them even so. Why? Because I was a kid, because I had lots of free time and not much to do but fight with my brother. Because getting to the end of Black belt would be the ultimate in bragging rights. But these days things are different. Who's got time to play a game with only 10 minutes of actual game play, but which takes months of hours a day practice to beat?

Sure, a difficult game will force you to improve so you can beat it. You can't just coast through. But there has to be a better way than save die reload or die restart infinite loop. At the end of the day we want people to play our games (I assume) and there aren't many people with the patience to put up with that kind of thing any more.

EDIT: Just been reading on the news about flappy bird. It seems that people do want to play that kind of game after all. However, I'm not really thinking of making games for the mobile market. That whole demographic is something I can't identify with anymore.
« Last Edit: February 12, 2014, 09:56:43 AM by Pickledtezcat »
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

Paul Jeffries

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 257
  • Karma: +1/-0
    • View Profile
    • Vitruality.com
Re: Monster generation
« Reply #50 on: February 13, 2014, 01:42:39 AM »
If they do actually die you could save info about that event in a config file for next time they play. The game would keep on spiking the player trying to equal but not exceed their ability threshold.

That sounds like just about the worst thing you could ever possibly do.  I'll come back to why in a moment.

Games, like stories should have a narrative, development, progression.

Well, that depends on what you mean by 'games'.  Games can be like stories, but games are not stories.  Let's delve into that a little bit because it might make it a bit clearer why we're so sceptical about this.

Imagine a line.  At one end we'll put 'gamey games' - games which are totally abstract and are basically rigid rulesets within which the player(s) have to optimise their actions as best they can.  Things like Go, Tetris, Football etc.  The appeal of these comes from their challenge and a sense of personal progression as you gradually increase your skill and knowledge.

At the other end, we'll put 'narrative experiences' - games which some people might not even call 'games' but which are still very much 'play'.  These have no fixed rules - everything that happens is controlled either by a god-like author or by the players themselves.  The purest form of this would be something like a playground game of 'let's pretend' or just simple bog-standard fantasising.  The appeal here comes from a number of things, but mainly wanting to see how the narrative develops and a bit of wish-fulfillment.

In between these two extremes you have most actual games.  Chess is more towards the gamey end, but with a slight aspect of fictional flavour in that the pieces represent kings, knights etc.  Art games like Dear Esther go more towards the other extreme.  D&D would be more towards the fantasy end, but can shift along the spectrum depending on how you decide to play it - you can choose to follow the rules exactly or to bend them to suit the narrative you're trying to create.

Roguelikes traditionally fall very much on the gamey-game end - they have clear and rigid rules with strong penalties for failing to observe them.  Their stories are usually minimal or non-existant and more often than not their fictional universe is cribbed directly from some other work.  (To complicate things; they do have their own kind of narrative experience, but it is one that arises directly from the rules of the game and not one imposed by an author or the player - it's a subtle but important difference).

It sounds like what you want to create is a game that is far more towards the fantasy/role-play/make-up-your-own-adventure/anything-goes end of the spectrum.  You want the player to be able to play the game the way they want to and for the rules of the game not to get in the way of that.  I don't, for the record, think there is anything wrong with that.

But what's important to understand is that the reason there is a spectrum at all is that there is a tension between these two poles.  They are two very different masters and serving them both at the same time is difficult - design measures that you take to enhance one can often (not always, but often) harm the other.  Consequently, trying to take a set of design characteristics engineered towards one end (such as the basic roguelike formula) and trying to drag it down wholesale towards the other is probably not the best way to approach the problem - the end result is likely to come out a little bit confused about what it's trying to be.

Which brings me back to why

If they do actually die you could save info about that event in a config file for next time they play. The game would keep on spiking the player trying to equal but not exceed their ability threshold.

is a bad idea.  Well, there are several reasons; people don't tend to enjoy sudden difficulty spikes, for one.  But putting that aside, the chief reason is that it undermines the whole purpose behind death (and more specifically, permadeath).  In gamey-games, death is a lesson.  It's the game saying 'don't do that'.  Ideally, every death should teach the player something and leave them a little better prepared to face similar challenges in the future.

But your system would poop all over that.  In your case, the player might learn something from death, but it would be the wrong lesson, because the aim of the whole thing isn't to teach the player how to adapt to the game, it's to teach the game how to adapt to the player.  They could make exactly the same mistake next time and come out OK because the game has shifted the goalposts.  Worse, the player isn't even being punished this time because they did something wrong - they're being punished because the game did something wrong.

From a narrative perspective, player death is usually a bad thing because it interrupts - and perhaps ends forever - that narrative.  A lot of adventure games, for example, have no death states because they don't want to have to pull the player out of the story by cutting it off and making them go back a bit.  The 2008 Prince of Persia also - rather bravely - did away with death altogether (which I personally hated, but then I'm a gamey-game kinda guy).

So your system ends up trying to be all things to all people but succeeding in being nothing to anybody.  Gamey-gamers won't like feeling like their actions have no consequence and narrative-role-playey people will just be annoyed that they've died a death that served no purpose and don't have that unicorn they wished for.

Rogue was a very difficult game because all games were like that then. Go and play even a Disney game from the 1980s. They were hard as hell. Certain people, like me, were prepared to play them even so. Why? Because I was a kid, because I had lots of free time and not much to do but fight with my brother. Because getting to the end of Black belt would be the ultimate in bragging rights. But these days things are different. Who's got time to play a game with only 10 minutes of actual game play, but which takes months of hours a day practice to beat?

Sure, a difficult game will force you to improve so you can beat it. You can't just coast through. But there has to be a better way than save die reload or die restart infinite loop. At the end of the day we want people to play our games (I assume) and there aren't many people with the patience to put up with that kind of thing any more.

None of this is really relevant, though - we're not talking about absolute difficulty, we're talking about auto-adjusting difficulty, which is a separate issue.  If you want to make a game easier then you can just go ahead and balance it so it's easier.  Likewise, if you want to make classes other than clerics viable then you can balance the classes to make them all equally difficult.  If you want a game with more than 10 minutes of actual game-play then make a game with more than 10 minutes of actual game-play.  There are other solutions to these problems which don't involve compromising a core mechanic of the game.  By far and away the best option would seem to be to provide a suitable range of difficulty levels so that the players themselves can choose what it is they want to get out of the game.

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: Monster generation
« Reply #51 on: February 13, 2014, 04:23:13 AM »
Oh well, different horses for different courses.
in my case I'm sure this will be a useful system but in other cases it probably wouldn't work.
« Last Edit: February 13, 2014, 05:24:38 AM by Pickledtezcat »
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

Trystan

  • Rogueliker
  • ***
  • Posts: 164
  • Karma: +0/-0
    • View Profile
    • my blog
Re: Monster generation
« Reply #52 on: February 13, 2014, 05:57:06 AM »
Oh well, different horses for different courses.
in my case I'm sure this will be a useful system but in other cases it probably wouldn't work.

I agree with all the criticisms of your idea to shape the game around the player - I've seen it tried a few times before and there were always counter-intuitive consequences. But don't let that discourage you. Make a prototype and let people try it. Prove everyone wrong. Maybe a 7DRL in March?

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: Monster generation
« Reply #53 on: February 13, 2014, 11:31:01 PM »
Oh well, different horses for different courses.
in my case I'm sure this will be a useful system but in other cases it probably wouldn't work.

I agree with all the criticisms of your idea to shape the game around the player - I've seen it tried a few times before and there were always counter-intuitive consequences. But don't let that discourage you. Make a prototype and let people try it. Prove everyone wrong. Maybe a 7DRL in March?

thanks,
I'm certain it'll work in my own long term game project, and I know that it will work in certain situations,  so it would be fun to show other situation where it could be used. Now that ive got a lot of the basic code worked out it wouldnt be impossible to do such a thing.
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

sokol815

  • Rogueliker
  • ***
  • Posts: 85
  • Karma: +0/-0
  • Web Developer by Day, still Web Developer by night
    • View Profile
    • Email
Re: Monster generation
« Reply #54 on: March 05, 2014, 05:54:21 AM »
just to add my 2 cents, I use a probability distribution class. It basically takes in an array of objects each having a chance and a value like so:

javascript:
Code: [Select]
var test = new jsRL.probabiltyArray([
{'value':'orc','chance':30}, //50% chance
{'value':'gnoll','chance':15}, //25% chance
{'value':'wizard','chance':10}, // 16.666% chance
{'value':'dragon','chance':5} // 8.333% chance
]);

then I can just call 'test.getRandomValue()' and it will pass a value back with a probability distribution exactly like that denoted in the total sum of the chance properties.

here is the javascript class below: (jsRL is the namespace for my game's library)
Code: [Select]
jsRL.probabilityArray = function(arr){
this.items = arr;
this.totProbabilities = [];
this.maxChance = 0;

for(var i = 0; i < this.items.length;i++) {
this.maxChance += this.items[i].chance;
this.totProbabilities.push(this.maxChance);
}

};
jsRL.probabilityArray.prototype.getRandomValue = function(){
var choice = jsRL.rand(this.maxChance);
for(var i = 0; i < this.items.length;i++){
if(this.totProbabilities[i] >= choice){
return this.items[i].value;
}
}
};

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Monster generation
« Reply #55 on: June 30, 2014, 10:14:47 PM »
I dunno yet how well this'll work, but I've put the infrastructure in place to do it this way just in the last couple of days....

I have a "generation table manager" that allows initialization functions to create and populate a set of named tables.  There are predefined tables that the standard map generators use to generate things; the map generators choose their tables based on depth and theme.  (Yes, there are themed map generators: some of them make themed areas such as The Ant Hill, The Diggle Dens, Dwarf Fortresses, Dragonkeep caverns, Goblin cities, the Stinking Swamp, etc).  An Init function could also create a new table and register a new themed map generator to use it. 

Each entry in a generation table has an oddment (what you've been calling a "weight") and a generation function that it can call.  The generation function gets some general information like the depth (dungeon level) and the total strength of monsters already generated on that level,  when it's called. 

The generation function is then responsible for actually creating things to put into the dungeon, and it can generate different things depending on its arguments.  So the same generation function can generate a "scout ant" if called on level 1-6, or "2 soldier ants" on level 2-7, or "7 soldier and 4 forager ants" if called on level 5-9, etc.  Or a different generation function could create a runaway goblin slave in the early levels, or a hunting party of goblins a bit deeper, or a detachment of goblin cavalry, complete with armor, lances, and saddled Battle Swine, if you're getting close to their main city. 

As I see it, it gives me a lot of flexibility to make fine adjustments in monster balance working at the level of the generators (different mixes of probabilities depending on depth etc, without messing with the probabilities of anything generated by anything else), at the level of tables (different oddments for generation functions), and at the level of dungeon generators (use different mix of tables).  But it won't be at all simple to say what the likelihood of meeting a particular monster on a given level will be, and it's not at all clear that this was the best way to do it - it might turn out to have been a better idea to try to control probabilities in a more central way that's easier to comprehend.

Like most of the things I do, it's insane overengineering.   ::)


Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Monster generation
« Reply #56 on: July 01, 2014, 07:41:44 AM »
I've thought this when planning Teemu's new more dynamic monster generation and decided to try the simplest possible way by giving a threat value to each monster based on generic feel about how difficult the monster is. Then each level has a max value for threat and monsters are generated randomly until max reached. Monster packs could represent a collective threat amount. There could be some random variations in threat amount and/or the amount of monsters which could exceed the threat max or sometimes create much less monsters than usual. I also believe that the player should adapt to the situation rather than the game trying to create more or less monsters based on player's stats etc.