Jump to content

StarsMmd

Innovator
  • Posts

    710
  • Joined

  • Days Won

    3

Posts posted by StarsMmd

  1. That's really amazing! I don't know how you found the patience for that. I wrote an app that lets me type in an id and it automatically searches for me (and can replace strings) although It only searches the major ones right now because I couldn't be bothered to track down all the other files. The details of the special characters is really great too (that 7 byte one though 8O). I was dreading the day I'd have to go and find those.

    I'd really love to use your text dump as a reference if you make it available and maybe you could include a list of the fsys files that each table comes from?

  2. I gave up on the logo textures for a while but then I stumbled across a texture which the header states is 4bpp and indexed. The pointer to the palette points to a 16 colour palette confirming that the image is indeed 4bpp. This reinforced what I said earlier about the 5th byte in the header being the bpp for the texture. So I decided to investigate the logo again with the following assumptions:

    1. The 5th byte indicates that the image is 4bpp.

    2. The first four bytes indicate 640x480 dimensions for the image. This makes sense as it gives a 4:3 aspect ratio and the image is displayed full screen. This also adds reinforces the 4bpp info since the number of bytes in the texture is half of 640x480 meaning each byte must be 2 pixels.

    3. Tiledggd assumes that the image is indexed if you specify 4bpp.

    Therefore, I decided to add a palette to the end of the the file. I made a 16 colour palette where each colour in the palette was the 16bit equivalent of the 4bit colour that would lead to that index. With a tile size of 8x8, this resulted in the following image:

    nintendo logos.rar

    You can see the rough outline of the nintendo logo but it is still very messy. Try looking at the image through a phone's camera from a distance and you can quite clearly see the nintendo logo. Like you said earlier, it makes more sense for 4bpp images to be indexed. The logo looks white from a distance and clearly not red like it is when it's viewed in-game.

    From all of this I've come to the conclusion that, although each pixel is indeed 4bits, they aren't colours. My best guess is that each 4bit pixel only contains a 4bit alpha channel. I know that in iOS development you can load an image as a 'template'. In simple terms this ignores the colour values of each pixel, leaving just alpha values. The image can then be assigned a 'tint colour' and each opaque pixel will be displayed as that colour.

    I reckon that the file only contains alpha values and is only assigned the colour red when it is loaded. The image would then probably be placed in front of a black background.

    I updated the palette so that the index each 4bit value will be converted to has the 8bit equivalent of that alpha value and a red channel of 0xFF. This simulates the effect of adding the red colour to each pixel later. This is what I got:

    logo_nintendo.fdat.png

    However, I'm definitely still missing something. From the distribution of opaque and transparent pixels it looks like the pixels aren't properly aligned. Maybe I've got the wrong tile size or I've made an incorrect assumption somewhere. I think the way forward will be to change the values of some of the bytes and see how they look when the game loads them. That's going to be really tedious and I'm not interested enough to do that right now.

    logo_nintendo_fdat.png.5093b9a98c9fea79b

    nintendo logos.rar

  3. In the attached images i mentioned what I erroneously guessed was some sort of unique trainer id. It only recently dawned on me that it was the string table id for the trxt the trainer says when you defeat them. I noticed this in the colosseum data so it's weird that It took me so long to make the connection. there is also the prebattle id (colosseums only) and victory text id (colosseums and mtbattle) like in colosseum.

    [EDIT:] So @Tiddlywinks informed me that a trainer's prize money is affected by the highest level of their pokemon. However, even though greevil's team of 6 and the shadow lugia battle just before both contain only level 50 pokemon, his shadow lugia battle awards $300 more. I just checked and this is because the prize money is calculated using the level in DPKM whereas the level used in battle is determined in DDPK. So although the DDPK level overrides the DPKM one, the DPKM one is usually raised a little just to increase the prize money from some shadow pokemon users.

  4. I've been messing around with dolphin's debugger on xD. It turns out that the physical/ special split was really easy to use on all moves instead of just shadow moves. ( I converted the implementation to only 5 lines of action replay code). of course actually editing each move to incorporate the physical special byte is a bit more effort but I've tested it and it works almost perfectly since it was already in the game just largely unused. It is to be noted that the flash fire ability just boosted the pokemon's special attack when using fire moves in this gen (since fire moves were expected to always be special. This means flash fire only boosts special fire moves with the split. I need to test whether it would boost attack instead ifni edit fire type to be physical.

    Another interesting thing I've found is that setting a move's accuracy to 0 doesn't provide perfect accuracy like in the gba games but rather (more intuitively) just results in always missing. The interesting thing though, is that you can set the accuracy to more than 100 and that value is displayed. I set dragon claw to 200% accuracy and at -2 accuracy still had 100% accuracy. I don't know if this is the case in any other games. haven't seen anyone try it.

    [EDIT:] So I tested flash fire and it seems its hard coded to boost special attack (oh well).

  5. I've been looking at the string tables in xD and have some updates. Each string is terminated by the value 0x00 spanning 2bytes. There are also some 'escape' characters (a bit like \n, \t or \\ in programming). They start with 0xFFFF followed by one or 2 bytes determining the special string or character that it will be replaced with in game. 0xFFFF00 and 0xFFFF03 seem to add a new line (so basically \n) . I think the gba games have 2 different ones as well; one which just continues the text on the next line and one which does the same but also scrolls up a row in the text box. Might be something similar. I don't know exactly what the rest do but some clearly fill in the player's name, the name of the npc meant to say that line or variable text like item or pokemon names. 0xFFFF07 and 0xFFFF53 always have one extra byte after them taking a total of 4 bytes for the special character. Every other special character I've seen so far is 3 bytes. The regular characters are 2 byte unicode characters and the strings are 'null terminated' (end in 0x0000).

    Colosseum is probably exactly the same but I haven't checked.

  6. Just a quick update. I found the recompression script I've been using on a forum somewhere like a year ago and it's been really tedious to use. I just did some research on quickBMS scripts and I've amended the script to be a little easier to use. This new script automatically calculates the file size so you don't need to update the script every time you want to compress a different file. This also means that multiple files can be compressed on one run of quickBMS.

    The new script:

    Endian Big

    ComType LZSS_Compress "12 4 2 2 0"

    Get Name Filename

    Get FileLength ASize

    Get Ext Extension

    String Name -= Ext

    String Name += ".lzss"

    CLog Name FileLength FileLength

  7. Hello.

    Yesterday I tried xD RNG Manipulation, and I just could not get into it.

    Would it be possible to hex edit a xD save file to get a pkmn bred in pkmn emerald there?

    What I mean is, I would trade my bred pkmn into a xD post-game, and than try to edit a xD fresh save file (right after the salamence vs metagross fight) with that said pkmn. (as in, figure out the Hex location of eevee and replace it with the bred pkmn, does not have to be a replace, it can be add)

    Would something like this be possible?

    Or I'm I just day dreaming?

    Thank you in advance.

    Hey, I don't know much about RNG or save editing but I do work on editing the game files in the ISO directly.

    From what I've read I think the save files are encrypted in some way which means it would be almost impossible to copy the hex from one save file to another. The game has a way of checking that everything in the save file makes sense and as soon as you change something it will say the save is corrupted and make you start again.

    However, there are alternative methods of getting the pokemon you want:

    1. Action replay codes.

    It's very easy to find action replay codes to give you any pokemon you want. You can find the unencrypted AR codes and modify them to give you the exact pokemon you want.

    2. RAM editing. If you're playing on the dolphin emulator you can run it in debug mode and edit the game's ram directly. If you search, you should be able to find the ram offsets of your party and change the data to whichever pokemon you want. Then you can save and that pokemon will be in your save file permanently. (Note that this is exactly what action replay codes do, just they do it automatically.)

    3. Edit the game files directly.

    This method is a lot lengthier but if you wanted you could edit the ISO you're playing so that the first shadow pokemon is the pokemon you want. In theory, you could change it so that eevee is the pokemon but I haven't been able to figure out where the game stores this quite yet.

    I spend a lot of time using the first 2 methods when I want to run quick little tests so I would recommend those for a small job like adding one pokemon. Of course these depend on having either an emulator or AR device.

  8. It's been a while since I played on a gamecube but don't all the ngc games use that same nintendo logo athletes e start. It would seem that every game is required to include that image and display it as soon as the game loads. incolo/xd it is bundled in a .fsys file which is as far as I know a file format which only thise games use. It's possible that each game chooses how to handle displaying the logo and if so, comparing with ither games may shed some light on what's going on. I'll see if I can extract it from some ither ISOs and compare.

  9. I doubt it works that way. If it was only 2 colors, it would be 1 bit per pixel.

    But the image has gradated colors. So its not just 2 colors, but several.

    I'm guessing there's probably something we've missed in there.

    The alternating patterns would create faint vertical blue strips on the resulting image. But it actually doesn't.. So either some bytes are ignored, or either they got a particular purpose :/

    I don't mean a 2 colour palette. I mean each pixel is 4 bits. 1 bit alpha, 1 bit red, 1 bit green and 1 bit blue. I feel like this gives really basic colours and since each pixel is only half a byte, the images are actually pretty high resolution. They could for instance alternate between blue and black pixels to produce a dark blue when viewed on a screen, since our eyes wouldn mix the pixels. This is mainly a theory but it fits with the file headers saying its 4bits per pixel and would explain the weird alternating patterns that don't show up when the images are viewed in game.

    What do you think?

  10. I thought so. I think the header says its 4bits per pixel ( so one bit per channel) and it isn't indexed . That means each colour is only half a byte but tiledggd has a minimum of 2 byte colours. The nintendo logo only has black and red while the genius sonority logo only has white and blue. 2 very simple colours for each. So I assume each pixel only needs half a byte. Do you know any tile viewers that can handle 4bit colours?

  11. I just realized something xD

    For some reason, I just completely derped and read bits as byte on the user interface.. even though I've used that thing for nearly a million times before ^^;

    And I got it to show up:

    [ATTACH=CONFIG]12341[/ATTACH]

    16 bits per pixels, RGB, little endian, tiled 4x4.

    And the start offset is 0x80.

    Sweet. you're really good at this. Okay, so there's just one more if you don't mind. I n "genius_logo.fsys" and "nintendo_logo.fsys" there are the images that come up when the game starts up. I've been comparing the headers between the other two texture file types we've seen. The xD ones have 0x8 at around the 5th byte and are 8 bits per pixel. The colo ones have 0x10 for the same byte and are 16 bits per pixel. Therefore, I believe the logos are 4 bits per pixel from the header. The first 4 bytes are the width and height (usually) and for the logos they are 640x480. The combination of these works out in Tiledgggd. However, once again I get a good enough image to see what the image is meant to be but I can't get it to show perfectly. I really thought I could figure this one out...

  12. Nice!

    And I've taken a look, but I can't seem to figure it out for sure. The format of the pixels differs from xD though, so its possible there aren't any palette involved.

    From looking at the repeating patterns, I'd guess they probably encoded pixels on 2 bytes. Possibly 5 bits per color, and 15 bits per pixels. Its not all that common, but it kinda looks like that.

    Especially since the highest bit of every groups of 2 bytes is always set to 1 in colosseum's pokemon portraits. And in 15bpp images, that bit is either ignored or possibly used as 1 bit alpha.

    Now, the problem is that I don't know any viewers that handle 15bpp, so you'd probably have to write some code to convert the pixels to a 16bpp/32bpp bitmap or png, and see if it works.

    Its probably just something as simple as this:

    uint16_t rawpixel = 0x8C84; //Example value
    
    uint8_t r = ( pixel & 0x7C00 ) >> 10;
    uint8_t g = ( pixel & 0x3E0  ) >> 5;
    uint8_t b = pixel & 0x1F;
    

    Or maybe the opposite order.

    Ah that makes sense. The palettes in xD use that format as well. If it turns out to just be 2 byte colours then that should be easy enough to convert to a bitmap. It would be rather tedious to do again though so I think I'll pass on this one for now.

  13. Well, the main concern is the header and data structure.

    Tileggd ignores the header, but the game needs it to parse the image properly. That's why its not all that much of a good indication to look at it in Tileggd.

    It worked !

    Screen Shot 2015-05-23 at 21.50.55.png

    Screen Shot 2015-05-23 at 21.49.03.png

    Also, could I get you to look at the textures in colosseum and tell me what you think? They have a slightly different format which is almost identical but without any pallet data as far as I can tell. Thought you might have some insight as to where the pallets may be. I was thinking maybe a pallet that colosseum shares for all the textures? I've noticed a lot of these textures are reused in xD.

    583dd043b2e84_ScreenShot2015-05-23at21_5

    583dd043ed39a_ScreenShot2015-05-23at21_4

  14. texture replacement.png



    I was feeling up to the challenge so I wrote an app for replacing a texture with an edited png. It wasn't particularly difficult after all.

    Forgive the crappy fairy type image. I was improvising using the colours from the pallet. I've noticed that the pallets repeat a lot of colours so it should be possible to replace those colours with whatever we like. Just need to keep the compressed file size in mind.

    583dd0437bfb4_texturereplacement.png.239

  15. In retrospect, I guess I should have mentioned I was using files from PXD ^^;

    However, there is still a little thing that bothers me with the PXD textures. If you look closely, you'll notice that there are some artifacts on some of the pictures. Like one of Poochyena's ears is garbled, and Bulbasaur has that weird blue blob appearing near its ears.. So I'm guessing there might be a little bit more to this.. Maybe there is a subtlety about how colors are indexed ? :/ The best thing would be finding the exact pixel in the raw data that appears garbled and look at its value.

    I'll also try to take a look at other image formats from PXD when I get the chance. Unless they're all the same that is. xD

    If you have anything in particular you'd like me to take a look at feel free to mention it !

    Had a look at the textures again and if you include the alpha value in TiledGGD the images are perfect. The garbled pixels you mentioned are actually transparent.

    The results:

    xd textures with alpha.png

    583dd0435ab8d_xdtextureswithalpha.png.cf

  16. I haven't looked into them too much but as far as I can tell they're scripts. They have clear "function-like" names and the respective code isn't asm.

    Refer to part II in this thread - '>http://projectpokemon.org/forums/showthread.php?46260-Stars-list-of-things-which-still-need-research-in-Pokemon-Colosseum-and-Pokemon-xD. I think I also attached some images in the second research images rar file.

    As for the textures I guess I'll try comparing them with known gamecube formats but I could probably have a go at writing my own code if it comes to it. TiledGGD has revealed a lot about the format already and I may be able to reuse the original file header if the new image is similar enough. I'm still writing my xD hacking tools so that won't be a priority for a while though.

    I've just finished writing some code that can automatically look up string IDs which will be very helpful for data-mining. The string IDs pop up in so many different data structures and are by far the easiest way to identify the data.

  17. Thanks for all the information. It should be a great help.

    As for the symbols, I know that Start.dol in xD has random function names scattered around but I don't know how they correspond to the code. Also you'll find that the maps have scripts which have good headers so it's easy to match the script names to the script data itself.

    Btw, does TiledGGD have a way to reimport an image after editing it? can't seem to figure it out.

  18. What kind of garbage?

    Did you set the palette offset to the offset indicated in the header ? Have you set the palette's format to 2 bytes per color ?

    Did you change the tiling of the image to 8x4 ? Did you set the image mode to tiled ?

    Did you use the arrow keys to resize the image correctly ?

    Yeah, shadow moves are handled oddly. Back when I was editing moves and etc directly in memory, I noticed shadow moves wouldn't work on non-shadow pokemon. So there is most likely something bypassing regular typing checks. Since all ??? moves are different about how they calculate damages, its possible it has a special role.

    And, its pretty rare to find someone that can handle ASM ! Are you using IDA or just a regular disassembler / hex editor ? Does Pokemon xD still have symbols left in its binaries ?

    Also, just by curiosity, how did you proceed to find the type effectiveness table ? I've been struggling for a while to find it for Pokemon Mystery Dungeon, and I'd assume my method isn't very good !

    Also, I don't know if it can be of any use to you, but I found the old notes I wrote on how the game works in memory at runtime. It contains mainly memory locations and data structures, along with observations on how the game deals with several things :

    https://www.dropbox.com/s/qx8zah411t6dbvt/PPDX_MemoryDataStructureInfo.txt?dl=0

    I'm pretty sure I set everything correctly. I even tried it with bulbasaur and poochyena like in your images and cross-checked the settings but I kept getting random pixels. I'll give it another go though.

    Oh man, I wish I'd had your notes before I started. You figured out quite a lot before I did. All I had was HxD so it took me ages. I've been trying to find some memory offsets to help poke around so this will definitely come in handy, thanks.

    I've understood the concept behind ASM for a while but never really tried it myself but I was looking around smashboards since melee hacking has a bit of a headstart on pokemon colo/xd. I found a tutorial on hacking using Dolphin's debug mode and its been very useful. I'm mainly going by programming experience, common sense and the strategic placement of breakpoints in the debugger. I'm still a bit of a noob so I'm not 100% sure I'm correct but I don't believe xD has symbols (if that means what I think it means). On dolphin the debugger just names the function by their memory addresses.

    At first I assumed the effectiveness table would work like it does in the gen III gba games but I was wrong so I checked some gen V threads and turns out its actually very similar to gen V, i.e. every type combination is listed. From your notes, it looks like you noticed that the game refers to each string using a unique ID number. I found the ID for "NORMAL" and searched for the ID number in HxD and this led me straight to the type table. Not sure if mystery dungeon has a similar system, but being able to search for strings is extremely convenient since they can lead you directly to what you're looking for.

    Here's a picture:

    types.rar

    The effectiveness values in xD are 0x3F,0x41,0x42 and 0x43 (don't know why they chose those particular numbers) but in black & white 2 they're apparently 0x0,0x2,0x4 and 0x8 with 4 being neutral, 2 (4 x 0.5) is 0.5x damage, etc.

    Good luck ;)

    oh and I never had any trouble using shadow moves on regular pokemon, strange... Also when I edited the function that changes a move's type so that all moves retain their original typing, future sight still did neutral damage, regardless of what type I changed it to (I assume due to the move's effect itself). It seems it only changes to ? type so it doesn't gain STAB.

    [EDIT] : So it turns out I was using the textures from colosseum and only just clocked that you might have been using the xD ones. Just switched to the xD ones and it worked perfectly. This is awesome.

    types.rar

  19. I used all the same settings you specified and I keep getting garbage ?. I don't know what I'm missing.

    Yeah, I know the ??? Type is a bit dodgy but I'm willing to take the risk. I know a big problem with is that it is neither physical nor special but I can easily change that. Plus with my physical special split implementation that doesn't even matter since it's based on the move rather than the type. I'm happy with just changing curse to ghost type as I don't think the type affects the move itself. It just affects what is displayed to the player afaik.

    I know that struggle is based on ??? Type which makes it always neutral but in XDs ASM I found a function that changes the type of a move like changing weather ball depending on the weather and changing hiddenpower, etc. So I'm going to make it stay as normal type. The game actually has a list of moves that should still hit ghost types (including he shadow moves which are set to normal type but have a different effectiveness calculation, sketch, mimic and struggle). The only downside is struggle will now be not very effective on rock and steel types which I'm willing to accept since its a rare move anyway. A few other moves use the ??? Type like future sight and beat up but they can receive similar treatment.

    I can't think of anywhere else that the ??? Type is used so it should probably work out.

    [Edit:] after looking again, it turns out shadow moves are also set to ? Type. This could mean that they go through the regular effectiveness check before checking if the target is a shadow pokemon or not. There are two possible outcomes:

    1. The shadow pokemon check overrides everything else and so setting them to any type has no effect.

    2. The shadow pokemon check multiplies after the regular type check which would force a new mechanic where moves like shadow fire would be set to fire type and be 4x effective on regular grass pokemon while neutral on shadow grass pokemon. This may be a necessary compromise for the fairy type.

    I'll have to test it to know.


    Okay, just checked and it seems to be case 1. Shouldn't have any problems.

  20. Just an update for anyone who's interested. I've found the weakness and resistance table and I've also managed to successfully implement the physical special split. I expected it to be pretty straight forward but I was actually surprised at how simple it was.

    I'll post some more tutorials soon.

    I'm still no closer to figuring out how the scripts work in the maps. I have however identified key data in them which can at least allow basic editing. For example in the agate village map the script for the man who gives you berries clearly has the item ids of each of the potential berries in a clear pattern. you could probably change this to any berry (maybe even any item) very easily.

    [EDIT:] I've found the actual pokespot data in common_rel. I've also successfully edited textures. This is all documented here:

    -Info-dump'>http://projectpokemon.org/forums/showthread.php?46590-Pokemon-xD-Info-dump


    EDIT: wow it's been a long time since these days but pretty much everything here has been reverse engineered. We've come a long way.

  21. If you decompress the pokeface.fsys you'll find all the faces. Charizard is number 6. All the title screen textures, including the pikachu, are in title.fsys. I tried just about every combination of options. I'm pretty sure I shifted to the right start which i believe is 0x80.

    On the bright side, I just managed to implement the physical/special split in xD! I've also found the weakness/resistance type table. So lots of progress.

  22. Have you figured the compression they're using on the game disc ? That's something I have been struggling with back when I was attempting to reverse it. Though I didn't really dig very deep into the file system.

    Then PMD2 came up, and I switched all my attention on that xD

    As for the textures, I've dealt with several image formats in the past, so I might be able to see if I can't do something about it. Also, a good tool to work with several texture formats IMO is Tileggd. You can change endianess and the pixel format, work with palettes, change the offset to begin reading the image at, and etc.. It should work with a lot of formats.

    Moreover, if you've got some nice info on Pokemon XD/Colosseum, you might want to ask Alpha to get access to the wiki and write that over there ? I could probably even give you a hand on the wiki, since I'm an editor. And I'm about to make another info dump for PMD anyways.

    So I've been running some files which I suspected to be textures through TiledGGD and I've got this far:

    colosseum textures.rar

    I've dumped textures from the game using dolphin previously so I knew the kinds of things I was looking for and from the file names I had a pretty good idea where things would be.

    As you can see in the attached image, you can kind of see the textures (an egg, charizard's party sprites in regular and shiny and pikachu). I've also found many other textures from the game but I can't seem to get any of them to display properly.

    Does anyone have any tips?

    colosseum textures.rar

×
×
  • Create New...