NPC Randomization

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
NPC Randomisation

Have you ever played a game, and have asked an NPC a question...and they say the same thing over and over again, well I have seen this so many times. So it's time to show you how to give your NPC's a chance to come to life abit more...

You Will Need...

  1. Basic Understanding of Events
  2. Understanding of Conditional Branches
  3. Understanding of Variables

First of all create an event with a character graphic:

I am assuming you know what I'm talking about with this, so will not go into too much detail.

Then what you need to do is to create a Variable called Random:

So once you've named it you need to make sure you have it on the "Set" Radio button, which is normally the default anyway so you can normally just leave it, however you are going to use a different operand known as Random.

this means that when you run the event, RPG Maker VX changes the variable to the number in between the two numbers you place in the two boxes. For this example we are going to have up to five random comments made by the NPC. So you need to fill in the two numbers,

to ensure that we keep in the proper format, I'm going to keep it from 0-4. This is purely something I do, dunno why but it most likely makes it easier for RPG Maker so that if you create an error with your Variable and it returns 0 you will still get a responce...so make sure that it is filled like so:

So, now it is time to complete the next step....

Now we are going to set up a number of conditional branches, which can be found on the first page of the event command window, now we have a number of options to choose, for this event we want to select the Variable Radio button, and then select the Random Variable we created and set earlier:

One thing to note here, is to ensure that you deselect the Set handling when conditions do not apply, this is just purely to ensure smooth running of the event, and it makes it look tidier

Once you have done this your event should NOW look like this:

Now comes the creative bit, and also the most simplest bit of the Eventing :) All you need to do now, is to create your first piece of dialogue that you're NPC is going to say, however make sure that it is inside the first conditional branch like so:

How original, I know, but still this is an Eventing tutorial...not a writing one...so carry on

Once you have done this you need to follow the same steps again, however this time go up one number each time up to the last number that you set in the variable at the beginning of the event, for example if you've been following this tutorial it's 4.

Once done your even should look something like this:

Now...your final step, is to input more lines for your other options, remember to try and make them as varied as possible... and THEN you are done...your event should look something like this:

Now assuming that everything has gone to plan, you can now go into the game, and talk to your NPC, and every time you talk to them, it will provide you with a different response, of course due to the fact that the choice of variable is random, there are chances that you get the same response, the more different pieces of dialogue that you use. the more variety there is, and the less likely there is of repetition...So get creating interesting NPC's that aren't repeating the same lines....

Hope you enjoyed this tutorial as much as I did making it....and although simple, it's effective and makes the players experience slightly more original....Good luck and happy developing :)
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
I remember doing this too, the problem sometimes they will still say the same thing over and over or randomized. But hey, better than none at all :D
 

EvilEagles

Stargazer
Veteran
Joined
Mar 8, 2012
Messages
1,679
Reaction score
714
First Language
Vietnamese
Primarily Uses
Other
this is a little bit too basic but well I guess at least you deserve a thank for the effort hahaha ;)
 

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
@EvilEagles Thanks for the thanks :D I know this tutorial is a very basic way of creating interesting NPC's. There are other ways for example combining this method with Switch Events, and other things similar to this. It all depends on how much work you put into your eventing really lol.

But it's a start :) I can add more complicated NPC eventing. If people are finding this slightly too easy. Thanks for your comments

@Archeia_Nessiah

Yeah, that is one annoyance, but the more numbers you put in, the more different responses you can get
 

Genii Benedict

Supervillain, Extraordinaire
Veteran
Joined
Jun 13, 2012
Messages
333
Reaction score
115
First Language
English
Primarily Uses
this is a little bit too basic but well I guess at least you deserve a thank for the effort hahaha ;)
What's with all the negativity today, people? Geez!

;)

I like the idea behind what you're doing, Jonnie91. I, myself, am putting in a minimum of three layers of description on everything, just in case people do something the same three times in a row. The challenge with the 'random' text, as you've done, is that it's true - your NPC's do spout off the same stuff over and over again. I'm considering something similar, but having a randomized chance they tell you off if you speak to them too much, and then, they'll just choose to ignore you if you speak to them again.

Just like real life.

:D
 

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
What's with all the negativity today, people? Geez!

;)

I like the idea behind what you're doing, Jonnie91. I, myself, am putting in a minimum of three layers of description on everything, just in case people do something the same three times in a row. The challenge with the 'random' text, as you've done, is that it's true - your NPC's do spout off the same stuff over and over again. I'm considering something similar, but having a randomized chance they tell you off if you speak to them too much, and then, they'll just choose to ignore you if you speak to them again.

Just like real life.

:D
Now that is a great example of eventing :D Looks like I better sharpen up my beginners tutorials ;) there ain't very many beginners here lol

That is another awesome effect, and also, you could set it up that you can change the facesets, to angry face, the more you talk to them ^_^
 

Genii Benedict

Supervillain, Extraordinaire
Veteran
Joined
Jun 13, 2012
Messages
333
Reaction score
115
First Language
English
Primarily Uses
Now that is a great example of eventing :D Looks like I better sharpen up my beginners tutorials ;) there ain't very many beginners here lol

That is another awesome effect, and also, you could set it up that you can change the facesets, to angry face, the more you talk to them ^_^
Thanks. I actually only got into this in the past week. :) (Somewhere on here, I posted how surprised I was this product even existed - as I'd never seen it before.)

:D
 

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
Well, you certainly have started off exceptionally well :D Took me ages to get this confident in Eventing...then again I originally was just a writer lol :p
 

SolarGale

Learning
Veteran
Joined
Jun 8, 2012
Messages
479
Reaction score
37
First Language
English
Primarily Uses
Well my eventing skills are poor, and I didn't even see the random option, so for me this is great :3
 

Genii Benedict

Supervillain, Extraordinaire
Veteran
Joined
Jun 13, 2012
Messages
333
Reaction score
115
First Language
English
Primarily Uses
Well my eventing skills are poor, and I didn't even see the random option, so for me this is great :3
I agree. Over the past 30 minutes, my brains have exploded with ideas... ...so I've had to close the development window. I'm going to need to write down a bunch of ideas and conditions before I go putting more on the page. I've been playing over in my mind the ability for the NPC to:

  • Deliver the important information he has.
  • Randomly deliver miscellaneous information once he has provided the 'important information', while steadily increasing his "ire" (see: "discontent")level by a random amount. (There's a chance you're REALLY bothering them, and then the discontent might jump by tens instead of ones.)
  • Start randomly delivering lines such as, "Don't you have anyone else you could be bothering?" (This will be based upon a random chance, based upon the level of discontent he/she is experiencing.)
  • Cut the conversation out completely, should the player bother him/her too many times. (This will also be based upon a random chance, based upon the level of discontent he/she is experiencing.) ...or...
  • ATTACK! (You've severely upset them, and they're going to take it out on you!)

...and, on top of all this, figure out how to create this as a common event, so that I don't have to copy/paste the entire thing for every NPC I come across.

:D
 

Levi

Veteran
Veteran
Joined
Jun 7, 2012
Messages
798
Reaction score
143
First Language
English
Primarily Uses
I normally have 2-6 lines of dialogue written per NPC. I set it up so that every line is only heard once (using self-switches and conditional branches)... and once you've heard them all there is a 'farewell'. After that it displays the "Silence" bubble above the NPC. Infinite looping of 3 or 4 dialogues seems silly to me. It's lacks a "real" factor. I'm sure that this would be fine when used sparingly. But having every NPC say the same four things, in a different order, endlessly... not my cup of tea.

As a gamer, I'd rather have a dialogue come to a complete end, then have the same dialogue recycled.

Concise tutorial though! This technique is used for things other than dialogue. Gambling games, randomized loot... good stuff!

Edit: @Genii Benedict

Good stuff! I think I'll try and work on something like that as well.
 
Last edited by a moderator:

SolarGale

Learning
Veteran
Joined
Jun 8, 2012
Messages
479
Reaction score
37
First Language
English
Primarily Uses
I agree. Over the past 30 minutes, my brains have exploded with ideas... ...so I've had to close the development window. I'm going to need to write down a bunch of ideas and conditions before I go putting more on the page. I've been playing over in my mind the ability for the NPC to:

  • Deliver the important information he has.
  • Randomly deliver miscellaneous information once he has provided the 'important information', while steadily increasing his "ire" (see: "discontent")level by a random amount. (There's a chance you're REALLY bothering them, and then the discontent might jump by tens instead of ones.)
  • Start randomly delivering lines such as, "Don't you have anyone else you could be bothering?" (This will be based upon a random chance, based upon the level of discontent he/she is experiencing.)
  • Cut the conversation out completely, should the player bother him/her too many times. (This will also be based upon a random chance, based upon the level of discontent he/she is experiencing.) ...or...
  • ATTACK! (You've severely upset them, and they're going to take it out on you!)

...and, on top of all this, figure out how to create this as a common event, so that I don't have to copy/paste the entire thing for every NPC I come across.
Wow-omg when you do plz do a tut :D
 

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
Well if Genni Benedict doesn't mind, I'll take a crack at these idea's and then I'll post them here, of course crediting him for the ideas too lol or we could both work together on it ^_^
 
Last edited by a moderator:

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
Cool, I'll get this started and will get it posted :)
 

Shablo5

Veteran
Veteran
Joined
May 23, 2012
Messages
608
Reaction score
23
First Language
English
Primarily Uses
What's with all the negativity today, people? Geez!
+1

Good tutorial. We have people who've never touched rpg maker coming to this site daily, anyone who doesn't think tutorials like this are deserving, should go diaf :)
 

Robin

Veteran
Veteran
Joined
Mar 25, 2012
Messages
642
Reaction score
71
First Language
English
Primarily Uses
Good tutorial. We have people who've never touched rpg maker coming to this site daily, anyone who doesn't think tutorials like this are deserving, should go diaf :)
That's a completely unfair characterisation of criticism.

I normally have 2-6 lines of dialogue written per NPC. I set it up so that every line is only heard once (using self-switches and conditional branches)... and once you've heard them all there is a 'farewell'. After that it displays the "Silence" bubble above the NPC. Infinite looping of 3 or 4 dialogues seems silly to me. It's lacks a "real" factor. I'm sure that this would be fine when used sparingly. But having every NPC say the same four things, in a different order, endlessly... not my cup of tea.

As a gamer, I'd rather have a dialogue come to a complete end, then have the same dialogue recycled.
I think I am more in favour of having 3 or 4 lines of dialogue in order with the final line being repeated, having the cycle of conversion, which can seem unnatural, or having a conversation menu, where you can select topics.

With a random system, the player simply doesn't know how many times to speak to the NPC, as they will often seen repeated lines. Even if you tell the player "okay, each NPC has 4 lines", the player will still have to speak to the NPC more times than would be necessary. The chance that, with 4 lines, a player speaks to the NPC and doesn't see a repeated line is less than 10%. The average number of times a player will need to speak to the NPC to get all 4 lines is just over 7. With 5 random lines (as in the tutorial), the player will need to speak to the NPC an average of over 10 times. Simply, you're wasting the players time unnecessarily by using a number of lines of random dialogue.
 
Last edited by a moderator:

Adon

ADONKADONK
Veteran
Joined
Mar 24, 2012
Messages
93
Reaction score
15
First Language
English
Primarily Uses
I also think this "ire" variable should be a variable specific to the event! If you are using a single variable to track this, then you will end up resetting the ire for each NPC or something similar. Of course I am not all caught up with what exactly you are doing. Of course, you'll need a script or something to have a self variable for EVERY EVENT instead of using the limited regular ones.

Also, more importantly, Self Switches could help in the prospect of stopping repeating lines.

What do you call eventing that is aided by a script?
 

Genii Benedict

Supervillain, Extraordinaire
Veteran
Joined
Jun 13, 2012
Messages
333
Reaction score
115
First Language
English
Primarily Uses
I've considered it, and I have decided I'm not into the repeating lines thing. What I am envisioning, is a bigger, more grandiose version of "NPC". I mean, the initialism itself is capitalized already, so it demands importance!

;)

I feel that playability is the most important item in any game, and as the harshest critic in any game should be its creator. As such, my NPC's need to be as integral to my stories as possible. I need to feel that they are important, and not all simply eye candy. I aim to make even the negative element NPC's, those NPC's who are dedicated to providing lies and non-progressive story elements, integral as well.

That being said, I want to look at building a common, intelligent AI for my NPC's from a context point of view. For that to work, I need to take a more holistic view of every NPC, what information they might know, what information they won't know, the situation in which they find themselves, and the likelihood of which they may provide this information to the Adventurer. Beyond this, to keep the story from being extremely linear (i.e. you learn bits and pieces from each NPC) I want to look into having a chance system by which the NPC would choose to not provide this information to the Adventurer. Of course, this means that the information has to be duplicated, or at least fairly distributed across NPC's, so that there is never a chance to miss out on a crucial amount of information to complete the adventure. If that ever happened, the game would be unbeatable. (I've toyed with this, as being a possible outcome - so I'm not completely writing it out... ...as there could always be a "second place" ending. And, oh yeah, would I EVER make sure to let the Adventurer know, "YOU LOSE"... LOL.)

Of course, there are different types of information that will need to be implemented. Critical and non-critical information would need to be recognized, and provided to the Adventurer, and those pieces of information that are deemed critical, would need to be almost forced onto the Adventurer unless they do things so wrong, that they could not possibly earn them. In my personal opinion, there's a choice for the creator in this, if your Adventurer is traveling down a path that makes sure they aren't going to get the critical information. One, you push them back to the path to get that information (for example, you have the NPC's tell them directly, "you're an ass, and you're not going to get very far this way!", or you make the path back to righteousness more evident) or two, you allow them to move down a dark path, and give them the ability to gain that information from other sources. This could be via bad NPC's, by roughing up the good NPC's, or other ways.

I know there are many, varied methods by which I can accomplish this whole idea. Like your standard "HP" variables and such, I want to break down the different "Personality" variables, so that conversations are able to be more realistic. With my system, Fear, Caution, Trust, Anger, Attraction, and other emotional triggers should effectively become as integral as any other statistics in-game. Essentially, any and every conversation becomes a mini-game, a verbal 'battleground', where you are working to win more and more information from your opponent. I'm not content to have a fixed script for every NPC. I'm not content to even have a simple choice-based conversation to get to the information. I want to exploit every option available, to give my NPC's the virtual life that they deserve.

I've decided that I am planning on doing this in stages. First, I need to identify the different statistics and variables available, and build an information distribution structure that can be used 'as an example' for the program design. I need to identify how these variables and the information co-exist, and design the different methods by which the Adventurer can and will interact with different NPC types. Once I have this information, I'm going to flowchart everything I have, and then, it's down to the scripting and /or event building, and playtesting each type of NPC interaction.

Of course, I invite any critique or ideas you might have, to help me out. (Thanks for reading the wall o' text!)
 
Last edited by a moderator:

Jonnie91

Veteran
Veteran
Joined
Apr 16, 2012
Messages
584
Reaction score
182
First Language
English
Primarily Uses
N/A
I've considered it, and I have decided I'm not into the repeating lines thing. What I am envisioning, is a bigger, more grandiose version of "NPC". I mean, the initialism itself is capitalized already, so it demands importance!

;)

I feel that playability is the most important item in any game, and as the harshest critic in any game should be its creator. As such, my NPC's need to be as integral to my stories as possible. I need to feel that they are important, and not all simply eye candy. I aim to make even the negative element NPC's, those NPC's who are dedicated to providing lies and non-progressive story elements, integral as well.

That being said, I want to look at building a common, intelligent AI for my NPC's from a context point of view. For that to work, I need to take a more holistic view of every NPC, what information they might know, what information they won't know, the situation in which they find themselves, and the likelihood of which they may provide this information to the Adventurer. Beyond this, to keep the story from being extremely linear (i.e. you learn bits and pieces from each NPC) I want to look into having a chance system by which the NPC would choose to not provide this information to the Adventurer. Of course, this means that the information has to be duplicated, or at least fairly distributed across NPC's, so that there is never a chance to miss out on a crucial amount of information to complete the adventure. If that ever happened, the game would be unbeatable. (I've toyed with this, as being a possible outcome - so I'm not completely writing it out... ...as there could always be a "second place" ending. And, oh yeah, would I EVER make sure to let the Adventurer know, "YOU LOSE"... LOL.)

Of course, there are different types of information that will need to be implemented. Critical and non-critical information would need to be recognized, and provided to the Adventurer, and those pieces of information that are deemed critical, would need to be almost forced onto the Adventurer unless they do things so wrong, that they could not possibly earn them. In my personal opinion, there's a choice for the creator in this, if your Adventurer is traveling down a path that makes sure they aren't going to get the critical information. One, you push them back to the path to get that information (for example, you have the NPC's tell them directly, "you're an ass, and you're not going to get very far this way!", or you make the path back to righteousness more evident) or two, you allow them to move down a dark path, and give them the ability to gain that information from other sources. This could be via bad NPC's, by roughing up the good NPC's, or other ways.

I know there are many, varied methods by which I can accomplish this whole idea. Like your standard "HP" variables and such, I want to break down the different "Personality" variables, so that conversations are able to be more realistic. With my system, Fear, Caution, Trust, Anger, Attraction, and other emotional triggers should effectively become as integral as any other statistics in-game. Essentially, any and every conversation becomes a mini-game, a verbal 'battleground', where you are working to win more and more information from your opponent. I'm not content to have a fixed script for every NPC. I'm not content to even have a simple choice-based conversation to get to the information. I want to exploit every option available, to give my NPC's the virtual life that they deserve.

I've decided that I am planning on doing this in stages. First, I need to identify the different statistics and variables available, and build an information distribution structure that can be used 'as an example' for the program design. I need to identify how these variables and the information co-exist, and design the different methods by which the Adventurer can and will interact with different NPC types. Once I have this information, I'm going to flowchart everything I have, and then, it's down to the scripting and /or event building, and playtesting each type of NPC interaction.

Of course, I invite any critique or ideas you might have, to help me out. (Thanks for reading the wall o' text!)
Be careful, as Robin said, if you are creating something huge that will have to average out the times you speak to someone, then you are in some ways wasting time, however what you must consider Rob, is the fact that some Gamers, like myself, will speak to every NPC and will go 10 times to see whether they have anything else to say. If I remember rightly I'm not the only one, even on this site. As an Ex-Reviewer over on RRR, I always pushed every section of the game to see how far they've gone.

But I must agree that Genii idea although brilliant and complex, that is the problem. This method has it's flaws, but so do most methods, this is just a simple way of trying to make the game slightly more interesting, and for those gamers, who don't search every NPC etc it is just a waste of time. You need to think about what target market you're aiming for.

For example if you are creating a Murder/Mystery similar to One Night, then your players will want to search every single area just so they can find out as much as they can about everything. so the more advanced method is actually quite a good idea...

Wheras if you doing a straight up fantasy...your player is going to be more intregued by the battles and the character Development, rather than some silly NPC that say a bunch of random stuff.

tl;dr: In short, It is all dependent on the time scale of your game. For example my main game has been going on for 2-3 years now, due to the fact that I tried to do EVERYTHING, to make EVERYONE happy. I tried to make it error free, tons of different evented systems, but it got to the point I was pulling my hair out, and it wasn't fun anymore. So keep yourself to a manageable goal. Otherwise you will find yourself three years down the line giving up.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top