• ### Announcements

• #### Wondering what's new and changed at GameDev.net?06/20/17

Check out the latest Staff Blog update that talks about what's changed, what's new, and what's up with these "Pixels".

#### Archived

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

# Using Lisp (or another language) to generate fictional characters

## 126 posts in this topic

quote:
Original post by Tron3k
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.
Now you''re talking about characters'' histories entwined with each other - an altogether more difficult task.

0

##### Share on other sites
*sigh*

If I had my other machine in operation (the one with Lisp and other development tools installed on it) I''d work on this as a sideline project, just for the heck of it. But alas, that isn''t the case, so I thought it''d be interesting if someone else was just a smidgeon inspired to try something like this.
0

##### Share on other sites
Has anyone gone anywhere with this thread? I've just begun to put some of my thoughts into code, albeit hideous at that. Though it won't exactly be beautiful, exactly what is called for or very clean I'll put it up in the hopes it revives this thread a bit. At least it'll be something!

Right now what I'm working with is pretty simple and straightforward, though I am beginning to see the ease with which it may be extended later on.

The entire process begins with a randomly selected (ethnicity last_name) set. Then are selected the mother and fathers (gender ethnicity first_name), with the father's ethnicity matching that of the orignal last_name set. I've toyed with have other attributes here, such as (gender ethnicity first_name attributes) where attributes might be occupation, whether the parent was an alcoholic as was mentioned, deceased etc. This part I'm leaving out until I have a better feel as to whether my initial design holds up or if I'll need to heavily redo (as I suspect). From here I determine the characters gender, ethnicity (based upon parents) and first name.

I haven't quite solidified the next part but what I just pumped out is when and why the main character left his home (which may tie into the parents "attributes" or what have you later on.

The more shady part that I've only scribbled so far is her present condition which includes but is not limited to the state, local geography and current occupation. As to whether or not this will include recent noteworthy events I'm not yet ready to take a definitive stance.

/ramble

Cheers.

(Edit: and it might do this thread some justice to move it somewhere other than the lounge, though that's most likely where 70+% of the sites activity can be found.)

[edited by - kordova on October 31, 2003 12:10:29 PM]
0

##### Share on other sites
I would try it, but I do not know Lisp well enough to try--and no, I cannot buy books, I am broke until December comes up, and then I will be broke again (otherwise, I would be more inclined).
0

##### Share on other sites
quote:
Original post by DakeDesu
I would try it, but I do not know Lisp well enough to try--and no, I cannot buy books, I am broke until December comes up, and then I will be broke again (otherwise, I would be more inclined).

I consider myself pretty terrible with Lisp at this point. I''m still willing to try.

0

##### Share on other sites
I'm willing to give it a shot, but I'm going to ramp up on my Lisp skills. Haven't programmed in it since university (about 3 years ago).

For those of you wanting to learn, ANSI common lisp by Graham is what I learned from, and is a terrific book. I still have it somewhere in my room. *reminds himself to go look for it when he gets home*

[edited by - Zul on October 31, 2003 12:25:52 PM]
0

##### Share on other sites
quote:
Original post by kordova
quote:
Original post by DakeDesu
I would try it, but I do not know Lisp well enough to try--and no, I cannot buy books, I am broke until December comes up, and then I will be broke again (otherwise, I would be more inclined).

I consider myself pretty terrible with Lisp at this point. I''m still willing to try.

Yeah, I seen a bunch of links myself--but I''ve never wrapped my mind around how cdr, car and their derivatives might be used in a useful manner.
0

##### Share on other sites
Read the BP gamedev threads and perhaps some of Paul Graham''s articles on his webpage if you''re truly interested. It begins to make sense, albeit rather slowly at first.
0

##### Share on other sites
btw, this topic didn''t really die, it evolved into this one and got moved to the AI forum.

Well, it''s a bit different, but similar.
0

##### Share on other sites
quote:
Original post by kordova
Read the BP gamedev threads and perhaps some of Paul Graham''s articles on his webpage if you''re truly interested. It begins to make sense, albeit rather slowly at first.

I''ve read the first few ones--until the point where people kept asking the same questions over again, and yes, Lisp rocks for handling data structures (as was some of the arguments against XML). However, I still do not know where something like "cdaddaar" might possibly be of any use.
0

##### Share on other sites
Unless you can interact with the character (directly or indirectly) in question there is, in my opinion:

a.) little point
b.) not much going on of interest

While the history might supplement a more in depth character system, when it is alone it is not all that intriguing.

Comically, writing it in Lisp wouldn''t be much effort except for the tables of information you wish to select from (names, ethnicities, diseases, occupations, etc).

You could turn this the other way and instead of generating a history, you generate offspring for people. This might be more simplistic than the history but somehow more interesting as the use could interact and perhaps guide the generation.
0

##### Share on other sites
quote:
Original post by Zul
btw, this topic didn''t really die, it evolved into this one and got moved to the AI forum.

Well, it''s a bit different, but similar.

I think there are enough differences to warrant my investigation into the topic here alone first, though I''ve been informed of that thread''s move recently as well. Cheers.
0

##### Share on other sites
quote:
Original post by flangazor
You could turn this the other way and instead of generating a history, you generate offspring for people. This might be more simplistic than the history but somehow more interesting as the use could interact and perhaps guide the generation.

That is similar to my intent, though I''ve always preferred the egg before the chicken myself.
0

##### Share on other sites
quote:
Original post by DakeDesu

I've read the first few ones--until the point where people kept asking the same questions over again, and yes, Lisp rocks for handling data structures (as was some of the arguments against XML). However, I still do not know where something like "cdaddaar" might possibly be of any use.

Generally, functions like cdddr aren't something you want to use often (in the middle of your code) - makes for difficult to read code. There are built in functions, and you can write your own to say take the second, third, fourth, etc. element of a list.
(defun fourth (list)  (car (cdr (cdr (cdr list)))))

Which could be simplified to

(defun fourth (list)  (cadddr list))

Which is a lot less to type (and will give you less problems with matching your parens up - that can happen alot.

Of course, you'd really want to make sure the list isn't null first, so it should really be:
(defun fourth (list)  (if (not (null list))    (if (not (null (cdr list)))      (if (not (null (cddr list)))        (if (not (null (cdddr list)))          (cadddr list))))))

Which is pretty godawful.

Or you could iterate with a do and a counter, or recursion and a counter.
(defun fourth (list &optional (count 0))  (if (= count 3)    (car list)    (if (not (null (cdr list)))      (fourth (cdr list) (1+ count))      null)))

Ok, I'm going to stop now.

[edit: code tags are my friend]

[edited by - Zul on October 31, 2003 12:49:37 PM]
0

##### Share on other sites
What's the point?

(By the way, this is the same as pumping a list or sequence of events into an "AI" program called Author - can't find a link right now - which turns it into narrative. Take a look at this page for a syllabus, tools and reference material for a course on narrative AI.)

So a list of properties/events (a history) exists, and some fancy text processor turns it into something a cheap author might right. And? So far in the discussion (I read about 80% of the posts), the most advanced idea is random (perhaps modulated by statistical distribution info) selection of properties from domain-appropriate lists. Wow. Real mindblowin'.

I have a mid-term.

[Edit: Typeface.]

[edited by - Oluseyi on October 31, 2003 12:55:44 PM]
0

##### Share on other sites
I think I may try it in Ruby when I finish this current project I have. Lisp just looks so, uhhg.
0

##### Share on other sites
quote:
Original post by Oluseyi
What's the point?

I might contend with what is the point of...
-making just another FPS/RTS/MMORPG/RPG as so many people are doing here
-becoming just another code monkey like so many will end up with their shiny CS degrees

What would you deem worthy of my time in lieu of toying with this a bit? If you don't see the point then why do you bother to post?

quote:

(By the way, this is the same as pumping a list or sequence of events into an "AI" program called Author - can't find a link right now - which turns it into narrative. Take a look at this page for a syllabus, tools and reference material for a course on narrative AI.)

So a list of properties/events (a history) exists, and some fancy text processor turns it into something a cheap author might right. And? So far in the discussion (I read about 80% of the posts), the most advanced idea is random (perhaps modulated by statistical distribution info) selection of properties from domain-appropriate lists. Wow. Real mindblowin'.

First, I don't think it's really supposed to be "mindblowin'" unless of course I or someone else has mistakenly said that somewhere. Second, I'm not looking for a proper narrative and I don't think that the two are the same. I can see this extending more easily into a game or what-have-you than what you've mentioned. Furthermore, I guess we should just drop this since similar programs/research exist. Perhaps you'd like to provide your own entirely genuine research/fun pursuits or perhaps even an alternative as opposed to pointing a finger and claiming something not worthwhile? (If I sound hostile disregard it, I'm genuinely interested in what you have to say, sir.)

quote:

I have a mid-term.

Um, ok.

[edited by - kordova on October 31, 2003 3:41:51 PM]
0

##### Share on other sites
quote:
Original post by kordova
I might contend with what is the point of...
-making just another FPS/RTS/MMORPG/RPG as so many people are doing here
-becoming just another code monkey like so many will end up with their shiny CS degrees
Well, the former is pointless except as a proof of concept or ability. As a product intended for mass consumption, most have zero potential. As a potential portfolio stuffer, most will never be completed. But you already know that.

The latter is a purely socioeconomic phenomenon. "Computers" was the hot industry of the last decade, so there''s been a massive influx of minimally-adjusted and poorly motivated saps to such courses of study in the pursuit of lucre. Unfortunately - or ironically, if you prefer - that same industry has made itself hyperportable, resulting in the offshore relocation of an increasing number of the jobs. As physical location becomes a non-factor, the pointlessness of the CS degree-toting code monkey will only increase. And I find that rather funny.

But we''re not here to discuss Despair.

quote:
What would you deem worthy of my time in lieu of toying with this a bit?
Only you can make that assertion.

quote:
If you don''t see the point then why do you bother to post?
Perhaps to prod more thought? Perhaps to shake the C-language mentality-having masses from their stupor? This program is fundamentally simple, given the right toolset. It is well-suited to languages that do not require forward declaration (most scripting languages), and particularly apt for languages with lists and associative arrays as native types (Perl, Python, LISP).

I''m being that snide voice that says "You can do better than that POS!"

quote:
Furthermore, I guess we should just drop this since similar programs/research exist.
No. I think you should look at the similar programs though, borrowing ideas liberally from them and evolving from there. It''s much faster that writing from scratch. At the very least, you might be able to see their shortcomings.
0

##### Share on other sites
Well thank you, I just edited my post before you posted, but it can be difficult to differentiate from crap and positive criticism. I can see that yours is quite the latter (and I thought it weird that you'd be in the other camp :-p)

I know that what I've written so far is really dreadful in its implementation of the ideas at hand, as well as how I'm still hung up on years of C++, but I have very little knowledge outside of those C/Java etc books so I'm all ears when it comes to other resources. I'm really content in getting something done and then realizing some of its shortcomings and going back to redo it. Thanks much and sorry about the misunderstanding.

Cheers.

[edited by - kordova on October 31, 2003 3:45:23 PM]
0

##### Share on other sites
No problem.

I''d suggest Python first because it''s really clean and easy to learn. It borrows ideas from C and Java (C-style structure; immutable strings like Java) - well, it''s 12 years old, so it doesn''t actually "borrow" from Java - and the whitespace thing becomes refreshing once you get used to it.

Dictionaries (associative arrays) are the fundamental Python type. Their pervasive use makes the language extremely reflective without the use of external classes or APIs. Type is dynamic as well, which can lead to interesting routines. Try it out. Once you''re up to speed, you''ll probably hammer this out in no time.
0

##### Share on other sites
While that sounds interesting, if I''ve already invested time in Lisp, is there a definite reason to pick up Python instead/as well? From this thread I''m under the notion that Python''s dictionaries are just like the Lisp cons etc. not to mention the other similarities mentioned. I definitely have it on my list of things to learn but I like getting input about the same.
0

##### Share on other sites
quote:
Original post by Oluseyi
What''s the point?
The point, is to regenerate, revitalize, and introduce the concept of symbolic programming and the use of exceptionally flexible data structures present in the Lisp paradigm, and through that process, build a foundation upon which a significant focus of programming can move forward away from the paradigm where graphic design is the norm for content, and instead make evident the idea that substantive and dynamic depth within a story can gain momentum, and one such way of doing that is slowly building towards that goal in small steps, such as the idea presented here.
0

##### Share on other sites
And furthermore, as an exercise in thought, the idea is limitless with regard to how far one might take it, and the methods one would use to explore the idea are undoubtedly and decidedly different from the conventional and more common methods one usually sees explored within the domain of programming found here.

If you explore the General Programming Forum, you''ll see discussions and debates about string manipulation, pointer management, OOP, and so on. Nowhere is it evident that such discussions or debates are terribly relevant here, and that notion by itself is interesting.
0

##### Share on other sites
quote:
Original post by flangazor
Unless you can interact with the character (directly or indirectly) in question there is, in my opinion:

a.) little point
b.) not much going on of interest

While the history might supplement a more in depth character system, when it is alone it is not all that intriguing.

Comically, writing it in Lisp wouldn''t be much effort except for the tables of information you wish to select from (names, ethnicities, diseases, occupations, etc).
Your take on the subject, as well as Oluseyi''s, is that the end result is a list of traits articulated into a set of sentences. That''s rather dull, isn''t it? It seems you have chosen to conclude the matter, rather than explore it.

I myself think the subject at hand here dovetails nicely with my other thread, and in fact, the efforts here could serve as inputs to narratives generated by an application such as that envisioned in the other thread.
0