View previous topic - View next topic |
Author |
Message |
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Wed Nov 03, 2004 9:25 am Post subject: |
[quote] |
|
Hajo wrote: | A problem linked to this is that objects that are levels on one scale (the players space ship, on a 1x1 m scale) are objects on bigger scale levels (a space map e.g.). The abilities of the space ship object must depend on the installed equipment. Installation is done on the 1x1m scale interior level. Currently the H-World engine can't link level contents to object abilities. |
Interesting idea. In my engine, my maps are objects and to add an actor to it you invoke its spawn method. What I'd need to add in your case is to have the map create an actor of its own that can be placed on another map. In such a scheme, the spawn method could check what's getting added and optionally change some of its map's actor. The map will also need to get notified about any object that is destroyed within it, so that it can downgrade its actor accordingly.
|
|
Back to top |
|
|
PhyrFox Tenshi's Bitch (Peach says "Suck it!")
Joined: 19 Nov 2004 Posts: 64 Location: New York, USA
|
Posted: Fri Nov 19, 2004 9:15 pm Post subject: "Random" Dialogs |
[quote] |
|
Greetings.
First of all, I am new here, but I thought I'd throw in my two cents regarding this rather interesting topic. There's an idea that I've read about that would greatly improve the theories presented by the other posts here. Feel free to use or ignore the idea, as you will.
I have several game design books, and inevitably, they cover the topic of AI. Specifically, how to make customized NPCs seem more realistic. Here's a few ideas that you might use, as paraphrased from the book "Game Design: Secret of the Sages" (if my memory serves me correctly).
It was stated in this useful book that a NPC or enemy (whatever) could have a set of associated weights and/or genes. Weights determine the probability of a given character saying or doing something based on what they've "learned" or due to various "personality" quirks. In the book, it goes to say that an AI of a fighter pilot in a dog fight versus the player would try a more favorable attack method (roll, scissor, loop-de-loop, etc) based on the successfulness of previous attacks of that type.
A success would increase the weight (and thus, the probability that it would use that action in the future), whereas a failure would decrease its usage. To apply a personality quirk, simply adjust the amount that a weight is adjusted by (for example, if a NPC really enjoys using loop-de-loops, a failed action would decrease the weight by 1% instead of 10%, or something).
This might be useful in having the NPCs react to a player in an RPG based on previous dialogs (for example, when you give them an item they "like" or say something to "offend" them). This idea has been used in many games, really, from FFVII, to Morrowind, and so many others. Although generally, they used less-defined methods, such as "How many times did the player let hero X die?", or "How often was a combination of heroes in a party?"
The other idea was the use of "genes," a "genetic pool" of abilities or attributes that would be assigned to a NPC that would affect how they act. Examples might be "sneaky," "greedy," "friendly," or any other attributes you might think of. In the book, they used it as a method of determining how AI-controlled bots would attack you in Halo. In this context, you might use genes to determine the initial responses that the player would get from interacting with an NPC, and further adjust the weights mentioned above similar to "personality quirks." The only difference here is that they are dynamic changes instead of "static" changes, such as above, where specific NPCs were hard-coded to change their weights by who they were, instead of randomly assigning personality traits.
Genes could be populated from a "gene pool", thus ensuring that only a certain population percentage would have the traits, absolutely guaranteeing a variety of characters in different places every game. The gene pool could be global, by area, or any other way you might divest them.
This is, of course, all just vague, but if anyone sends me a message, I'd be glad to help out with more specific examples, or I could help whoever needs help coding some of this stuff. I've got plenty of free time. Anyway, must be going, but I'll be back later.
--Fox--
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Mon Nov 22, 2004 9:29 am Post subject: |
[quote] |
|
Hi,
I've just released a very first version of my space exploration game.
Look here:
http://www.simugraph.com/forum/viewtopic.php?id=11&t_id=32
Maybe you can install "Arxigle Xentrophore" (needs the base package and engine instralled also), and take a look at the space station.
There are a number of NPCs on deck 1 of the space station (the one above the hangar). Some are traders, one shall become a public officer who hands out mining licences and there is a bar. Also some other space station inhabitants that don't have a well defined role currently.
Maybe you can explain your ideas using them as examples?
Currently all space stations in the game are 100% identical. There is an almost unlimited number of solar systems. The problem is how to create different NPCs for all the stations. I think it's ok that the station have the same level layout, we can assume they are build from mass-produced modules that are always the same (I'll introduce a few basic station types to get a little of variety, but that's not a problem).
It would be nice if the NPC could talk about things that are specific to their solar system or environment. Moreover, I'd really appreciate if all NPCs would have individuel dialogs.
|
|
Back to top |
|
|
PhyrFox Tenshi's Bitch (Peach says "Suck it!")
Joined: 19 Nov 2004 Posts: 64 Location: New York, USA
|
Posted: Tue Nov 23, 2004 7:19 pm Post subject: |
[quote] |
|
Hajo wrote: | Hi,
I've just released a very first version of my space exploration game.
Look here:
http://www.simugraph.com/forum/viewtopic.php?id=11&t_id=32
Maybe you can install "Arxigle Xentrophore" (needs the base package and engine instralled also), and take a look at the space station.
There are a number of NPCs on deck 1 of the space station (the one above the hangar). Some are traders, one shall become a public officer who hands out mining licences and there is a bar. Also some other space station inhabitants that don't have a well defined role currently.
Maybe you can explain your ideas using them as examples?
Currently all space stations in the game are 100% identical. There is an almost unlimited number of solar systems. The problem is how to create different NPCs for all the stations. I think it's ok that the station have the same level layout, we can assume they are build from mass-produced modules that are always the same (I'll introduce a few basic station types to get a little of variety, but that's not a problem).
It would be nice if the NPC could talk about things that are specific to their solar system or environment. Moreover, I'd really appreciate if all NPCs would have individuel dialogs. |
I'm tired of trying to hack the library system enough to get the program to work, so I'll have to wait until next week, when I'll have my own computer setup to run things on. It's not so bad, except now I'll be just stabbing in the dark, hoping I hit the target.
I did some thinking about this "dilema" and thought of how one might expand the ideas I mentioned, since it wasn't too specific, although I'd been hoping to have gotten the point across. Hmmm... Here, let's try it this way:
Code: |
typedef struct {
char Name[16];
int GeneCode[3];
int Race;
int Class;
} NPCClass;
|
Okay, starting from here, you end up with some obvious truths: Each NPCClass character can have a name up to 15 characters long (or 16, if you're willing to add an extra error check), three "genes" as I discussed earlier, a "race", and a "class". Let's cover these elements individually and make some sense of them...
1) Race
This is the easy one. Race is a Human, an Elf, a Ferrangi, a Vulcan, a T'salkian, or whatever you want them to be. Presumably, they'd be assigned various stats (such as how they look) based on their race.
2) Class
This is also just as easy, although adds a layer of complexity. A class is what they do for a living. You might have one class be "Fighter", one "Trader", one "Shopkeep", one "Innkeep", and any other myriad of classes available to NPCs. This might alter their clothing or style of talk (a person hawking thier wares would say something of that type, or an innkeeper would offer a place to stay). This is a "class" of dialog options as well. Innkeepers inevitably offer a place to stay for the night, although how enthusastic they are about the player staying the night might depend on the race/class of the character.
3) Genes
Here's where the dirt hits the ground. It promises to be slightly messy here, but hopefully I'll do a well enough job of this...
For a given area (say, a ship), you might assume that you have a given population:
Code: |
Qty Gene
-------------------
10 Intelligent
30 Normal
10 Stupid
-------------------
10 Daring
20 Adventurous
20 Conservative
-------------------
15 Humorous
10 Down-to-earth
25 Serious
-------------------
|
Now, you'll notice I've come up with three arbitrary sets of genes. This is only the smallest subset I could imagine. You could list hundreds of personality types, and assign them "at random." All of them "work" together to form the final selection of dialogs presented. Each dialog could have custom examples from the native area (or possibly even beyond).
Note the numbers on the left indicate the presence of a gene within the pool. The numbers in this case add up to 50. Each participant would be given one gene from each group; when there are no more of that gene, no more NPCs will have that attribute within the group. The more gene "sets" you define, the more work you need to put into making the dialogs, but the more you guarantee unique individuals.
By adjusting the values, you can introduce a "serious" society (such as mine is... 50% of all the NPCs will have serious attitude), or humorous. Daring or conservative. Brainaics or dorks. Also, you could introduce some relationship factors: the guy walking down the street is dating the secretary at the hospital. You could store several relationships (which would reciprocate) that a given NPC could be in. Maybe say 4-5 "friends", 2-3 "close relatives", and possibly a signifigant other.
Also, one could relate the story of somebody nearby who happened to have done something (using their "smart" and "daring" genes, but told with the speakers "humor"). Could be even a collaboration between several NPCs and the NPC that did it. A sort of ripple effect.
A few examples:
Stupid / Daring / Humorous
This NPC comes up with an amusing ancedote about how he bravely took on a {random creature} single-handedly and barely managed to come out alive. You'd note that, in a good probability, the undertaking was extremely *stupid* to have even attempted, and the poor fool is lucky to be alive.
Intelligent / Adventurous / Down-to-Earth
This NPC describes a situation that took place not long ago regarding a cave he visited in an astroid belt nearby. Not precisely a dangerous mission, although if something had gone wrong, he could have gotten seriously hurt. But he sounds like he knew what he was doing.
Normal / Conservative / Serious
Not really wanting to discuss matters far from home, this NPC relates some recent news she heard about a shop that's having a sale nearby. She would go there herself, but, as she somberly notes, she doesn't get paid until next week.
I think I'm starting to show a bit of how genes might affect a dialog, depending on the number of genes and what they represent. Now, to take it one step further, you might incorporate these dialogs into a particular class as well.
For example, a trader with "Adventurous" would relate how she nearly got herself robbed while off in a nearby quadrant trying to purchase some items of "ill repute." Or an Innkeeper with "Conservative" might mention that there's too many rowdy characters staying at her inn tonight.
This is a vastly complex idea the more I think about it, but I'm quite certain it would have the effect you're quite looking for.
In the simplist aspect, dialogs would then produce random dialogs from each class of genes. In the cases above, the first gene describes the likihood of the NPC doing something stupid or downright naive. So the game would choose from a particular list of activities or things that they might talk about.
The second gene describes action, or, better defined, what they did about it. "Daring" is a reckless gene, often involving near-fatal accidents or other stupid acts (seeing how long one can survive in outer space unprotected). It's a reaction to the random activity they did or heard about (conservatives rarely risk their neck for anything, so unless it's an event that would happen to *them*, they'd just as much not be there). The third gene relays the "how" of how they communicate this to the player.
I've made a huge post out of this, and I think I'm still only scratching the surface. Next week I'll write an example dialog creator and post it somewhere convient.
I've gotta go, I've been here like... for hours.
~= PhyrFox =~
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Wed Nov 24, 2004 10:38 am Post subject: |
[quote] |
|
PhyrFox wrote: |
A few examples:
Stupid / Daring / Humorous
This NPC comes up with an amusing ancedote about how he bravely took on a {random creature} single-handedly and barely managed to come out alive. You'd note that, in a good probability, the undertaking was extremely *stupid* to have even attempted, and the poor fool is lucky to be alive.
|
Now, since we were taliking about atomatically creating dialogs for NPCs, how will this anecdote be made?
If it is prewritten, all NPCs of this type will use it (bah, boring). If a few are prewritten, it takes longer for the player to notice but it's still the same problem.
Writing lots of them is time consuming for the game designer.
I'm looking for a solutions that doesn't require me to write lots of text. First I'm bad at that, second I'm slow at that, third prewritten texts lower replay value drastically.
This measn I'm looking for a piece of code that constructs a dialog for a NPCs. In your example race, class and genes will be parameters for this piece of code. Yet I have no idea how to write somthing like that?
Particularly because a dialog must consider the players answers.
|
|
Back to top |
|
|
PhyrFox Tenshi's Bitch (Peach says "Suck it!")
Joined: 19 Nov 2004 Posts: 64 Location: New York, USA
|
Posted: Tue Nov 30, 2004 2:05 pm Post subject: |
[quote] |
|
For a rather complex-looking (but should be rather simple) system, I'd try something like this:
1) Choose Race or Class, select a topic.
This will be the basis of their conversation. They might choose a topic such as "homeworld," "profession," "family," or some other major topic.
2) Choose more specific details.
Depending on what group they are talking about, have the speaker choose a specific topic item, maybe an item, creature, or something. Could apply to a possible event (as something that has, or could, happen).
3) Apply genes to dialog.
So, they are now talking about a subject in light of a specific "mode of thinking." You could add/change phrase groups to fit a particular gene. For example, a greedy gene would show it's ugly face whenever a NPC discusses an item they'd *love* to have.
4) Construct dialog sentence(s).
Now you have the basic phase groups. Each group is based on the subject they are talking about, and in reference to the "relationship" to the thing they are talking about. Within the group there are various phrases that *could* be said. The more groups or "fragment families" you have, the more the dialog sounds normal (or at least, a lot less like pre-gen talk). Having a reasonable amount of fragments in each "fragment family" would keep the dialog fresh.
5) Translate to native talk per race/class.
This extra step might translate "You" into "Y'all", or "Goodbye" to "Laters" or "See ya around" based on a table that would contain basically "grep()" commands to change the text further, so that it would further customize the dialog based on perhaps their race (they expand the 's' sound) or they talk as a younger/older generation, or they have odd sayings unique to their culture or profession. Possibilities are near-endless on this.
----------
Alright, so that ended up different than my previous idea. My idea seems to be evolving differently the more I think about it. Sounds much like the problem you're having, not knowing how to express yourself (pun intended). But you could just as easily start off with Genes first (choose a "madlib" series to fill in) and fill in the blanks, then translate. Goodness. All this typing about it makes me want to try my hand at making something like this. I'll see if I can post something near the end of the week to this effect.
As for making dialog boxes that have responses (now that I've had a chance to actually play the game), I'd recommend possibly not having any useful responses to most of the dialog boxes (because, AI only looks intelligent for so long), or have them have a set of response dialogs depending on the situation (if they choose an event, ask the player what s/he thinks, or if it's a story, the player may choose to act interested or not, etc). Then have them respond in kind to these responses much the same way (making fragment families for various positive and negative responses).
The only *final* alternative, if you really wanted to, would be to actually personify each NPC with an AI memory, and some sort of advanced AI chatting system (something like ALICE would be interesting to see in an engine), but those require programming neural networks, etc. I'd settle for having mostly not-repeated dialogs that are completely random, versus something that is quite a bit more repeated (like Morrowind... try it, you'll see what I mean).
~= PhyrFox =~
|
|
Back to top |
|
|
|
Page 2 of 2 |
All times are GMT Goto page Previous 1, 2
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|