Character generator

Off topic discussion zone.

Moderators: winston, another_commander, Cody

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Character generator

Post by spara »

Just started a new Jameson and this time I wanted to give my character a bit more depth. I quickly run out of ideas and started to look for some nice random character generators. I stumbled to http://www.random-generator.com and got more than I bargained for. Hudreds of generators from names to backgrounds and fantasy to scifi.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

Hehe - funny. Since a few days Disembodied and I are already working on such a mechanism which will become part of CCL.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Character generator

Post by spara »

Svengali wrote:
Hehe - funny. Since a few days Disembodied and I are already working on such a mechanism which will become part of CCL.
Sounds like something to look forward to.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

spara wrote:
Sounds like something to look forward to.
Heh - it will take some time to get it right, though.

The main mechanism is already done. The next steps are to finalize the rules and to complete the helper tool to make things easier. Then comes populating the objects, although some things are already there. The goal is to keep it fast (to be usable inflight) and easy to use, while its rules should allow a wide range of possibilities (up to generating Snoopers newsflashes or small tales/rumours).
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

spara wrote:
Just started a new Jameson and this time I wanted to give my character a bit more depth. I quickly run out of ideas and started to look for some nice random character generators. I stumbled to http://www.random-generator.com and got more than I bargained for. Hudreds of generators from names to backgrounds and fantasy to scifi.
We could implement a few of them. I've just tried the Brew Names generator in the helper tool - lots of funny brews :mrgreen:

Some examples:
The Scorchin' Hot Pegasus
Slashing Eagle Gristle
Biarge's Hard-Kickin' Tiger Hide
Dunking Desert's Tongue Teaser
The Scorchin' Hot Worg
The Crunching Blinding Goblin
Grabbing Ailment's Secret Sauce
User avatar
PhantorGorth
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Wed May 20, 2009 6:48 pm
Location: Somewhere off the top left of Galaxy 1 map

Re: Character generator

Post by PhantorGorth »

I am also looking forward to this.

How are you doing names (where required)? Random sylables like Oolite does at the moment for passenger contracts or built from a bunch of first names, surnames or a mix of both? I also assume as part of CCL you can chose or override the parts of the character details as needed.

Phantor
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.

Phantor's OXPs: [EliteWiki] GalCop Rewards and [EliteWiki] Safe Docking
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

PhantorGorth wrote:
How are you doing names (where required)? Random sylables like Oolite does at the moment for passenger contracts or built from a bunch of first names, surnames or a mix of both? I also assume as part of CCL you can chose or override the parts of the character details as needed.
I'd think all these random name generators are working somewhat similiar (mostly for performance reasons). Some arrays are holding words or parts of them and control patterns. We have combined the arrays in named sets (e.g. PirateInsult) and every set has its own control patterns. A OXP just calls a function which returns the generated output. If no pattern was specified it chooses a random pattern from the set. Every set holds 18 arrays of words or phrases.

The script simply replaces the numbers (1-9) in the pattern with content from the arrays. Switching between 1-9 and 10-18 is done via special char, so it would be possible to get even higher numbers of arrays, but 18 should be enough for most things. Some other special chars are giving patterns some more oompf, e.g. for displaying player.name or setting flags for the word processing. And when a word is picked from the arrays additional rules are applied before it replaces the number in the pattern. The rules are designed to work with english words (some exceptions are handled). The main goal is performance and it really looks promising. Creating a brew name takes 0.000474 s totalTime, with 0.00038 s javaScriptTime on my box.

Names are build from sylables. The script precreates 40 first names and 40 surnames and populates the corresponding array to be combined via pattern when a OXP requests it. It is possible to do this procedure on every docking to get fresh names. Adding a new set is on my list, but I doubt that it makes sense to give OXPs much more possibilities than defining the pattern (e.g. like defining the rules), because it should be usable inflight as well.

Sorry for the long-winded answer.
User avatar
PhantorGorth
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Wed May 20, 2009 6:48 pm
Location: Somewhere off the top left of Galaxy 1 map

Re: Character generator

Post by PhantorGorth »

Svengali wrote:
PhantorGorth wrote:
How are you doing names (where required)? Random sylables like Oolite does at the moment for passenger contracts or built from a bunch of first names, surnames or a mix of both? I also assume as part of CCL you can chose or override the parts of the character details as needed.
I'd think all these random name generators are working somewhat similiar (mostly for performance reasons). Some arrays are holding words or parts of them and control patterns. We have combined the arrays in named sets (e.g. PirateInsult) and every set has its own control patterns. A OXP just calls a function which returns the generated output. If no pattern was specified it chooses a random pattern from the set. Every set holds 18 arrays of words or phrases.

The script simply replaces the numbers (1-9) in the pattern with content from the arrays. Switching between 1-9 and 10-18 is done via special char, so it would be possible to get even higher numbers of arrays, but 18 should be enough for most things. Some other special chars are giving patterns some more oompf, e.g. for displaying player.name or setting flags for the word processing. And when a word is picked from the arrays additional rules are applied before it replaces the number in the pattern. The rules are designed to work with english words (some exceptions are handled). The main goal is performance and it really looks promising. Creating a brew name takes 0.000474 s totalTime, with 0.00038 s javaScriptTime on my box.

Names are build from sylables. The script precreates 40 first names and 40 surnames and populates the corresponding array to be combined via pattern when a OXP requests it. It is possible to do this procedure on every docking to get fresh names. Adding a new set is on my list, but I doubt that it makes sense to give OXPs much more possibilities than defining the pattern (e.g. like defining the rules), because it should be usable inflight as well.
That's sounding great. Can you tell us what other "characteristics" that this is going to provide?
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.

Phantor's OXPs: [EliteWiki] GalCop Rewards and [EliteWiki] Safe Docking
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

PhantorGorth wrote:
That's sounding great. Can you tell us what other "characteristics" that this is going to provide?
The current status:

Code: Select all

Patterns:
 Next word after . ! or ? is capitalized.
 + -> Forces capitalization.
 } -> Forces fields 1-9.
 { -> Forces fields 10-18.
 > -> Applies plural rules.
 < -> Applies singular rules.
 | -> Random plural.
 # -> Verb case 1. simple present
 _ -> Verb case 2. simple past
 ^ -> Verb case 3. past participle
 * -> Verb case 4. perfect
 @B -> player.bounty.
 @C -> player.name.
 @D -> player.ship.displayName.
 @F -> Random Firstname.
 @f -> Stored @F, else empty string.
 @I -> player.ship.name.
 @L -> player.legalStatus.
 @N -> Random Surname.
 @n -> Stored @N, else empty string.
 @P -> Current system.name.
 @R -> player.rank.
 @S -> Random system.name.
 @s -> Stored @S, else empty string.
 @T -> player.ship.target.displayName.
 a followed by vowel a,e,i,o,u -> an
 a followed by superlative -> the

Words:
 $ -> identifies verb (e.g. decide$).
 & -> identifies irregular noun or verb
      (e.g. &go$ or &bison).

Noun Plural Rules:
 & -> irregular, uses lookup table.
 otherwise:
   [^es]s -> unchanged
   fe -> replace with ves
   e -> word + s
   [^o]o,[^ei]x,es[s],[cs]h -> word + es
   [^aeiou]y -> replace with ies
   [^erf]f -> replace with ves
   [ei]x -> replace with ices
   else -> word + s;

Verb Rules:
 & -> irregular, uses lookup table.
   Can be combined with plural prefix.
     case 0 -> base form, e.g. go
     case 1 -> simple present, e.g. goes
     case 2 -> simple past, e.g. went
     case 3 -> past participle, e.g. gone
     case 4 -> singular: has gone
     case 4 -> plural: have gone
 otherwise:
   case 0 -> base form
   case 1 -> apply plural noun rules
   case 2 ->
     e -> word + d
     [^aeou]y -> replace with ied
     [aeioy]p -> word + ped
     [aeioy]b -> word + bed
     [^l]l -> word + led
     else -> word + ed
   case 3 ->
     e -> word + d
     [^aeou]y -> replace with ied
     [aeioy]p -> word + ped
     [aeioy]b -> word + bed
     [^l]l -> word + led
     else -> word + ed
   case 4 -> singular: has + case 3
   case 4 -> plural: have + case 3
Edit: Updated rules
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Character generator

Post by Svengali »

Some more rules have been applied now and I'd think it doesn't take long before we can upload a first test-version for interested OXPers.
Post Reply