TUTORIALS: How to mod Resident Evil 2

Moderators: pcwzrd13, deluxux, VasiliyRS

Green Ranger
killer
Posts: 267

Re: Modding Tutorials: Resident Evil 2

Post#11 » Tue May 17, 2022 12:44 am

EDITING NON-PLAYABLE CHARACTERS (NPCs)

What you'll need-

BIOFAT version 06.23.2011 (download link provided at the end of this tutorial)
A Hex Editor (Such as Hex Workshop)
AdtTools (download link provided at the end of this tutorial)

Next we're going to look at NPCs- these are non-playable characters such as enemies and human characters during cutscenes. While PLDs are the file format for playable character models, TIM files are used for the cutscene versions. Enemies also use TIMs, all of which are located in PL0>EMD0 (Leon's Disc) and PL1>EMD1 (Claire's Disc) folders.

Here's where the Dreamcast Port of Resident Evil 2 differs from the Playstation and PC versions. These platforms use an EMD & TIM file for each NPC. The EMD houses a character model while the TIM houses its textures. If you wanted to view the model outside of the game you could simply open the EMD in RE2MV, provided the TIM texture file is in the same folder.

On the Dreamcast however, each NPC only has a single file- a TIM file, so by itself it won't open on RE2MV. This is deceptive however because on the Dreamcast those TIMs aren't actually texture files- they're ADT archives which, when decompressed into a RAW file, contain both the EMD and TIM data you'd normally find in the Playstation and PC versions.


PART 1

Because of this we need to decompress the Dreamcast TIMs before any editing can occur. In the following example, we'll use the Zombie Dog (file EM020 on Leon's Disc, file EM120 on Claire's).

NPC image 1.jpg


Change the file's extension from EM020.TIM to EM020.ADT. Open up BIOFAT version 06.23.2011 and in the menu, click on Bio2>ADT>Decompress

NPC image 2.jpg


Select EM020.ADT, resave it as EM020.RAW. We now have to hex edit the RAW file in order to separate both the EMD and TIM from it.

Open Hex Workship and drag EM020.RAW into the window. The first 4 bytes tell us the filesize of the TIM texture while the other 4 bytes tell us the filesize of the EMD. Highlight the first 4 bytes and note the values at unit32 to the right by the arrow- this is the filesize of the TIM texture, 66592.

NPC image 3.jpg


Highlight the next 4 bytes right after and you'll get the filesize of the EMD.

NPC image 4.jpg


Byte 9 is the start of the TIM file. At the 9th byte, hold down Shift and use the PgDn or down arrow key to highlight and select the bytes until you reach 66592. Copy and save this selection into a separate file, named EM020.TIM.

In the screenshot above you'll see the EMD size is 121144. Immediately after the TIM's 66592 selection is the start of the EMD file, so hold down Shift at this point and the PgDn or down arrow key till you hit 121144. Copy that selection and save it as EM020.EMD.

With your newly saved EM020.EMD and EM020.TIM, open it in RE2MV and you'll finally be able to view the Dreamcast model!

NPC image 5.jpg


Now you can edit it however you want using the suggestions found in my first tutorial- export/replace the texture, export parts to Blender to edit, etc. Once you're happy with how your edited dog looks, save in RE2MV (viewtopic.php?f=52&p=165092#p165092).


PART 2

We now have to get the data from your newly saved EMD and TIM into the RAW file. Note that whatever changes you make, the filesize for your newly saved EMD or TIMs may have changed. For this example, I'm going to replace the default zombie dog with an alternate dog by Enrico Marini. Not only does it have different textures, it has a different model too.

NPC image 6.jpg


Use the Hex editor to open both the EMD and the TIM you intend on placing into the RAW file. Hit Ctrl+A then Ctrl+C to select and copy all the bytes in the TIM file. Pay attention to the selected bytesize at the bottom which is thankfully the same size as the TIM data in the RAW.

NPC image 7.jpg


Go back to your RAW file and select the original TIM bytesize area of 66592 . Overwrite it with the new data found in the EM020.TIM. The texture swap is now complete.

Now do the same with the EM020.EMD (Ctrl+A then Ctrl+C to select and copy all the bytes). You'll notice however the EMD filesize differs from the EMD numbers found in the RAW file- 123528 vs the original 121144.

NPC image 8.jpg


Overwrite the original EMD data in the RAW file with the new EMD data. Because the EMD file sizes differ, we'll need to modify byte 5-8 to let the file know there's a difference, otherwise the game will crash while trying to read it. Since the new size is 123528, we have to convert it to hexadecimal. Use this site if necessary- https://cryptii.com/pipes/integer-encoder

Once you've selected '32-bit unsigned integer' as the decimal format and the byte order as 'Little-endian', place the 123528 in the 'Text' column to the right. It'll convert it to the hexidecmial '88 e2 01 00'.

NPC image 9.jpg


In the RAW, replace byte 5-8's '38 D9 01 00' with '88 e2 01 00'. Now the file is aware the EMD's size has changed.

Save the RAW. We're almost done.


PART 3

Now we have to recompress the RAW back into an ADT. For this we'll need AdtTools. Make sure you have the CMD command prompt application, the RAW file and AdtTools all in the same folder. Open CMD.exe then type this command to compress the RAW file back into a Dreamcast TIM-

AdtTools e EM020.RAW EM020.TIM

And you're good to go! Place it back in the EMD folder of the Leon or Claire disc (if Claire Disc, rename it from EM020 to EM120), recompile the game image and test it on your Dreamcast console or Dreamcast emulator. :)



PART 4

For a detailed list on what files correspond to the NPCs, see below. There are the same across all platforms- PC, Playstation and the Dreamcast. This list is provided by the RE Modification site- http://re123.bplaced.net/board/viewtopic.php?f=11&t=35

**NOTE- For Leon's Disc his NPCs are all begin with 'EM0'- so the RPD zombie cop (shown as '10' below) in Leon's game would be EM010.TIM. Claire's Disc NPCs all begin with 'EM1' so her RPD zombie cop would be EM110.TIM.

Entities
10 - ZOMBIE - RPD COP
11 - ZOMBIE - BRAD VICKERS
12 - ZOMBIE - CIVILLIAN
13 - ZOMBIE - PROSTITUTE
14 - (unused - you can place a zombie here)
15 - ZOMBIE - UMBRELLA TEST SUBJECT
16 - ZOMBIE - UMBRELLA SCIENTIST
17 - ZOMBIE - NAKED
18 - ZOMBIE - CIVILLIAN
19 - (unused - you can place a zombie here)
1A - (unused - you can place a zombie here)
1B - (unused - you can place a zombie here)
1C - (unused - you can place a zombie here)
1D - (unused - you can place a zombie here)
1E - ZOMBIE
1F - ZOMBIE - COMBO PACK
20 - CEREBRUS - ZOMBIE DOG
21 - CROW
22 - LICKER - RED
23 - ALLIGATOR
24 - LICKER - GRAY
25 - SPIDER
26 - BABY SPIDER
27 - BIRKIN MUTAGENIC GOO
28 - BIRKIN OFFSPRING - CROTCH HUGGER
29 - COCKROACH
2A - TYRANT STAGE 1
2B - TYRANT STAGE 2
2C - TYRANT’S ARM
2D - ZOMBIE ARMS
2E - GREEN IVY
2F - IVY TENTACLES
30 - BIRKIN MUTATION - STAGE 1
31 - BIRKIN MUTATION - STAGE 2
33 - BIRKIN MUTATION - STAGE 3
34 - BIRKIN MUTATION - STAGE 4
36 - BIRKIN MUTATION - FINAL STAGE
37 - BIRKIN STAGE 5 TENTACLE
38 - BIRKIN STAGE 5 TENTACLE
39 - IVY - PURPLE
3A - GIANT MOTH
3B - MAGGOTS
3E - ROBOTIC ARM IN THE LAB - OBJECT
3F - POWER GENERATOR - OBJECT
40 - CHIEF IRONS I
41 - ADA WONG I
42 - CHIEF IRONS II
43 - ADA WONG II
44 - BEN BERTOLUCCI I
45 - SHERRY BIRKIN - WITH PENDANT
46 - BEN BERTOLUCCI II
47 - ANNETTE BIRKIN I
48 - ROBERT KENDO
49 - ANNETTE BIRKIN II
4A - MARVIN BRANAGH (it's a NPC, needs special codes to work as a zombie)
4B - MAYOR’S DAUGHTER - OBJECT ONLY
4C - (unused, you can place a NPC here, but doesn't have hitbox)
4D - (unused, you can place a NPC here)
4E - (unused, you can place a NPC here, but doesn't have hitbox)
4F - SHERRY - WITH CLAIRE VEST
50 - LEON S. KENNEDY - RPD ARMOR
51 - CLAIRE REDFIELD - ORIG. OUTFIT
52 - (unused Leon slot, you can place a NPC here)
53 - (unused Claire slot, you can place a NPC here)
54 - LEON S. KENNEDY - BANDAGED
55 - CLAIRE REDFIELD - NO VEST
56 - (unused Leon slot, you can place a NPC here)
57 - (unused Claire slot, you can place a NPC here)
58 - LEON S. KENNEDY - CAP & TANK TOP
59 - CLAIRE REDFIELD - COWGIRL OUTFIT
5A - LEON S. KENNEDY - BLACK LEATHER
5B - (unused Claire slot, you can place a NPC here)


You can find necessary tools here-

BIOFAT version 06.23.2011- http://remer.bplaced.com/remer_files/res_index.php
AdtTools by PmData.rar
(116.39 KiB) Downloaded 239 times
Last edited by Green Ranger on Tue Jul 26, 2022 11:36 pm, edited 11 times in total.

Green Ranger
killer
Posts: 267

Re: Modding Tutorials: Resident Evil 2

Post#12 » Tue May 17, 2022 1:45 am

xaeroxcore wrote:
Green Ranger wrote:
xaeroxcore wrote:I followed instructions but the cdi isn´t being recognized by redream (it does not even appear on the folder when searching with library option on Redream. Tried to drag cdi to redream, and it says WinCE not currently supported. Burned it to test it on real DC, and it reboots automatically after SEGA and Greenranger logo :(. Probably did something wrong, but don´t know what. Heeeeelp please!


What program did you use to compile your CDI? If using Bootdreams, for Disc format set it to 'Data/Data'. When you click 'Process' it'll then ask if you want to scramble the WinCE binary- select 'No'.


Yes, i'm using Bootdreams and using the settings described by you...not working :(. Same error. May be am i doing something wrong extracting the files with GD Rom explorer or replacing the models. I´m using the CDI of your RE 2 Special Edition...or maybe i have to use the vanilla RE 2?

Without more info it'll be difficult to determine where you went wrong. Let me know what you did step by step in order for us to figure it out. PM me if necessary.

xaeroxcore
fire
Posts: 78

Re: Modding Tutorials: Resident Evil 2

Post#13 » Wed May 18, 2022 11:01 am

Green Ranger wrote:
xaeroxcore wrote:
Green Ranger wrote:
What program did you use to compile your CDI? If using Bootdreams, for Disc format set it to 'Data/Data'. When you click 'Process' it'll then ask if you want to scramble the WinCE binary- select 'No'.


Yes, i'm using Bootdreams and using the settings described by you...not working :(. Same error. May be am i doing something wrong extracting the files with GD Rom explorer or replacing the models. I´m using the CDI of your RE 2 Special Edition...or maybe i have to use the vanilla RE 2?

Without more info it'll be difficult to determine where you went wrong. Let me know what you did step by step in order for us to figure it out. PM me if necessary.


Thanks in advance!

So i´m going step by step.

1. Use GD Rom explorer: open you cdi of RE Special Editiom
2. Copy or extract files from the iso to my PC.
3. Replace the PL00.PLD original with PL00.PLD from the HD Leon, in to the PLD folder. This obviously on a saved folder on windows, cuz GD Rom explorer does not allow me to replace directly on the app....or if it allows, i don´t know how)
4. Take that folders and stuff and use bootdreams to create the cdi, puttin data/data on settings and selecting no on the Wince option that pops up.

What am i missing?

Green Ranger
killer
Posts: 267

Re: Modding Tutorials: Resident Evil 2

Post#14 » Fri May 20, 2022 2:51 pm

xaeroxcore wrote: Thanks in advance!

So i´m going step by step.

1. Use GD Rom explorer: open you cdi of RE Special Editiom
2. Copy or extract files from the iso to my PC.
3. Replace the PL00.PLD original with PL00.PLD from the HD Leon, in to the PLD folder. This obviously on a saved folder on windows, cuz GD Rom explorer does not allow me to replace directly on the app....or if it allows, i don´t know how)
4. Take that folders and stuff and use bootdreams to create the cdi, puttin data/data on settings and selecting no on the Wince option that pops up.

What am i missing?


GDI Explorer.jpg

So you copied everything shown above that's highlighted from the CDI into a folder on your computer, then replaced the PL00.PLD in the PLD folder, then pointed Bootdreams to that folder in order to re-compile the image?

If so, it sounds like you're doing things correctly. Let's take a look at the next step then- how you're burning the disc. Are you using Discjuggler or IMGBurn? If using the former, try using IMGBurn with the CDI plugin instead to get successful burns.

xaeroxcore
fire
Posts: 78

Re: Modding Tutorials: Resident Evil 2

Post#15 » Sun May 22, 2022 10:07 pm

Green Ranger wrote:
xaeroxcore wrote: Thanks in advance!

So i´m going step by step.

1. Use GD Rom explorer: open you cdi of RE Special Editiom
2. Copy or extract files from the iso to my PC.
3. Replace the PL00.PLD original with PL00.PLD from the HD Leon, in to the PLD folder. This obviously on a saved folder on windows, cuz GD Rom explorer does not allow me to replace directly on the app....or if it allows, i don´t know how)
4. Take that folders and stuff and use bootdreams to create the cdi, puttin data/data on settings and selecting no on the Wince option that pops up.

What am i missing?


GDI Explorer.jpg
So you copied everything shown above that's highlighted from the CDI into a folder on your computer, then replaced the PL00.PLD in the PLD folder, then pointed Bootdreams to that folder in order to re-compile the image?

If so, it sounds like you're doing things correctly. Let's take a look at the next step then- how you're burning the disc. Are you using Discjuggler or IMGBurn? If using the former, try using IMGBurn with the CDI plugin instead to get successful burns.


Haven´t tried tu burn another CD-R, because the image re-compiled by boot dreams is no even recognized by ReDream.

Green Ranger
killer
Posts: 267

Re: Modding Tutorials: Resident Evil 2

Post#16 » Wed May 25, 2022 10:36 pm

xaeroxcore wrote: Haven´t tried tu burn another CD-R, because the image re-compiled by boot dreams is no even recognized by ReDream.


What version of Bootdreams are you using and what's your operating system?

Green Ranger
killer
Posts: 267

Re: Modding Tutorials: Resident Evil 2

Post#17 » Sun May 29, 2022 4:49 pm

EDITING CHARACTER SPEECH

Character dialogue can be edited in the game. If you'd like to change or add new audio, here's how-

Such files have the .SAP file extension. Character speech files are found in the PL0>VOICE folder for Leon's Disc and the PL1>VOICE for Claire's Disc.

This link provides a list of what most of the voice files are, helping you take out much of the guesswork-
http://re123.bplaced.net/board/viewtopic.php?f=11&t=314

To preview the audio, you can convert SAP files to WAV files and listen to them in VLC media player to determine what the audio is and if you'd like to replace it. You have 2 ways of doing this-

a) open up a SAP file in a Hex Editor (like Hex Workshop) and delete the SAP header which is the first 8 bytes- 01 00 00 00 00 00 00 00

SAP 1.jpg

Resave the file as a WAV then play it in VLC media player. Or,


b) use Nova (Audio) Software Extractor to extract the WAVs from the SAP files. If using this method, you'll see the audio format for each- 22050 Hz, 16 bit, Mono, Yamaha ADPCM. Keep these specifics in mind.

SAP 2.jpg

Once you've determined the audio you want to replace, create/edit your own audio clip and save it as a WAV file in 22050 Hz (or 22.050kHz), 16 bit Mono PCM (Microsoft Wave file). You can use whichever sound editor works best for you.

After that, you'll need to resave the WAV file as a (Dreamcast) Yamaha Wav file. Use Wav2adpcm to accomplish this. When opened, use this command-

wav2adpcm -t <infile.wav> <outfile.wav>

'Infile' being the name of the file you're converting, and 'outfile' being the name of the completed converted file.

Finally, the WAV needs to be a SAP file so the game can read it. Open the newly saved Yamaha WAV file in a Hex Editor and reinsert the 8 bytes that make up the SAP header at the beginning of the file- 01 00 00 00 00 00 00 00

SAP 3.jpg

Save as a SAP file. And now you're done! Place the file(s) back into its original folder and compile your game image!


Below is an example of this mod in my YouTube video, showing character dialogue being changed/replaced with new audio. The 'Before' segment shows the original convo between Leon and Marvin, while the 'After' segment showcases new lines and rearranged speech.




Grab VLC here-
VLC media Player (portable version)- https://portableapps.com/apps/music_video/vlc_portable
Last edited by Green Ranger on Sat Jun 18, 2022 1:18 am, edited 11 times in total.

Green Ranger
killer
Posts: 267

Re: TUTORIALS: How to mod Resident Evil 2

Post#18 » Sun May 29, 2022 5:11 pm

A new tutorial is up but I'm having a slight problem with linking. How do you set up links to open specific posts on a thread instead of them taking the user to the top of the page?

User avatar
fafadou
Gold Lion
Posts: 1653

Re: TUTORIALS: How to mod Resident Evil 2

Post#19 » Mon May 30, 2022 5:02 am

I never find it but maybe if you select copy link on the post number :

viewtopic.php?f=52&p=165698#p165699

Green Ranger
killer
Posts: 267

Re: TUTORIALS: How to mod Resident Evil 2

Post#20 » Mon May 30, 2022 4:18 pm

fafadou wrote:I never find it but maybe if you select copy link on the post number :

https://www.dreamcast-talk.com/forum/vi ... 98#p165699


That did it! I was missing the '#p(post number)' tag at the end of my links. Thanks so much fafadou. :)

  • Similar Topics
    Replies
    Views
    Last post

Return to “Modifications”

Who is online

Users browsing this forum: No registered users