## Markovchain???

Moderators: Forum Moderators, Developers

Forum rules
• Please use [code] BBCode tags in your posts for embedding WML snippets.
Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Markovchain???

What does it do? It seems to make names longer. If I see it, it is usally set to 2. Is the value 1 standard?

Edit:

Is there any link for this name generator?
I could not find it.
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

### Re: Markovchain???

http://www.wesnoth.org/wiki/UnitsWML
markov_chain_size: (default 2) number of letters per "syllable". "Syllables" are groupings of names that the Markov name generator uses to determine names. It does this by running a probability algorithm to guess from the name list which syllables fit well together, which can start or end a name, etc.

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

Yep, thanks for pointing me to that. I searched in Internet as well. So far I am not so happy with the outcome.

Could it be possible to give a range for total name length? If I put Markovchain=1 I end up with some 2 letter names.

If I put it =3 the names of my name list are not changed at all. The original names have all 5 to 8 letters. The generated names should have the roughly same. I end up with lots of names with really od spelling like quadruple t in the middle.

A friend of mine once wrote a name Generator containing syllables. So basically he defined the Syllables himself in Excel. Is it possible to do something like that?

However I like the name generator:

I wish for two (three) wml addition.

max_repeat_letter=

(should reduce extra letters like Pollllium to Pollium)

total_name_length_min=
total_name_length_max=

Should check if the name is within reason. (Say 3 to 10 letters) Otherwise reject and make new.

I guess that would be a developers job. Please consider it.
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Markovchain???

If it doesn't work for you, it probably means you seeded it incorrectly.

First of all, you have to put complete names into the male_names and female_names attributes. The more you put, the better the algorithm works. Second you should put the size of syllables in these names into the markov_chain_size attribute. More precisely, it should be big enough so that syllables are not truncated, but small enough so that you don't have to put thousands of names in the lists. The default value (2) is fine for languages with "simple" syllables. That's all.

Then the algorithm analyzes the name lists and deduces rules to produce new names. For instance, if you set markov_chain_size=1 and some of the input names have two "t" in a row, then the algorithm will consider that the letter "t" is just fine after the syllable "t" and you may get a name containing "tttt...". But if you set markov_chain_size=2 or bigger, and if none of your input names contain "ttt", then you should never have several "t" in a row.

You cannot chose the length of the generated names (but you shouldn't find much names above 10 characters and definitely none above 12). But note that the average length of generated names directly depends on the average length of initial names. Indeed, the shorter the names, the more chance the algorithm has to draw an end-of-word syllable.

Now if you still get four "t" in a row after understanding what I wrote, please show us your race definition, you may have uncovered some bugs in the engine.

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

So far I have 15 names in my list. Usally 5 or 6 letters. Shortest 4 letters longest 8 letters. Some double L and double T.

The important info for me is, that it gets better with more names in the list.

The last set of names with Markovchain=2 was ok. This time it does change some names.

Can you dwell a bit on Markovchain=3? It means each Syllable has to have 3 letters. letts take a typical name: Kevin.

Will it consider Kev a starting sylabus and vin an ending sylabus(a)? Or will it Consider Kevin a starting and Ending sylabus and thus not change the name at all(b)?

Would it refuse ( in case (a) or allow to create Kev-vin as a name?

Lets take the next name: Mike.

Will it be Mik and ike(a)? Or just Mike(b)?

In case a it could generate Mik-vin and Kev-ike and Kev-vin and Mik-ike.

Lets do Markovchain 2:

Mike: Mi ke
Kevin: Ke Kev vin in
and maybe inbetween ev vi (case c)

Generate Mi-vin Mi-in Ke-ke Kev-ke

and maybe lots of ev and vi in the middle? Like Kev-ev-ke Kev-vi-ke Ke-vi-ke Ke-ev-ke.

Will it repeat the middle sylabus?

I did like some of the names with Markovchain=1. However it would give you names like Ke or Kevvvvin. (If Kevin would have been Kevvin in the beginning)

It could create Meke Mekin Kive Kivin Kiven Meken and on top Mevike Keviven Kivekeve and over the top Kivivekevike

I hope you see why I like these names and would like to filter the triple letters and disregard the long and short once.
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Markovchain???

Just forget about "syllables", this is probably more confusing than needed. The algorithm is simple: it randomly chooses a letter depending on the markov_chain_size previous letters. In order to get a sample big enough, you need several hundreds of names for size 2, several thousands of names for size 3, and so on.

Consider size is 2 and your list contains only two names "mike" and "kevin" (no uppercase on purpose). The deduced rules are as follows. (^ means start of name, \$ means end of name.)

Code: Select all

``````^ -> m|k
^k -> e
^m -> i
ev -> i
ik -> e
in -> \$
ke -> \$|v
mi -> k
vi -> n
``````
Now starts from "^" and adds letters by following the arrows. If you have several choices on the right (separated by a pipe), choose one at random. So with just these two names, you can generate only the three following names: "kevin", "mike", "mikevin" (probabilities are 50%, 25%, 25% respectively).

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

Wow, can you do Markovchain 1 and 3 as well please?
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Markovchain???

For size 3, you can only get "mike" and "kevin", since none of the input names share a length-3 sub-word. For size 2, I was mistaken, you get "ke", "kevin", "mike", and "mikevin", each with probability 25%.

For size 1, you will get "ke" (25%), "kevin" (12.5%), "kevike" (6.25%), "kevikevin", "kevikevike", ..., "min" (25%), "mike" (12.5%), "mikevin" (6.25%), "mikevike", "mikevikevin", ... if I'm not mistaken.

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

Thanks a lot. This really helps to understand whats going on. I will play the name list accordingly and stay away from Markovchain 1. ( Markovchain 3 only if the minimum name has 6 letters).
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

I am still not happy with the outcome.

Only Markovchain 1 gives resonable variety of names with a short list.

The names should be filtered and fixed.

Therefore the 3 wml commands would be great. Can I repost or link in Coders Corner?
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Markovchain???

Tet wrote:Only Markovchain 1 gives resonable variety of names with a short list.
I guess I will have to stress it again:
1. You should never use markov_chain_size=1, since it produces poor names.
2. You are supposed to use a long list of names, so that the algorithm can deduce interesting rules.
For instance, Wesnoth initializes the elvish generators with about 500 names each.

VS
Translator
Posts: 187
Joined: November 27th, 2005, 10:07 am

### Re: Markovchain???

Come on... it uses statistics. That's why
wikipedia wrote: a larger sample size leads to increased precision
matters to you. You can't really think it will work well with just a few names!

http://en.wikipedia.org/wiki/Sample_size

Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

### Re: Markovchain???

The chain with size 1 generates random results if the same letter appears in different names. For example from "Li'sar" and "Konrad" it could make a hybrid "Lis'ad" or "Konrar". The common letters are parts where the words can be separated ("Lisa..." and "...ar", "Konra..." and "...ad"), and then joined differently. In this example also the letter "r" could be used as the splitting/joining place. When generating a word, multiple splits/joins can happen.

The chain with size 2 splits/joins the words on pairs of letters; a single letter is not good enough. For example "Konrad" and "Delfador" share a sequence "ad", so they could be changed to "Konrador" or "Delfad". If you provide a list of words without such sequences, the generator is only able to return original names. But if you provide enough names, there can be enough such pairs to promote creativity.

The chain with size 3 would need a sequence of 3 letters appearing in two different words. With sufficiently large list of names, it is possible. But the list must be really large.

Please note that this description is just a simplified (and not very exact) version of what silene wrote, though it may give a different impression to reader. I hope this way it gives better insight on how the chain size is related to provided list of names.

Tet
Posts: 391
Joined: February 18th, 2009, 5:11 am

### Re: Markovchain???

Hello dear all,

Thank you so much for picking up my topic. I totally agree and understand the above.

BUT (sorry for capitallizing)

If you wanted to make a custom race with some nice specific names (like the Phoenix or Silverwolves in COTS).
How would you come up with a list of 500 names?

I tell you what I did. I used Markovchain 1 and wrote down all the names I liked. Every time I played a test scenario I got 10 names. In average: 3 great 4 standard 3 obvious crap. I added the 3 great names to the list. Do it 100 times and the list should be full. Than you can set Markovchain to 2.

So please be realistic. If it would be possible to filter the outcome of the name generator for obvious crap names, a list of 15 names would be sufficient. Please consider it.

I would additionally like Markovchain 1,5. That means one Syllabus by the rule of 1 and one Sylabus by the rule of 2 alternating. This should introtruce varity without going totally over board.
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895

Turuk
Sithslayer
Posts: 5283
Joined: February 28th, 2007, 8:58 pm
Contact:

### Re: Markovchain???

Tet wrote:If you wanted to make a custom race with some nice specific names (like the Phoenix or Silverwolves in COTS).
How would you come up with a list of 500 names?

I tell you what I did. I used Markovchain 1 and wrote down all the names I liked. Every time I played a test scenario I got 10 names. In average: 3 great 4 standard 3 obvious crap. I added the 3 great names to the list. Do it 100 times and the list should be full. Than you can set Markovchain to 2.

So please be realistic. If it would be possible to filter the outcome of the name generator for obvious crap names, a list of 15 names would be sufficient. Please consider it.

Here's the problem I see with this. What defines a great name, a standard name, or a crap name? You are asking a filter to be created to this effect, but the "coolness" of names is entirely subjective to each player.
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time