Jump to content

Needing help with Doom RPG Persian Translation


Recommended Posts

I want to translate Doom RPG into Persian (I live in Iran), and I chose the Java ME version.

Since .jar files are like .zip files, I can extract the game file, to see what's inside. So, here's what I got so far:

  • I can change the font (to inject Persian/Farsi characters):
    a.png.906ae0443a641bf97050ceca4e37000c.png
  • I can change the in-game text using CrystalTile2:
    image.png.039e32cc57aec3c7807c97db9567c061.png
  • I can also change in-game images using Paint, or any other graphical tool:
    g.png.ccc3b92650d2d5f6ce04bd3cf2b55a06.png

 

But how to change the text direction? This is where I got stuck for weeks, and I need your help!

What's the problem? In Persian, we write from right to left (so our language is like Arabic; it's RTL), but all the texts in the game are LTR, and I want to change the direction of the texts.

So far I found two tools, named Recaf and DirtyJoe, that helped me a lot to see the game's codes, but I still have no idea how to make it RTL.

But this is what I found so far:

  • In the k.class file, there is a method named a, and it seems that it controls the text appearances. Why? Because the variable named var3 is exactly the index of the text:
    image.png.2ccf524f036806fbc76a3343dfbb7d19.png
    And when I changed it from 0 to 1, the first character, which is I, was gone:
    image.png.7872126c7c10e275552e5192caa5f781.png
  • Also, I found another thing. The variable C, indicates the index of lines:image.png.3c3035660947bd4a3e3e8221764e9925.png

But I still don't know how to RTL the texts... Any idea?

Not to mention that translating the game to ANY LTR LANGUAGE is literally easy, and if you're interested I can help you out with that!

But translating Doom RPG to RTL languages is not yet possible... Any tips?

Share this post


Link to post

Looks like each line of text is separated by the '|' character (ASCII code 0x7C).

 

Easiest thing to do would be to simply write the Farsi letters backwards.  For example, if English were RTL and you wanted to change a line of text to say "Hello World" then actually make it "dlroW olleH".

Share this post


Link to post
5 minutes ago, andrewj said:

Looks like each line of text is separated by the '|' character (ASCII code 0x7C).

 

Easiest thing to do would be to simply write the Farsi letters backwards.  For example, if English were RTL and you wanted to change a line of text to say "Hello World" then actually make it "dlroW olleH".

Oh, I forgot to say that I also found that. Yeah, each line is separated with one "|".

And you're right, but I want to make the game RTL, so that each line starts from the right side of the screen.

Share this post


Link to post

The code you showed is responsible for splitting the lines (I believe).

 

You'll need to find the code which actually draws each line, then modify it.  There will be a function which calls the code you showed, and then either calls another function to draw it, or does the drawing itself.

Share this post


Link to post

It's unlikely that there is still someone around who messed with Java version of Doom RPG. If you can modify and compile the decompiled .class code, then you may rewrite the logic which outputs the text on the screen. Some for-loop has to be modified like that "for (int i = X-1; i >=0; i--)", where X is some variable responsible for the dialog line length

Share this post


Link to post
17 minutes ago, andrewj said:

There will be a function which calls the code you showed, and then either calls another function to draw it, or does the drawing itself.

Now you gave me an idea!! I think you're right, so let me find the piece of code you're talking about!

Share this post


Link to post
14 minutes ago, Dimon12321 said:

It's unlikely that there is still someone around who messed with Java version of Doom RPG. If you can modify and compile the decompiled .class code, then you may rewrite the logic which outputs the text on the screen. Some for-loop has to be modified like that "for (int i = X-1; i >=0; i--)", where X is some variable responsible for the dialog line length

I see I see, but @andrewj gave me a cool idea to search for a piece of code that draws each line! I think I have to find it first.

Share this post


Link to post
  • 2 weeks later...
On 1/31/2024 at 1:41 AM, sina-gst said:

I want to translate Doom RPG into Persian (I live in Iran), and I chose the Java ME version.

Since .jar files are like .zip files, I can extract the game file, to see what's inside. So, here's what I got so far:

Ok what version of the game are you using?


Yes, it should be possible, but all the texts must be repositioned.466664241_2024-02-1015-28-37.gif.89bf45dc0121ce6ad8868f43afe5864b.gif
 

Edited by Erick194

Share this post


Link to post
9 hours ago, Erick194 said:

Ok what version of the game are you using?


Yes, it should be possible, but all the texts must be repositioned.466664241_2024-02-1015-28-37.gif.89bf45dc0121ce6ad8868f43afe5864b.gif
 

Hi @Erick194,

Wait what?! You RTL'ed the game?????????

I use this version.

Share this post


Link to post

Hi @sina-gst

Ok, the version you showed me is 1.8.94, that's fine, I can look for the necessary functions to modify them, now my question is the following, according to the language, what do you want to modify the game, how are the numbers handled? It's the same RTL mode

Share this post


Link to post
39 minutes ago, Erick194 said:

Hi @sina-gst

Ok, the version you showed me is 1.8.94, that's fine, I can look for the necessary functions to modify them, now my question is the following, according to the language, what do you want to modify the game, how are the numbers handled? It's the same RTL mode

Thanks @Erick194,

To answer your question; everything is RTL, except for numbers.

For example:

ما به ۳۴ سیب‌زمینی نیاز داریم

In the sentence above, you have to first write

۳

...and then write

۴

But it's not a big deal at all, as appearing "۴" first and then "۳" is also fine, the result will be the same.

Share this post


Link to post
3 minutes ago, Erick194 said:

that's the J2ME version

You mean you RTL'ed the version I'm talking about? 🤯

How did you do that?!

Edited by sina-gst

Share this post


Link to post
2 minutes ago, sina-gst said:

You mean you RTL'ed the version I'm talking about? 🤯

How did you do that?!

image.png.eb273ab6abf0d5798a1e8daebb731e6f.png

Share this post


Link to post
12 minutes ago, sina-gst said:

Can you send me the version you have @Erick194 please?

Actually, I gave the names of the classes, to be able to identify them more easily, since I also already had this work done previously, but it is not yet complete. I can help you with the modification but I still can't release this reverse engineering of the J2ME version, sorry.

Share this post


Link to post
Just now, Erick194 said:

Actually, I gave the names of the classes, to be able to identify them more easily, since I also already had this work done previously, but it is not yet complete. I can help you with the modification but I still can't release this reverse engineering of the J2ME version, sorry.

It's ok man! So please just don't delete the attached picture of Recaf that you sent! When I RTL the game, I'll let you know then! THANKS A LOT 😍

Share this post


Link to post

Ok although here you also have as a reference the reverse engineering of Doom RPG BREW source code.

Practically it's almost the same.

Edited by Erick194

Share this post


Link to post

Also @Erick194, I've got another question, but not about the modification process... What's the best version of the Java ones? Are they all the same?

Share this post


Link to post

And now about modification!

image.png.2e291cc46b91565d191635666398b12c.png

I did what you showed me, but looks like we have to reposition the text! Any idea?

Edited by sina-gst

Share this post


Link to post
2 minutes ago, sina-gst said:

You're my hero @Erick194!
Just one question... What's the best version of the Java ones? Are they all the same?

It is almost the same, but in version 1.8.94 it is easier to modify the text

Share this post


Link to post
Just now, Erick194 said:

It is almost the same, but in version 1.8.94 it is easier to modify the text

It's ok then! So we go with this version!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...