• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

bishop_pass

Using Lisp (or another language) to generate fictional characters

126 posts in this topic

Let's imagine, for the sake of exercising our brains, the way that we could code a program where its purpose is to create a dossier on a fictional character. Essentially, it is the program's task to contrive, imagine, and flesh out a character and a little bit of his history. I'll lay out some basic ideas. In my example, I'll assume that depth is more important than breadth with regard to the program's abilities, therefore, in my example, I'll restrict the domain to a particular region and period. If you wish to elaborate on this whole idea, then explore the idea how you might. For my example, let's assume that domain is the Old West. The first thing we want is a name. Since I'm not up on Native American culture, I'll limit my program to having knowledge of European and Hispanic names. So, we'd provide a database of names. We might create a list of lists like this: ((Smith English) (Sanchez Hispanic) (Bierstadt German) ...) and so on. And for first names, we might create a list like this: ((John English Male Johnny) (Carlos Hispanic Male) (Mary English Female) ...) and so on. Now, first the program decides on an ethnic background and gender, and then proceeds to find a suitable surname, first name, middle name, etc. Notice that a provision can be made for marriages between individuals of different ethnic backgrounds, allowing for leeway in the choosing of first names. From here, the program can recursively create parents of the individual, receving information regarding the birthdate, the surname, etc. Speaking of birthdates, the program will choose a birthdate and age for the character. Also, the program can decide if the character is an orphan or not, and if so, create a guardian who raised the character, or an institution, such as an orphanage, school, etc. After that, the program can create a medical history for the character, based upon any knowledge the program has on common ailments, etc. If there exists knowledge about any disfiguring attributes of any diseases, then such characteristics can be created for the character, such as a limp, etc. Then come accidents. If there were any accidents which caused permananet scarring or some other such maladies, these are recorded. Again, note that such embellishments of character require knowledge with respect to the event. As an example, we might have a list which lists things such as muggings or carriage driving accidents, and the possible resulting wounds which might have happened. Note that we not only create a physical description of the character, but a history which explains how such physical traits were acquired. I'll leave it at that, but obviously there is more to say... [edited by - bishop_pass on October 3, 2003 12:09:49 AM]
0

Share this post


Link to post
Share on other sites
So would this character generator be most useful for something like a computer game, or do you have something else in mind?
0

Share this post


Link to post
Share on other sites
I think that in order to generate each character''s life story, you would have to take into account all the other characters'' life stories. Basically, you would have to evolve all the life stories together. That would be quite an interesting project - something like The Sims except more global in nature.
0

Share this post


Link to post
Share on other sites
This is an interesting idea. I''ve got nothing better to do, so I might as well get to work on this

I don''t know Lisp and I''m not really up to learning it, but I''ll give it a try in c++.
0

Share this post


Link to post
Share on other sites
quote:
Original post by Tron3k
I think that in order to generate each character''s life story, you would have to take into account all the other characters'' life stories. Basically, you would have to evolve all the life stories together. That would be quite an interesting project - something like The Sims except more global in nature.
I don''t think it''s necessary to do such a thing, unless you''ve defined a set of criteria requiring just that. I would consider it a sufficient problem to tackle it as I originally put forth, whatever the context might be, and whatever depth and breadth you wish to add to the domain.

0

Share this post


Link to post
Share on other sites
quote:
Original post by Xtremehobo
I don''t know Lisp and I''m not really up to learning it, but I''ll give it a try in c++.
Hmmm. I''d like to point out that Lisp is better suited to focusing on the problem at hand - that is to say, the actual domain knowledge, rather than a language like C++, where you''d have to spend time developing the infrastructure for such domains before actually tackling the domain knowledge itself.

0

Share this post


Link to post
Share on other sites
But all you are left with is the equivalent of an RPG hero with generated statistics and some kind of physical description. You still don''t have a REAL character with personality, attitudes, vices, fears, goals, dreams, etc.

I guess you could just take the same approach even farther to get all this, but all you''ll still have is just a character with a bunch of flags set. Then again, I guess technically that''s all we are.
0

Share this post


Link to post
Share on other sites
quote:
Original post by BradDaBug
But all you are left with is the equivalent of an RPG hero with generated statistics and some kind of physical description.
I don't even recall focusing on a physical description or statistics. I think I was more focused on a history for the character.
quote:

You still don't have a REAL character with personality, attitudes, vices, fears, goals, dreams, etc.
I thought that was more the direction that I was taking.

[edited by - bishop_pass on October 4, 2003 12:06:26 AM]
0

Share this post


Link to post
Share on other sites
Do you have any ideas on giving the characters personalities? I think this is an important aspect because it can affect different traits that a person can have. Someone who loves excitiment and adventure might be more likely to have one of those accidents that lead to disabling diseases.
0

Share this post


Link to post
Share on other sites
It sounded to me sort of like a character would look something like this (btw, I don't know Lisp (which may have something to do with me not understanding), so this is pseudo C):

injury i0

i0.date_received = 20031004
i0.type = LIMP
i0.bitterness_weight = 3.5
i0.depression_weight = 1.2
i0.happiness_weight = -0.2

character.injuries[0] = i0
character.eye_color = "blue"
character.hair_color = "brown"

character.outgoing = 3.0
character.neatness = -3.0
character.friendliness = 0.8

Something like this.

Edit: syntax error in my pseudo code!

[edited by - BradDaBug on October 4, 2003 12:19:04 AM]
0

Share this post


Link to post
Share on other sites
Well, I'd have to say that a stat describing a character's depression is pretty dull. Wouldn't it be more interesting if the program spit out a transcript describing him?

Bill 'Billy' Thomas was born in Laredo, Texas on March 14th, 1866. His father was Albert Thomas, his mother Lucille Brown. They were married in 1863.

Billy despised his father, who was an alcoholic, and he left home on April 10th, 1877, at the age of 15. A year later, he settled in Williams, Arizona. He found employment as an apprentice to a blacksmith.


So, to reproduce that, you might want to focus on encoding knowledge of such concepts as names, first and last, male and female, marriage, leaving home, drinking, towns, professions, etc.

No need to get too in depth - just focus on giving enough rules to fabricate characters.

The purpose of such a program isn't nearly as important as the purpose of creating it. It's the act of creation which can inspire and create a purpose.

[edited by - bishop_pass on October 4, 2003 12:36:35 AM]
0

Share this post


Link to post
Share on other sites
I think something like BradDaBug suggested is necessary to get the type of output you''re looking for, bishop_pass. The program would need to know that Billy hates his father and why in order to generate something like this:

Six years later, Billy returned home to find that his father had mended his ways and sobered up. He was hesitant at first, but after a while Billy realized that his father really had changed, and then he joyfully welcomed his father back into his life.
0

Share this post


Link to post
Share on other sites
quote:
Original post by Naaga
I think something like BradDaBug suggested is necessary to get the type of output you''re looking for, bishop_pass.
Sorry, but you''re wrong. Knowledge encoding does not need a list of silly stats, with shades of an RPG.

0

Share this post


Link to post
Share on other sites
quote:
Original post by Naaga
Six years later, Billy returned home to find that his father had mended his ways and sobered up. He was hesitant at first, but after a while Billy realized that his father really had changed, and then he joyfully welcomed his father back into his life.
And furthermore, I don't think for a minute that any program created by anyone here is going to come up with that (the above quote). It's just too much. Unfortunately, by proposing such a thing, you're making the whole idea seem more intractable.

However, if you delve a little deeper into symbolic programming and knowledge bases, and look for templates in fiction, you can see that simple biographies within limited domains are possible, and can be fun and tractable.

[edited by - bishop_pass on October 4, 2003 12:52:41 AM]
0

Share this post


Link to post
Share on other sites
The point here is that when you decide to fabricate a story or history, you don''t create a list of stats. There''s no need for such methods in a program designed to do the same.
0

Share this post


Link to post
Share on other sites
I don't claim to be an expert on LISP. I've only recently started learning. I curious, though, instead of representing a person using a list, why don't you define a class?

Also, how would you go about generating a description if you don't have any statistics to base it off of?


[edited by - Forcas on October 5, 2003 9:26:09 PM]
0

Share this post


Link to post
Share on other sites
quote:
Original post by Forcas
I don''t claim to be an expert on LISP. I''ve only recently started learning. I curious, though, instead of representing a person using a list, why don''t you define a class?
Why? I don''t see the point. First of all, we''re talking about the history of a person. I personally don''t think the constrained notion of a class comes close to the flexibility of s-expressions for storing knowledge about a history/story.
quote:

Also, how would you go about generating a description if you don''t have any statistics to base it off of?

You''re thinking is truly stuck within a very constrained programming methodology. Make up a person''s history in your mind. Now, did you use a list of statistics?
0

Share this post


Link to post
Share on other sites
I am going to have to agree with Bishop Pass here on this one. Stats mean nothing in this sort of project.

I did an extremely watered down sort of thing that Bishop Pass is suggesting, you can find the PHP Source on the Evil Twin (just note that the Demo link is not working).
0

Share this post


Link to post
Share on other sites
In the example I created above, we see that Billy left home because his father was an alcoholic. I made that story up in my head based on knowledge I have, for example, I know that family troubles, abusive fathers, etc. are reasons that one would leave home.

It stands to reason that in describing a person''s history, one of the things that they almost universally do is leave home at some point or another. Given that, we draw on our knowledge of reasons why someone might leave home.

So, our program should have some knowledge of reasons why people leave home. In a quick and dirty way, (by no means comprehensive) we might encode it like this:

(LeavingHome Reasons
(IsA Father Alcoholic)
(Died Parents)
(Desired Protaganist SeeTheWorld)
(Offered Protagonist Job)
(Attended Protaginist College)
)


Each of those examples are of course rough and dirty with regard to implementation, but you get the idea. Appended to each reason should be a name of the reason, where another list can contain other information about the event, such as how to write it out, what dependencies it might have, and what things it can lead to cause in the future.
0

Share this post


Link to post
Share on other sites
Well, all I can say, is that it appears that if many of you can''t use a list of RPG stats, suddenly your thought processes have stopped dead in their tracks.
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Well, all I can say, is that it appears that if many of you can''t use a list of RPG stats, suddenly your thought processes have stopped dead in their tracks.

I can see what you''re saying, and I feel like I''m standing just outside of fully grasping the first step in the right direction but in the meantime I''ll stick with my Lisp books. (Which my school has a whole 14 of)


[paralogist] [Lisp is King] [Support Codesprout]
Part of the Lisp revolution since 03.30.03
0

Share this post


Link to post
Share on other sites
We might create a history as a sequence of events, each with a symbol name for the title of the event, a date, a reason, etc.

This sequence is in a list.

We might have a template for each possible event, giving the required semantics, and whether it is required or not:


(
(Name First Last Middle Required)
(Born Month Day Year City State Required)
(Father First Last Middle Required)
(Mother First Maiden Middle Required)
(LeftHome Month Day Year Reason Optional)
(MovedTo Month Day Year City State Optional)
(Employed Employer Month Day Year Occupation Optional)
)



(
(William Johnson Bernard)
(Born November 3 1864 Jackson Wyoming)
(Father Francis Johnson)
(Mother Lucille Smith)
(MovedTo July 10 1870 Cheyenne Wyoming)
)


And we might have for each semantic slot, a list of possible entries. A more complex and robust version would have constraints for each entry, maintaining dependencies.


(Month
(January February March April May June July August September October November December))


[edited by - bishop_pass on October 6, 2003 12:00:54 AM]
0

Share this post


Link to post
Share on other sites
While stats are by no means necessary, we need to think of a method to achieve a description of the character''s personality in some way. After all, a person''s life history is shaped by his/her actions, which depend on his/her emotions, personality, bringing up, etc. This system must have some random element in it, since we are simply creating a single stand-alone story. Perhaps one way to do this would be to have a probability matrix, where each event influences the probability of another event happening down the line. For example, a "death in the family" event could increase the chance of a "suicide", "homicide", or "drop out of school" event. Again, perhaps I''m thinking too mathematically. Any ideas?
0

Share this post


Link to post
Share on other sites
Yeah, you are thinking too mathematically. Think like you think, not like you think your computer thinks. What do you do when you think up a story?

Chances are, you have a set of defined slots or roles to be filled, and you pluck from your mind plausible fillers for those roles (as I outlined in my prior post) and you base your choices on maintaining dependencies and satisfying constraints, often selecting one item over another because one thing fits better than other, which is based on knowledge, not a number.

I'm going to suggest again that you forget about stats and numbers.

[edited by - bishop_pass on October 6, 2003 12:24:11 AM]
0

Share this post


Link to post
Share on other sites
Yes, I had the feeling that my idea was flawed.

I like the idea of having pre-defined archetypes, as you say. Perhaps you could have two separate systems, one for creating the personality sketch based on the archetype, and the other for generating plausible archetypes. The second would probably be more difficult. Or do we really need more than the basic set?

Perhaps they could be divided into Heroes, Villains, and Side Characters, making it something like a novel.
0

Share this post


Link to post
Share on other sites