< >
Hello, guest! Please log in or register.

The PokéCommunity

Go Back     The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources Tutorial Inserting Battle Backgrounds

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.

Reply Post Reply
 
Thread Tools
  #51    
Old December 20th, 2014 (8:05 PM).
Exelis'20's Avatar
Exelis'20 Exelis'20 is offline
Filipino Pride!
 
Join Date: Dec 2014
Location: Paris, France
Gender: Male
Nature: Jolly
Posts: 15
Dude Thanks very much! I've inserted already 6 of the battle backgrounds in PLatinum to my ROM. Thanks very much! :D
"Im just beginning with romhacking. So hope you understand."

Hacks doing:
Pokemon Exelis Version


Please give a like to our Official Facebook Page! :D
Reply With Quote

Relevant Advertising!

  #52    
Old December 22nd, 2014 (6:50 PM).
Sky High's Avatar
Sky High Sky High is offline
Bellsprouts in Paris. Be aware a rare Victini.
 
Join Date: Feb 2014
Location: Shiganshina District, Wall Maria
Gender: Male
Nature: Adamant
Posts: 353
Quote:
Originally Posted by Lance32497 View Post
ahhm ok, but may I leave these blank? because I Changed the palettes of the battle bg
If you are going to make them blank, well, you just need a new blank image (all transparent) and a tileset of the blank image. And, kinda less fancy. If you are changing the background image palettes, it doesn't change the entry image palettes (if you are staying with the same offset of the original palette). Don't worry about it, entry image palette are handled separately from it. :3

I'll make a post of explanation of palettes later once I have figured out things.
Reply With Quote
  #53    
Old December 23rd, 2014 (12:19 PM).
wally-217's Avatar
wally-217 wally-217 is offline
 
Join Date: Nov 2012
Location: Yorkshire, UK
Gender: Male
Posts: 87
OK, I tried inserting a new battle background on Emerald using the information
Raileys posted and I end up with something looking like this:
Spoiler:


If it helps, I completely ignore the original tutorial and just imported it straight into UnLZ. The background seems to be fine, it's just the platform thing.
Reply With Quote
  #54    
Old January 7th, 2015 (6:57 AM). Edited January 7th, 2015 by HerobrineHunter.
HerobrineHunter's Avatar
HerobrineHunter HerobrineHunter is offline
 
Join Date: Dec 2014
Location: IN THE WORLD OF POKEMON
Gender: Male
Posts: 10
Can you insert that Battle BG in my rom . Haha Dont mind helping me ?

Plss!
Reply With Quote
  #55    
Old January 23rd, 2015 (10:47 PM).
LeiAlcantara025's Avatar
LeiAlcantara025 LeiAlcantara025 is offline
Hack Expert Most IN Mapping
 
Join Date: Jun 2014
Gender: Male
Posts: 67
Ca Someone Taught Me How To insert like this Battle Back grounds? In Fire Red? No worry I have my own Battle BG Since Kyledove Forbid anyone to UseThis
Pokemon Freezing Dawn


Im A Mapper Expert Invite me In a Good Projects If I Have Time
Pokemon Hacking Is So Complicated,If You Understand It Correctly You'll Become An Expert
Reply With Quote
  #56    
Old February 3rd, 2015 (2:32 AM). Edited April 4th, 2015 by Sky High.
Sky High's Avatar
Sky High Sky High is offline
Bellsprouts in Paris. Be aware a rare Victini.
 
Join Date: Feb 2014
Location: Shiganshina District, Wall Maria
Gender: Male
Nature: Adamant
Posts: 353

Manipulating Battle Background Palette


Have anyone wondered why the palettes of different battle backgrounds having twelve, thirteen, or sixteen (the transparent color counts) colors. Sometimes you want sixteen colors for the background and you want to maintain the original offset (only replacing values from it), but the original palette has only fifteen available colors. Solution to it? I have already found it out! I have amassed data to examine different palettes from different background. Then, finally, I have found one that can be universal to the maximum of sixteen colors (however, it is not only just the colors of the background… you will find out). Here’s the data as promised:

10 60 00 00 00 00 00 DC 73 1B 4B 7E 57 00 7C 5F 3C 4F 9A 67 5D 53 00 7E 57 3D 53 5C 53 A8 4E 00 0C 5B 51 6B 94 6F B8 73 80 10 1F B9 42 5D 53 7D 5F DA 00 46 9D 6F 1B 4B 3C 4F FB 40 4A B0 1F 5F 23 DF 63 5F 2B 02 9F 3B DF 43 00 00 F0 01 00 00

Let me explain. The data is a set of compressed palette. Each palette data contains three parts: the First Base, the Second Base, and the Entry Image Palette.
  • The red-bolded values are the First Base which is controlled in the 0x2 palette control in the tilemap. Literally, this is the basic and the main layer for the colors of the background. Noted that there are 2 bytes each color. After four colors, there is a stray byte which is 00 and is not always 00. The First Base contains sixteen colors (subtract one for the transparent color which is at the start of the palette).
  • The orange-bolded values are the Second Base which is controlled in the 0x3 palette control in the tilemap. This is the second layer of palettes for the background. It contains eight colors. In the fourth color, there is an insertion of the stray byte “00” between the two values. Then in the eight color, there is also an insertion of the stray byte “40” between the two values.
  • The green-bolded values are the Entry Image Palette which is used for the palette for the image-that-animates-to-the-left-then-disappears as you can see in the flow in the intro of a battle. It contains six colors and the stray bytes “02” appears after the third one. They can only be five colors but the highest possible is six colors (the rock entry image in the cave background having six). So, the sixth slot at 00 00 before the F0 01 is safe to use.
I still don’t know how compressed palettes works but I have explained everything as far as I know. You may use this as the palettes for all available backgrounds. This palette data is ripped off from Elite Four Sidney's palette but if you use this data to other backgrounds, it will still work just focus on byte ordering and changing. You have a new grass background with this format is okay. If you want to maintain the entry image palette, just copy the palette used for the entry image just by looking at VBA's palette and image viewer.
Reply With Quote
  #57    
Old February 27th, 2015 (2:50 PM).
AceRoku's Avatar
AceRoku AceRoku is offline
Dev of Pokemon Flare
 
Join Date: Feb 2015
Gender: Male
Posts: 28
Great ! This tutorial is very user-friendly. I'd recommend reading this.
Pokémon Flare - Coming SOON

Looking for scripters,mappers and tile inserters (all sort of persons who can help me) on Pokémon Flare.
If you're interested, feel free to leave me a VM/PM
Reply With Quote
  #58    
Old October 15th, 2015 (10:44 AM).
Cruztown's Avatar
Cruztown Cruztown is offline
Squirtle Squirt.
 
Join Date: Jul 2012
Gender: Male
Nature: Rash
Posts: 44
Out of curiosity, what ties the battle backgrounds to Nature Power? How does it handle adding more backgrounds? Does it just default to Swift, or is there a separate table somewhere in the rom?
Reply With Quote
  #59    
Old October 15th, 2015 (10:53 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
who is shenanigans
ModeratorCS
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 18
Posts: 4,383
Quote:
Originally Posted by Cruztown View Post
Out of curiosity, what ties the battle backgrounds to Nature Power? How does it handle adding more backgrounds? Does it just default to Swift, or is there a separate table somewhere in the rom?
Doesn't Nature Power just go off of the map itself (the Inside, Route, Underground etc. settings in A-Map) and behaviour bytes?
Reply With Quote
  #60    
Old October 15th, 2015 (4:25 PM).
Cruztown's Avatar
Cruztown Cruztown is offline
Squirtle Squirt.
 
Join Date: Jul 2012
Gender: Male
Nature: Rash
Posts: 44
Quote:
Originally Posted by Spherical Ice View Post
Doesn't Nature Power just go off of the map itself (the Inside, Route, Underground etc. settings in A-Map) and behaviour bytes?
That might explain it. Looking at Hoenn (Emerald, BPEE), the desert on Route 111 is still marked as a plain "Route" with regular weather, yet has Earthquake as the called move, so behavior bytes would be the only thing I could immediately think to check.
Reply With Quote
  #61    
Old October 15th, 2015 (8:28 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 685
Too bad, karatekid552's BattleBG Hack's link is broken
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
  #62    
Old October 20th, 2015 (10:41 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 685
Quote:
Originally Posted by karatekid552 View Post
The Data Behind Battle Backgrounds


Now that DrFuji has taught you how to edit Battle Backgrounds, I am going to take you into the data aspect. For right now, this lesson will just be for FireRed. If you do want it for another game and you are actually going to use it, I will attempt to do my best to help you.

To start off with, apply the patch at the bottom of this post to your rom. What it does is move the battle BG table to 0xF10000 where we can work with and expand it, and it also hacks the BG loading routine with branches placed 0xF00000 (I will completely explain this later).

The Table

To be honest, the table is quite simple. To start off, it has 20 backgrounds already in it designated by Game Freak. They are as follows:

1. Grass
2. Grass2
3. Sand
4. Field
5. Pond Sea
6. Sea Pond
7. Craggy
8. Cave
9. Multi/Indoor- White & Grey & some Yellow in the Palette (Normal Trainer Battle)
10. Multi/Indoor- Green & a little Yellow (Rival Trainer Battle)
11. Multi/Indoor- White & Grey ()
12. Multi/Indoor- White & Grey & some Tan in the Palette ("Gym" Trainer Battles (that option in A-Map))
13. Multi/Indoor- White & Grey & some Tan in the Palette (2) ("Gym" Gym Leader battle (yes the Leaders have different BG))
14. Multi2/Indoor2- White & Grey
15. Multi2/Indoor2- White & Grey & some Purple in the Palette
16. Multi2/Indoor2- Blue & some Tan in the Palette
17. Multi2/Indoor2- Yellow & Tan
18. Multi2/Indoor2- Purple & some Tan in the Palette
19. Multi2/Indoor2- Turquoise & some Tan in the Palette
20. Multi2/Indoor2- White & Grey & some Purple in the Palette

For each background, there are 5 pointers in order with this format:


Code:
VV VV VV 08 WW WW WW 08 XX XX XX 08 YY YY YY 08 ZZ ZZ ZZ 08 VV = Image Offset WW = TileMap Offset XX = Entry Image (Ex. The Grass that moves in front of the screen at the beginning of a grass battle.) YY = Entry Image Tilemap ZZ = Palette
Here is the documentation of each background and their pointers in the original table:

Spoiler:
Grass Background

VV = 24844C
WW = 2489A8
XX = 248C68
YY = 248F58
ZZ = 248400

Second Grass Background (There are two Grass Images in FR, I don't know the reason.)

VV = 2490C4
WW = 249620
XX = 2498DC
YY = 249E10
ZZ = 249074

Sand Background

VV = 249FE4
WW = 24A37C
XX = 24A618
YY = 24A844
ZZ = 249F98

Field Background

VV = 24A990
WW = 24ACD0
XX = 24AF70
YY = 24B0DC
ZZ = 24A940

Pond Sea Background

VV = 24B1EC
WW = 24B608
XX = 24B8A8
YY = 24BBE0
ZZ = 24B19C

Sea Pond Background

VV = 24BD38
WW = 24C07C
XX = 24C314
YY = 24C520
ZZ = 24BCE0

Craggy Background (Don't know what this is supposed to be called)

VV = 24C624
WW = 24C9B8
XX = 24CBF8
YY = 24CEC8
ZZ = 24C5D8

Cave Background

VV = 24CFEC
WW = 24D418
XX = 24D6B8
YY = 24DC98
ZZ = 24CF98

Multi-type Backgrounds/Indoor Backgrounds (Usually appears in Trainer Battles)

-There are 5 different ones in a row. They use the same setup, but different palettes.
VV = 24DE34
WW = 24E16C
XX = 24E410
YY = 24E490
ZZ =
1. 24DDF0
2. 24E81C
3. 24E528
4. 24E56C
5. 24E5B8

Another set of Multi-type backgrounds/Indoor Backgrounds. This set has 7.

VV = 24E858
WW = 24EB90
XX = 24E410
YY = 24E490
ZZ =
1. 24E604
2. 24E650
3. 24E6A4
4. 24E6F0
5. 24E740
6. 24E78C
7. 24E7DC


So, expanding this is really quite simple. Just follow the setup of the table and add on to the end. Don't delete any of them if you are not going to replace them. This may sound obvious, but you never know what people will do:p.


So, I expanded it... Now what?

This is probably what you are thinking after completing the above. This is where the hack of the loading routine that comes in. What it does is allows you to very easily change the battle background to whatever you wish.

If you remember, all of the backgrounds are in order. If the first grass is 0, then numbering from there will give you the number of background, which means that background slots from 0 to 19 are already filled. So, let's say we add 4 more backgrounds to the end of the table: Fire, Snow, Storm, and Metal, respectively.

The games coding does not directly allow access to these backgrounds, which is what the hacked routine does. Basically, it branches to a section of ASM that checks var 0x40F7. If this var is set to 0, it will automatically return to the regular routine and continue as normal. However, if it is set to any other number, the routine will operate from there and load the battle background of that number instead.

So, if you set var 0x40F7 to 20, then the Fire background will be loaded. If you set it to 22, then the Storm bg will be loaded, and so on. This will stay until you change it to something else. In order to return to the normal background for that map, then you simply set the var to 0.

Please note that this routine overrides every type of battle. This means you can change trainer battles, sea battles, grass battles, cave battles, etc, all by setting that one var. Also, the routine loads a half-word, not a byte, which means that you can have up to 0xFFFF backgrounds in the table, which is a little over 65,000. Granted, there isn't enough space in the rom to have unique backgrounds in each slot, but don't worry about over expanding the table. You won't have a problem there.

Well, that about wraps this up. Originally I had planned to give you the ASM routines and explain how to use them, but that got overly complicated with the branches, so I made it really simple with the patch.






Also, I did my best to make this compatible with both JPAN's engine and Jambo51's 649 patch. I haven't tested it on either, but I asked Jambo if there would be any complications or things I should avoid and the only thing he gave me was which var to use since he had used a few. For JPAN's, I avoided using any RAM that he used (which didn't matter in the end because Jambo had me switch to a var) and I don't think he had any routines and such that would affect this.


In order to make this even better for people, on case you have already used the free space at 0xF00000, I have included the source code here:


You can do as you wish with this code.


If there are complications, please let me know!



~Credits!

Driver - Driver was an old-time German hacker whom originally accomplished this for his own hack. Instead of using a var, he freed up some RAM and used that. About two months ago, I received a rom and some notes of his from Narutoactor via Tajaros. It took me a while to make heads or tails of them, but once I did, I set out to port it over to English FireRed and this was the result! So, most of the credit goes to him!

Jambo51 - A HUGE help in making this. He taught me how to access vars and answered a lot of questions. I know he hates people bugging him with questions, so I really appreciate him not ignoring me!

Darthatron - For being a really good friend and giving me a lot of help. When I was stuck and didn't have access to the var_access routine due to being on the go, but I still wanted to write up the ASM for it, he Pastied it me and I got a lot done. As usual, he also answered a lot of questions and was really helpful.

Mat - While I didn't end up using it because I switched to a var, Mat spent over an hour helping me try to find some free save-able RAM for this project. I really appreciated the time he gave me as we explored the save blocks and got almost nowhere, but he stuck with me until he had to go, so I have to give him a huge thanks!

Tajaros (Not Shadowraze, this was before the switch:p) - For starting this whole project by sending me all of Drivers stuff and asking for my help in deciphering it. He also decoded a lot of the table and documented the first 9 backgrounds before I even started working, which was a huge help.

Narutoactor - For sharing all of Driver's research, and attempting to help me contact Driver which, unfortunately, never happened.

Lastly, Drfuji - For digging into the archives and redoing his old private bg editing tutorial and completely rewriting it to go along with this research to make this ultimate guide to hacking battle backgrounds.


Well, that is all for now! On to the next project.... !

~karatekid552
Does anyone have the file of bg hack uploaded by karatekid552 or just the source code of it?
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
  #63    
Old October 21st, 2015 (12:01 AM).
BlackWhiteRobin BlackWhiteRobin is offline
 
Join Date: Sep 2012
Age: 18
Gender: Male
Nature: Quirky
Posts: 448
Quote:
Originally Posted by Lance32497 View Post
Does anyone have the file of bg hack uploaded by karatekid552 or just the source code of it?
OH! Lucky you! I was just scrolling through my old files and saw this. Hope it helps! Happy hacking!

Battle BG Hack BPRE.ips

Reply With Quote
  #64    
Old October 21st, 2015 (12:21 AM). Edited October 21st, 2015 by Spherical Ice.
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 685
Quote:
Originally Posted by BlackWhiteRobin View Post
OH! Lucky you! I was just scrolling through my old files and saw this. Hope it helps! Happy hacking! ^_^

Attachment 76880
Thank you! You made my day! Thanks!
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
Reply Post Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


  All times are GMT -8. The time now is 11:46 PM.


Contact Us Archive Privacy Statement Terms of Service Top