Aller au contenu

Photo

.LTR File Format


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
B_Harrison

B_Harrison
  • Members
  • 180 messages
BioWare's race/gender-specific generated names are stored in binary .ltr files. Does anyone know of any application or method for accessing (and editing, and re-saving/compiling) those files?

And if not, how difficult would it be to write a new Windows application to do so? My only programming experience is with nwscript (and some very simple Visual Basic stuff from years ago), but I'm willing to learn if someone can point me in the right direction.

Thanks!

Modifié par B_Harrison, 24 août 2010 - 03:55 .


#2
Jez_fr

Jez_fr
  • Members
  • 302 messages
Can't find that .ltr file. Would you mind telling where you found this?



And what's your goal in fact? random names for NPC's?

#3
B_Harrison

B_Harrison
  • Members
  • 180 messages
Data - Templates - Miscellaneous Resources

They contain the strings for random name generation in the character creation GUI and toolset, for the different races and genders. I wanted to write my own name lists to replace the defaults, but while I could probably figure out the file formats and immerse myself in a programming environment enough to do it, without any information to go off it's not worth the time it'd take.

Lacking a solution, I've just used renamed and empty .ltr files to replace first names with BioWare's familiar/animal companion ones, and remove last names entirely for my module.

Modifié par B_Harrison, 03 septembre 2010 - 01:02 .


#4
Jez_fr

Jez_fr
  • Members
  • 302 messages
but do you need it for PCs at character creation, or for NPCs?

#5
B_Harrison

B_Harrison
  • Members
  • 180 messages
Both. The same files are used for character generation names, and random names that can be assigned in the creature properties dialog in the toolset.

I don't need them for giving NPCs names in-game, if that's what you're thinking of.

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I looked at the file when you first posted. The file format is beyond me at the moment. There was very little ascII in the file. I scractched my head over it for a few day trying to find an answer.

#7
B_Harrison

B_Harrison
  • Members
  • 180 messages
Thanks for trying, Lightfoot. I'm not at all surprised or disappointed by the relative lack of input here though; I did research the topic on the legacy forums (and the 'net in general), and found only the occasional mention of the files, with no one, as far as I could tell, having actually worked on editing them. A number of text/code editors were suggested to edit or view .ltr, but never in the context of BioWare games, and the raw text binary stuff is meaningless to me.

It seems to me that the .ltr format used in NWN (and other BioWare games, I think) is somehow internally different to the standard, in the same way that .dds is.

Modifié par B_Harrison, 03 septembre 2010 - 05:48 .


#8
ElgarL

ElgarL
  • Members
  • 89 messages
Which file are you looking at specifically? I've worked a lot with Bioware file formats recently when I wrote a BIF/KEY reader/writer.

#9
B_Harrison

B_Harrison
  • Members
  • 180 messages
Found in NWN Explorer under,
NWN Main Data - data/templates - Miscellaneous Resources

animal.ltr
dwarff.ltr
dwarfl.ltr
dwarfm.ltr
elff.ltr
elfl.ltr
elfm.ltr
familiar.ltr
gnomef.ltr
gnomel.ltr
gnomem.ltr
halfelfl.ltr
halflingf.ltr
halflingl.ltr
halflingm.ltr
halforcf.ltr
halforcl.ltr
halforcm.ltr
humanf.ltr
humanl.ltr
humanm.ltr
names.ltr

f suffix - female first name
l suffix - last name
m suffix - male first name

Modifié par B_Harrison, 06 septembre 2010 - 10:33 .


#10
Jez_fr

Jez_fr
  • Members
  • 302 messages
Not sure that'll help, but it seems that Michale DarkAngel did some work on .ltr for his explorer tool (but I can't find a dl link out of his website, that's just me, its somewhere). You may want to ask him, and browse his tools http://www.tbotr.net

#11
B_Harrison

B_Harrison
  • Members
  • 180 messages
Thanks Jez. I've PMed MDA about it.

#12
Michael DarkAngel

Michael DarkAngel
  • Members
  • 367 messages
Without some insight from a Bioware insider, I'm afraid that I'm unable to help any more than anyone else has.

#13
ElgarL

ElgarL
  • Members
  • 89 messages
They all seem to be empty gff format template files. They contain no actual data, just the data structures used by the engine to hold data.

#14
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

ElgarL wrote...

They all seem to be empty gff format template files. They contain no actual data, just the data structures used by the engine to hold data.



The Header is not correct for it to be a GFF.  I have questioned if the files are even used. though, i'm still researching it on and off. 

#15
Michael DarkAngel

Michael DarkAngel
  • Members
  • 367 messages
Best explanation of the file I have been able to come up with is "Letter combo probability info for name generation"

And they do look like fairly empty files, except for some small areas of the file which probably holds the "probability info" which is most likely used by some hard-coded part of the game engine.

Just guessing :P

Posted Image

MDA

#16
B_Harrison

B_Harrison
  • Members
  • 180 messages
Thanks guys.

I can at least confirm that the files are used by the game, because swapping around the files (by renaming them) changes the names generated for a race, and using an empty text file with the .ltr extension prevents names being generated for that race/gender/field.

#17
rafhot

rafhot
  • Members
  • 34 messages
hi Ben, im in need to remove the default names for my project too, i will help to discover how things work too

#18
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
   HEADER
    VALUE           SIZE/TYPE        DISCRIPTION 
   File Type            4 bytes            'LTR '      
   Version              4 bytes             currently 'V1.0'       
  NumOfLetters    1 byte               either 26(alpha only) or 28(alpha +( ' and -))
  

The entire rest of the file is made up of letter probability arrays. Each letter probability array is made up of a number of floats equal to the number of available letters given  in the header. Each float is 32 bits(4 bytes) long. in this post I am going to treat this Letter Porbability Array as a data type that I will call LPA. Each LPA will have a length of 4 bytes times the number of possiable letters. Most of the LTR files in the nwn BIF's use 28 this will make each LPA 112 bytes long.  Since the length can vary I am going to use LPA.Length in the equations for where each array is located. 

The floats in the LPA are all in the range of 0.0 to 1.0.  They are in incremental values for the chance of the letter repersented by the position in the array to occur. unfortunatly what the positions in the array represent is hard coded. The first 26 posistions of the array LPA [0] through LPA [25] repersent the Alpha letters (a - z), LPA[26] is the accent mark (') and LPA[27] is the hyphen (-).  basicly what the engine does with the LPA is roll a random number between 0 and 1, then cycles through the LPA untill it finds a Float that is bigger then the random number, Returning the postion in the array that has the first value larger then the random number generated.  Later it changes the position number int the ASCII code for what the position represents.

The LTR file is made up of 3 arrays of LPA's. Each array has one more dimension then the one before it. 

The first array is a single dinension  array starting at  LTR + 9  (Address posistion 9 in the zerro based addressed  LTR file ). If our array is defined as   

LPA [] FirstArray =  new LPA[3];  

then   FirstArray[i] would be the inilized to the LPA at  (LTR+9) + (LPA.Length * i) 



**Getting late  will continue later.   

 

Modifié par Lightfoot8, 28 octobre 2010 - 05:21 .