PDA

View Full Version : Research: Pokémon Black/White mapping engine


Platinum Lucario
August 27th, 2011, 06:38 AM
I've been very fancinated by how 'more' improved the mapping engine really is in Pokémon Black/White. So far what I've noticed just by using the Walk Through Walls code... is the fact that the maps have their boundries. Could the whole mapping engine be based on designing the layout then inserting the movement area? What I've noticed during my research on a Pokémon Black ROM is the fact that every movement area consists of 32x32 blocks. It is quite different from Pokémon Diamond/Pearl/Platinum in how every map piece consisted of 24x24 blocks. Something that everyone would possibly like to see ways of knowing how to edit that mapping engine... then maybe one day if a map editor was made for Black/White, then we might see Ruby/Sapphire remakes, eh? So far as what I've noticed when using the walk through walls code... is that the movement permissions that require surf cannot be passed through, I guess the game prompts for the character to use surf in order for the wild Pokémon encounters? In Diamond/Pearl/Platinum/HeartGold/SoulSilver, the wild Pokémon encounters on water were activated via the texture, not the movement permission. And there's layouts of maps that extend out into areas that have no movement area (in other words is an unpassible area). Nobody has managed to go into a Mystery Zone as of yet (not even I can), however I've found the Mystery Zone music for Pokémon Black/White, it sounds exactly the same as Icirrus City. The name "Mystery Zone" is found while using PPTEXT. And there's still many things we yet have to confirm about the mapping engine in Pokémon Black/White.

Remember... "nothing is impossible".

There are things that I don't even know about either... such as the locations of the 3D Model data and the map layout/land data. And prahaps also finding out how the movement of curving around in places such as the Skyarrow Bridge, Castelia City, Village Bridge. I aren't even sure if they are movement permissions. It surely is something we need to research. First off... knowing the location of the land data/map layouts in Pokémon Black/White. Once we learn about them... then we'll have fun messing around with the ROM and changing many portions of it and learning even more stuff about the mapping engine. This will be a brillient step in Pokémon Black/White hacking. After all... research is something that is shared across everyone on the world wide web.

Link_971
September 12th, 2011, 11:08 AM
I start the work with my editor this night.



Edit : I have finished my extended research.
That's my results :



(That's we already know) - Models have pre-integrated doors. Just imagine how it's more easier for me for include all possibilities.
(That's we already know) - Models have incorporated a rotation value (see my thread and my first research)


- Models coordinates are same. Just Y values are inversed (i think).
- Textures have the same system ; animation is already in the texture, and walk animation from permissions movements.
- Same as rarely models in DP, a few textures can now use sub-textures in only one texture, this is a problem for common modifications.
- 3D Textures removing is always easier
- 3D Textures moving is always boring
- 2D Textures extending is always harder


- Castelia and bridges are after all Maps of the game (i think, i can't go so far).
- Castelia is a normal Map with a giant texture background. The same system is used in Violet City arena and others (i think).

Team Fail
September 24th, 2011, 01:12 PM
Didn't I give you the voidable-Walk through walls code?

Anyways, I'd like to see how Skyarrow Bridge is done. I might try to find the map file and tinker with it.

@Link_971: I'll dump my Pokemon White save for you to use. I have all mainstream areas unlocked.

Link_971
September 24th, 2011, 02:50 PM
http://www.youtube.com/watch?v=flLBRNMAwow



There's a mod by KazoWar to view 5th gen maps in PG4Map.
Thanks to him!

I have no time to test this, if you find the bridges and Castelia, can you contact me in PM?
Thanks.

Team Fail
September 25th, 2011, 06:28 AM
It also seems that he imported 4th gen maps into BW, so we know it's capable of rendering them. I'd say our next step is to find out all the coordinates of objects on all the maps and make a psuedo-editor out of that. Then, we figure out the more challenging things, and incorperate that.

And, to make it as complete as possible, it must be able to remove and add models on the map, rather than just move them around. This goes for both Gen. 4 and 5.

Edit: I have modified it to the specifications. I can't get textures working, but I got models to display. Attached is a modified PG4Map.

Edit 2: I found the .btx files for the title screen. It's located at root/a/0/4/9

Edit 3: I found some more .btx files. I found 4 similar maps of the 2nd area of Nimbasa City. They're located at a/1/6/6 and the .btx files are called 0_063.bmd, 0_065.bmd, 0_067.bmd and 0_069.bmd.

Edit 4: I have made a slightly better version that has less Engrish and has some instructions for usage.

Edit 5: Screenie of it using proper textures: http://img43.imageshack.us/img43/1567/pg4mapmod.png

Team Fail
September 26th, 2011, 10:14 AM
Ok. If you want to tinker with the movement permissions system, you can work with 8_544.ng in the map file (a/0/0/8). It's the main room for the Battle Subway (the one that rotates).

Link_971
September 27th, 2011, 02:00 AM
I'd say our next step is to find out all the coordinates of objects on all the maps and make a psuedo-editor out of that.


Yeah, that's maybe what i'll make now, and Pichu2000 too, for his editor.
We lost accuracy but we got many Maps and options.

I've added a new poll in my thread.


And, to make it as complete as possible, it must be able to remove and add models on the map, rather than just move them around. This goes for both Gen. 4 and 5.


I don't think we can add anything, but we can use doors objects for add more models. We can move objects to another Map, but this can cause glitchs and that's not a properly editing.


Edit: I have modified it to the specifications. I can't get textures working, but I got models to display. Attached is a modified PG4Map.


Thanks, i'll try in next days.


Edit 5: Screenie of it using proper textures: http://img43.imageshack.us/img43/1567/pg4mapmod.png


Awesome!

Team Fail
September 27th, 2011, 05:12 AM
Yeah, that's maybe what i'll make now, and Pichu2000 too, for his editor.
We lost accuracy but we got many Maps and options.

I've added a new poll in my thread.





I don't think we can add anything, but we can use doors objects for add more models. We can move objects to another Map, but this can cause glitchs and that's not a properly editing.





Thanks, i'll try in next days.





Awesome!

Ok. Since I want to learn some programming, I will try to add some more features to it.

Link_971
September 27th, 2011, 09:42 AM
Yeah, maybe WASD navigation like YAMV.
Also, a better support for DPP HGSS and entire file support if you can.

I want add this viewer in my tool :)

Team Fail
September 27th, 2011, 07:14 PM
Yeah, maybe WASD navigation like YAMV.
Also, a better support for DPP HGSS and entire file support if you can.

I want add this viewer in my tool :)

Actually, I kinda like that dial system. WASD controls get me really confused. The only fix I really need is to get textures to render properly. When that's out of the way, I'll make a release for you all and get to work on the next part: Finishing the map selector drop-down menu.

So if you have expertise in C#, let me know.

Link_971
September 28th, 2011, 04:57 AM
I have extracted the textures in the folder but i can't display textures in the viewer. Maybe file names are wrong or a problem with the materials.txt?

Team Fail
September 28th, 2011, 05:11 AM
I have extracted the textures in the folder but i can't display textures in the viewer. Maybe file names are wrong or a problem with the materials.txt?

Get the old copy of materials_dp.txt and put it in the Textures directory. I forgot to include it. I'll include it in the next release.

Link_971
September 28th, 2011, 05:33 AM
It works now, thanks.
I start the extended listing and maybe hacking Castelia :p


Edit : Two screens.
A few Maps are missing for Castelia. I think it's a problem of viewer.

Team Fail
September 28th, 2011, 01:45 PM
It works now, thanks.
I start the extended listing and maybe hacking Castelia :p


Edit : Two screens.
A few Maps are missing for Castelia. I think it's a problem of viewer.




Yeah. I need to get textures working right. If I could find the texture rendering lines from YAMV and port it to C#, I'd like to do so. And, what files are those? I need to start listing them off.

Link_971
September 28th, 2011, 01:56 PM
I don't think it's textures, i can't view the 2D ground, or maybe it's a full 3D Map with models.



107- ???
108- Castelia City (Large Fountain)
109- ???
110- Castelia City (North)
111- ???
112- ???
113- ???
114- Castelia City (South-West)
115- Castelia City (Port)
116- Castelia City (Port)
117- Castelia City (Port)
118- Castelia City (Est)
119- Skyarrow Bridge (Panorama)

Team Fail
September 28th, 2011, 02:58 PM
Hm. 132-137 is the Driftveil/Hodome Drawbridge.

Edit: I'm going and documenting all the maps.
Edit 2: I've put a name to 198 of the map files, and I also found Village Bridge. Give me a few days to finish naming maps and I'll release a new build with a map name list.
Edit 3: I've gotten 437 maps done now. Some of them are incorrect, though, I think. I also think that movement permissions depend on the filetype. .ng files are ones that rotate, and are incapable of WTW. .bw and others are capable.
Edit 4: I'm almost done. I have a handful of maps left, and I have a little surprise for you all. :D

The Author
September 30th, 2011, 03:47 PM
There are things that I don't even know about either... such as the locations of the 3D Model data and the map layout/land data. And prahaps also finding out how the movement of curving around in places such as the Skyarrow Bridge, Castelia City, Village Bridge. I aren't even sure if they are movement permissions. It surely is something we need to research. First off... knowing the location of the land data/map layouts in Pokémon Black/White. Once we learn about them... then we'll have fun messing around with the ROM and changing many portions of it and learning even more stuff about the mapping engine. This will be a brillient step in Pokémon Black/White hacking. After all... research is something that is shared across everyone on the world wide web.

Haha. You sound like me. I totally agree with you. Creating a BW map editor would be revolutionary. Some day we'll be editing things like crazy with some DPPtHGSSBW map editor. And then we'll wonder why we didn't figure it out sooner! :D

Team Fail
September 30th, 2011, 05:14 PM
Haha. You sound like me. I totally agree with you. Creating a BW map editor would be revolutionary. Some day we'll be editing things like crazy with some DPPtHGSSBW map editor. And then we'll wonder why we didn't figure it out sooner! :D

Well, I have something that we can start with. And the source is included!

Team Fail
October 11th, 2011, 04:55 PM
Okay. I've been analysing the map files and I found that some of the unloadable map files (Identified by "Blank Map?") cannot load because the program does not look at the same place as all the other map files are at. In the normal files, it looks at 0x14, when in these "Blank Maps", the BMD0 offset is at 0x10. I need to make it go either at 0x14 or 0x10. I'll modify my code and get the names of the maps with a BMD0 offset of 0x10 and I'll add support for them later.

Edit: I've modded it and not had any success. I must see why that is.
Edit 2: I found this, if you want to see it: http://llref.emutalk.net/docs/?file=xml/bmd0.xml
Edit 3: If we can get it to work with this tinke plugin (http://code.google.com/p/tinke/source/browse/trunk/Plugins/3DModels/3DModels/BMD0.cs?spec=svn96&r=96) instead of it's conventional method, maybe it may work for all DS Maps.

Link_971
October 12th, 2011, 05:42 AM
Cool!
Good job, Team Fail :)

Team Fail
October 14th, 2011, 02:46 PM
Well, I can't seem to get it to work at the moment, so I took the time to improve the GUI. I'm still trying to implement WASD support, but it's not working.
http://img714.imageshack.us/img714/4382/newpg4map.png

HackingIsFun
October 15th, 2011, 08:59 AM
This looks great so far, great job :)

X-Lan
November 6th, 2011, 12:31 PM
No wonder game freak takes so long to release games, they are afride of you guys cracking them! You have my full support guys :D

Team Fail
November 27th, 2011, 01:15 PM
Well, Full Metal helped me a few days ago and I have a few new features in the Viewer! Check the readme for more information on the release! I removed the maps lists because I need to implement a version checker with that as well.

http://dl.dropbox.com/u/34957059/Pok%C3%A9mon%20DS%20Map%20Viewer.zip

Platinum Lucario
March 21st, 2012, 03:55 AM
Hm... it appears the Pokémon Black/White mapping engine uses triangular polygons as well as square ones. In generation 4, it seemed like it could only use square polygons. During my research I zeroed out some of the values.

And so I started off with turning the bytes from 0x2A30 - 0x316C into "00", which then resulted in this:
http://img571.imageshack.us/img571/8215/maphackexperiment.png

But then after I continued to "00" the bytes from 0x316C - 0x331E, this was the result:
http://img13.imageshack.us/img13/4293/maphackexperiment2.png

When we discover something new, we always research further into it. ^^

looper
April 5th, 2012, 06:54 AM
I attached a Screenshot. Don't ask me, how that happened, but it seems that some textures were randomly replaced by rock-textures. That happens in several places, but it looks interesting!

renekokkie
April 22nd, 2012, 12:55 AM
I attached a Screenshot. Don't ask me, how that happened, but it seems that some textures were randomly replaced by rock-textures. That happens in several places, but it looks interesting!

This happens when you use walktrough walls and you will not enter a gate.
so a gate will have something to do with a maplink.
but after I refresh my screen. likes using the bag of the trainercard.
looks everything normal

Team Fail
April 22nd, 2012, 06:21 AM
This happens when you use walktrough walls and you will not enter a gate.
so a gate will have something to do with a maplink.
but after I refresh my screen. likes using the bag of the trainercard.
looks everything normal

Yeah. It occurs when the incorrect map objects are loaded and are loaded incorrectly. They default to a generic stone.

MarinoKadame
August 17th, 2012, 01:01 PM
Been a while no one putted updates here. Any new info on this ?

Pike15
October 5th, 2012, 01:53 PM
You guys still map hacking??