blog:x86_raygun_english

Ray-Gun for the Sharp X68000 - English Translation

Main repository for code and data for this project is at: https://github.com/megatron-uk/raygun-x68k

Georgie(1) is a young man who lives with his fiancee Miria(2) in the quiet town of Lakeside, repairing large combat robots which are strangely called “steroids”(3). One day he discovers several such steroids in the forest, and as he decides to inspect them, unknown flying steroids kidnap Miria. Now Georgie has to pilot a steroid himself and to rescue his beloved one. Ray Gun is a traditional Japanese RPG, with top-down navigation, random turn-based battles viewed from first-person perspective, etc. The combat is usually between the player's steroids and enemy ones. Steroids can attack normally or execute special techniques. Many cut scenes feature nudity.“

Description from Mobygames.com

  • (1) Georgie? I'd suggest just George.
  • (2) Miria? Milia?
  • (3) Steroid? Really??? I think we may need to change that…

Ray Gun is a fairly early/simplistic RPG (or roll playing game, as the Engrish on the title exclaims!) game for the NEC PC-88, MSX and Sharp X68000 containing a top-down overworld map, random turn-based battles and 80's style anime cut-scenes:

Screenshots from the PC-98 version of the game, courtesy of Mobygames, but they're essentially identical to the X68000 version, although the X68000 has slightly less dithering.

This is my attempt to translate the content of the game to English. Why? Well it's a pretty simple game, the text is (mainly) stored uncompressed and in standard S-JIS form and I thought it would be fun to try something that doesn't appear to be very well known!

Ray-Gun, as with many late-80's through early 90's RPG games on the aforementioned computers contains an element of nudity. Now, the content is fairly tame by most standards but this game is *not for children*, nor should it be considered safe for work.

There are some minor spoilers in this document - mainly (pixelated) images of some of the people you meet and/or locations. However I have tried to keep the amount of images shown to a minimum (there's generally one per text/dialogue/asset file to indicate which area of the game the data relates to) and they are pixellated to hide any not-safe-for-work content.

The game starts from Disk A / Disk 1, which you should have in the first drive, you also need Disk B / Disk 2 in the second drive.

There is a hidden menu with some secret content; if you swap Disk 1 and Disk 2 (i.e. you have Disk 2 in the first drive and Disk 1 in the second drive on boot) you instead get a bonus content of a secret menu.

The bonus menu offers the following content:

  • A slideshow of the various not-safe-for-work animations without having to unlock them
  • A music test mode

Also:

  • Don't press space when the game starts, expecting to get to the title screen quicker; it won't and actually skips the entire intro and drops you onto the game world map without showing you anything!
  • Some text dialogue autoplays; you don't need to do anything to progress
  • A mouse click will progress from one message to the next where input is expected

Unless otherwise noted, all text is in Shift-JIS format and represented by two bytes within the game files.

The text output routine includes a complete upper and lower-case western alphabet and a mostly complete set of punctuation characters, however, all of the fonts are double-width, so the formatting is neither as pretty as it could be, nor as compact (less text per line). On the plus side, the font is actually quite nice.

Some other points:

  • Most screens restrict you to a maximum of 30 characters in width.
  • Auto-playing screens during the introduction can show 4 lines of text (4x 30 = 120 chars) and can be scrolled upwards.
  • Normal dialogue scenes are limited to 3 lines of text (3x 30 = 90 chars max.) and the scroll function doesn't work correctly (it overwrites the on-screen image, if you try to embed a linebreak+linescroll control code).

I am not a Japanese speaker, neither can I read Hiragana, Katakana nor Kanji. All of the translations I will make in this exercise will be primarily sourced from machine translation, dictionary lookup or the walkthrough guide for non-Japanese speakers, so bear that in mind.

It won't be a simple one-to-one replacement though; the text will be extracted, studied and re-inserted so that it makes sense - no “set us up the bomb!”, as long as I can help it!


  1. Identify all of the data files which contain translatable text - listed below in this document.
  2. Extract the Japanese strings from the above files and do an initial machine translation - this is then recorded in the CSV files.
  3. Rewrite the machine translation to make sense, standardise and fix naming conventions and other story elements, wrap the English text, etc.
  4. Reinsert fixed text back in to data files - this is done using the inject.py tool.

For each data file found, there is an individual status summary listed against it in the Disk Content Overview section below.

At present, we are working on (1) and (2), though where it is obvious, I am making small edits to (3) as I go (fixing glaring translation typos, for example).

Of course, amongst all that there are decisions to be made about typos in the script, layout considerations (English is not as compact a language as the various Japanese characters) and formatting/control codes to decipher.

Most of the experimentation was done on the introductory section of the game, as it is the easiest to see and includes both auto-playing and interactive dialogue scenes.


The raw translation of some names ends up with some funny sounding words, here's a table of what I've found so far:

Japanese Text Literal Translation Suggested Replacement Notes
ジョージ George / Georgie George You, the main character
ミリア Milia Miria The main characters girlfriend. Milia would work, but Miria is a real name derived from Miriam
ルピア Rupia / Rupiah Rupia / Lupia A character who joins you on your quest. Depending on your pronunciation, either the R or L version of the name works just as well
くステロイ Steroid Bioroid/Cybernetic/Mechazoid Argh! I hate this word! This is the name given to the race of bio-mechanical monsters who roam the world. Steroid just sounds silly… we've got to replace it with something better.

Disk Content Overview

Contents (in root folder, unless otherwise noted):

  • DISKNO - Contains the bytes 0x00 0x1A
  • COMMAND.X, HUMAN.SYS, AUTOEXEC.BAT - basic Human68k OS (this is a bootable floppy)
  • AI.X, CSS2.X, JISIN.X - The game executables.
  • .MES Files - The main source of dialogue and text.
  • .ATR Files - Unknown
  • .DAT Files - Unknown
  • GAMEN.PR7 - Image data
  • ANI/.ANI Files - Some sort of data format that animates between .PR7 image files.
  • PIC/.PR7 Files - Image data

Files related to data shown during battle screens.

Disk 1 - BATTLE.MES

Disk 1 - BATTLE2.MES

Disk 1 - BATTLE3.MES

Data files related to text, messages and conversations on level 1 of the world map.

Disk 1 - FL1_*.MES

This data file contains the text conversations with the NPC “Moon”, who you meet on the first level.

Only one image/animation loading sequence is mentioned in the entire file. This, presumably, is the animation of “Moon” speaking to the player.

Every string in this file is seperated by a single delimiter type: `0xA6 0xAA`.

https://github.com/megatron-uk/blob/master/csv/disk1/FL1_1.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

Disk 1 - FL1_2.MES

This file contains the text dialogue with the NPC “Leila”, who, again, you meet on the first level.

Only one image loading sequence is mentioned in the entire file. This, presumably, is the image of “Leila” speaking to the player.

Every string in this file is seperated by a single delimiter type: `0xA6 0xAA`.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/FL1_2.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

Disk 1 - FL1_3.MES

Disk 1 - FL1_4.MES

Disk 1 - FL1_5.MES

This data file contains the text which is shown whilst talking to the NPC “Sherri”, the first person you encounter on starting the game (see below for the state in which you encounter her).

This encounter is immediately after leaving the introduction animation and before you even get control over your in-game character.

Every string in this file is seperated by a single delimiter type: `0xA6 0xAA`.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/FL1_5.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

Disk 1 - FL1_6.MES

Disk 1 - FL1_7.MES

Disk 1 - FL1_8.MES

Messages and text shown on level 2 of the world.

Disk 1 - FL2_1.MES

Disk 1 - FL2_2.MES

Disk 1 - FL2_4.MES

Disk 1 - FL2_5.MES

Disk 1 - FL2_6.MES

Disk 1 - FL2_7.MES

Disk 1 - FL2_8.MES

Messages and text shown on level 3 of the world.

Disk 1 - FL3_1.MES

Disk 1 - FL3_2.MES

Disk 1 - FL3_4.MES

Disk 1 - FL3_5.MES

Disk 1 - FL3_9.MES

Messages and text shown on level 4 of the world.

Disk 1 - FL4_1.MES

Disk 1 - FL4_3.MES

Disk 1 - FL4_4.MES

Disk 1 - FL4_5.MES

Disk 1 - FL4_6.MES

Disk 1 - FL4_7.MES

Disk 1 - FL4_8.MES

Disk 1 - FL4_9.MES

Messages and text shown on level 5 of the world.

Disk 1 - FL5_1.MES

Disk 1 - FL5_2.MES

Disk 1 - FL5_4.MES

Disk 1 - FL5_5.MES

Disk 1 - FL5_6.MES

Disk 1 - FL5_7.MES

Disk 1 - FL5_8.MES

Messages and text shown on level 6 of the world.

Disk 1 - FL6_1.MES

Disk 1 - FL6_2.MES

Disk 1 - FL6_3.MES

Disk 1 - FL6_4.MES

Disk 1 - FL6_5.MES

Disk 1 - FL6_6.MES

Disk 1 - FL6_7.MES

Disk 1 - FL6_9.MES

Disk 1 - FLOOR1.MES

Disk 1 - FLOOR2.MES

Disk 1 - FLOOR3.MES

Disk 1 - FLOOR4.MES

Disk 1 - FLOOR5.MES

Disk 1 - FLOOR6.MES

This data file contains text strings related to the level/floor select system.

Status:

  • Japanese text extraction: 0%
  • Literal English text: 0%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

This data file contains links to the boot-up animation ('Elf') shown as the game starts, as well as menu text shown in the secret menu (which isn't present when starting the game normally).

There's a lot of hexadecimal data in this one that isn't printable - lists of the various .MES files, for example.

Also the option text shown in the music jukebox screen are in the same file.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/OMAKE.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 0%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

The literal/rewritten text in this one needs some thought, as it contains embedded spaces and carriage returns to position on the right place on the screen.

The contents of this file doesn't actually appear to be in-game text, but more akin to instructions to a programmer or artist; describing a scene or sequence. For example:

Original Text Literal Translation
真っ黒な空間の中に赤や黄色の星が瞬いている。しばらくすると、コーという音がはいる。きらめいていた星の数がだんだんと増え暗闇の中に巨大な宇宙船が浮かびあがる。クレジット表示ミュージックFO、スクリーンFO Red and yellow stars are twinkling in the black space. After a while, there is a clicking sound. The number of twinkling stars gradually increases, and a huge spaceship emerges in the darkness. Credit display Music FO, Screen FO

And then, an even clearer indication that this is a set of instructions to a programmer:

Original Text Literal Translation
誘惑の泉の風景。森の中に静かに泉が沸いている。出来れば横スクロール。 Temptation fountain landscape. A fountain is quietly boiling in the forest. Horizontal scroll if possible.

That text very clearly describes one of the opening scenes during the introduction. If you look at further examples of text from that file it's obviously an attempt to describe the story and key scenes in the game.

At present I'm not sure where (or even how) this text is displayed to the player. The data is all extracted, but I don't know if this will actually be needed.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/OPEN_END.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

This data file contains text strings which are shown in the game over screen which prompts you to load a saved game. There are actually only 3 strings in the file, since it is a tiny 473 bytes in size.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/OVER.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 50%
  • Reinsertion progress: 0%

This file contains strings which your in-game companion Rupia (or Lupia) says to you as you progress through the game. They are various messages meant to tell you where to go, what to do next, words of encouragement etc.

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/RUPIA.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 0%
  • Reinsertion progress: 0%

This data file contains the text which is shown at the beginning of the game, immediately after the start screen. This text scrolls up the screen, starting with an image of the town the main character lives in and changing through various images (see below for example).

The section continues through many scrolling/animated images, including those of your girlfriend being kidnapped by the bad guys of the game. The game proper then begins, with you dropped onto the overworld map. At this point START.MES is no longer used.

All the text in this file relates to that animated intro.

Hacking!!!

Quite sensibly, being pretty much the first source of text you encounter in the game, most of the hacking and experimentation was done on the `START.MES` file. So there's a lot more information about this file than you will find regarding the others.

The maximum text display width during the opening sequence is 30 characters. If you attempt to display a string longer than that length you end up with text cut off from the line it should be displayed on, and instead left *floating* at the bottom edge of the screen (see below for example).

The inject.py utility can use a line length parameter suffixed to the script csv file (each line can have a unique value, as different scenes may have different display limits) to determine if the inserted text will overflow. If the text is beyond this limit it will automatically insert line breaks. So instead of the above, you get a more presentable version (see below).

The interactive scenes (basically, you push a button to continue reading, unlike all the previous scenes which were essentially an automatic slideshow) have a different text display routine. Initially, they seem to work great….

Overwriting Images

But, for some reason whilst displaying, they scroll upwards and overwrite the contents of the current image (see below), this continues until the screen changes. This needs some investigation…

It turns out that the interactive text display automatically does line wrapping, so it's reasonable to disable the line-wrapping of the `inject.py` script for text that is displayed during this section of the intro (or, at the very least, set it to some huge number like 999). However, even disabling it does not prevent the overwriting behaviour as shown above. More investigation needed.

It appears that there are several code sequences for inserting a newline into the text, and each has a slightly different behaviour:

Hexadecimal sequence Text representation Example Output
0xC1 We substitute | for 0xC1 in the script
[George] This is a placeholder|another1|another1|
0x81 0x93
%
[George] This is a placeholder%another1%another1

Linebreak Character

So, using the linebreak character '%' (or, more strictly speaking, the S-JIS '%' character) we can embed a normal return into the printed text. Alternatively using the '|' character we can inject a return and then upward scroll of the immediately printed text. Note that the latter won't work particularly well on the interactive scenes, due to the taller image being shown.

Available Line Width

The width of all text during the introduction sequence (auto-playing and interactive scenes) is 30 characters. Anything over that length will cause:

  • Truncation and graphical errors (auto-playing segments)
  • Auto-wrapping of the text to the next line (interactive scenes)

Available Row Size

During the auto-playing introductory sequence up to 4 rows of text can be shown. During interactive sequences the number is reduced to 3 rows maximum. The on-screen image shown during the latter sections is larger, hence there is less available room for text - even so, it does appear that there is room for more, but attempting to do so will cause:

  • The 4th and greater lines of text to wrap back to the 1st line, overwriting it

https://github.com/megatron-uk/raygun-x68k/blob/master/csv/disk1/START.MES.csv - Japanese to English mapping CSV

Status:

  • Japanese text extraction: 100%
  • Literal English text: 100%
  • Rewritten English text: 100%
  • Reinsertion progress: 75%

  • DISKNO - Contains the bytes 0x01 0x1A
  • COMMAND.X, HUMAN.SYS, AUTOEXEC.BAT - basic Human68k OS (this is a bootable floppy)
  • MUSIC.X - FM Synth driver to playback the Ray Gun music tracks
  • RAY_GUN.PCM - ???
  • START.MES - Text for the secret menu and music test screens
  • ANI/.ANI Files - Image data
  • PIC/.PR7 Files - Animation data

As noted earlier, if this disk is used to boot, the Secret Menu will be shown, rather than the normal game start screen.

Beyond the single Secret Menu text, there is no dialogue to extract or translate on Disk 2, it contains image/animation data only.


  • DISKNO - Contains the bytes 0x02 0x1A
  • START.MES - Text for secret menu
  • ANI/.ANI Files - Image data
  • PIC/.PR7 Files - Animation data

This is not a bootable disk.

Beyond the single Secret Menu text (which is identical to that found on Disk 2), there is no dialogue to extract or translate on Disk 3, it contains image/animation data only.


Patch

A patch is not yet available.

  • blog/x86_raygun_english.txt
  • Last modified: 2020/06/25 09:15
  • by john