PDA

View Full Version : [Tutorial] Turn Gen. IV interiors into 3D


Spiky-Eared Pichu
October 6th, 2011, 01:09 PM
Annoyed by the fact Gen. IV interiors (houses, shops and other buildings) are in 2D? Want to change that permanently and without a cheat device? If you want to do that, then this is your tutorial!

What you need:


A Generation IV Pokémon game (Diamond, Pearl, Platinum, HeartGold* or Soulsilver*)
DSLazy or another DS ROM unpacker/packer.
An Hex Editor (I'll be using HexWorkshop).

*Pokémon HeartGold and SoulSilver are unsupported at the moment. They use the same system for the 2D maps as DPPt, but they are more protected. I'll update the thread when possible.

Preparations:

Open your ROM with DSLazy (or the software you use with ROMs) and unpack your game to a folder.

Instructions:

Open the folder where you extracted the ROM. It should have two folders, "Overlay" and "Data"/"Root", as well as many .bin files. We are going to use arm9.bin to edit the 2D maps. Here's how Pokémon Diamond looks when extracted:

http://img18.imageshack.us/img18/1373/step1qa.png


Now open the file with your Hex Editor. You'll see lots of bytes. The data we want to edit starts at:


Pokémon Diamond and Pearl: 0xEEDC0 (or search for "70013B031200E803E803FFFF", it's the first coincidence)
Pokémon Platinum: 0xE6020 (or search for "910181031700E803E803FFFF", it's the first coincidence)
Pokémon HeartGold and SoulSilver: Unknown (not even sure if they are in arm9.bin)

This is how it appears in Diamond (cursor at the start of the section):

http://img831.imageshack.us/img831/5814/headersdiamond.png


Now that you have the start of the section we want to edit, take a look at these bytes in this picture (Pokémon Diamond, shouldn't be difficult to find the same in Platinum):

http://img404.imageshack.us/img404/57/diamondlocation.png


The second byte of those grups (sometimes 00, sometimes 04) is what we have to edit (adjust the view of the program to see the bytes more clearly). Those bytes tell the game which type of camera to use in each map, and for some reason GameFreak decided to employ a 2D-like camera inside the buildings during Generation IV. The maps are all 3D!!!

So, to change the camera to the standard 3D angle used outdoors, you have to replace all the bytes that are "04" with "00". But be careful, change only that column or you'll screw up the game!!! Also, there are a lot of maps (the picture only shows the first ones), so you'll have to replace a lot of data.

When you're done (remember to stop when the section ends, you'll know because the bytes change to random things), save the file. Repack your ROM with the software you're using, and enjoy!


Here's a sample of the result (ignore Brendan, it's a picture from my hack), as well as a picture from Diamond showing an unmodified interior (thanks to Pokémon Wikia for it):

http://img683.imageshack.us/img683/9956/mapcamera.pnghttp://images.wikia.com/pokemon/images/6/67/Day-Care_Checker_1.png



If you have any problems, please post here so I can help. Also, I'll try to have HeartGold and SoulSilver available as soon as possible.

Pingouin_7
October 7th, 2011, 02:33 PM
Amazing, I'll do that on a copy of Diamond, this'll make it more interesting to play.

Lord Varion
October 7th, 2011, 02:42 PM
It shouldn't be to hard to find for Heart Gold/ Soul Silver right?
The Goldenrod underground uses 3-D so can't you see the hex code for that ... and do it to the rest ... |: (you can tell I don't hex much)

Pingouin_7
October 7th, 2011, 03:11 PM
I'm wondering, though, we are supposed to stop as soon as it changes from 0004 to (I think it was 17C0), even though there are more 0004 after it?

Spiky-Eared Pichu
October 8th, 2011, 05:12 AM
@Nintendork15 It doesn't matter if the Goldenrod's Unerground is in 3D, because HGSS have data structured similarly to DPPt when it comes to define camera. Even BW still follow the pattern (a bit modified, though). The only problem I have is finding the file that stores that data in HGSS.

@Pingouin_7 If it changes to another value but it then changes again to 0004 and the rest of lines still follow a "pattern", go ahead and change more.

Team Fail
October 8th, 2011, 11:58 AM
That's interesting. I would have never thought it would be in the arm9.bin. I'll have to incorporate it into Aqua Sapphire.

Pingouin_7
October 8th, 2011, 02:53 PM
I changed the other values to 00 and it now works everywhere. Thanks!

Link_971
October 15th, 2011, 11:08 AM
If you give your autorisation, i can implant this function in my tool.

Full Metal
October 15th, 2011, 12:31 PM
This is a nice find and everything, but why does this work, and how did you figure it out? That could help us figure out / find the info for HG / SS, could it not?

Spiky-Eared Pichu
October 15th, 2011, 12:35 PM
This works because ALL the maps in Gen. IV are 3D, there are no 2D maps. The same way there's a byte that tells the game which music to play in a map, there's one that sets the camera type.

If you want to help, it's better to start analyzing the RAM while playing. Comparing the bytes that change between maps and so, you'll end up finding how they are stored, so you can then look for them in the ROM. It's a bit hard to explain :)

@Link_971 Feel free to implement it. But please give me credit (although I think it's already there, as the translator).

Link_971
October 17th, 2011, 04:47 AM
@Link_971 Feel free to implement it. But please give me credit (although I think it's already there, as the translator).


Thanks :)

It works for me too.
I need to know, if we edit all 0000 by 0004 - or another value - , we can edit camera of exteriors Maps, too?

Also, i think other values exists (Oreburgh Gym use a 3D lowered for example).
If you find another camera angles, please tell me :)


(I need to know all possibilities before implanting a function).

Spiky-Eared Pichu
October 17th, 2011, 05:29 AM
Yes, you can manipulate the camera at any map by this method, you just need to know what to write there (and for now I only know these values).

But by taking a look at all the strings and identifying each map, it'll be really easy to discover the values.

axlefoley
October 17th, 2011, 06:02 AM
i dunno if it just a case of I don't remember what the original looks like but I don't see anything different could you post a before and after picture?

Link_971
October 17th, 2011, 09:29 AM
Yes, you can manipulate the camera at any map by this method, you just need to know what to write there (and for now I only know these values).

But by taking a look at all the strings and identifying each map, it'll be really easy to discover the values.



Ok
Yeah, so each value = one Map?

I don't really think that because they are not many values, or maybe values are regrouped for each town.


And... If the camera values are in arm9, i think other data of header are in arm9 too (Weather, Map music, block border). Maybe we can find interesting things!

Zark
October 17th, 2011, 10:59 AM
Here are some file offsets arm9.bin flight zones, which are 4 bytes.
First two bytes are Coordinate X and the second two bytes are Coordinate Y:

0xF222C: Pueblo Hojaverde (Twinleaf Town)
0xF223C: Pueblo Arena (Sandgem Town)
0xF224C: Pueblo Aromaflor (Floaroma Town)
0xF225C: Pueblo Sosiego (Solaceon Town)
0xF226C: Pueblo Caelestis (Celestic Town)
0xF227C: Ciudad Jubileo (Jubilife City)
0xF228C: Ciudad Canal (Canalave City)
0xF229C: Ciudad Pirita (Oreburgh City)
0xF22AC: Ciudad Vetusta (Eterna City)
0xF22BC: Ciudad Corazón (Hearthome City)
0xF22CC: Ciudad Pradera (Pastoria City)
0xF22DC: Ciudad Rocavelo (Veilstone City)
0xF22EC: Ciudad Marina (Sunyshore City)
0xF22FC: Ciudad Puntaneva (Snowpoint City)
0xF230C: Liga Pokémon: Sur (Pokemon League: South)
0xF231C: Zona de combate (Fight Area)
0xF232C: Zona Sobrevivir (Survival Area)
0xF233C: Zona Descanso (Resort Area)
0xF234C: Parque Compi (Pal Park)
0xF235C: Liga Pokémon: Norte (Pokemon League: North)

Team Fail
October 17th, 2011, 01:58 PM
This can be of some help.

6. Motion3D

Code:
94000130 FDFF0000
DA000000 02000002
B21C4D28 00000000
B0000004 00000000
D7000000 0000150E
DC000000 FFFFFFFE
94000130 FFF70000
DA000000 00112F56
D3000000 00000000
D7000000 02000002
D2000000 00000000
-For Pkmn D/P only


Simply type in your Poktéch calculator the number of your desired camera perspective and press L + Start to save the number in the memory. Then hold L while going into a house (or getting out of it) for using that number.

:: Camera perspectives

00 - Basic 3D
04 - Basic 2D
05 - 3D Like on Spear Pillar
08 - 3D Camera high placed, like on Stark Mountain
09 - 3D Better sight, like in the Eterna City arena
14 - 3D Little dwarfs in a world of giants, like in Hall of Origin
I remember using this code and having a lot of fun with it. I think it modifies the arm9 in the RAM on the fly.

Spiky-Eared Pichu
October 18th, 2011, 08:00 AM
@Team Fail Well, if the 00 and 04 values match what I teach in this tutorial, then this means the values from that cheat will probably work.

Zark
October 18th, 2011, 01:25 PM
Here I show you pictures of how they would be changing the bytes from 00 to 0F:

00
http://i457.photobucket.com/albums/qq295/Zarks/Camara00.png

01
http://i457.photobucket.com/albums/qq295/Zarks/Camara01.png

02
http://i457.photobucket.com/albums/qq295/Zarks/Camara02.png

03
http://i457.photobucket.com/albums/qq295/Zarks/Camara03.png

04
http://i457.photobucket.com/albums/qq295/Zarks/Camara04.png

05
http://i457.photobucket.com/albums/qq295/Zarks/Camara05.png

06
http://i457.photobucket.com/albums/qq295/Zarks/Camara06.png

07
http://i457.photobucket.com/albums/qq295/Zarks/Camara07.png

08
http://i457.photobucket.com/albums/qq295/Zarks/Camara08.png

09
http://i457.photobucket.com/albums/qq295/Zarks/Camara09.png

0A
http://i457.photobucket.com/albums/qq295/Zarks/Camara0A.png

0B
http://i457.photobucket.com/albums/qq295/Zarks/Camara0B.png

0C
http://i457.photobucket.com/albums/qq295/Zarks/Camara0C.png

0D
http://i457.photobucket.com/albums/qq295/Zarks/Camara0D.png

0E
http://i457.photobucket.com/albums/qq295/Zarks/Camara0E.png

0F
http://i457.photobucket.com/albums/qq295/Zarks/Camara0F.png

Team Fail
October 18th, 2011, 01:48 PM
stuff

What happens after 0F? Like 11, 15 or 1A?

Zark
October 18th, 2011, 02:07 PM
What happens after 0F? Like 11, 15 or 1A?
They are not useful for 10 and up and coming out in black.

Link_971
October 18th, 2011, 02:48 PM
So, we have all results, thanks!
And i will check soon for the flight zones too.

Team Fail
October 18th, 2011, 02:51 PM
They are not useful for 10 and up and coming out in black.

I know there was one, that if you set it on the Poketch, it would show a distant skyline shot. It's completely unused, but it looked really cool. I'll try to get that value. I think it was 18 on the Poketch if memory serves correct. Another one I remember had the map so small it was just a colored pixel on the screen.

EDIT: It's 16. I'll get a pic later.

SwirlyBirds
October 18th, 2011, 05:12 PM
http://i457.photobucket.com/albums/qq295/Zarks/Camara09.png


I think this one is the best. It's not completely birds-eye-view, unlike traditional Pokemon games, but its really cool. It'd be neat if there was a hack like that.

Team Fail
October 18th, 2011, 05:28 PM
I think this one is the best. It's not completely birds-eye-view, unlike traditional Pokemon games, but its really cool. It'd be neat if there was a hack like that.

There's actually a small glitch with that angle. Go to Solaceon Town and walk around there. You'll see sprites disappear and reappear when you leave/enter the town's area.

And attached is that special unused camera angle. I apologize for the blurriness- I took it on my DS Lite and used a crappy camera.

Full Metal
October 18th, 2011, 06:10 PM
You know what this smells like to me?
I would bet that there is an array / table of a structure containing x/y/z co-ordinates that are relative to the player for the camera. Perhaps somebody with a NDS debugger, and a ROM could set a break on read for one of these values and test? Then we could make our own. (:

Team Fail
October 18th, 2011, 06:33 PM
You know what this smells like to me?
I would bet that there is an array / table of a structure containing x/y/z co-ordinates that are relative to the player for the camera. Perhaps somebody with a NDS debugger, and a ROM could set a break on read for one of these values and test? Then we could make our own. (:

There is a Pokemon Diamond/Pearl code that allows you to modify the camera angle on the fly. It's called "Crazy Zoom". You use L, R, Select and Start and you can modify the camera to wherever you want. Even under the map.

Kakko97
April 12th, 2012, 10:52 AM
Can anyone give me an arm9.bin (diamond usa) already patched with 3d everywhere?? Thanks :)

bwburke94
April 29th, 2012, 10:38 AM
This thread's been dead for 6 months, and I'm not sure if what you're asking for is legal. Just follow the instructions in the first post.

Spiky-Eared Pichu
May 1st, 2012, 12:43 PM
Can anyone give me an arm9.bin (diamond usa) already patched with 3d everywhere?? Thanks :)

That's not legal in the forums for sure, only patches can be distributed here. But man, it's not that difficult to do it with the replace option of your hex editor, although you have to be careful.

groud'
June 16th, 2012, 08:27 AM
Hello.
Just to inform you that I adapted the tutorial on French ROMs of pokemon (pearl, diamond and platinum).
So normally, this adaptation is valid for any other European ROMs normally.
Thank you Spiky-Eared Pichu for this discovery!
And thank you also Zark, because you helped me with your list ^ ^
If you want to see my work, and my tutorial (beware, it is written in French ...), just ask me by PM.

PS: sorry if I misspelled, but being French, and poor language speaker of Shakespeare, I helped myself to google translation, knowing that sometimes poorly translated ...