ROM Hack YGO World Championship 2008 CPU Opponent Editing

g00dman

Member
OP
Newcomer
Joined
Feb 22, 2017
Messages
13
Trophies
0
Age
28
XP
116
Country
Hiya, I've been trying to edit the CPU opponents in YGO World Championship 2008 since I've gotten pretty bored of the default CPU opponents.

I posted on here a while ago about figuring out the deck files, and I can easily replace those and duel against custom decks. I also know where the decks' names are stored so I can change those as well (although I'm not sure if I'd have to repoint stuff if I made the deck's name longer than the default or something...)

However, I wanted to go a step further and figure out how to change other stuff like the appearance of the character and other things about them. I've been looking through the files in Crystal Tile but I'm really not sure what I'm supposed to be looking for. I think it must be compressed somewhere and I'm not sure where to look.

Any help would be greatly appreciated!

EDIT: While I'm at it it could also be interesting to know how to edit the duelist ghosts within the save file itself, which could potentially be easier... I can actually find the data in the .sav file (it starts at offset 33000), and a lot of the data is right there. However, I've tried editing simple things like the name of the deck, and then when I save the file and import it to Desmume, the ghosts won't show up any more. I found that offsets 33004 to 33007 contain some hex data which changes when deleting different ghosts, so I think there might be some kind of verification check for the ghosts involved with that.
 
Last edited by g00dman,

g00dman

Member
OP
Newcomer
Joined
Feb 22, 2017
Messages
13
Trophies
0
Age
28
XP
116
Country
Oh, here's a SAV file as an example... Let me know if this isn't allowed to be posted on here. I've figured out what most of the related hex offsets for duelist ghosts are but some are a mystery. I'd mess around and edit them and find out, but I can't because if you change anything at all the ghosts don't appear any more...
 

Attachments

  • yugioh2008.zip
    10 KB · Views: 285

g00dman

Member
OP
Newcomer
Joined
Feb 22, 2017
Messages
13
Trophies
0
Age
28
XP
116
Country
Apologies for a triple post! I don't think this forum allows you to delete messages... But I've found where the enemy duelists' stats are stored as well as a file where it defines what deck is assigned to what character. If you change the hex addresses around you can change which decks they have. However, it seems that the list of characters available in Free Duel mode is hard-coded in somewhere, but I'm having trouble finding where.
 

SetoKaiba

Member
Newcomer
Joined
Nov 29, 2019
Messages
6
Trophies
0
Age
28
XP
58
Country
United States
I don't know about modding,but im in to see where this goes to,weird to see how little hacking there is in Yugioh games
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,795
Trophies
5
XP
28,518
Country
United Kingdom
I quite often encounter people wanting to change decks in computerised versions of collectible card games.

It is frequently a bad path to take if you aspire to play against CPU opponents and have them even be in line with the generally feeble nature of most such games under normal conditions. This is as AI play of such games is terrifically difficult (chess tends to be the domain of super computers to beat moderately talented humans, things like go beyond that by some way and CCGs would be to the go AI algorithm what a tic tac toe/noughts and crosses solver would be to those) and it is only by limiting both your deck and having the AI be known combos that something approximating a useful game could happen, never mind on a handheld powered by a CPU that would have been outdated about the time smartphone became a word in popular vocabulary.
A favourite article covering the struggles of AI in playing such things
https://magic.wizards.com/en/articles/archive/duels-planeswalkers-all-about-ai-2014-02-13

It is not because the devs are stupid, mean or clueless of demands that they don't provide customisation options (indeed not providing them is almost an active measure/extra coding) but because physics say no if you want to play against AI.
Challenge is then better served by handicapping yourself -- start with less health, CPU stats with more, some kind of drag on your play options, CPU having some measure of xray glasses, purposely nerfing your deck a bit (lesser cards, stuffing them to make drawing good cards less likely), giving yourself a turn limit...
It is not impossible to recode the AI to do more but if you can do that then this changing contents of a deck (though curious to see someone like the OP be able to do that and struggle with graphics) is as nothing, though as a hint then contents of deck is nothing more than an inventory and can be approached the same way.
 

Paulinho66

New Member
Newbie
Joined
Aug 15, 2022
Messages
3
Trophies
0
Age
29
Location
Brazil
XP
30
Country
Brazil
I quite often encounter people wanting to change decks in computerised versions of collectible card games.

It is frequently a bad path to take if you aspire to play against CPU opponents and have them even be in line with the generally feeble nature of most such games under normal conditions. This is as AI play of such games is terrifically difficult (chess tends to be the domain of super computers to beat moderately talented humans, things like go beyond that by some way and CCGs would be to the go AI algorithm what a tic tac toe/noughts and crosses solver would be to those) and it is only by limiting both your deck and having the AI be known combos that something approximating a useful game could happen, never mind on a handheld powered by a CPU that would have been outdated about the time smartphone became a word in popular vocabulary.


It is not because the devs are stupid, mean or clueless of demands that they don't provide customisation options (indeed not providing them is almost an active measure/extra coding) but because physics say no if you want to play against AI.
Challenge is then better served by handicapping yourself -- start with less health, CPU stats with more, some kind of drag on your play options, CPU having some measure of xray glasses, purposely nerfing your deck a bit (lesser cards, stuffing them to make drawing good cards less likely), giving yourself a turn limit...
It is not impossible to recode the AI to do more but if you can do that then this changing contents of a deck (though curious to see someone like the OP be able to do that and struggle with graphics) is as nothing, though as a hint then contents of deck is nothing more than an inventory and can be approached the same way.

I understand what you say friend but i do want to play with another type decks on the game.
If g00dman was capable of doing it i want to try too.
 

UsernameUsername

New Member
Newbie
Joined
Jul 19, 2023
Messages
1
Trophies
0
Age
29
XP
12
Country
Australia
I ended up on this forum while trying to search for ways to modify AI decks. Unfortunately, I couldn't get as far as to modify character appearances as OP g00dman desired, but I did manage to change AI decklists and deck names and so I'll leave my method here for anyone else who is curious. This isn't some optimal method or anything close to one, but it was sufficient for changing decklists (including fusion decks) and deck names. Obviously the AI isn't the smartest player around, but replacing weak AI decks can make the game more entertaining since you no longer auto-win due to the AI playing a bunch of do-nothing cards. You can see how the AI performs with a custom decklist in the Recipe Duel mode anyway.

[Required software]
- a hexadecimal editor with addresses and a search capability
- a ROM opener/editor
I used Tinke for the ROM editor and Visual Studio Code with some random Hexadecimal editor plugin for general hexadecimal editing. I don't know if these are optimal/safe/secure but they're what worked for me. I'm also unfamiliar with different versions of the WC2008 ROM and how these various versions might affect the deck changing process.

[Relevant files within ROM]
- root/Data_arc_pac/deck.pac - where CPU decklists are stored
- root/Data_arc_pac/bin2.pac - where CPU deck names are stored

[Relevant files elsewhere]
- Your game save file (don't forget to make backups)

[Things to remember]
- Within the game files, each individual card is represented using four hexadecimal characters, such as 7C 13 for Dust Tornado. Therefore, a deck that has three copies of Dust Tornado will contain the sequence 7C 13 7C 13 7C 13 when represented in the game's files. Each line of hexadecimal contains thirty-two characters, and each card requires four characters, so each line of hexadecimal stores eight full cards, i.e. the four characters for a card aren't split over multiple lines. Be careful that, when you're looking for a particular card, you don't accidentally count the end of one card and the start of the next as being your desired card. For example, 7C 13 7C 13 is two Dust Tornado, but you might accidentally use the 13 7C between those cards and think it's a card that you are looking for. Again, each line contains eight full cards of four characters each, so use the position of the characters to ensure that you're not grabbing the end of one card and the start of the next.

============================================================

1. Create a recipe containing the deck that you want the AI to use. You can use up to 80 cards and up to 20 fusion cards. I don't know if decks with fewer than 40 cards are possible. You can't include a side deck to my knowledge. Save it under a name that you'll remember.

=== Finding the Location of a Specific CPU Deck in the ROM files ===

2. Decide which existing CPU deck you want to replace, e.g. Dark Zane's Underworld Deck. Testing to see whether your modifications are successful is easy for the 13 or so pages of opponents listed under CPU duel since the game will freeze on the opponent selection screen if you make a mistake. I don't know if something similar exists for other AI in the game. AI deck names have different length limits within the game files. The length limit is similar to the existing name for that deck.

3. Find a text-based compilation of all the CPU decklists online. I don't know if external links are allowed here, but if you search for "Yu-Gi-Oh! World Championship 2008 – CPU Opponent Deck List" you should be able to find one by someone called Munckeyz.

4. Identify a group of cards that is unique to the deck that you want to replace. This group of cards will be used to isolate the deck within the game files, so the group of cards must be sufficient to identify the deck when it's alongside every other AI deck. The overall process is simpler if you find the smallest group of cards that is unique to the deck.

For example, only two decks contain the card "Cyberdark Impact!" - the Armed Dragons deck of Cyberdark Dragon and Dark Zane's Underworld Deck. However, Dark Zane's deck also contains Dust Tornado whereas the Armed Dragons deck does not. In other words, there is only one AI deck that contains both Cyberdark Impact AND Dust Tornado. Therefore, the cards Cyberdark Impact and Dust Tornado are sufficient to identify Dark Zane's deck in the game files.

If there is a card that is only contained within a particular deck, such as Silver Fang in Stray Lambs' Like Two Heads deck, then only that single card is needed. However, if a deck doesn't contain many unique cards and instead only contains a bunch of generic staples like Heavy Storm, Bottomless Trap Hole, Call of the Haunted, etc, then you may need to determine several cards before that group of cards is unique to the deck that you want to change. Again, using the lowest quantity of cards makes this easier, so it would be better to represent Dark Zane's deck using the two cards Cyberdark Impact and Dust Tornado instead of the four cards Cyber End Dragon, Dust Tornado, Crush Card Virus and Mechanicalchaser.

5. Create and save a deck recipe containing the unique identifier cards. Since you won't be able to tell which card is which within the save file (they're represented in hexadecimal), I recommend including one copy of the first card, two copies of the second card, three copies of the third card, and repeating this in another recipe for additional cards. Unlike the card names, the recipe names will be readable in the save file, so name the recipes something you will recognize. When the recipes are created, save your game.

6. Open (a copy of) your save file using your hexadecimal editor and scroll to address ~00010000 which is where your deck recipes are stored. Your hexadecimal editor should have the titles of your recipes visible. Recipes are separated by a chunk of FF FF FF FF. The first few lines contain the recipe name and some other unneeded data. The end of the fourth line for each recipe contains the first two cards of the deck, such as 9B 11 9B 11. After all of the cards in the deck are listed, there is a bunch of 00 00 00, followed by the fusion deck if one is in the recipe. More on that later. For now, find the recipe containing your unique cards, and using the amount of times each card is listed (e.g. once, twice, three times), determine the four characters that represent each of the unique cards.

7. Using the ROM editor, enter the game files and open root/Data_arc_pac/deck.pac as a hexadecimal file. Decks are stored somewhat similar to in the save file, i.e. in blocks. Using the search functionality, search for the least common of the unique cards using the hexadecimal characters from the previous step. Once you've found a deck that contains one of the unique cards, note the approximate address of the deck. Then, search for the next least common unique card and see if it is also present in this deck. Continue to use the unique cards in this way until you find the deck that contains all of the unique cards. Write down the approximate starting address of this deck, and also record the starting address of the next deck in case you accidentally move it later.

=== Replacing the CPU Deck ===

8. In your save file, find the hexadecimal section that corresponds to the deck that you want to replace the AI deck with. Again, the actual cards start being listed at the end of the fourth line for the deck, whereas the first three lines and the start of the fourth line are used for other data that isn't needed yet. Two cards (eight characters total) are positioned at the end of the fourth line, whereas each line after contains up to eight cards (thirty-two characters total). After the maindeck cards, there's a buffer of 00 00 00 00, followed by the fusion deck. Take a mental note of where the maindeck and fusion deck are, since these will be copied over the respective sections in the AI decklist file.

9. Back in the AI deck file, where you found the section of hexadecimal that contains the AI deck that you want to replace, the data is stored a little differently to the save file. It's stored in the format:
XX XX XX XX XX XX XX XX NN 00 C1 C1 C2 C2 C3 C3

XX XX etc is not needed. NN is where the deck length is stored in hexadecimal. 28 is a deck size of 40 cards, 29 is a deck size of 41 cards, 50 is a deck size of 80 cards. If you know the size of the maindeck that you'll be replacing the AI deck with, you can manually convert that quantity to hexadecimal and replace the characters NN with 28 representing 40 cards for example. Alternatively, you can use the first two characters of the fourth line of the recipe in the save file, since the maindeck size is stored here as well. If you do not use the correct number then your deck will not load properly.

C1 C1 C2 C2 C3 C3 is where the first 3 cards of the maindeck are stored. The next few lines each contain 8 cards as usual, until the main deck ends.

Immediately after the maindeck cards are listed, there is a four character separator of the format YY 00, which specifies the number of cards that are in the fusion deck. For example, 03 00 is the separator before a fusion deck containing 3 cards, whereas 0C 00 is the separator for a 15 card fusion deck. After the separator, the fusion deck is listed. If a deck has no fusion deck then it will not contain a separator.

Take a mental note of where these sections are. Also, if you haven't already, write down the starting address of the next AI deck within the AI deck file, in case you nudge it up or down.

10. Using the copying method of your choice (I did line by line, character by character), replace the maindeck of the AI deck in the AI deck file with the cards from your save file. Depending on your hexadecimal editor, you may end up inserting new characters instead of replacing existing ones, so check to ensure that the overall format of the AI deck file isn't being changed.

When you've finished replacing the AI's maindeck, if your new deck contains a fusion deck, add the appropriate fusion separator, such as 05 00 for a 5 card fusion deck. Then, in your save file, the fusion deck is listed in the final five lines before the buffer of FF FF FF FF before the next deck. The first line containing the fusion deck contains four cards (sixteen characters), and the rest of the fusion deck is listed immediately after. Copy the cards from the fusion deck in your save file into the AI deck file, immediately after the separator.

After all of the cards in your recipe have been added into the AI deck file, the rest of the characters are 00 00 00 00 until the line where the next deck begins. Ensure that the next deck starts on the same line that it did before you made any changes, and add or remove 00 00 00 00 until it is in the correct location.

11. Save any changes that you make and export the ROM if necessary so that you'll be launching the game using the new modified ROM.

=== Testing the Changes ===

12. Open the game, select CPU duel, and select the portrait of the AI whose deck you replaced. If you made an error, the game will freeze when you select their portrait. Otherwise, everything should be good to go. You might need to play against the new deck a few times to make sure there weren't any errors when copying the deck lists over.

=== Changing the AI Deck Name ===

13. AI deck names are stored in root/Data_arc_pac/bin2.pac . Use a search functionality to find the current name of the AI deck. AI decks have different length limits that I don't know how to change. Make sure that the starting position of the next deck's name doesn't move when you make changes. With this in mind, your hexadecimal editor should let you directly modify the deck name within the decoded text, and it should convert to hexadecimal automatically. If you have space after your new name and before the start of the next deck's name, you can pad it with 00 00 00.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    She is speedrunning how much she can scam out of her fans. This is what fame does to a mofo.
  • Veho @ Veho:
    People didn't expect her to pump-and-dump them.
    +2
  • The Real Jdbye @ The Real Jdbye:
    people never expect to be pump and dumped
  • The Real Jdbye @ The Real Jdbye:
    people are stupid
  • The Real Jdbye @ The Real Jdbye:
    people don't truly understand what a pump and dump is they think "i just need to sell before it dumps"
  • Veho @ Veho:
    Sex.
  • Veho @ Veho:
    People don't understand crypto is inherently worthless and expect any new coin to come out to explode the way Bitcoin did. Protip: they won't.
  • Veho @ Veho:
    It's not an investment opportunity, it's a lottery. It's a ticket with a very very very small chance of winning big, and an almost certainty of losing.
  • Veho @ Veho:
    So if you want to dabble in crypto, buy a dollar's worth and wait. Don't fucking "invest" in it, it's literally nothing.
  • The Real Jdbye @ The Real Jdbye:
    you can invest in the "trusted" cryptocurrencies
  • The Real Jdbye @ The Real Jdbye:
    everything else is not worth it
  • The Real Jdbye @ The Real Jdbye:
    but people don't wanna invest, they wanna get rich quick
  • A @ anotherthing:
    I'm one of those crazy paranoid people who think bitcoin is only valuable while they need the processing power of all those miners.
  • Veho @ Veho:
    You can't invest in trusted cryptocurrencies, they are all too volatile.
  • The Real Jdbye @ The Real Jdbye:
    100 bucks (or whatever) for a small chance to get rich seems worth it to a lot of people
    +1
  • The Real Jdbye @ The Real Jdbye:
    you say that but on average they have only been going up
    +1
  • The Real Jdbye @ The Real Jdbye:
    what people don't get is investing is a long term commitment, you can't sell at the first dip
    +1
  • The Real Jdbye @ The Real Jdbye:
    that's how you lose money
    +1
  • The Real Jdbye @ The Real Jdbye:
    and "get rich quick" schemes never work
    +1
  • Veho @ Veho:
    On average most of them failed before anyone even heard of them.
    +2
  • Veho @ Veho:
    They offered to replace it with a pair of rollerblades.
    +3
  • BigOnYa @ BigOnYa:
    And a stair-master
    +2
  • SylverReZ @ SylverReZ:
    @The Real Jdbye, Don't forget Peter Popoff, he's been doing scams for decades since the 70's. Been busted many times. Surprised he hasn't been arrested yet.
    SylverReZ @ SylverReZ: @The Real Jdbye, Don't forget Peter Popoff, he's been doing scams for decades since the 70's...