HTTPS SSH

Note: You do not need wr-trans to use its results: All currently working languages are available as mods for word-realms-mods). Since word-realms-mods is significantly less technical to install and use than wr-trans, this should open things to a wider audience.

Currently working languages: French, Italian, and German

How to hack Word Realms 1.1 into a language learning game

DISCLAIMER: Asymmetric is OK with you doing this hack and with this guide being available, but naturally, you are on your own with the result. Don't report bugs or anything else directly to them about your altered copy of the game. Also I make no warranties whatsoever, but feel free to share your experiences.

OS CAVEAT: You might be able to do this entirely on a Windows, Linux, or Mac box, but it's known to so far work with:

  • Windows for ffdec, and a Terminal in Haiku OS (not Linux-based, but as far as bash goes, it should hopefully work) for the perl (5.18) and python (2.6.8) scripts
  • Linux Mint 16 with its included perl 5.14.2, for everything
  • Linux Mint 17.2 with its included perl 5.18.2 and python 2.7.6, for everything; if you use the very latest flash decompiler, you'll need Java 1.8, which you'll have to figure out how to install on your own. However, you can probably use JPEX Flash Decompiler 3.0.0 just fine.

Basic steps:

  1. if you care to, you may want to back up your global/player game data, just in case
  2. install word-reams-mods and make sure the sample mod works
  3. use it to create a new mod, e.g. "Original in Spanish"
  4. prepare alternative game data (see below)
  5. copy alternative game data into mod directory
  6. use word-realms-mods to try it out!

Preparing alternative game data

ffdec will make the 'binaryData' subdirectory within 'wr-trans' for you, but you may need to create 'intermediate' and 'downloaded'.

I've made some Bash and Perl scripts (may need adaptation to work with Windows line-endings) that will help with preparing the game data, but you'll still need some outside raw data to work with: word lists, word frequency lists, example sentences (to use as taunts), and translations. Unfortunately, some of these have licensing restrictions, so you'll have to download them yourself and process them using the scripts provided. Download the following files into wr-trans/downloaded, depending on which language you're wanting to translate into.

Note: if you dislike dicts.info's data and prefer your own translation, you can just create a blank file in place of that particular download.

Please read the licensing included with the below data, as it applies to the downloaded mod.

French:

German:

Italian:

Spanish:

Example sentences are derived from downloaded/sentences.csv, which you can get from the Tatoeba Project at http://tatoeba.org/eng/downloads and then running wr-trans/sentences.sh to process them. Being that they're CC-licensed, I was going to include the derived versions, but they're rather large. If requested I could put them in a separate download area so you can pick and choose, rather than have to get them all from me or all plus many unused extra languages from the Tatoeba Project.

You'll also need to download https://github.com/ilius/pyglossary/archive/master.zip and extract it in the 'downloaded' directory (i.e., you'll have 'wr-trans/downloaded/pyglossary-master/pyglossary.pyw' and its other files). Once that's in place, run wr-trans/dicts.sh to convert the BGL file(s) you downloaded into txt files. You can always run this again later.

Once you have the files ready for the language, cd to the wr-trans directory, run "perl wr-trans.pl", and follow the directions from there.

For the parts where you need to help translate a file, you can use any online translation engine that doesn't get rid of your line breaks (i.e. keeps one word or sentence per line, whatever you feed it). This is important, because the translated ("done") file must have the exact same layout, line for line, as the "needs translating" file. Most of them will not translate all of large files, so you'll have to do them in chunks. I found 10 screenfuls or so at a time worked OK without it starting to just give you the original back again. Please note that sometimes you are, in fact, asked to translate FROM English, and sometimes TO English. After preparing the file asked, re-run wr-trans.pl the same way as before, and it will continue on.

Hacking the game's scripts to work with your alternative data

1 - Disable reporting of taunt and dictionary problems

HotStuff asked that this be part of the instructions, because Asymmetric doesn't want to receive reports of foreign words (which they can't do anything about, anyway, if you're controlling the dictionary yourself.)

This is now handled automatically by word-realms-mods if you change the dictionary.

2 - Make all opponents use the player's taunts so you can learn from their played words, too

Copy in Word.NPC.764.pcode and change this part:

getlocal_2
getproperty MultinameA("taunts",[PrivateNamespace(null,"175"),PackageNamespace(""),PackageNamespace("Word"),PrivateNamespace(null,"176"),PackageInternalNs("Word"),Namespace("http://adobe.com/AS3/2006/builtin"),ProtectedNamespace("Word:NPC"),StaticProtectedNs("Word:NPC"),StaticProtectedNs("Word:Character"),StaticProtectedNs("flash.events:EventDispatcher")])
callpropvoid Qname(PackageNamespace(""),"loadTaunts") 1

so that it only says

pushstring "player"
callpropvoid Qname(PackageNamespace(""),"loadTaunts") 1

Click Save at the bottom.

This can be reused if you're doing another language translation mod, since it's not specific to any language.

3 - Replace letter frequencies and ordering to help balance the game a bit

Trying to play only foreign words, but having to make them using letters that are common in English but may not be in another language, will likely get frustrating. This hack will make it more likely that you can actually spell something.

You can generate the needed P-code replacement files by running the wr-trans/letterfreq.pl script, which will base it on your downloaded dictionary data.

CAVEATS

  1. The dictionary and especially taunts will likely contain the some translation errors, but as a language learner, you're probably used to working with that. Nonetheless, feel free to post improvements and patches (but probably not entire dictionaries).

  2. Some dream opponents, e.g. Screamy's teacher, will make nonsensical taunts at you due to all opponents' taunts being overridden with the player's taunts.

  3. Some dreams will end with a strange message at the top, like "You were defeated by Fake Player," rather than the normal one. I'm not sure why this is.

  4. For languages where the data files used are much larger, the game loads and plays a bit slower overall, and there's a small lag just after hitting the attack button.