Thread: Ambermoon
View Single Post
Old 07 April 2009, 14:04   #179
dlfrsilver
CaptainM68K-SPS France
dlfrsilver's Avatar
 
Join Date: Dec 2004
Location: Melun nearby Paris/France
Age: 40
Posts: 7,054
Send a message via MSN to dlfrsilver
Quote:
Originally Posted by st-th View Post
All text-related .AMB files have the following format:

Code:
ULONG subtype_id;  /* 'AMNP' */
UWORD num_of_chunks;
ULONG sizes[num_of_chunks];
UBYTE chunk1[sizes[0]];
UBYTE chunk2[sizes[1]];
 ...
UBYTE chunkN[sizes[num_of_chunks-1]];
The actual text data chunks are usually LOB-packed and have this format:

Code:
UWORD num_of_strings;
UWORD sizes[num_of_strings];
UBYTE string1[sizes[0]];
UBYTE string2[sizes[1]];
 ...
UBYTE stringN[sizes[num_of_strings-1]];
All strings must be 0-terminated and the 0 is part of the size.

There are no checksums whatsoever. Strings allow for several imbedded formatting codes, e.g. ^ for "new line" or $ for "hard space". There's an oddity that all strings (should) start and end with a space, probably required by the text justification ("outline text mode" in the options menu). You CAN crash the game by fucking up the formatting, but this can easily be avoided by being careful.

I'm currently converting all texts of the English version into normal text files for easy editing (have done 3 of the 6 files so far; the German version is already complete). The result contains all information you need to create the data files completely from scratch. The tool to do this will have all of the relevant formatting checking in it, so one will be able to edit the texts freely without risking to create bad data files. Here's an excerpt of the file I'm currently working on:

Code:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ $Id$
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ FName: NPC_Texts.amb
@ FType: AMNP
@ Parts: 70
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ Chunk: 001
@ Texts: 9
@-
YOU SEE AN OLD SICK MAN. HIS CHEEKS ARE SUNKEN AND AS PALE AS ASH. HIS EYES
ARE TIGHTLY SHUT, FLINCHING WITH THE LIGHT OF THE FIRE. HIS BREATH IS
LABOURED AND RATTLES IN HIS THROAT.
@-
"HELLO ~SELF~, PLEASE COME CLOSER TO THE BED, MY BELOVED GRANDCHILD! MY BODY
IS WEAK AND MY VOICE IS NOT AS STRONG AS BEFORE."
@-
"I WOULD LIKE TO TELL YOU A STORY AND ASSIGN YOU A QUEST."^ AS YOU STEP
CLOSER TO THE BED TO LISTEN CAREFULLY TO YOUR GRANDFATHER YOU SEE HOW HIS
FACE DISTORTS IN PAIN AND ABOVE HIS HEAD YOU FEEL YOU SEE THE SHADOW OF
BALA.^ "WHEN I WAS JUST YOUR AGE, I HAD A DIFFICULT LIFE. [...snip...]
BTW, the conversion is done manually in CygnusEd. Reason for this is that there are quite a few problems in these files that can't be easily sorted out by a tool, e.g. string size mis-matches when two strings run into each other without 0-terminator, or missing text blocks. These problems are not exclusive to the English version but are also present (albeit much less) in the German data files. Doing it this way also revealed all formatting codes and how they are used.

Once the conversion is finished and the tool is written, any of those texts can be edited at will. The texts could also be translated into other languages, if someone wants to take on this task (the German texts have a total size of ~260 KB, the English ones will end up being a bit shorter).

It would be nice if, eventually, someone would make the English texts "nicer". The German ones contain typos here and there, but all in all they are quite "literally". The English texts are often rough German-to-English translations which actually make me shudder reading them. Any (preferably native) English speakers interested in doing this eventually?
Hi, please check your PM
dlfrsilver is offline  
 
Page generated in 0.07670 seconds with 9 queries