Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5 ... 11

Author Topic: DFLang: generate realistic language raws, every time.  (Read 72229 times)

slink

  • Bay Watcher
  • Crazy Cat Dwarf
    • View Profile
    • Slink's Burrow Online
Re: DFLang: generate realistic language raws, every time.
« Reply #30 on: January 05, 2010, 05:06:08 pm »

The diagnostic version works for me.  I copied the default.txt over from the diagnostic version to the original version, and that still does not work.
Logged
There is only one cat, and all cats are that cat.
Almost losing is sometimes fun.

Igfig

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #31 on: January 05, 2010, 05:56:21 pm »

Huh.  Weird.  Maybe I fixed a bug by accident while I was adding the diagnostic bits.

I'll upload the diagnostic version, minus the log-printing stuff, as version 1.2.  Hopefully that should still work for everyone.

Rafal99

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #32 on: January 05, 2010, 06:38:42 pm »

I think I have tracked the problem.
Here are the tests I made:

1. Unpacked it into "D:\" (folder was "D:\DFLang diagnostic"), used standard defaults.txt with relative paths
It worked

2. Changed dafaults.txt to use absolute paths
It worked

3. Changed "DFLang diagnostic" folder to "DFLangdiagnostic", and updated defaults.txt
It didn't work!

4. Changed folder name to "DFLang", updated defaults.txt
It didn't work!

5. Changed folder name to "DF Lang", updated defaults.txt
It worked!

6. Changed folder name to "DFLang", and reverted defaults.txt to use relative paths
It didn't work!

Here are contents of log.txt:
Spoiler (click to show/hide)

Conclusion: It seems that it doesn't work if folder path doesn't contain a space!
Absolute / relative paths in default.txt doesn't matter.
May need more tests with more complicated paths.

The bug has been struck down!

Hope it helped. :)
« Last Edit: January 05, 2010, 06:51:52 pm by Rafal99 »
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #33 on: January 05, 2010, 07:35:43 pm »

Confirmation: By inserting a space into the name of one of my folders (changing "DF" to "D F"), the problem appears to have been solved on my end.

Strange bug, that. I've heard of internal problems being caused by a filename having a space in it, but never by one NOT having a space in it.


Awesome program, it's nice having a generator around that doesn't require typing a lot of stuff in a command line. I've been planning to make one as powerful as Mephansteras's old program but with a better interface, but I keep encountering problems along the way ("learning Python" and "general laziness" being the biggest two). This here thing'll work nicely for my upcoming mod, though.
« Last Edit: January 05, 2010, 07:40:01 pm by Untelligent »
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Arrkhal

  • Bay Watcher
  • Who modded in these flying killer attack babies???
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #34 on: January 05, 2010, 07:47:12 pm »

Very odd behavior.

Are you willing to share source code for lc2.pyc, Igfig?  It seems to be a custom library, that does the majority of the grunt-work.  A friend's trying to figure out what makes this thing hang if there isn't enough word variety, and the reason seems to be hidden in lc2.
Logged
In development: Arrkhal's Material and Weapon balance
Please test and let me know what still needs fixing.  And get these freakin' babies offa me!

Igfig

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #35 on: January 05, 2010, 10:33:49 pm »

Oh yeah, the source code is already there.  Just open lc2.py with Notepad or something, you'll see it.

lc2.py is actually a modification of a script I found on the net, and I know it's not terribly efficient; I've been planning to replace it with something better when I have some spare time.

The thing that makes it hang has to do with how lc2 makes sure every word is unique.  Each time it constructs a word, it adds the word to a set structure.  (You can't have duplicate elements in a set.)  When the size of the set passes a certain threshold (the number of words we want to generate), it returns the set, and DFLang does the actual translation and creation of raw files.

The problem arises when the source language doesn't have enough variety to generate the number of words we're asking it for.  It keeps generating words and adding them to the set, but since those words are already in the set, it doesn't get any bigger.

I didn't think it would be much of a problem, so I didn't bother fixing it and just left a warning in the readme.  Now that it is a problem, I've fixed it.  Version 1.3 has been uploaded.

Arrkhal

  • Bay Watcher
  • Who modded in these flying killer attack babies???
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #36 on: January 05, 2010, 10:44:10 pm »

Hooway!  Thanks.  And actually, the v1.2 I got only had lc2.pyc in the library.zip, no .py source code in the root directory.  And I couldn't really get the decompiler I found to work.
Logged
In development: Arrkhal's Material and Weapon balance
Please test and let me know what still needs fixing.  And get these freakin' babies offa me!

Draco18s

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #37 on: January 06, 2010, 12:13:39 am »

Ok, I decided to have some fun.  I went and looked up all the Pernese dragon names I could find (found a list with almost 230 names--most of which I don't think were in the books...) and generated a language based off that (the names were in alphabetical order).

I haven't read most of the file, but here's the first 2 pages or so.
Spoiler (click to show/hide)

Some interesting ones:

AUNT:Morlith
AURA:Marlith

Aunts and Auras must be closely related.

AWE-INSPIRING:Kelarth

Kelarth must have been an impressive beast.
Logged

Igfig

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #38 on: January 06, 2010, 01:06:13 am »

I've been playing a bit with Nahuatl, the language of the Aztecs.  Some fun results:

[UGLY:oyan]
[liGHT:ti]
[FIRE:yo]
[FESTIVAL:mo]
[NAME_ENTITY_KINGDOM:tl]
[DANCE:cuan]
[NAME_WAR:itl]

[T_WORD:PASSION:oyan]
[T_WORD:GIRDLE:oyanyolli]
[T_WORD:PRIEST:oyanti]
[T_WORD:GIRL:amo]
[T_WORD:BOY:oyantlamo]
[T_WORD:SERVANT:cuan]
[T_WORD:BUSY:azcuanitl]
[T_WORD:SQUIRM:azcuani]

While I was doing that, I found a bug with how roots files are read.  Fixed that.  Version 1.4 has been uploaded.

Fieari

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #39 on: January 06, 2010, 04:44:48 pm »

How does the roots thing work when a word belongs to multiple symbols?  I'd think it should use roots from each, but it doesn't seem to.  For instance, the word for FIRE never contains the root from the SYMBOL:FIRE, even though, well, it should.  I'm guessing it's using the root from another symbol the the word FIRE belongs to.
Logged

Igfig

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #40 on: January 06, 2010, 05:30:39 pm »

What DFLang does is pick a random one of the symbols associated with the word, and look for generated strings that include that symbol's root.  If it doesn't find any, it picks another associated symbol, and so on.  If there are no strings left with any of the associated roots, it chooses a word at random.

So yeah, it only uses one symbol for each word in the end.  I've got some ideas on how I might improve on that, but I'm holding off on it because it'll make generation really slow until I can think up some clever tricks to get around that.

I'm not entirely sure why FIRE never gets the right root, but it might have something to do with how FIRE only belongs to two symbol groups, FIRE and VOLCANO, both of which are on the small side.  But that's just a guess.

Wirevix

  • Bay Watcher
  • Hammered Elf Sympathizer
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #41 on: January 06, 2010, 07:27:12 pm »

I would suggest adding in the readme file, what "properly formatted" means.  Mine kept messing up, and I was assuming "proper format" meant line spacing - having the words in a block versus having one per line, for example.  It wasn't until I'd changed the line spacing as many times as I could think of that I realized "properly formatted" meant you couldn't use Unicode files to make a language.
Logged
In other news, the trees in my game can have invisible sex.

Fieari

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #42 on: January 06, 2010, 10:19:20 pm »

Definitely weird.  The word it generates for fire contains neither the root of fire, nor the volcano root.  Here's the files I'm using:

Language file (draconic, containing all the published draconic words in D&D plus a few others for variety I found on the net)
Spoiler (click to show/hide)

Roots file:
Spoiler (click to show/hide)

And after a dozen or so tries, the word for fire has neither contained ix nor char.  And it's not like words aren't getting generated with those letters... just never the word for fire.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #43 on: January 06, 2010, 11:39:29 pm »

I couldn't make it to work too.

I've changed DFLang to DF Lang and now it works.
Maybe it's supposed to accept the root folder as a two-word parameter, or something like that?
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Fieari

  • Bay Watcher
    • View Profile
Re: DFLang: generate realistic language raws, every time.
« Reply #44 on: January 07, 2010, 12:30:17 am »

Update... I think the roots are working, but they aren't applying to the right words.  Again, using the exact files listed in the post two above, no "fire" words have the IX letter combination in them.

But almost all of the "Death" words have IX (buzzard, coffin, bone, etc).

So, that tells me the roots are being used... they're just being used in the wrong symbols.
Logged
Pages: 1 2 [3] 4 5 ... 11