The Last Ranker Null char

Discussion in 'PSP - Games & Content' started by K.F, Jan 10, 2015.

  1. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Hello everyone.

    I am working on translating the Last Ranker, a PSP game. The game text is already translated by "Englishsubs4all", and I already found and extracted the text files and manually translated the intro and the tutorial and they work well. Now I am planning on writing a tool for the translation, but I am having trouble with the null character. The files are in utf-8 format and as with most PSP games, all strings are tailed by a null character. My problem is that when I shift the null character to make a string shorter while the adjacent string longer - the file size stay the same- the game does not allow that and it crashes when the shifted null string is reached to be displayed.

    Is there a way to shift the null character to lengthen a string size that needs more space by reducing the other that doesn't? I can continue writing a tool that deals with constant size strings, but that would be a pain to change the translation just because the string is too small.

    When I add a null in the middle of the string, the game display the first half the string, then jumps to the next string skipping the other half without crashing which rules out that game is using either using string length and displaying strings sequentially. It was suggested to me that the game may use offset for strings, but I cannot find their locations.

    a sample of the files can be found here:

    http://wikisend.com/download/169400/MAP_T_KAN_00
     
    Majima likes this.
  2. azyleo1997

    azyleo1997 Newbie

    Newcomer
    1
    0
    Jan 10, 2015
    Pakistan
    Shouldn't This Be posted In Hacking And Homebrew?
     
  3. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    The past last Ranker translation threads are in here, so I put mine here too.

    Mods can put it where it belongs.
     
  4. StorMyu

    StorMyu "I'm too old for this"

    Member
    896
    437
    Jan 2, 2010
    France
    Out of curiosity, how have you extracted the text ?
     
  5. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Not sure if you are asking about extracting the text files or extracting the text itself from the files. If you are asking about the former, the files are at "USRDIR\GAMEDATA\FLD\MAP", they are .BIN files compressed using GZIP so you can simply extract them with 7zip, modify them and compress them again with 7zip using GZIP format.

    If you are asking about extracting the text itself, then that is my next objective. I haven't done anything yet until I can solve this problem that I created this thread for. For the intro, as I said, I edited the file manually. I can proceed with constant length strings, but I prefer not to.
     
  6. StorMyu

    StorMyu "I'm too old for this"

    Member
    896
    437
    Jan 2, 2010
    France
    Ok I wanted to be sure, I do know everything about that already, just wanted to ask if you knew what a pointer was since apparently you're asking about the NULL character which is irrelevant.
     
  7. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Why does the game crashes when I shift a null location then?

    When I started, I thought -hoped?- that the game displayed strings sequentially with nulls indicating a string end, but after some tests, it is obviously not the case.

    As I said, I can't find where the offsets are, nor how they are stored, or even if the games uses them in the first place.

    I am not a professional programmer, but I know the basics. So yeah, I know what a pointer is.

    Most of my programming background is for small engineering programs, so I haven't worked with a lot of strings or pointers before.
     
  8. Scorp

    Scorp GBAtemp Regular

    Member
    247
    82
    Sep 23, 2010
    Kazakhstan
    Basically this means, that there is a list of offsets somewhere, pointing to the beginning of each line. So in order to edit that freely you must find that and correct for every phrase. Usually you write a small script which would extract that text into some CSV or Excel and after that make another script which will assemble all back. All you need is find the format. I am novice in this too, so it is just a guess.
     
  9. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Yes, this is my understanding too. All what I need to do this is to find these offsets, and I have no Idea how, assuming that is how it works in the first place. Again, this is not necessary to finish the translation, but it would help ALOT and save us so much hassle.
     
  10. StorMyu

    StorMyu "I'm too old for this"

    Member
    896
    437
    Jan 2, 2010
    France
    Just wanted to say, I was about to do it too, then give that project to some people who lost interest, then Englishsubs4all did the translation so I might look at it again but it's not as simple as looking at the text and changing it, especially with that game. I have to change the way the game buffer the text too, I remember it being a dick and not drawing after like ~11 chars per line.

    If it was that simple, believe me it would have been already done, by me. I like that game !
     
  11. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Thanks for the heads up. I already translated the intro section and tutorial and it is working for me. Of course that doesn't mean that there will be no problems for the rest of the game, and i'm not giving any promises other than that I will try.
     
  12. StorMyu

    StorMyu "I'm too old for this"

    Member
    896
    437
    Jan 2, 2010
    France
    That was my question, how did you translated the intro without any text extraction ? Hex editing ? That's just sounds messy to me.
     
  13. K.F
    OP

    K.F Newbie

    Newcomer
    7
    1
    Jan 10, 2015
    Saudi Arabia
    Yes, and of course it's messy, I just did it as a proof of concept. Now that I know it works without problems, I can write a tool to extract the text.
     
  14. macaronron

    macaronron Advanced Member

    Newcomer
    94
    94
    Oct 24, 2013
    United States
    My recommendation: If you figure out your end, get yourself a decent translation checker. Englishsubs4all admits that there may be gratuitous errors in their translation; hopefully having a fully extracted script to check against compared that giant playlist of videos will encourage someone to check for mistakes and fix them.
     
  15. Verard

    Verard Newbie

    Newcomer
    9
    0
    Oct 3, 2014
    Italy
    I'm rooting for her , after all I asked the game XD I have not unfortunately able to help you , but you have all my support u.u
     
  16. Scorp

    Scorp GBAtemp Regular

    Member
    247
    82
    Sep 23, 2010
    Kazakhstan
    Does it really that hard? From what you told all looks quite simple... Normal format for text. normal lookup tables... Find the limiter is not hard too, by me...
     
  17. Scorp

    Scorp GBAtemp Regular

    Member
    247
    82
    Sep 23, 2010
    Kazakhstan
    If I were you (lol :)), I would just go in debugger, find the address in the memory with text, put a breakpoint on read there, and after check how the routine where you fall back works... MIPS assembler is the dumbest thing I ever saw (comparing with PC or even Z80), this could save you some time in understand it (as there is really 10 different operationgs in max), but as all got compiled from C++, it not straightforward at all to understand what human logic was behind that assembler code...

    I think it only on my small experience (I digged max 2 games), so I could be wrong.
     
  18. StorMyu

    StorMyu "I'm too old for this"

    Member
    896
    437
    Jan 2, 2010
    France
    could be simple, could be not, I've just handed over the project to someone some time ago and they didn't finish the job, I guess I could try to look at it again one day...
     
  19. Verard

    Verard Newbie

    Newcomer
    9
    0
    Oct 3, 2014
    Italy
    Any notice?