sina-gst Posted January 31 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): I can change the in-game text using CrystalTile2: I can also change in-game images using Paint, or any other graphical tool: 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: And when I changed it from 0 to 1, the first character, which is I, was gone: Also, I found another thing. The variable C, indicates the index of lines: 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? 0 Quote Share this post Link to post
andrewj Posted January 31 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". 2 Quote Share this post Link to post
sina-gst Posted January 31 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. 0 Quote Share this post Link to post
andrewj Posted January 31 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. 1 Quote Share this post Link to post
Dimon12321 Posted January 31 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 1 Quote Share this post Link to post
sina-gst Posted January 31 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! 0 Quote Share this post Link to post
sina-gst Posted January 31 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. 0 Quote Share this post Link to post
Erick194 Posted February 10 (edited) 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. Edited February 10 by Erick194 2 Quote Share this post Link to post
sina-gst Posted February 11 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. Hi @Erick194, Wait what?! You RTL'ed the game????????? I use this version. 0 Quote Share this post Link to post
Erick194 Posted February 11 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 1 Quote Share this post Link to post
sina-gst Posted February 11 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. 0 Quote Share this post Link to post
Erick194 Posted February 11 I see, it is because the numbers would also be seen from RTL if the functions are modified. 1 Quote Share this post Link to post
sina-gst Posted February 11 Btw @Erick194, what was the first gif you showed me? Did you reverse the text direction of the BREW version? 0 Quote Share this post Link to post
sina-gst Posted February 11 (edited) 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 February 11 by sina-gst 0 Quote Share this post Link to post
Erick194 Posted February 11 2 minutes ago, sina-gst said: You mean you RTL'ed the version I'm talking about? 🤯 How did you do that?! 1 Quote Share this post Link to post
sina-gst Posted February 11 Just wow! You're a hero! But I've got a question: I have this version of the game, but the class files are totally different (download it from here using Recaf), what should I do? 0 Quote Share this post Link to post
sina-gst Posted February 11 Can you send me the version you have @Erick194 please? 0 Quote Share this post Link to post
Erick194 Posted February 11 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. 1 Quote Share this post Link to post
sina-gst Posted February 11 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 😍 0 Quote Share this post Link to post
Erick194 Posted February 11 (edited) 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 February 11 by Erick194 1 Quote Share this post Link to post
sina-gst Posted February 11 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? 0 Quote Share this post Link to post
sina-gst Posted February 11 (edited) And now about modification! I did what you showed me, but looks like we have to reposition the text! Any idea? Edited February 11 by sina-gst 1 Quote Share this post Link to post
sina-gst Posted February 11 THANKS A LOT @Erick194!!! Everything works well, except for two things: The intro texts: And everything about the UI: Any tips? 0 Quote Share this post Link to post
Erick194 Posted February 11 ok don't worry all that can be corrected 1 Quote Share this post Link to post
sina-gst Posted February 11 You're my hero @Erick194! Just one question... What's the best version of the Java ones? Are they all the same? 0 Quote Share this post Link to post
Erick194 Posted February 11 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 1 Quote Share this post Link to post
sina-gst Posted February 11 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! 0 Quote Share this post Link to post
Erick194 Posted February 11 ok when I was referring to the numbers they would look like this 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.