-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
930 lines (718 loc) · 34.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
WA1Tools V1.1
=============
WA1Tools is a suite of command-line translation and hacking tools for the
PlayStation 1 version of the game "Wild Arms" by Media Vision. It can be
used for modding the game, searching for hidden content, and creating fan
translations. The main focus of the tools is on the dumping and editing of
in-game text.
The included tools are:
* trans / untrans
Dump ('untrans') or reinsert ('trans') all translatable text and graphics
in the game to or from a set of text and image files.
* mapinfo
Dump the script code of all maps.
The tools are entirely written in Python and have the following
dependencies:
* Python 3.11
* Pillow >= 10.3.0 (https://pypi.python.org/pypi/Pillow/)
The tools use the included 'wa' package which must reside in the same
directory as the tools themselves, or be included in the PYTHONPATH.
Restrictions and general information
------------------------------------
The tools are designed for the PlayStation 1 version of the game. They will
not work with the PlayStation 2 remake "Wild Arms Alter Code: F" nor with
any other of the games in the Wild Arms series.
Only the 'untrans' and 'mapinfo' tools can operate directly with a CD image
of the game. The 'trans' tool only works on extracted files from the
filesystem of the game CD. For extracting the filesystem tree of the game
I recommend using the 'psxrip' tool from the PSXImager toolset (see
https://github.com/cebix/psximager) which preserves the XA media files the
game uses.
The tools support the following releases of the game:
* Wild Arms, Japanese release (SCPS-10028)
* Wild Arms, US release (SCUS-94608)
* Wild Arms, English European release (SCES-00321)
* Wild Arms, French European release (SCES-01171)
* Wild Arms, German European release (SCES-01172)
* Wild Arms, Italian European release (SCES-01173)
* Wild Arms, Spanish European release (SCES-01174)
The 'trans' tool does not work with the Japanese version of the game because
Japanese text encoding is not implemented. Dumping Japanese text with the
'untrans' tool works fine, though.
trans / untrans
---------------
Usage: untrans [OPTION...] <game_dir_or_image> <trans_dir>
-a, --altchars Use alternate character set for text
-V, --version Display version information and exit
-?, --help Show this help message
Usage: trans [OPTION...] <trans_dir> <game_dir>
-a, --altchars Use alternate character set for text
-V, --version Display version information and exit
-?, --help Show this help message
With these two tools you can dump and reinsert all translatable text in the
game, including the game's fonts and textures with embedded text.
When doing a retranslation of the game it is recommended that you first use
the 'untrans' tool to dump all text, change what you want to change, and
then use the 'trans' tool to reinsert the text into the game files. The
section "Workflow for translation" below will give you some hints for doing
this efficiently.
The 'untrans' tool extracts text from either a plain ISO or raw
("MODE2/2352") CD image, or from a local directory (the "game directory")
containing the game files, to a newly created "translation directory" which
holds individual text and graphics files for each of the game's maps, menus,
etc.
The 'trans' tool performs the reverse operation of inserting the text and
graphics from the files of the specified translation directory into the game
files. It only writes to extracted game files, not to CD images.
The tools only read and change the following game files, and the 'trans'
tool creates backups (with the ending ".orig") of all files it changes:
SYSTEM.CNF
BIN/CDSTG.BIN
BIN/CDFLR.BIN
EXE/WILDARMS.EXE
EXE/OPENING.EXE
SYS/SY0.BIN
SYS/SY1.BIN
SYS/UT0.BIN
SYS/UT0.OVR
SYS/OP0.BIN
To put the files changed by 'trans' back into the actual game you either
have to replace these files directly in the CD image (for example with the
'psxinject' tool from PSXImager), or remaster the entire CD image (for
example with 'psxbuild' from PSXImager).
The translation directory consists of the following subdirectories and
files:
exe/
item.txt
item_help.txt
arm.txt
arm_help.txt
tool.txt
tool_help.txt
fast_draw.txt
fast_draw_help.txt
magic.txt
magic2.txt
magic_help.txt
force.txt
force_help.txt
Names of items, ARMs, tools, Fast Draw techniques/hints, spells and
force abilities, together with their respective help texts.
"magic.txt" contains the 64 standard spells which can be renamed by
the player. They are limited to 10 characters each. The names of other
spells, some of which can be cast with the 'Randomizer', are in
the file "magic2.txt".
technique.txt
Names of the special abilities unique to each character.
character.txt
Default names of the playable characters. They are limited to 8
characters each.
job.txt
Character descriptions in the status screen.
luck.txt
Luck levels as displayed in the status screen.
guardian.txt
Names of the Guardians.
map_name.txt
Names of maps, indexed by map number (0..127).
menu_help.txt
Help texts for the main menu commands (which only have icons, not
names).
auto_cmd.txt
auto_cmd_help.txt
Texts for the 'Auto Battle' menu
config.txt
config_help.txt
config_setting.txt
controller.txt
Texts for the 'Config' menu.
menu.txt
menu2.txt
Additional texts for the game's menus.
There are more menu texts which are embedded in textures
("gfx/menu_labels.png", see below).
load_save.txt
load_save2.txt
memory_card.txt
Texts for the load/save and memory card management screens. The
"load_save2.txt" file is only used with European releases of the game.
There are more texts which are embedded in textures
("gfx/load_save.png" and "gfx/memory_card.png", see below).
name_entry.txt
Mapping of cursor positions to characters in 'name entry' screens.
This file only determines which character to insert when the player
makes a selection. The actual layout of the entry screen is stored as
a texture ("gfx/name_entry.png", see below). If you want to customize
the name entry screen you need to change both files in a consistent
way.
icon.txt
Texts for the icon editor.
window.txt
Texts for the window frame editor.
command_help.txt
Help texts for battle commands.
enemy.txt
Names of enemies.
attack.txt
Names of enemy attacks and abilities.
battle.txt
miss.txt
ok.txt
Additional texts used in battles.
best_runners.txt
trial_result.txt
Texts for the Time Trial leaderboard in the Adlehyde fair.
script.txt
Text related to using the Gella Coin item. This file has the same
format as the map dialog text files (see below).
map/
One file for each map of the game (except for map 25 which doesn't
exist), containing all dialog text of that map. Each string is prefixed
with a header line starting with the character '▶' (Unicode U+25B6), for
example:
▶ 1 (dialog)
*You Can't Summon
The Earth Golem Here!
▶ 2 (string)
YES
▶ 3 (string)
NO
▶ 4 (dialog)
{CHAR 1}:
「Fine, I'll take care of my
own problems.
... etc. ...
The 'untrans' tool puts a running index number into the header line, and
an indication about the use of the string ('dialog' = the string appears
in a message window, 'string' = the string is a choice response or is
used as a text for some menu screen).
The 'trans' tool looks for the '▶' header lines to determine the start
of each string, so you should not remove or add these lines. The text
following the '▶' character on the same line is ignored, however, so you
can use these headers to record comments about your translation.
Note that due to possible differences in the map scripting, corresponding
strings in different regional versions of the game are not guaranteed
to have identical index numbers.
Maps which have no corresponding text file in the translation directory
are skipped by the 'trans' tool and left unchanged.
Four maps (5, 36, 51, and 57) have extra text files which contain
additional strings used in the map-specific code:
005_extra.txt
The names of the five runners initially on the Time Trial leaderboard.
They are limited to 7 characters each, except for the last name which
is limited to 11 characters.
036_extra.txt
The password ("Emiko") for the Memory Temple. It is limited to 7
characters.
051_extra.txt
The password ("Metal Bird") for the Epitaph of the Sea Wind. It is
limited to 11 characters.
057_extra.txt
The password ("Demon Gate") for the Demon's Lab. It is limited to 11
characters.
gfx/
This directory contains graphics that are relevant to translation:
1) the game's fonts, 2) textures with embedded text.
The graphics are stored as PNG images. You can edit them using a
graphics program (or a specialized sprite/tile editor if you have one)
and reinsert them into the game with the 'trans' tool. You must,
however, preserve the original size of each image.
The tools only handle 8-bit indexed (paletted) PNG images and you cannot
make any changes to the color palette. The 'untrans' tool gives each
image a default palette which is why some icons in the images show up
with the wrong colors (the game actually uses different palettes for
different parts of a texture). The 'trans' tool ignores the palette from
the image file completely, and only looks at the pixel values in the
image data (0..15, since the game uses 4-bit textures). It also never
changes the color palettes defined in the game files.
The directory contains the following files, which vary between game
versions:
dialog_font.png
The main font of the game which is used for dialogs and help texts in
menus.
For the US release of the game, the font contains 96 characters (ASCII
range 20..7f), each character occupying 8x16 pixels. The lower five
pixel rows are not drawn by the game so the maximum character height
is actually only 11 pixels.
In European releases, the font contains 224 characters (code range
20..ff) but the character dimensions are the same.
The Japanese release of the game uses an entirely different character
set with 12x11 pixels per character.
dialog_font2.png
dialog_font3.png
dialog_font4.png
These files are only used with the US release of the game and contain
alternate versions of the "dialog" font which are, to our knowledge,
unused by the game. If you want to give the game a different look you
can copy one of these files over "dialog_font.png".
kanji.png
This file is only used with the Japanese release of the game and
contains the kanji for the texts in the "exe" directory. The game
actually has additional kanji sets embedded within each map which are
not dumped by 'untrans'.
This font is provided for reference purposes only since the 'untrans'
tool can automatically decode kanji into their UTF-8 equivalents.
menu_font.png
This is the second font of the game which is mainly used in menus, for
example in the inventory list. The texture has 8x16 pixels per
character (8x12 pixels used) in all versions of the game. European
releases have a different character set, however.
The magenta background (pixel value 0) is transparent in the game.
menu_labels.png
This texture contains the labels for the game's menus ("HP", "LV",
"EXP", "Gella" etc.), texts for battles ("LEVEL UP!"), and some icons.
battle_icons.png
battle_icons2.png
These textures have the "CONDITION GREEN!" and "CHARGE UP!" icons
which come up in battles, as well as the labels for Cecilia's spells
that raise character stats.
load_save.png
memory_card.png
These two files contain buttons and texts for the load/save and memory
card screens, and for the icon and window frame editors.
name_entry.png
This image contains the layout of the 'name entry' screen. In
non-Japanese versions of the game only the lower third of the image is
used.
The image only determines what is visible on the screen. The actual
characters which are entered into a name when the user makes a
selection are stored as a text file ("exe/name_entry.txt", see above).
If you want to customize the name entry screen you need to change both
files in a consistent way.
op_title.png
op_push_start.png
op_demo.png
The elements of the game's title screen. The "demo" image is unused by
retail versions of the game.
Warning and error messages of 'trans'
Common warning and error messages of the 'trans' tool which you may
encounter include:
"File '<file>' expected to contain <x> lines but found <y>"
Many files in the translation directory (everything in the "exe"
directory, as well as the "extra" text files in the "map" directory)
must contain a certain, fixed number of lines, even if some of them are
empty. You probably accidentally deleted or inserted a line.
"String '<str>' from file '<file>' is too long when encoded (<x> > <y>
bytes)"
"Text in file '<file>' is too long when encoded (<x> > <y> bytes)"
Since the 'trans' tool replaces some of the game's texts in-place, they
are limited in the maximum number of characters they can contain. You
should shorten these texts.
"Not enough room for strings"
There is not enough room for inserting all of the text from the files in
the "exe" directory. You should shorten some of these texts.
"Unknown escape sequence '\<char>' in string '<str>'"
The '\' backslash is used to escape the characters '{', '}', and '\'
itself. Other escape sequences are not recognized.
"Mismatched {} in string '<str>'"
"Unknown command '<command>' in string '<str>'"
"Syntax error in command '<command>' in string '<str>'"
Either you misspelled one of the {<command>} control codes, or you
wanted to use a '{' or '}' character in the text but forgot to escape
it as '\{' or '\}', respectively.
"Argument of <command> command out of range in string '<str>'"
The numerical argument of a {<command> nn} control code is not within
the range of supported numbers. Depending on the command, this range is
0..9, 0..99, or 0..999.
"Unencodable character '<char>' in string '<str>'"
Your text uses a character which is not present in the character set of
the particular game version. See the section "Character set" further
below for a list of supported characters.
"Image '<file>' expected to be of size (<w>, <h>) but found (<w>, <h>)"
The size (width, height) of an image file in the "gfx" subdirectory of
the translation directory has been changed from the original image. The
'trans' tool can only insert images which have the exact same size.
Known problems in the official translations
The US release of the game contains invalid characters in the following
files which are a remnant of the Japanese character set:
map/003.txt, string 144
map/037.txt, strings 135 and 136
map/119.txt, strings 135 and 136
The German release also has one invalid character:
map/005.txt, string 138
The Spanish release has an invalid "{COLOR \0}" control code which should be
"{COLOR 1}":
map/040.txt, string 107
The Italian release has an invalid "{COLOR C}" control code, where the "C"
probably belongs to the next word, and the actual code should be "{COLOR 4}":
map/016.txt, string 41
You should correct these strings before running 'trans'.
Text which is not extracted
Some of the text in the game is not extractable or changable with the
'trans' and 'untrans' tools:
* Text embedded in map tilesets.
* The ending credits which are hardcoded into the ending movie.
Control codes
-------------
The strings in the translation files may contain some special characters,
and control codes denoted by {} braces. For this reason, if you want to have
literal '{' or '}' characters in your texts you need to escape them as '\{'
and '\}'.
Some control codes have a numerical parameter which is specified in decimal
notation.
Note: Names of items, spells, enemies, etc. do not support these codes, but
their help texts do.
<newline> character
Starts a new line of text. The game does not have automatic word
wrapping, so all line breaks must be inserted manually.
Map dialog text is usually displayed in message windows holding a
maximum of three rows with 32 characters each.
{STR n}
Insert the string specified by the game variable var[n] (n = 0..9).
{NUM n}
{UNUM n}
{HEX n}
Insert the value of the game variable var[n] (n = 0..9). {UNUM} displays
the value as an unsigned quantity, and {HEX} uses hexadecimal notation
(neither of these two codes is actually used in the game and they are
probably leftovers from development).
{CHAR n}
Insert the name of a character (which may have been changed by the
player):
0: Rudy
1: Jack
2: Cecilia
3: Hanpan
9: current party leader
{COLOR n}
Set the color of the following text:
0: black
1: white (default)
2: red
3: orange
4: cyan
5: green
6: gray
The following control codes are only supported in dialog messages (the text
files in the "map" directory):
{ITEM n}
{SPELL n}
{TOOL n}
Insert the name of the item, spell, or tool referenced by the game
variable var[n] (n = 0..9).
{ITEMICON n}
{SPELLICON n}
{TOOLICON n}
Show the icon of the item, spell, or tool referenced by the game
variable var[n] (n = 0..9) in the top left corner of the message window,
shifting the text to the right to accomodate. This is usually used for
'XYZ acquired!' messages.
{PAUSE}
Show the green continuation arrow at the bottom of the message window
and wait for the player to press the OK button before continuing.
{SCROLL}
Scroll the contents of the message window up one line. This is used in
the game to present the dialog in segments of three lines which are
visible at once, and is usually followed by a {PAUSE} code or the end of
the string.
{CLEAR}
Clear the contents of the message window and move the cursor to the top
left corner of the window. The 'untrans' tool automatically adds a
newline to the translation file after this code to make the formatting
of the following text easier to see. Similarly, the 'trans' tool ignores
a newline immediately following a {CLEAR} code.
{SOUND nnn}
Play a sound effect (nnn = 0..999).
{WAIT nn}
Wait nn frames before continuing (nn = 0..99). One frame equals 1/60 of
a second in NTSC releases of the game, and 1/50 of a second in PAL
releases.
{SPEED nn}
Set the text output speed (the number of frames the game waits between
printing each character). Higher numbers make the text appear slower.
{LARGE}
{SMALL}
These two codes are only supported in the Japanese release of the game
and switch the text size between a large font (16 pixels) and the small,
default font (12 pixels).
{XSHADOW}
{YSHADOW}
Toggle the text shadow in the X or Y direction, respectively. The
default is for the shadow to appear in both directions, i.e. one pixel
below and to the right of the text.
To completely toggle the shadow on or off you need to use both codes
together: {XSHADOW}{YSHADOW}
{ASK 0}
Let the player choose between two responses, for example to answer a
yes/no question. The two choices are specified by the game variables
var[10] and var[11], and are always strings contained in the same map
translation file. To see which choices correspond to which questions
you need to consult the script code dumped by the 'mapinfo' tool.
If used, this code must appear at the end of a message.
{CONTINUE}
Automatically continue script execution after the message has been
displayed completely. Normally, at the end of a message the game shows a
spinning green symbol in the bottom right corner of the message window
and waits for the player to press the OK button. The {CONTINUE} code
disables this behavior.
If used, this code must appear at the end of a message.
{ASYNC}
Continue script execution while the message is being displayed. This is
used for playing cutscene animations over accompanying text, for example
in the character intros.
If used, this code must appear at the end of a message.
In general, you should not add or remove {CONTINUE} and {ASYNC} codes in
the dialog texts because doing so may interfere with the timing of
cutscenes.
Character set
-------------
The text files in the translation directory produced or used by the
'untrans' and 'trans' tools use the UTF-8 character encoding. The game's
fonts include only a subset of all Unicode characters, of course.
All Western releases of the game support the following standard ASCII
characters:
0123456789
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
!"#%&'()*+,-./:<=>?[]_`{}
as well as these additional characters which take the place of some of the
ASCII code points:
in-game
Unicode character
character code (hex) notes
------------------------------------------------------------------------
「 40 opening dialog quote (replaces the ASCII '@' character)
『 7e left quote mark (replaces the ASCII '~' character)
』 5e right quote mark (replaces the ASCII '^' character)
★ 3b star (replaces the ASCII ';' character)
♂ 5c male sign (replaces the ASCII '\' character)
♀ 7c female sign (replaces the ASCII '|' character)
The angled quote marks are taken from Japanese typography. Note that there
is no 」 closing dialog quote in the font. The characters ★, ♂, and ♀ are
only used in name entry screens.
European releases of the game use an extended font which provides additional
characters:
in-game
Unicode character
character code (hex) notes
------------------------------------------------------------------------
Á b5 + A with acute
Ä 8e A with diaeresis (A umlaut)
Å 8f A with ring
Æ 92 AE ligature
Ç 80 C with cedilla
É 90 E with acute
Í d6 + I with acute
Ñ a5 N with tilde
Ö 99 O with diaeresis (O umlaut)
Ú e9 + U with acute
Ü 9a U with diaeresis (U umlaut)
ü 81 u with diaeresis (u umlaut)
à 85 a with grave
á a0 a with acute
â 83 a with circumflex
ä 84 a with diaeresis (a umlaut)
å 86 a with ring
æ 91 ae ligature
ç 87 c with cedilla
è 8a e with grave
é 82 e with acute
ê 88 e with circumflex
ë 89 e with diaeresis
ì 8d i with grave
í a1 i with acute
î 8c i with circumflex
ï 8b i with diaeresis
ñ a4 n with tilde
ò 95 o with grave
ó a2 o with acute
ô 93 o with circumflex
ö 94 o with diaeresis (o umlaut)
ß e1 German sharp s
ù 97 u with grave
ú a3 u with acute
û 96 u with circumflex
ÿ 98 y with diaeresis
¢ 9b * cent sign
£ 9c * pound sign
¥ 9d * yen sign
ƒ 9f * florin sign
ª a6 feminine ordinal indicator
º a7 masculine ordinal indicator
¿ a8 inverted question mark
¬ aa * not sign
½ ab * 1/2 fraction
¼ ac * 1/4 fraction
¡ ad inverted exclamation mark
« ae left guillemet
» af right guillemet
¶ e3 * pilcrow
µ e6 * micro sign
± f1 * plus-minus sign
÷ f6 * division sign
° f8 * degree sign
∙ f9 * bullet
The characters marked '*' are present in the game's font but not actually
used anywhere in the game's texts, while the characters marked '+' ARE used
in the Spanish release of the game despite not being present in the font,
showing up as white squares instead (nice QA job, Sony...).
The tables above specify all characters which the 'untrans' tool will
produce (for Western game releases, at least) and which the 'trans' tool
will recognize.
When invoked with the '-a' (--altchars) option, the 'trans' and 'untrans'
tools switch to an alternate Western character set which exchanges the quote
marks with their more common forms:
in-game
Unicode character
character code (hex) notes
------------------------------------------------------------------------
“ 40 left double quotes (replacing 「)
” 60 right double quotes (replacing `)
‘ 7e left single quote (replacing 『)
’ 5e right single quote (replacing 』)
and which, for European releases of the game, adds the following additional
code points which are missing in the game's font:
in-game
Unicode character
character code (hex) notes
------------------------------------------------------------------------
À b7 A with grave
 b6 A with circumflex
à c7 A with tilde
Ð d1 Eth
È d4 E with grave
Ê d2 E with circumflex
Ë d3 E with diaeresis
Ì de I with grave
Î d7 I with circumflex
Ï d8 I with diaeresis
Ò e3 O with grave (replacing ¶)
Ó e0 O with acute
Ô e2 O with circumflex
Õ e5 O with tilde
Œ ef OE ligature
Ø 9d O with stroke (replacing ¥)
Ù eb U with grave
Û ea U with circumflex
ã c6 a with tilde
ð d0 eth
õ e4 o with tilde
ø 9b o with stroke (replacing ¢)
œ ee oe ligature
ý ec y with acute
Ý ed Y with acute
þ e7 thorn
Þ e8 Thorn
~ aa tilde (replacing ¬)
… f2 ellipsis
Note that giving the '-a' option to 'trans' will not actually alter the
game's font in any way. It just changes the set of characters that the tool
will recognize in translation files. To make the characters show up
correctly you need to add them to the font textures yourself, by editing
the files "gfx/dialog_font.png" and "gfx/menu_font.png" (see above).
These additional characters are intended to support future fan translations
of the game to other European languages. Except for the four quote
characters they are not supported in the US release of the game which is
restricted to the 20..7f character range.
For advanced users: If you want to translate the game into a language that
is not covered by the game's character sets, such as Russian, you need to
supply your own font image files and change the variable 'altCharset' in
'wa/text.py' accordingly to define the correct mapping between characters in
the text files and code points within your font.
Workflow for translation
------------------------
This section describes a possible workflow for creating a fan translation or
a mod of Wild Arms using the WA1Tools and PSXImager.
Here, we assume that we are translating from Japanese and are using the US
release of the game as a basis for our new version. This doesn't necessarily
mean that the target language has to be English. For most languages it might
actually be better to base the translated version on a PAL release, because
of their support for non-ASCII characters.
1. Produce a raw ("MODE2/2352") image from the US game CD, for example
using 'cdrdao':
cdrdao read-cd --read-raw --datafile WildArms-US.bin WildArms-US.toc
toc2cue WildArms-US.toc WildArms-US.cue
2. Dump the game files with 'psxrip' from PSXImager, creating the game
directory "WildArms-US":
psxrip WildArms-US
3. Extract all game text to the translation directory "text-us":
untrans WildArms-US text-us
The created files will be the template for inserting the new, translated
texts.
4. Repeat steps 1 and 3 for the Japanese game CD, creating a second
translation directory "text-jp":
cdrdao read-cd --read-raw --datafile WildArms-JP.bin WildArms-JP.toc
toc2cue WildArms-JP.toc WildArms-JP.cue
untrans WildArms-JP.bin text-jp
The created files will be the source for the translation.
Note that in order to save disk space we did not extract the game files
with 'psxrip' but ran 'untrans' directly on the CD image.
5. Translate/modify the files in the "text-us" directory. The 'trans' tool
will work slightly faster if you make a copy of that directory and
delete all files from the "map" subdirectory which you are not going to
change, or which you haven't translated yet (since you are unlikely to
complete the entire game script in one go).
6. Reinsert the changed text and images into the US game files:
trans text-us WildArms-US
7. Rebuild the CD image:
psxbuild WildArms-US
8. Load the resulting image into an emulator and test your changes.
9. Repeat steps 5 through 8 if necessary.
Note 1: CD images produced in this way will not be bootable on original
PlayStation hardware because the PlayStation checks a signature on the CD
which is not reproducible using 'psxbuild' and off-the-shelf CD burners.
Note 2: You are not allowed to redistribute modified copies of the game
without having obtained permission from the copyright holders (Media Vision
in this case).
mapinfo
-------
Usage: mapinfo [OPTION...] <game_dir_or_image> <output_dir>
-V, --version Display version information and exit
-?, --help Show this help message
The 'mapinfo' tool dumps a rough disassembly of the script code embedded in
each of the game's maps. It creates the given output directory and writes
one text file per map.
Not all of the script commands are completely decoded but the dump should
give you a general idea of how a particular map's scripts are organized, the
context in which certain messages are used, and how to trigger them.
Examining the script requires you to have some familiarity with programming
and with the use of scripting languages in gaming. The following
explanations are not supposed to be a complete specification of the game's
scripting language (which we don't have, either) but only to give you some
general hints on how to interpret it:
- The language supports simple jumps ('jump'), subroutine calls ('call',
'ret'), conditional branches ('if'), and nested loops ('while', 'break').
- Script instructions are referenced (for example in jump targets) by 16-bit
hexadecimal addresses.
- 'window' opens a message window, 'message' displays the specified text in
the active window, and 'close' closes it.
- 'mapfunc' and 'exec' execute native MIPS code in the map file which
implements map-specific functions.
- Game variables ('var[x]') and event flags ('flag[x]') are stored as a part
of the game save state. Each game variable can hold a 32-bit signed
integer value or a script address.
- Variables 'var[0]' through 'var[9]' are mainly used in conjunction with
message control codes (e.g. '{ITEM n}').
- The two choices of an {ASK} question in a message are stored as pointers
to 'string' commands in variables 'var[10]' and 'var[11]', loaded with
commands of the form 'let var[10] = (addr xxxx)'. The player's choice can
be queried via the special 'result' variable.
- The 'result' variable is also set by certain 'menu' instructions, by code
called with 'exec', as well as by some other commands. For example,
'result' indicates whether adding an item to the inventory was successful.
- 'rand' returns a random value between 0 and 32767.
- The flags 'flag[-1]' and 'flag[-2]' as well as the variable 'var[12]' are
specific to the object or NPC the player currently interacts with. For
example, 'var[12]' could be the amount of gold obtained from a treasure
chest. This allows the game to reuse the same script code for different
treasures.
- 'party[0]' through 'party[2]' correspond to the three party slots, each
holding the index number of the character who occupies the respective slot
(0 = Rudy, 1 = Jack, 2 = Cecilia, -1 = nobody).
'let party[-1] = x' adds a character to the party.
'let party[-2] = x' removes a character.
- 'let inventory[-1] = x' adds one copy of item number x to the party's
inventory, while 'let inventory[-2] = x' removes an item. Inside
expressions, 'inventory[x]' checks whether the item x is in the inventory.
- 'arm[]', 'fast_draw[]', 'spell[]', and 'tool[]' work in the same fashion.
- 'status[]' yields the status effects inflicted on a character.
The WA1Tools suite does not currently include a tool which would let you
change the game script.
Acknowledgements
----------------
Creating WA1Tools would not have been possible without:
* The aid of Marco Kretschmer in deciphering the kanji character sets.
Author
------
Christian Bauer
www.cebix.net