Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Resource] The ROM Hacking Documentation Project

Notices
For all updates, view the main page.

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
 
Thread Tools
  #1    
Old November 11th, 2014 (03:22 PM). Edited November 15th, 2014 by Akiba.
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
rhdp: The ROM Hacking Documentation Project

Introduction

So, it's been almost a year and a half since I've hacked seriously. Most of you probably don't remember me, save a few old friends (shoutout to GoGo, shiny, Jambo, Team Fail, and karatekid). That being said, I've always yearned for a stable, definitive resource for ROM hacking information. I'm sure that many of you have come to realize that a bulletin board system isn't the best format for organizing in-depth research and development. I've been visualizing a web platform in which all that we know and ever will know about ROM hacking can be documented and well-organized. It's a grand undertaking, and may take months or years to become something really useful, but a step like this must eventually be taken if we are to wish for more productive hacking and tooling. I will consistently update this thread as more information becomes available and our goal becomes ever more clear.

Context

The community has created some great tools. However, those that were created earlier on (which we happen to rely on very often) employ many secret or obscure techniques, and are closed source. As a result, the creator of any given tool is the sole liability of his userbase. Bugfixes, optimizations, improvements, and implementations all depend on the creator, with few to no supporters critically eyeing the source. Furthermore, once the creator inevitably decides to leave the community, his project is halted indefinitely, and no further changes can be made. This is one characteristic of the mass fragmentation within the community. Tools developed cannot be integrated or improved, and any attempt at creating a general and sustainable development environment cannot succeed. Notable attempts include PGE and G3HS, but for many tasks, we rely on tools with no alternatives. Such tools are often simply standalone, and the furthest we can go to integrate them is to loosely string them together with embedded command line calls. One major disadvantage is that ROMs are loaded locally into the memory of a tool. The ROM can only be modified one task at a time, and should you require information of that ROM to be open in another tool, the entirety of it must be loaded into memory, resulting in redundant memory and processor usage. Another consequence of such tools not being open source is that they cannot be ported to other operating systems. Avid hackers such as shinyquagsire and myself use Linux as our operating system of choice. As some of you know, we work on a prospective successor to AdvanceMap -- the MEH: Map Editor of Happiness. This was one of the first steps in moving our ROM hacking community into the field of open source and progressive development. However, I feel that even MEH is deficient in many ways. For example, MEH depends on Java. While that may bring many advantages, I cannot see a tooling ecosystem that relies on Java becoming the future of the hacking community. This brings me to another point - the development processes for many our tools differs vastly. MEH is being created in Java. G3HS uses Python. PGE uses Visual Basic. AdvanceMap was created in some old Turbo language that I'm not even sure is supported anymore. The interactivity and parallelism between tools is remarkably low. A much better system would consist of all components maintained by multiple people, implemented mostly in the same language, and using a wide and well written subsystem. A single codebase, with libraries and modules contributed by multiple developers with expertise (creators of previous tools made for the same task). This way, ROM hacking can be done with more productivity, and by using tools with defined behavior, not risk corrupting a ROM or possibly even something worse. The fragmentation within the community extends past the tooling environment. New and old hackers alike often find themselves asking questions that could be answered by consulting a resource. There are some resources in the forums, but no definitive single resource, and sadly, threads suffer the same problem that closed source applications do. karatekid's introduction to Assembly is a great example of where improvement could be made. Instead of having a resource describing what Assembly is and how it works, then linking to several other threads (possibly containing links as well), all of the information could be combined into a single resource, and missing information can be supplemented and statements corroborated. Such a resource would contain an introduction, then specific and formal information, with each section followed by a succinct digest and one or more examples. One exemplary documentation base that I often both point to and utilize is the CanJS (a Javascript framework that I like to use) API documentation. There is a formal definition of each component of the framework, followed by explanation and usage scenarios, and concluded with live demos using some framework code. A similar comprehensive documentation system for the Pokemon ROM would be phenomenal in its extreme usefulness.

tl;dr We are terribly disorganized and need to do something quick

Purpose

I am creating this documentation project for the purpose of aiding ROM hackers in their undertakings, as well as ROM researchers and hacking tool developers. I hope that this project will unify the community and bring about higher-level collaborative projects such as a ROM hacking IDE.

Roadmap

The project will be a dynamic site served by a to-be-determined server, and with code hosted on an already determined Github repository. Once the platform has reached a minimum viable product, it will be deemed ready for public use. At that point, most of the effort given to the project will be made by the community. Information from many threads previously written on the ROM Hacking Forum, as well as knizz's ROM decompilation will be organized and used as content. Five to fifteen content moderators will be selected or nominated, to review content submissions to the site's open submission system. They may also be responsible for updating the documentation content during early stages. Frequent contributors will be given privileges to more freely edit the content. Once the project reaches an agreeable level of maturity, I plan to initiate several projects that utilize the documentation. These include the ROM hacking IDE mentioned in the Purpose section of this manifest.

Design

We're currently working this out, but are more than happy to take suggestions. Drop one by at the IRC channel or on this thread. We've decided on a Single Page Application -- one where the page is loaded once and any further information is grabbed without impeding the user's experience. We've also decided on an Open Submission System, where edits and changes can be made by anyone. The approval process for a change can follow two paths: approval by moderator, or surpassing a number found through rough calculation of the ratio between amount of content in a change and number of upvotes for that change.

Core Contributors

Synchronous - Lead Platform Developer, Project Manager
Team Fail - Secondary Project Manager
knizz - Lead Researcher
GoGoJJTech - Content Moderator, Researcher
itari - Content Moderator
AlexAhnon - Content Moderator
Elsa - Content Moderator, Researcher
Sisyphean - Resource Compiler

Currently looking for volunteers.

Communication

Discussion relevant to rhdp can take place in this thread, in rhdp's IRC channel on Laz's website, or on the official discussion boards.
IRC: http://chat.linkandzelda.com:9090/?channels=GoGo,rhdp
BBS: http://systemic.io:8080/

Be aware that the forum technology that we use is still under heavy development, so there will be some occasional issues.

Site

The project is still in its early stages, and volunteers for the project are welcome. Fork us and submit a pull request -- we'll need all the help we can get.

Live Development: http://www.systemic.io/
Incremental Release: https://rhdp.github.io/
Git repository: https://github.com/rhdp/rhdp.git

tl;dr We are terribly disorganized and need to do something quick
__________________
Reply With Quote
  #2    
Old November 11th, 2014 (04:36 PM).
Gamer2020's Avatar
Gamer2020 Gamer2020 is offline
This love is a sickness...
 
Join Date: Jun 2008
Location: Distant Land
Gender: Male
Nature: Bold
Posts: 799
Send a message via Skype™ to Gamer2020
Quote originally posted by Synchronous:
PGE uses C#.
Actually it uses VB.Net for simplicity reasons. Also note that PGE does run on Linux these days.

Good luck with your project!
__________________
ENERGYSEARCH.ME
A Pokemon TCG database and Social network!
Pokemon Game Editor Download!
PGE is not being worked on currently but is there for those that need it.
Fun Fact: Even though PGE isn't posted on PC anymore it still has the same number of downloads per day.
Accept no imitations!
Reply With Quote
  #3    
Old November 11th, 2014 (04:45 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Quote originally posted by Gamer2020:
Actually it uses VB.Net for simplicity reasons. Also note that PGE does run on Linux these days.

Good luck with your project!
Thanks, I'll change that.

Spoiler:
Deja vu
__________________
Reply With Quote
  #4    
Old November 11th, 2014 (08:55 PM).
Xela's Avatar
Xela Xela is offline
Do you believe in yourself?
Gold Tier
 
Join Date: Feb 2008
Location: You know where.
Posts: 349
This seems promising. If it takes off and people start contributing to it, it'll be a wonderful reference resource that everyone can use to their disposal. Hopefully you'll be able to put up some sort of "demo" that everyone can take a look at and see how it'll function.
__________________
Reply With Quote
  #5    
Old November 12th, 2014 (04:58 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Team Fail is writing a clarification post to explain some of the ideas that we've discussed on IRC.

This is also actually a completely and utterly pointless thread bump that I made out of excitement
__________________
Reply With Quote
  #6    
Old November 12th, 2014 (05:03 PM). Edited November 12th, 2014 by Team Fail.
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
 
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,525
PREP FOR HYPE GUYS | View this post on PHO - Pokémon Hackers Online
First off, I'd like to mention that I can't take credit for the entire idea. I'd like to thank Synchronous for the inspiration.

Now with that out of the way, I thought I'd get in touch with other members and see about making this into a Rom Hacking site (Note, it's not strictly Pokémon!!), although there have been a few speedbumps along the way. Some members who I've pitched the idea to have different ideas on how we should do it, and I thought I'd bring it to a larger demographic to discuss and map out, as well as fix issues that pertain to this potential project. First off, here's how I'd like to implement this whole thing:

The site will have three major components. The first, a Wiki, the second a forum, and the third, an IRC channel. I'll go in-depth with each.

1. The Wiki:
The Wiki will be the home of most of the site's content. It will contain tutorials, research, and odd bits of information on aspects of various games. I'd like to keep it incredibly organised though. Something like this:
  • System 1
  • System 2
    • Game 1
    • Game 2
      • Documents
        • Doc 1
        • Doc 2
        • Doc 3
      • Patches
        • Patch 1
        • Patch 2
        • Patch 3
      • Research Projects
        • Project 1
        • Project 2
        • Project 3
    • Game 3
  • System 3
  • System 4
It's organised, and people can find things easily, instead of digging around various forum pages, trying to find exactly what they need. Instead, it's all laid out, right there, at your fingertips. Right where you need, when you need it. Even Google can't beat this.

2. The Forum:
The forum won't have as much a centering of attention. In fact, it's not the focus of the site. The point of the forum is to have a place for working on things, setting up new projects, etc etc. It'll be the starting place of most things on the site. It won't be as neatly laid out as the Wiki is, however, I'll think of something soon enough.

3. The IRC:
This will be one of the larger things to watch out for. The point of the IRC is for instant communication. People that are doing research projects can hop onto an IRC channel and get to work instantly. Users will be free to create their own channels for their projects, so that people that want to work with only their team members can do so without the interruption of others, or the ebb and flow of regular-use IRC channels.

As has been stated repeatedly in the past, Rom Hacking is dying because of a few things:

-A lack of interest
-A lack of creativity
-An increase in difficulty

What I'd like to have this site do is be able to educate, inspire, teach, and direct new and experienced Rom Hackers to ensure that the community stays tight to its roots. So another thing I'd like to see with this site is community relations. Be able to associate with various Rom Hacking/Research/Development boards, and be able to share information. This site is not designed to try and beat out other boards and sites (romhack.me, PHO, PC, jul, hcs64, etc etc), but to work alongside them, and with them, to create a network of sites.

As it stands now, there's also a few options. I've had both tossed at me. We can start in one of two different ways:
  • We can start with an existing forum/wiki, and revamp it to our needs, or
  • Get an entirely new domain, host, and start with a clean slate (I'd prefer this option, tbh. It'll be much easier to get started, instead of having to dig through piles of crap to fix stuff that could be broken.)
This will be up to everyone, really. Once we decide, I'll try getting some decent hosting, hopefully not throttled, and perhaps get a prototype site set up that we can put through a test run.

This is merely a WIP of the idea in my head. I'll probably flesh it out in time, however, I'd like to get some user feedback, and ponder upon what people have to say. If this is handled correctly, it could become a very big thing in the Rom Hacking world in a very short amount of time.
__________________
Pair 1 Pair 2 Twitter Alt 1 Alt 2 PHO Image Source Avatar Source

"On my business card, I am a corporate president.
In my mind, I am a game developer.
But in my heart, I am a gamer."

- Satoru Iwata, 1959 - 2015
Reply With Quote
  #7    
Old November 12th, 2014 (05:47 PM). Edited November 13th, 2014 by Akiba.
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Now, for some technical specifications of the project. (Rough outline, will be updated)

Domain (pro tempore):
http://rhdp.github.io/
We'll buy the domain rhdp.io if this project is backed by high community participation (or donations).

PaaS/Host:
Heroku

Github Repository:
https://github.com/rhdp/rhdp

Platform:
Node.js
MongoDB
Express
Socket.IO
Stylus
Jade
CanJS
jQuery

Relevant Languages:
Javascript/JSON
Jade (HTML)
Stylus (CSS)

Paradigm:
Single Page Application (SPA)
Open Submission System

Coding Style (for developers):
4-spaced hard tab
Single-quoted strings

Javascript Sample
Code:
var a = 1,
	b = {
		a: 'Hello',
		b: true
	},
	// synchronous
	fnSync = function(arg) {
		var result;
		// do something
		return result;
	},
	// asynchronous
	fn = function(arg, next) {
		var result;
		// do something
		next(err, result);
	};

doAsynchronousTask({
	size: 40
	encoding: 'utf-8'
}, function(err, data) {
	// do stuff with data
});
__________________
Reply With Quote
  #8    
Old November 12th, 2014 (05:49 PM).
slashtiki's Avatar
slashtiki slashtiki is offline
Just Some Average Anthropomorphic Gallade
 
Join Date: Mar 2014
Location: Like You Actually Care...
Gender: Male
Nature: Modest
Posts: 1,173
Well there isn't much I can contrubute right now(no stable home WiFi coupled with financial instability). But I can help by porting all of my tutorials and guides to the ROM Hack DB, if wanted
Reply With Quote
  #9    
Old November 13th, 2014 (09:29 AM). Edited November 14th, 2014 by Akiba.
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Quote originally posted by DJTiKi:
Well there isn't much I can contrubute right now(no stable home WiFi coupled with financial instability). But I can help by porting all of my tutorials and guides to the ROM Hack DB, if wanted
Definitely. We'd love to have as many contributors to this project as possible. Anybody with expertise our experience is more than welcome. Send me a message if you want to have write privileges or if you want to contribute in any other way.
__________________
Reply With Quote
  #10    
Old November 14th, 2014 (08:57 AM). Edited November 14th, 2014 by Rocka210.
Rocka210's Avatar
Rocka210 Rocka210 is offline
The Code Never Bothered Me Anyway
 
Join Date: Jun 2009
Age: 18
Gender: Male
Posts: 23
I have talked to both Team Fail and Synchronous and I can tell you that this is a great idea and will (hopefully) revolutionize the hacking community forever!
__________________

LET IT GO!!!!

System.Console.WriteLine("The code never bothered me anyway.");

Twitter | YouTube | Steam | PHO
Reply With Quote
  #11    
Old November 14th, 2014 (02:50 PM).
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
 
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,525
Just wanna mention that we now have a temporary IRC channel going until we can get on our own server. If you'd like to join, the server information is

Server: irc.romhackersonline.com
Port: 6667
Channel: #rhdp
__________________
Pair 1 Pair 2 Twitter Alt 1 Alt 2 PHO Image Source Avatar Source

"On my business card, I am a corporate president.
In my mind, I am a game developer.
But in my heart, I am a gamer."

- Satoru Iwata, 1959 - 2015
Reply With Quote
  #12    
Old November 15th, 2014 (02:01 AM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Progress Report:

We have now begun to develop the platform and set up the discussion system.

Relevant Information:

Live Development at: http://www.systemic.io/
Incremental Release at: https://rhdp.herokuapp.com/
Discussion Forum at: http://systemic.io:8080/

Thanks for the support, and we'll continue to keep you updated with the project.
__________________
Reply With Quote
  #13    
Old November 15th, 2014 (03:03 PM). Edited November 15th, 2014 by Akiba.
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Progress Report:

An initial protoype has been developed and can be viewed at the incremental release.

Sample content was copied from Wikipedia and placed on the server's database polyfill. We used special technologies to send this data from the server to the client with a short initial page load and negligible further latency.

A screenshot:
Spoiler:


We've also fixed the bug that crashed the discussion forum last night.
__________________
Reply With Quote
  #14    
Old November 15th, 2014 (03:06 PM).
Lost Heart's Avatar
Lost Heart Lost Heart is offline
miko-san
Crystal Tier
 
Join Date: Mar 2010
Age: 18
Gender: Male
Nature: Relaxed
Posts: 1,727
Hmm... Looking good!
Am I right in assuming there will be subtopics for each section?
__________________
Reply With Quote
  #15    
Old November 15th, 2014 (03:17 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Yeah, we'll probably implement subtopics and submissions by the next progress report.
__________________
Reply With Quote
  #16    
Old November 15th, 2014 (06:18 PM).
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
 
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,525
Quote originally posted by Synchronous:
Yeah, we'll probably implement subtopics and submissions by the next progress report.
Is there plans to add various formatting tags, as well as bars we can place on pages (For example, pages that need to be tagged as WIP, NSFW (Doubt that'll happen, but...), etc?
__________________
Pair 1 Pair 2 Twitter Alt 1 Alt 2 PHO Image Source Avatar Source

"On my business card, I am a corporate president.
In my mind, I am a game developer.
But in my heart, I am a gamer."

- Satoru Iwata, 1959 - 2015
Reply With Quote
  #17    
Old November 15th, 2014 (06:52 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Quote originally posted by Team Fail:
Is there plans to add various formatting tags, as well as bars we can place on pages (For example, pages that need to be tagged as WIP, NSFW (Doubt that'll happen, but...), etc?
I doubt there will be much NSFW content, and research is, of course, forever a WIP. Although we might add tags for different purposes.
__________________
Reply With Quote
  #18    
Old November 15th, 2014 (07:31 PM).
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
 
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,525
Quote originally posted by Synchronous:
I doubt there will be much NSFW content, and research is, of course, forever a WIP. Although we might add tags for different purposes.
Well, if we plan to target all sorts of game genres, there will certainly be some NSFW content. I'd list some examples, but...
__________________
Pair 1 Pair 2 Twitter Alt 1 Alt 2 PHO Image Source Avatar Source

"On my business card, I am a corporate president.
In my mind, I am a game developer.
But in my heart, I am a gamer."

- Satoru Iwata, 1959 - 2015
Reply With Quote
  #19    
Old November 15th, 2014 (07:41 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Quote originally posted by Team Fail:
Well, if we plan to target all sorts of game genres, there will certainly be some NSFW content. I'd list some examples, but...
Ah, yeah. I understand. We'll probably add ESRB rating tags for each specific game.
__________________
Reply With Quote
  #20    
Old November 16th, 2014 (11:26 AM).
Sisyphean Sisyphean is offline
 
Join Date: Nov 2014
Location: California
Gender: Male
Nature: Bold
Posts: 13
So as I have been combing through various threads finding data about ROM hacking, and I've come to the realization that a simple:
Spoiler:
System 1
System 2
Game 1
Game 2
Documents
Doc 1
Doc 2
Doc 3
Patches
Patch 1
Patch 2
Patch 3
Research Projects
Project 1
Project 2
Project 3
Game 3
System 3
System 4

method won't work as well. While I like the simplicity of a branched system, I feel like there is perhaps a better solution. It makes sense to organize the data like:
Spoiler:

Firered-->
Graphics-->
In Battle Graphics-->
Move Animations-->
Battle Backgrounds

But this leaves the Move Animations information only in the Graphics section of the site when it should also be in the Attacks section or in the Battle Effects section (if we choose to delineate it in such a way). We could always store the information in multiple places though which would work but it would increase the clutter as well. I feel like the solution is assigning each relevant topic a series of keywords and we could cross-reference between documents. This would make for an easier search feature as well.
Just an idea as I've found it difficult to classify data.
That being said, this is some condensed information that I have found and would classify as Battle Graphics (excluding sprites). I mainly copied and truncated tutorials and threads and then added in relevant additions made in the comment section.

Replacing Old Battle Backgrounds:
Spoiler:
Tools Needed:
Nameless TileMap Editor (NTME)
Old version of Paint/ Photoshop/ GIMP/ An image-editing program of some kind that can work with indexed images
unLZ.GBA
A Hex Editor
Free Space Finder
An Emulator with a Fire Red ROM


Starting off, make a back up of you ROM, it is very possible that things may not come out as originally intended.

Firstly, we need to create a mock-up of the background we want to insert in Paint. In this instance I’ve decided to make a background for a generic grass battle.

The dimensions of this background are 240x112 pixels if you’re interested. Some of you keen-eyed people may have noticed that I have more than the standard 15 colours plus a transparent colour as per usual in an indexed image. This is the case because I’ll be taking advantage of a second palette that can be used when we are in battle – I will go further into this later.

If you don’t know whow to index an image then there are many other tutorials that cover this. For the sake of laziness length I would advise you to find another graphics tutorial that includes indexing.

Anyway, now that we know what we want to insert, we need to make it more compact for the next step. We will need to remove as many 8x8 pixel tiles that have been repeated as possible. If we were to insert something the size of our mock-up above it would take up quite a lot of unnecessary space and possibly overwrite/ be overwritten by other graphics loaded in the RAM.

While this tileset isn’t optimal as there are still a number of repeated tiles it is close enough and has already significantly shrunken the filesize that will be inserted. There also appears to be an anomaly on the right hand side of the tileset, this is to do with the second palette that I mentioned earlier. I’ve lined up the colours in the tiles so they will directly match their places in the second palette. As this particular picture can only be made with fifteen colours (plus transparency) it has to look out of place for the time being. Nevertheless, this is what we’re going to be working with.

Now we’re going to need to extract some things via unLZ.GBA (It is possible to insert a background without doing this step, but it makes everything easier). Open your ROM in unLZ and head to picture number 3. There you should see the tileset for the current grass background. Click ‘Save As’ and put it somewhere on your computer. Click ‘Next’ to arrive at picture number 4 which just appears to be a big jumble of random lines resembling television static. This is the tilemap for the grass background, it essentially tell our tileset how to arrange itself in-game to give us a full blown battlefield. To save it click ‘RAW Dump’ and then proceed to open up NTME.

NTME is a program that allows you to create your own tilemaps to be inserted along with tilesets. For now just open up the two files you saved from unLZ and you should be able to be able to recreate the default grass background. To make it look like it should in-game select the dropdown menu underneath ‘Size (Keep Ratio)’ and select 32x64.

But this isn’t what we want – We want to aim higher and greater. Now we should open up the combination of our own tileset as well as the default grass tilemap. 99% of the time a message will pop up asking about whether some tiles should be replaced with the first tile in your tileset. Just say yes to this and move on. The result may look random, but that’s only because we’re working with old data (the default tilemap) so now we need to remake our mock-up from the beginning of the tutorial. Load your tileset and start painting! It is easiest to just follow what has already been done by mirroring the original tilemap which is why it is open now.

But we’ve only got half the story in this screenshot, there’s a lot more that has gone unseen here - NTME’s viewing window can only show a fraction of what needs to be done. This actually what we have to make by manipulating the up/ down and right/ left scroll bars.

Yup, it’s just like an iceberg: most of the image’s size lies beneath the water. A handy image that briefly covers what each part of the tilemap represents has also been included for your convenience.

Once you’ve recreated your battle background we need to make sure it is using the correct palette. Select the ‘PaletteMap’ tab at the bottom of NTME and the viewing window should change to a series of numbers overlaying your background. These numbers indicate which palette the tiles will be loaded from when being played in-game. The only two numbers which we are interested in are two and three as they are what the game uses in its original backgrounds.

This is the point where if you prepared ahead of time you will be able to add more than fifteen colours (plus transparency) to your background. In this background I have a large strip of background that isn’t supposed to use the same palette as the majority of the background. There is a catch when it comes to adding a second palette though – It can only have a maximum of seven new colours. You will be able to see why this is the case later on, but for now know that you are restricting in how much you can add. Anyway, this is how my palette map will look, where palette two applies the full fifteen colour palette while palette three will only apply the restricted seven colour palette.

And with that, we’re finished making the tilemap for our background – Now it is time to insert both it and the tileset into the ROM. Reopen unLZ.GBA and head to the background of your choice. Once you’re at your background’s position select ‘Import’ and open your tileset. Select ‘Write to ROM’ and a second smaller window should pop-up; this is where we shall decide where the tileset will be inserted in the ROM. I’m going to be inserting the tileset at 0x720000 in the FR ROM as there is quite a lot of free space from there so I know nothing will be accidentally overwritten.

Don’t try to insert the palette accompanying the tileset at this point. Unlike other compressed images like Pokemon sprites, the proper palette isn’t attached to the tileset in unLZ – We need to change it manually later. Now let’s enter a battle and see how it’s looking.

It should not look great at this point. We have to insert the tilemap to fix this problem. Click ‘Next’ in unLZ and you should have returned to the tilemap from earlier. Rather than simply importing the tilemap like the tileset there is a slightly different method as it is not an image file (though unLZ is able to translate it into one). Select ‘File > Load RAW’ and select your custom tilemap. Now we just have to write it to the ROM in the exact same manner we did with the tileset. I’ve chosen to insert it directly after my tileset which means it will be located at 0x720400 according to HackMew’s Free Space Finder.

With both our tileset and tilemap inserted the background should be shaping up far better than before.

Alright, that’s looking much better – Our background actually has a recognisable structure now. We are now up to the final part of our insertion method, altering the palette. As you must have noted several times throughout this tutorial I have deferred talking about the background palettes for one reason or another. This was because it would have been quite jarring to interrupt with notes on how the palettes are structured as they differ from ordinary compressed and uncompressed palettes.

The palettes which are assigned to battle backgrounds are made from two palettes, palettes 0x2 and 0x3 in your emulator’s background palette viewer. Both of these palettes are highly interlinked as 0x3 borrows most of its data from 0x2 to save some space. This has caused them to appear fractured with a byte jutting out after every fourth word.

Thanks to this interlinking we cannot simply open up palettes in a palette editing program such as APE, even if it is instructed to uncompress the palette.

There is one main way to find your palette. Search for the first string of four words of your background’s 0x2 palette (I’ll discuss palette 0x3 shortly). You can do this by entering a battle with your chosen background, opening the palette viewer and reversing the colour values (e.g 0x1234 becomes 34 12). In the last screenshot you can see this as the string ’00 00 FC 73 D4 3F 90 3F‘ in front of the first marked byte. At this point you can just calculate the HEX values of your new palette and overwrite the current words but keep in mind the stray bytes - Leave them as they are.

Now when we check our background in-game.

Awesome, we’re almost done. This part of the tutorial is only needed if you have chosen to utilise palette 0x3 in conjunction with 0x2. Since palette 0x3 is interwoven with palette 0x2 it is generally more garbled and difficult to find if you don't know what to do. Once you have found palette 0x2’s location, palette 0x3 should be somewhere nearby, but you should only search for the NEW values that are present in 0x3. In my case, when I searched for the grass background’s first two new values in palette 0x3 (92 37 4E 37) I found them at 0x24842B. Changes these values (once again looking out for any stray bytes) and save your ROM.

Congratulations, you have just inserted your first battle background!

There are also some lesser know things you have to be aware of when inserting particular backgrounds.
The grass background also doubles as the background for when your Pokemon evolves. Be sure to not have an extra-large battle platform that stretches out into the centre of your tilemap in NTME otherwise it will be visible during the cutscene.
The Gym battle background is linked to the field and three other backgrounds. Their palettes are incredibly garbled and you would be lucky to get more than 7-8 colours out of them.


Expanding Number of Battle Backgrounds
Spoiler:
I am going to take you into the data aspect of editing battle backgrounds. 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:


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. 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:



How to Do this in other ROMS

SWI 0x12 is LZ Decompression. Using the logging feature in VBA, log that as the battle starts. You will get a list of all calls to an SWI. Some will be LZ decompression with an offset after. That offset is for an image. Go there in a graphics editor until you find the right one.

BGs are the same on all advance gen games, just in different locations, so use the logging feature to find one in ruby, then search for its pointer in the rom and you will find the table I talk about in my post. This table will tell you all you need to know about palettes, bgs, raws, EVERYTHING.
Everything is the same, just the offsets are different.

How to find offsets in other ROMS:


1) Go into tall grass in VBA-M.

2) BEFORE the battle, go into Tools-> Logging.

3) Check the box "SWI" and then click "Start".

4) Close that window.

5) Enter a battle.

6) Once the battle bg has loaded, go into the logger and save all of the junk that was there to a txt file.

7) Open that txt file in Notepad.

8) Hit "CTRL+F" and type this:

If you see a lot of CPUSets: type "LZ" in the box.

If you see a lot of SWI 0x8, type "SWI 0x12" in the box.


9) Click "Find".

You should now be brought to either an SWI 0x12 or an lz decompression (same thing, just different ways of writing it.)

10) Now, look for an 4 byte hex number that looks like 0x08XXXXXX just to the right of the text we found. This is the offset of an image that was decompressed.

11) Go into an image viewer like NSE 2.X or GBA Graphics editor and go to that offset.

12) Is this a bg???? If no, repeat steps 8 -> 12 until it is. If it is, continue:

13) Take that offset, and reverse it:

So, 08XAYBZC -> 08 XA YB ZC -> ZC YB XA 08.

Ex. 08 12 34 56 becomes 56 34 12 08.

Search that in a hex editor. Now you have found the table I talk about in my post. Cool.

How to Find a Palette
There is one main way to find your palette. Search for the first string of four words of your background’s 0x2 palette (I’ll discuss palette 0x3 shortly). You can do this by entering a battle with your chosen background, opening the palette viewer and reversing the colour values (e.g 0x1234 becomes 34 12). In the last screenshot you can see this as the string ’00 00 FC 73 D4 3F 90 3F‘ in front of the first marked byte. At this point you can just calculate the HEX values of your new palette and overwrite the current words but keep in mind the stray bytes - Leave them as they are.

VBA has a built in Palette viewer. Use it in battle and look through to find the palette you need on the left hand side.

Emerald Battle Backgrounds

Alright! This is the Battle Backgrounds table for Emerald. The table has the same concept for each background as FireRed has. I dunno if anyone already posted this kind of research but let's just say that I made fine research. LOL Having this format of having five pointers for each background:

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
The difference between FireRed and Emerald is that the Emerald's table only covers 10 backgrounds which are in this list:
Grass 1 (Normal Grass)
Grass 2 (Tall Grass)
Sand
Dive
Sea
Pond
Craggy
Cave
Trainer Battles (Indoor)
Trainer Battles (Outdoor) "can be called as the outdoor FIELD"

The table begins at 31ABA8 and ends at 31AC6F. The table hasn't the background for Gym Leader battles, Hideout battles, Pokemon League battles, Battle Frontier battles (doesn't count the Smeargle cave underneath Battle Frontier), and the backgrounds for the Weather Trio battles isn't in the table too. I'm pretty sure that the table is somewhere else but they are located separatedly. Here is the documentation of each background and their offsets and pointers in the original table:

Code:
- Grass 1 (Normal Grass)
--- D77D68 (image) - pointer 68 7D D7 08 at 31ABA8
--- D75008 (image tilemap) - pointer 08 50 D7 08 at 31ABAC
--- D7E280 (entry image) - pointer 80 E2 D7 08 at 31ABB0
--- D7E808 (entry image tilemap) - pointer 08 E8 D7 08 at 31ABB4
--- D78318 (image palette) - pointer 18 83 D7 08 at 31ABB8

- Grass 2 (Tall Grass)
--- D78600 (image) - pointer 00 86 D7 08 at 31ABBC
--- D78CB8 (image tilemap) - pointer B8 8C D7 08 at 31ABC0
--- D7E9C4 (entry image) - pointer C4 E9 D7 08 at 31ABC4
--- D7F0D4 (entry image tilemap) - pointer D4 F0 D7 08 at 31ABC8
--- D78C78 (image palette) - pointer 78 8C D7 08 at 31ABCC

- Sand
--- D78F68 (image) - pointer 68 8F D7 08 at 31ABD0
--- D795A8 (image tilemap) - pointer A8 95 D7 08 at 31ABD4
--- D7F3C0 (entry image) - pointer C0 F3 D7 08 at 31ABD8
--- D7F850 (entry image tilemap) - pointer 50 F8 D7 08 at 31ABDC
--- D79560 (image palette) - pointer 60 95 D7 08 at 31ABE0

- Dive
--- D79858 (image) - pointer 58 98 D7 08 at 31ABE4
--- D79E58 (image tilemap) - pointer 58 9E D7 08 at 31ABE8
--- D7F9F8 (entry image) - pointer F8 F9 D7 08 at 31ABEC
--- D7FEC4 (entry image tilemap) - pointer C4 FE D7 08 at 31ABF0
--- D79E10 (image palette) - pointer 10 9E D7 08 at 31ABF4

- Sea
--- D7A108 (image) - pointer 08 A1 D7 08 at 31ABF8
--- D7A720 (image tilemap) - pointer 20 A7 D7 08 at 31ABFC
--- D80054 (entry image) - pointer 54 00 D8 08 at 31AC00
--- D80660 (entry image tilemap) - pointer 60 06 D8 08 at 31AC04
--- D7A6DC (image palette) - pointer DC A6 D7 08 at 31AC08

- Pond
--- D7A9D0 (image) - pointer D0 A9 D7 08 at 31AC0C
--- D7AFB8 (image tilemap) - pointer B8 AF D7 08 at 31AC10
--- D80804 (entry image) - pointer 04 08 D8 08 at 31AC14
--- D80D50 (entry image tilemap) - pointer 50 0D D8 08 at 31AC18
--- D7AF78 (image palette) - pointer 78 AF D7 08 at 31AC1C

- Craggy
--- D7B268 (image) - pointer 68 B2 D7 08 at 31AC20
--- D7B864 (image tilemap) - pointer 64 B8 D7 08 at 31AC24
--- D80E9C (entry image) - pointer 9C 0E D8 08 at 31AC28
--- D8147C (entry image tilemap) - pointer 7C 14 D8 08 at 31AC2C
--- D7B828 (image palette) - pointer 28 B8 D7 08 at 31AC30

- Cave
--- D7BB14 (image) - pointer 14 BB D7 08 at 31AC34
--- D7C154 (image tilemap) - pointer 54 C1 D7 08 at 31AC38
--- D81610 (entry image) - pointer 10 16 D8 08 at 31AC3C
--- D81E2C (entry image tilemap) - pointer 2C 1E D8 08 at 31AC40
--- D7C10C (image palette) - pointer 0C C1 D7 08 at 31AC44

- Trainer Battles (Indoor)
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC48
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC4C
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC50
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC54
--- D7DEB4 (image palette) - pointer B4 DE D7 08 at 31AC58
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.

- Trainer Battles (Outdoor) "almost going to be called as the outdoor field"
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC5C
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC60
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC64
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC68
--- D7C404 (image palette) - pointer 04 C4 D7 08 at 31AC6C
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.
For Gym Leader and Battle Frontier battles, they have separated backgrounds. Now, here is the documentation on other special backgrounds and I just give the location of their pointers:

Code:
BATTLE FRONTIER image pointer @ 03579C
BATTLE FRONTIER image tilemap pointer @ 0357A4
BATTLE FRONTIER image palette pointer @ 0357AC

GROUDON image pointer @ 0357D0
GROUDON image tilemap pointer @ 0357D8
GROUDON image palette pointer @ 0357E0

KYOGRE image pointer @ 035804
KYOGRE image tilemap pointer @ 03580C
KYOGRE image palette pointer @ 035814

RAYQUAZA image pointer @ 035838
RAYQUAZA image tilemap pointer @ 035840
RAYQUAZA image palette pointer @ 035848

GYM LEADER image pointer @ 035884
GYM LEADER image tilemap pointer @ 03588C
GYM LEADER image palette pointer @ 035894

CHAMPION image pointer @ 0358B0
CHAMPION image tilemap pointer @ 0358B8
CHAMPION image palette pointer @ 0358C0

"Gym Style (AM)" image pointer @ 035964
"Gym Style (AM)" image tilemap pointer @ 03596C
"Gym Style (AM)" image palette pointer @ 035974
* (AM) - Advance Map

MAGMA HIDEOUT "Team Rocket Style (AM)" image pointer @ 03598C
MAGMA HIDEOUT "Team Rocket Style (AM)" image tilemap pointer @ 035994
MAGMA HIDEOUT "Team Rocket Style (AM)" image palette pointer @ 03599C
* (AM) - Advance Map
* Although that the Ruby's Magma Hideout isn't used in the normal gameplay of Emerald, it exists in Emerald just for a standard "Team Rocket Style" and for FireRed, it is used in Pokemon Tower.

AQUA HIDEOUT "03 (AM)" image pointer @ 0359B4
AQUA HIDEOUT "03 (AM)" image tilemap pointer @ 0359BC
AQUA HIDEOUT "03 (AM)" image palette pointer @ 0359C4
* (AM) - Advance Map
* In Emerald, the "03 ???" from the Fight Type, it is the Aqua Hideout. Although that in FireRed, it appears to be for Rocket Hideout.

ELITE FOUR 1 image pointer @ 0359DC
ELITE FOUR 1 image tilemap pointer @ 0359E4
ELITE FOUR 1 image palette pointer @ 0359EC

ELITE FOUR 2 image pointer @ 035A04
ELITE FOUR 2 image tilemap pointer @ 035A0C
ELITE FOUR 2 image palette pointer @ 035A14

ELITE FOUR 3 image pointer @ 035A2C
ELITE FOUR 3 image tilemap pointer @ 035A34
ELITE FOUR 3 image palette pointer @ 035A3C

ELITE FOUR 4 image pointer @ 035A5C
ELITE FOUR 4 image tilemap pointer @ 035A64
ELITE FOUR 4 image palette pointer @ 035A6C

"Big Red Pokeball (AM)" image pointer @ 035A90
"Big Red Pokeball (AM)" image tilemap pointer @ 035A98
"Big Red Pokeball (AM)" image palette pointer @ 035AA0
* (AM) - Advance Map
So far, that's only the separated backgrounds I've found in Emerald. Some of the images are aligned with the first ten backgrounds or the other backgrounds so be careful while repointing. Example: You have a background for the Elite Four and Champion but it relates with the Team Rocket Style background. I suggest that if you have good instincts, insert the image without repointing and just edit the pointers manually by using a HEX editor. I just gave all the information I have found so you won't be having problems dealing with Emerald background. I hope this help you a lot. Good luck!

Credits
karatekid552
RaileysXerilyasRx
Driver
Drfuji
Jambo51
Darthatron
Mat
Tajaros
Narutoactor


Creating Custom Animation Particles:
Spoiler:
Just to reiterate all the offsets are for FireRed and Emerald.

Tools Needed:

A Hex Editor (I recommend HxD, it's free and amazing)
unLZ-GBA (preferably the hacked one)
Windows Calculator, or any other Calculator that can do sums in Hex.


General Information on the structure of the table:

The table begins at 0x83ACC08 and ends at 0x83ADE18. This table contains both
the particle and palette information.

The actual particle information goes from 3ACC08 to 3AD50F.
Each particle entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the particle image at ZZ YY XX) XX YY (size of the particle YY XX) XX 28 (the index, the second byte of which will be 27 or 28, for expansion purposes it will be 28)

The palette information goes from 3AD510 to 3ADE18
Each palette entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the palette at ZZ YY XX) XX 28 (the corresponding particle index) 00 00 (padding)


STEP 1:

Using your Hex Editor, goto offset 0x83ACC08 in Fire Red or 0x8524B44 in Emerald and select 1210 blocks (hex).




STEP 2:

Copy the selected area, then find a good free space area to paste it to. Make sure you use Ctrl B (Paste Overwrite) otherwise the Rom will stop working. For this tutorial I'll be using the offset 960000, though you can realistically place it anywhere you want with realistically about 1300 bytes of free space.





STEP 3:

Now you'll have to change all the pointers to the original offset for those of your current offset. A pointer is laid out in the structure XX YY ZZ 08, wherein XX YY ZZ 08 would point to ZZ YY XX 08. Using the original offset 3ACC08 for Fire Red, the pointer would be 08 CC 3A 08. For the new offset 960000, our pointer would be 00 00 96 08. Navigate to the start of the rom and click Ctrl r (replace). Search for 08 CC 3A 08 in Fire Red or 08 44 4B 52 in Emerald and replace with 00 00 96 08 and click replace all (make sure hex values is selected). There should only be two instances of this pointer located in the 0x8072000 area for Fire Red (this is where the loading routine is located).




STEP 4:

This is the part in which we add new particles. You will need to make the majority of these yourselves, as I make them I'll be sharing them with the community. For the purposes of this tutorial I've attached the image for Wood particles.

Open up unLZ-GBA. Import your image (make sure it's indexed), and click write to rom. Make sure only 'Export Image' is selected. Type in your desired offset into the image box, for the purposes of this tutorial I'll be using 940000, and click OK.



After doing that navigate to that offset in your Hex Editor and scroll through until you reach free space again, make a note of that offset.



Return to unLZ and once again click write to rom, this time however make sure only 'Export Palette' is selected, then type the offset you just got into the palette box.




STEP 5:

Now that the particles are in the rom, we have to add them to the table. Unlike other expanded tables, the particle and palette information are part of the same table. As such we can't just add the entries to the end of the table. What we have to do first is navigate to the start of the palette information, now at 960908, and then select the rest of the table, this can be done easily by just selecting 1000 bytes (hex).



Now copy the data and paste it 8 bytes after where it originally was, in this case that would be 960910.



Now at 960908 we have to add our particle entry. As mentioned before the data is set up as a pointer, the size and then the index. First write the pointer to your image, in this case 00 00 94 08.
The size is equal to half the area of the image. eg. Our image is 32x192, which is equal to 1800 in hex. As such, our size would be half of 1800, which is 0C00, so we'd write 00 0C. Finally we'd choose our index number. The last used one in the rom is 30 28, as such anything up from there is available to be used.



Now we just need to add our palette information. This is thankfully easier, just navigate to the end of the table, this can be done easily by searching for FF bytes. If using the offsets of this tutorial it should now be 961218. As mentioned before the palette information is listed in this structure, pointer to the offset of the palette, index number, filler bytes. First write the pointer to your palette, in this A8 04 94 08, follow it up with the same index number you used for the particle in this case 31 28, and then add 00 00.



Congratulations! You've set up your first particle.

Note: For future entries, you will have to repeat the procedure, by constantly moving the palette part of the table back to allow space for entries. It is not particularly convenient, but it's not too difficult either.


STEP 6:

You may now think, great I have fully working new particles. Well that's not entirely true, first we have to alter the loading routine. If you do not, the moves will just freeze, or the rom will restart, as they will not be able to load the proper information. Luckily its easily fixed by changing a few pointers.

Navigate to the offset 0x80728B7 in Fire Red or 0x80A3D74 in Emerald, you should see two pointers. These are the pointers used in the particle loading routine and the palette loading routine respectively. The reason for this being, that the loading routine takes these offsets and then adds a variable number dependent upon the particle being used in the routine to this offset to reach the relevant area of the table.



We'll have to change these two pointers, so they now properly go to the 960000 area. As such we're going to have to start doing some calculations, so open up Windows Calculator (or an alternative) and access programming mode (alt+3). Subtract the offset of the first pointer (399388) from the original start of the table (3ACC08). You should get the number 13880.



Now substract that number from the offset in which you repointed the table to, and you'll have the offset to change the first pointer at 728B7 to. If using this tutorial, you should get the offset 94C780, and as such, the pointer 80 C7 94 08. Then change the pointer.




The palette pointer is done in more or less the same way. Because we already know the variable number (13880) that is added to both pointers, we can simply substract 13880 from the current start of the palette information, which if you've been using the same offsets will be located at 960910. You should get the offset 94D090, and as such the pointer 90 D0 94 08. Then change the pointer.

Something key to note though. Is that for every new particle you add to the table, you will have to add a value of 0x8 to the palette loading pointer. Eg. If you added an extra particle to the one already added, it would become 98 D0 94 08. You will not need to do this for the particle loading pointer.





There is one more thing to fix, and that is the Shiny Pokemon entry animation!
Otherwise, if a Shiny Pokemon is sent out into battle the game will freeze.

STEP 7:

Navigate in your hex editor to 0x80F17E8 in Fire Red or 0x8172FB8 in Emerald, you should see two pointers.
Change the first pointer from what it is to the pointer to the new offset of
the F9 27 particle, which if you followed this tutorial is 960748, for those who
did not use the same offsets, you can easily find it by searching for this string
38 87 D2 08 C0 00 F9 27.

The second pointer is the palette, so just change the pointer to the new offset
of the F9 27 palette. Because each time you extend the table the palette will
change, you'll have to add 8 to this pointer everytime you add a new particle.
To find it search for this string BC 87 D2 08 F9 27 00 00.


And there you have it! Custom particles.


I'd once again like to thank Karatekid552 for getting the ball rolling, and for his documentation.
Also credits to HidoranBlaze for finding the relevant Emerald offsets.



ASM Routine to add many Particles

Just a tip for any of you planning to add a lot of new particles at once:

You can use asm to create a table much easier than typing everything in HxD. You don't need to know any asm to do this either. Here:

Code:
.align 2 /*Make sure everything is aligned.*/
.text

main:
.word 0x08960000 /*Your pointer to an image, not reversed!*/
.hword 0xC00 /*Data size, once again, not reversed.*/
.byte 0x31 /*Particle number.*/
.byte 0x28 /*Particle table. Either 27 or 28 like mrdollsteak said.*/
So yeah, just compile this using HackMew's compiler or another ARM compiler and you will have an 8 byte entry. For more entries, you can just repeat this template over and over in the same file:

Code:
.align 2 /*Make sure everything is aligned.*/
.text

main:
.word 0x08XXXXXX /*Your pointer to an image, not reversed!*/
.hword 0xXXXX /*Data size, once again, not reversed.*/
.byte 0xXX /*Particle number.*/
.byte 0xXX /*Particle table. Either 27 or 28 like mrdollsteak said.*/
Like this:

Code:
.align 2
.text

main:
/*Particle 1*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 2*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 3*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 4*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 5*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*et cetera*/
Credits:

Mr Dollsteak
Karatekid552
HidoranBlaze


Creating New Attack Backgrounds:
Spoiler:
Extending the Number
So here's what we need:
1. FireRed Rom
2. Hex Editor (I'll be using HxD)
3. Notepad
4. Custom Background (Background must be divisible by 8 and indexed), and Tilemap.
5. VBA
6. Free Space Finder (Optional if you know how to things right)
7. NTME/DARTHTME
8. UNLZ

Ok, so first let's get it down with the table offsets.

The table starts at 0x3ADE18, and ends at 0x3ADF5B. The table are all pointers so we'll just to have put pointers for our image, pallete, and tilemap. It goes like this.

[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08]
XX = pointer to graphics
YY = pointer to palette
ZZ = pointer to tilemap



So let's get it down to extending it.

Step 1) Open your FireRed Rom in a Hex Editor




Step 2) Goto offset 0x3ADE18


Now select 0x144 or 3444 bytes.

And then Ctrl+C or simply copy.


Step 3) Find some free-space that can hold 0x144 bytes so to make things easier I'll be using 0xA00000. So goto 0xA00000.



And paste it using Ctrl+B (though in Hex Workshop you have to highlight the 0x144 bytes and then Ctrl+V)

Make sure you don't use Ctrl+V or else the size of the Rom will change but it's only in HxD.
And then Ctrl+S or Save.


Step 4) Repointing the location of our table.

since it's located at 0xA00000, we need to search for a pointer pointing to 0x3ADE18. So the pointer will be looking for is 18 DE 3A 08 Find it using Ctrl+F and change it to our current table location which is 0xA00000 so replace it with 00 00 A0 08. But since it's only one pointer I'll just give the offset of the pointer so you can change it directly. The offset of the pointer is 0x73960. So goto 0x73960...

And write our new pointer.

Then Ctrl+S or Save. And there you have it you have successfully repointed the Background Animation Table.


Ok, so originally there are 0x1A or 26 backgrounds in the game. So with that small amount we can insert many custom backgrounds as we want.

Step 5) So now we'll be inserting our new background. So for it to be easy I'm gonna use the Waterfall Animation in DP. I'll be putting out a download link for the Waterfall so you can try it out.

First make sure the image is indexed and it's size is divisible by 8 so it can be accepted by UNLZ. So Load your Rom in UNLZ.

Then Load your Background I'm gonna use the Waterfall background.

Now Click Write to Rom. I'll be using 0xA10000 and 0xA20000 for the image and pallete respectively. Make sure to uncheck the Automatically Fix Pointers Checkbox.

Then Click Ok. After that load your Raw file or Tilemap that you made using NTME. (I'm not gonna cover that here but the right size for the tilemap 32x32 just in case you don't know. And also have pallete #2 for the image.)
Now goto file and then Load Raw...


Now Click Write to Rom, make sure you uncheck everything except for Export Image. I'm gonna use 0xA30000 for the tilemap offset.

Now Click ok, and you're done inserting.


Step 6) Now will be placing the new pointers in our table.

Our Image Offset is - 0xA10000
Our Pallete Offset is - 0xA20000
Our Tilemap Offset is - 0xA30000
So we'll place 00 00 A1 08, 00 00 A2 08, and 00 00 A3 08 at the end of our table in 0xA00000.

And then Ctrl+S or Save.
By doing that the background will take up 0x1B so put that in your battle animation and test it in your game.


Step 7) Testing time



Taa Daa! Now you can Insert more custom backgrounds yourself...


Credits:
Tajaros
Chaos Rush
Jambo51
Itman
Hackmew
Darthatron
D-Throgh


Manipulating Attack Animations:
Spoiler:
There are at least two types of actions:
1) a background
2) a movement of a graphic (requires loading correct graphics)

Note: Everything in this document/tutorial is designed with FireRed in mind. There are pointers within the animation scripts, meaning that unfortunately, these have to be ROM-specific. These will work with FireRed, and only FireRed.

Here's what I've got of the scripting language so far: (credits at bottom of post for people who found these)
------------------------------------------------------------------
00 XX 27 = loads image data, XX is an argument
00 XX 28 = same thing as above, but loads from a different bank of graphics

02 = executes current animation segment
05 = waits for current animation segment to finish
06 = does absolutely nothing
07 = does absolutely nothing
08 = ends the animation script (DO NOT CONFUSE WITH POINTER!!!)

0E XX XX XX 08 = jumps to another animation, continues execution of original script when finished (can be used to combine multiple animations to play right after another)
11 XX XX XX 08 = same as above, haven't figured out the difference yet

19 XX XX = plays a sound

Display a non-scrolling, static background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 WW 17
Display a scrolling background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 WW 17 03 2D B8 0B 08 05 04 00 XX 00 YY ZZ 00 FF FF
-WW = selects which background graphics to display

Code:
Choose one of these for the WW byte:
00 = Dark-type BG, example: Faint Attack
01 = same as 00
02 = Ghost-type BG, can scroll horizontally, example: Shadow Punch
03 = Psychic-type BG, example: Psychic (EXCEPT IT DOESN'T ANIMATE)
04 = high-impact BG, light coming from top right, example: Focus Punch
05 = high-impact BG, light coming from bottom left
06 = high-impact BG, light coming from top left
07 = Horn Drill BG, can scroll horizontally and vertically, example: Horn Drill
08 = same as 07, but image is mirrored horizontally
09 = high-speed BG, can scroll horizontally, example: Mach Punch
0A = same as 09, but image is mirrored horizontally
0B = Thunder BG, can scroll horizontally, example: Thunder
0C = Guillotine BG, light coming from top right, example: Guillotine
0D = Guillotine BG, light coming from bottom left
0E = Guillotine BG, light coming from top left
0F = Ice-type BG, can scroll horizontally, example: Sheer Cold
10 = Space-oriented BG, can scroll horizontally and vertically, example: Cosmic Power
11 = Seismic Toss/Sky Uppercut BG, can scroll horizontally and vertically, example: Sky Uppercut
12 = Flying-type BG, can scroll horizontally and vertically, example: Sky Attack
13 = same as 12, but image is mirrored horizontally
14 = Aurora Beam BG, can scroll horizontally, example: Aurora Beam
15 = Fissure BG, can scroll horizontally (but it artistically makes no sense to do so), example: Fissure
16 = Silver Wind BG, can scroll horizontally, example: Silver Wind
17 = same as 16, but image is mirrored horizontally
18 = SolarBeam BG, light coming from top right, example: SolarBeam
19 = SolarBeam BG, light coming from bottom left
1A = SolarBeam BG, light coming from top left
-XX = how fast background scrolls horizontally
-YY = how fast background scrolls vertically
-ZZ = not sure but its either 00 or 01

Judging by unLZ, these backgrounds are simply tilesets+tilemaps. If we could find the table(s), we could theoretically expand them and have custom backgrounds.

To display the Psychic-background correctly, do not use the scrolling background command, instead use the 0E command, using it like this:
Code:
0E BB 59 1D 08
This will display the Psychic-type BG, while also animating it correctly.

To end any scrolling background (also works with the Psychic-BG animation):
Code:
0E C7 59 1D 08
Usually this is placed at the end of the script. If you're going to place it at the end of the script, make sure you add an extra 08 byte to the end of it, otherwise the game will freeze.

The table for the battle backgrounds starts at 0x3ADE18, and ends at 0x3ADF5B. The format goes like:
[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08] XX = pointer to graphics, YY = pointer to palette, ZZ = pointer to tilemap

Some other info (remember, these are FireRed offsets):
0x247094 = Attack names
0x250C04 = Attack data
0x4886E8 = Attack description pointers
0x1D65A8 = Battle script pointers
0x1C68F4 = Attack Animation pointers

To find the offset of an animation, follow these instructions:


1. Go to Bulbapedia's List of Moves
2. Find the move you want (for the sake of this example, we'll be using Surf)
3. According to the list, Surf is #57 in the game index
4. Open up Windows Calculator, switch to Programmer mode
5. (make sure the option on the left tab is set to, "Dec") type in 57 (or whatever number your attack is)
6. Click on "Hex"
7. Multiply it by 4
8. Add it by 1C68F4
9. Whatever the sum is, that offset contains the pointer to your animation. Open up a Hex editor, and go to that offset
10. The sum I got was 1C69D8. The bytes there are 01 FA 1C 08. The 08 indicates its a pointer.
11. If you know how to calculate pointers manually, good for you. If you don't, go find a Pointer Calculator on Google or something, or figure out how. With that said, the bytes 01 FA 1C 08 means its pointing to offset 0x1CFA01.
12. 0x1CFA01 is the Surf animation. Congratulations, you found the offset of your animation!

(To figure out when the animation starts and ends, simply make a new attack (assuming you've already looked at Jambo51's thread on adding new moves), and expand the attack animation table, and then paste the data of the Surf animation (or whatever attack) into free space and point one of the new attacks to that data. Then open up VBA, open up its Memory Viewer, and go to that data. Then replace the bytes and the end with FF, and keep testing it until the animation crashes (it should only crash when you change an 08 byte) Once it crashes, open up your hex editor, and go to the offset of the data, then make it look like how it does in VBA's memory viewer, then add an 08 at the end with the hex editor.

Eventually I will post a list of all the animation offsets, I haven't finished typing them all out yet.

Step-by-step example at creating a custom animation:
Example 1: Adding a background to an existing animation


So let's say we wanted to create a 4th Gen move. How about... Night Slash. We'll use Slash with the Dark-type background.

1. Using the steps I showed earlier in this thread, find the offset of whatever animation you want to base it by. The Slash animation is at 0x1caf7b. Insert the Slash animation data into free space, and then go to Night Slash's (or whatever your move is called) slot in the animation table and point to the animation data you just inserted.

2. For anyone else using it off of Slash's animation, this is the hex data for the Slash animation:
Code:
00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08
Right now, our animation looks exactly like Slash:


3. Now earlier in this thread, I mentioned the scrolling background animation command. Use it, and set WW as the Dark-BG. Place it at the beginning of the animation, and the Slash animation right afterwords. Our animation data should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08

Now we got the Dark-background! ...except that it doesn't disappear after the attack is done. That's because we need to add the BG-clear command.

4. As I mentioned earlier, the BG clear command is: 0E C7 59 1D 08. Remove the 08 byte from our current animation (NOT THE BG COMMAND!!!), then add the BG clear command at the end, and add an extra 08 byte to end the animation, otherwise the game will crash. Our script should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 0E C7 59 1D 08 08

Now we have a flawless Night Slash animation! And yes, the background will return to normal after execution of the attack.

Just for giggles, you can alter the second byte of the BG command (which also happens to be the second byte of our entire Night Slash animation) to change the background (I referred to it as the WW byte):


And that, is essentially how you take a non-BG animation and add a BG to it.


Example 2: Merging two animations to play right after another

Just find two separate animation hex data, and then remove the 08 byte from the end of one of them (except if its a pointer), then place the data of the second animation right after it. Alternatively, you can use the 0E or 11 command and point directly to it, but this will limit you to merging only 2 animations. By manually placing the data, you can have as many as you want, meaning you can create a move like, "Ridiculous Tackle", and have an animation that has the player Tackling the opponent 6 times.

If there's an 05 byte before the 08 byte, remove it, and then they'll play at the same time (perhaps with a slight delay)

I found that there's a special code or something to use backgrounds that are different depending on if you use the move or if the opponent does because if you use a regular command for example if you try the high power background you'll understand. I came across two pointers, one to use for the scroll flying type background and one for the high power one.

High Power - 0E 89 7D 1C 08
Flying background - 0E CF 59 1D 08

To do colored backgrounds like Giga Drain, insert the following:

02 24 7B 3E 08 02 05 01 00 SS 00 00 00 YY 00 XX XX 05

Where XX XX is the color you want, YY is the intensity (0C for Giga Drain- 10 replaces the background entirely with the given color), and SS is the speed of the transition (01 for Giga Drain, but I imagine Hyper Beam and other attacks use the same logic with a higher value). To revert the background to normal, place the following:

02 24 7B 3E 08 02 05 01 00 SS 00 YY 00 00 00 XX XX 05 0B 03 0D

The values here do not have to be the same, but I'd advise making the color and intensity the same or it will abruptly change at the start of the transition back.

This allows us to accomplish animations that benefit from backgrounds without always having to insert new ones.

Some random things:

15 17 and 15 16 appear to reset the background to normal.

21 07 XX 00 YY YY YY YY branches to YY YY YY YY if the side the attacker is on matches XX. Mega Punch's custom background operates by placing two of these in a row (with XX = 00 and 01) to branch to subroutines that set the background to the correct one and then return.

0F appears to return to where the initial script left off after a branch.

The first parameter of the 02 command always seems to be a pointer to some animation data- this structure is 24 bytes long.

The first two bytes indicate what image data to use, while the next two bytes indicate the palette. The enumeration for this is the same as that of the 00 command- in order for an effect to work properly, the 00 command must have been called for both of these- otherwise the palette and/or image will not be loaded. While the existing animations appear to always have these be the same, they don't have to be- you can for instance give the Stun Spore seeds Fire Blast's palette this way. For some animations both of these are 00- I believe these are effects that don't use images, such as Earthquake's screen-shaking.

I'm not entirely sure what the rest of the bytes do, but it appears the two pointers after these values contains more image data (I think the dimensions and how it animates, respectively) while the rest of it has to do with how the effect plays out. I've fiddled with it a bit and done some interesting things.



Credits:
Chaos Rush
Jambo51
DoestKnowHowToPlay
Darthatron
DreamEngine


To call this truncated might seem a little silly considering the length of each topic, but a lot has been removed. This is a link to the thread that contains the patch talked about in "Creating Custom Animation Particles": http :// www pokecommunity com/showthread php?t=302401(can't post full links).
Reply With Quote
  #21    
Old November 16th, 2014 (12:33 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Quote originally posted by Sisyphean:
So as I have been combing through various threads finding data about ROM hacking, and I've come to the realization that a simple:
Spoiler:
System 1
System 2
Game 1
Game 2
Documents
Doc 1
Doc 2
Doc 3
Patches
Patch 1
Patch 2
Patch 3
Research Projects
Project 1
Project 2
Project 3
Game 3
System 3
System 4

method won't work as well. While I like the simplicity of a branched system, I feel like there is perhaps a better solution. It makes sense to organize the data like:
Spoiler:

Firered-->
Graphics-->
In Battle Graphics-->
Move Animations-->
Battle Backgrounds

But this leaves the Move Animations information only in the Graphics section of the site when it should also be in the Attacks section or in the Battle Effects section (if we choose to delineate it in such a way). We could always store the information in multiple places though which would work but it would increase the clutter as well. I feel like the solution is assigning each relevant topic a series of keywords and we could cross-reference between documents. This would make for an easier search feature as well.
Just an idea as I've found it difficult to classify data.
That being said, this is some condensed information that I have found and would classify as Battle Graphics (excluding sprites). I mainly copied and truncated tutorials and threads and then added in relevant additions made in the comment section.

Replacing Old Battle Backgrounds:
Spoiler:
Tools Needed:
Nameless TileMap Editor (NTME)
Old version of Paint/ Photoshop/ GIMP/ An image-editing program of some kind that can work with indexed images
unLZ.GBA
A Hex Editor
Free Space Finder
An Emulator with a Fire Red ROM


Starting off, make a back up of you ROM, it is very possible that things may not come out as originally intended.

Firstly, we need to create a mock-up of the background we want to insert in Paint. In this instance I’ve decided to make a background for a generic grass battle.

The dimensions of this background are 240x112 pixels if you’re interested. Some of you keen-eyed people may have noticed that I have more than the standard 15 colours plus a transparent colour as per usual in an indexed image. This is the case because I’ll be taking advantage of a second palette that can be used when we are in battle – I will go further into this later.

If you don’t know whow to index an image then there are many other tutorials that cover this. For the sake of laziness length I would advise you to find another graphics tutorial that includes indexing.

Anyway, now that we know what we want to insert, we need to make it more compact for the next step. We will need to remove as many 8x8 pixel tiles that have been repeated as possible. If we were to insert something the size of our mock-up above it would take up quite a lot of unnecessary space and possibly overwrite/ be overwritten by other graphics loaded in the RAM.

While this tileset isn’t optimal as there are still a number of repeated tiles it is close enough and has already significantly shrunken the filesize that will be inserted. There also appears to be an anomaly on the right hand side of the tileset, this is to do with the second palette that I mentioned earlier. I’ve lined up the colours in the tiles so they will directly match their places in the second palette. As this particular picture can only be made with fifteen colours (plus transparency) it has to look out of place for the time being. Nevertheless, this is what we’re going to be working with.

Now we’re going to need to extract some things via unLZ.GBA (It is possible to insert a background without doing this step, but it makes everything easier). Open your ROM in unLZ and head to picture number 3. There you should see the tileset for the current grass background. Click ‘Save As’ and put it somewhere on your computer. Click ‘Next’ to arrive at picture number 4 which just appears to be a big jumble of random lines resembling television static. This is the tilemap for the grass background, it essentially tell our tileset how to arrange itself in-game to give us a full blown battlefield. To save it click ‘RAW Dump’ and then proceed to open up NTME.

NTME is a program that allows you to create your own tilemaps to be inserted along with tilesets. For now just open up the two files you saved from unLZ and you should be able to be able to recreate the default grass background. To make it look like it should in-game select the dropdown menu underneath ‘Size (Keep Ratio)’ and select 32x64.

But this isn’t what we want – We want to aim higher and greater. Now we should open up the combination of our own tileset as well as the default grass tilemap. 99% of the time a message will pop up asking about whether some tiles should be replaced with the first tile in your tileset. Just say yes to this and move on. The result may look random, but that’s only because we’re working with old data (the default tilemap) so now we need to remake our mock-up from the beginning of the tutorial. Load your tileset and start painting! It is easiest to just follow what has already been done by mirroring the original tilemap which is why it is open now.

But we’ve only got half the story in this screenshot, there’s a lot more that has gone unseen here - NTME’s viewing window can only show a fraction of what needs to be done. This actually what we have to make by manipulating the up/ down and right/ left scroll bars.

Yup, it’s just like an iceberg: most of the image’s size lies beneath the water. A handy image that briefly covers what each part of the tilemap represents has also been included for your convenience.

Once you’ve recreated your battle background we need to make sure it is using the correct palette. Select the ‘PaletteMap’ tab at the bottom of NTME and the viewing window should change to a series of numbers overlaying your background. These numbers indicate which palette the tiles will be loaded from when being played in-game. The only two numbers which we are interested in are two and three as they are what the game uses in its original backgrounds.

This is the point where if you prepared ahead of time you will be able to add more than fifteen colours (plus transparency) to your background. In this background I have a large strip of background that isn’t supposed to use the same palette as the majority of the background. There is a catch when it comes to adding a second palette though – It can only have a maximum of seven new colours. You will be able to see why this is the case later on, but for now know that you are restricting in how much you can add. Anyway, this is how my palette map will look, where palette two applies the full fifteen colour palette while palette three will only apply the restricted seven colour palette.

And with that, we’re finished making the tilemap for our background – Now it is time to insert both it and the tileset into the ROM. Reopen unLZ.GBA and head to the background of your choice. Once you’re at your background’s position select ‘Import’ and open your tileset. Select ‘Write to ROM’ and a second smaller window should pop-up; this is where we shall decide where the tileset will be inserted in the ROM. I’m going to be inserting the tileset at 0x720000 in the FR ROM as there is quite a lot of free space from there so I know nothing will be accidentally overwritten.

Don’t try to insert the palette accompanying the tileset at this point. Unlike other compressed images like Pokemon sprites, the proper palette isn’t attached to the tileset in unLZ – We need to change it manually later. Now let’s enter a battle and see how it’s looking.

It should not look great at this point. We have to insert the tilemap to fix this problem. Click ‘Next’ in unLZ and you should have returned to the tilemap from earlier. Rather than simply importing the tilemap like the tileset there is a slightly different method as it is not an image file (though unLZ is able to translate it into one). Select ‘File > Load RAW’ and select your custom tilemap. Now we just have to write it to the ROM in the exact same manner we did with the tileset. I’ve chosen to insert it directly after my tileset which means it will be located at 0x720400 according to HackMew’s Free Space Finder.

With both our tileset and tilemap inserted the background should be shaping up far better than before.

Alright, that’s looking much better – Our background actually has a recognisable structure now. We are now up to the final part of our insertion method, altering the palette. As you must have noted several times throughout this tutorial I have deferred talking about the background palettes for one reason or another. This was because it would have been quite jarring to interrupt with notes on how the palettes are structured as they differ from ordinary compressed and uncompressed palettes.

The palettes which are assigned to battle backgrounds are made from two palettes, palettes 0x2 and 0x3 in your emulator’s background palette viewer. Both of these palettes are highly interlinked as 0x3 borrows most of its data from 0x2 to save some space. This has caused them to appear fractured with a byte jutting out after every fourth word.

Thanks to this interlinking we cannot simply open up palettes in a palette editing program such as APE, even if it is instructed to uncompress the palette.

There is one main way to find your palette. Search for the first string of four words of your background’s 0x2 palette (I’ll discuss palette 0x3 shortly). You can do this by entering a battle with your chosen background, opening the palette viewer and reversing the colour values (e.g 0x1234 becomes 34 12). In the last screenshot you can see this as the string ’00 00 FC 73 D4 3F 90 3F‘ in front of the first marked byte. At this point you can just calculate the HEX values of your new palette and overwrite the current words but keep in mind the stray bytes - Leave them as they are.

Now when we check our background in-game.

Awesome, we’re almost done. This part of the tutorial is only needed if you have chosen to utilise palette 0x3 in conjunction with 0x2. Since palette 0x3 is interwoven with palette 0x2 it is generally more garbled and difficult to find if you don't know what to do. Once you have found palette 0x2’s location, palette 0x3 should be somewhere nearby, but you should only search for the NEW values that are present in 0x3. In my case, when I searched for the grass background’s first two new values in palette 0x3 (92 37 4E 37) I found them at 0x24842B. Changes these values (once again looking out for any stray bytes) and save your ROM.

Congratulations, you have just inserted your first battle background!

There are also some lesser know things you have to be aware of when inserting particular backgrounds.
The grass background also doubles as the background for when your Pokemon evolves. Be sure to not have an extra-large battle platform that stretches out into the centre of your tilemap in NTME otherwise it will be visible during the cutscene.
The Gym battle background is linked to the field and three other backgrounds. Their palettes are incredibly garbled and you would be lucky to get more than 7-8 colours out of them.


Expanding Number of Battle Backgrounds
Spoiler:
I am going to take you into the data aspect of editing battle backgrounds. 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:


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. 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:



How to Do this in other ROMS

SWI 0x12 is LZ Decompression. Using the logging feature in VBA, log that as the battle starts. You will get a list of all calls to an SWI. Some will be LZ decompression with an offset after. That offset is for an image. Go there in a graphics editor until you find the right one.

BGs are the same on all advance gen games, just in different locations, so use the logging feature to find one in ruby, then search for its pointer in the rom and you will find the table I talk about in my post. This table will tell you all you need to know about palettes, bgs, raws, EVERYTHING.
Everything is the same, just the offsets are different.

How to find offsets in other ROMS:


1) Go into tall grass in VBA-M.

2) BEFORE the battle, go into Tools-> Logging.

3) Check the box "SWI" and then click "Start".

4) Close that window.

5) Enter a battle.

6) Once the battle bg has loaded, go into the logger and save all of the junk that was there to a txt file.

7) Open that txt file in Notepad.

8) Hit "CTRL+F" and type this:

If you see a lot of CPUSets: type "LZ" in the box.

If you see a lot of SWI 0x8, type "SWI 0x12" in the box.


9) Click "Find".

You should now be brought to either an SWI 0x12 or an lz decompression (same thing, just different ways of writing it.)

10) Now, look for an 4 byte hex number that looks like 0x08XXXXXX just to the right of the text we found. This is the offset of an image that was decompressed.

11) Go into an image viewer like NSE 2.X or GBA Graphics editor and go to that offset.

12) Is this a bg???? If no, repeat steps 8 -> 12 until it is. If it is, continue:

13) Take that offset, and reverse it:

So, 08XAYBZC -> 08 XA YB ZC -> ZC YB XA 08.

Ex. 08 12 34 56 becomes 56 34 12 08.

Search that in a hex editor. Now you have found the table I talk about in my post. Cool.

How to Find a Palette
There is one main way to find your palette. Search for the first string of four words of your background’s 0x2 palette (I’ll discuss palette 0x3 shortly). You can do this by entering a battle with your chosen background, opening the palette viewer and reversing the colour values (e.g 0x1234 becomes 34 12). In the last screenshot you can see this as the string ’00 00 FC 73 D4 3F 90 3F‘ in front of the first marked byte. At this point you can just calculate the HEX values of your new palette and overwrite the current words but keep in mind the stray bytes - Leave them as they are.

VBA has a built in Palette viewer. Use it in battle and look through to find the palette you need on the left hand side.

Emerald Battle Backgrounds

Alright! This is the Battle Backgrounds table for Emerald. The table has the same concept for each background as FireRed has. I dunno if anyone already posted this kind of research but let's just say that I made fine research. LOL Having this format of having five pointers for each background:

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
The difference between FireRed and Emerald is that the Emerald's table only covers 10 backgrounds which are in this list:
Grass 1 (Normal Grass)
Grass 2 (Tall Grass)
Sand
Dive
Sea
Pond
Craggy
Cave
Trainer Battles (Indoor)
Trainer Battles (Outdoor) "can be called as the outdoor FIELD"

The table begins at 31ABA8 and ends at 31AC6F. The table hasn't the background for Gym Leader battles, Hideout battles, Pokemon League battles, Battle Frontier battles (doesn't count the Smeargle cave underneath Battle Frontier), and the backgrounds for the Weather Trio battles isn't in the table too. I'm pretty sure that the table is somewhere else but they are located separatedly. Here is the documentation of each background and their offsets and pointers in the original table:

Code:
- Grass 1 (Normal Grass)
--- D77D68 (image) - pointer 68 7D D7 08 at 31ABA8
--- D75008 (image tilemap) - pointer 08 50 D7 08 at 31ABAC
--- D7E280 (entry image) - pointer 80 E2 D7 08 at 31ABB0
--- D7E808 (entry image tilemap) - pointer 08 E8 D7 08 at 31ABB4
--- D78318 (image palette) - pointer 18 83 D7 08 at 31ABB8

- Grass 2 (Tall Grass)
--- D78600 (image) - pointer 00 86 D7 08 at 31ABBC
--- D78CB8 (image tilemap) - pointer B8 8C D7 08 at 31ABC0
--- D7E9C4 (entry image) - pointer C4 E9 D7 08 at 31ABC4
--- D7F0D4 (entry image tilemap) - pointer D4 F0 D7 08 at 31ABC8
--- D78C78 (image palette) - pointer 78 8C D7 08 at 31ABCC

- Sand
--- D78F68 (image) - pointer 68 8F D7 08 at 31ABD0
--- D795A8 (image tilemap) - pointer A8 95 D7 08 at 31ABD4
--- D7F3C0 (entry image) - pointer C0 F3 D7 08 at 31ABD8
--- D7F850 (entry image tilemap) - pointer 50 F8 D7 08 at 31ABDC
--- D79560 (image palette) - pointer 60 95 D7 08 at 31ABE0

- Dive
--- D79858 (image) - pointer 58 98 D7 08 at 31ABE4
--- D79E58 (image tilemap) - pointer 58 9E D7 08 at 31ABE8
--- D7F9F8 (entry image) - pointer F8 F9 D7 08 at 31ABEC
--- D7FEC4 (entry image tilemap) - pointer C4 FE D7 08 at 31ABF0
--- D79E10 (image palette) - pointer 10 9E D7 08 at 31ABF4

- Sea
--- D7A108 (image) - pointer 08 A1 D7 08 at 31ABF8
--- D7A720 (image tilemap) - pointer 20 A7 D7 08 at 31ABFC
--- D80054 (entry image) - pointer 54 00 D8 08 at 31AC00
--- D80660 (entry image tilemap) - pointer 60 06 D8 08 at 31AC04
--- D7A6DC (image palette) - pointer DC A6 D7 08 at 31AC08

- Pond
--- D7A9D0 (image) - pointer D0 A9 D7 08 at 31AC0C
--- D7AFB8 (image tilemap) - pointer B8 AF D7 08 at 31AC10
--- D80804 (entry image) - pointer 04 08 D8 08 at 31AC14
--- D80D50 (entry image tilemap) - pointer 50 0D D8 08 at 31AC18
--- D7AF78 (image palette) - pointer 78 AF D7 08 at 31AC1C

- Craggy
--- D7B268 (image) - pointer 68 B2 D7 08 at 31AC20
--- D7B864 (image tilemap) - pointer 64 B8 D7 08 at 31AC24
--- D80E9C (entry image) - pointer 9C 0E D8 08 at 31AC28
--- D8147C (entry image tilemap) - pointer 7C 14 D8 08 at 31AC2C
--- D7B828 (image palette) - pointer 28 B8 D7 08 at 31AC30

- Cave
--- D7BB14 (image) - pointer 14 BB D7 08 at 31AC34
--- D7C154 (image tilemap) - pointer 54 C1 D7 08 at 31AC38
--- D81610 (entry image) - pointer 10 16 D8 08 at 31AC3C
--- D81E2C (entry image tilemap) - pointer 2C 1E D8 08 at 31AC40
--- D7C10C (image palette) - pointer 0C C1 D7 08 at 31AC44

- Trainer Battles (Indoor)
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC48
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC4C
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC50
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC54
--- D7DEB4 (image palette) - pointer B4 DE D7 08 at 31AC58
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.

- Trainer Battles (Outdoor) "almost going to be called as the outdoor field"
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC5C
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC60
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC64
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC68
--- D7C404 (image palette) - pointer 04 C4 D7 08 at 31AC6C
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.
For Gym Leader and Battle Frontier battles, they have separated backgrounds. Now, here is the documentation on other special backgrounds and I just give the location of their pointers:

Code:
BATTLE FRONTIER image pointer @ 03579C
BATTLE FRONTIER image tilemap pointer @ 0357A4
BATTLE FRONTIER image palette pointer @ 0357AC

GROUDON image pointer @ 0357D0
GROUDON image tilemap pointer @ 0357D8
GROUDON image palette pointer @ 0357E0

KYOGRE image pointer @ 035804
KYOGRE image tilemap pointer @ 03580C
KYOGRE image palette pointer @ 035814

RAYQUAZA image pointer @ 035838
RAYQUAZA image tilemap pointer @ 035840
RAYQUAZA image palette pointer @ 035848

GYM LEADER image pointer @ 035884
GYM LEADER image tilemap pointer @ 03588C
GYM LEADER image palette pointer @ 035894

CHAMPION image pointer @ 0358B0
CHAMPION image tilemap pointer @ 0358B8
CHAMPION image palette pointer @ 0358C0

"Gym Style (AM)" image pointer @ 035964
"Gym Style (AM)" image tilemap pointer @ 03596C
"Gym Style (AM)" image palette pointer @ 035974
* (AM) - Advance Map

MAGMA HIDEOUT "Team Rocket Style (AM)" image pointer @ 03598C
MAGMA HIDEOUT "Team Rocket Style (AM)" image tilemap pointer @ 035994
MAGMA HIDEOUT "Team Rocket Style (AM)" image palette pointer @ 03599C
* (AM) - Advance Map
* Although that the Ruby's Magma Hideout isn't used in the normal gameplay of Emerald, it exists in Emerald just for a standard "Team Rocket Style" and for FireRed, it is used in Pokemon Tower.

AQUA HIDEOUT "03 (AM)" image pointer @ 0359B4
AQUA HIDEOUT "03 (AM)" image tilemap pointer @ 0359BC
AQUA HIDEOUT "03 (AM)" image palette pointer @ 0359C4
* (AM) - Advance Map
* In Emerald, the "03 ???" from the Fight Type, it is the Aqua Hideout. Although that in FireRed, it appears to be for Rocket Hideout.

ELITE FOUR 1 image pointer @ 0359DC
ELITE FOUR 1 image tilemap pointer @ 0359E4
ELITE FOUR 1 image palette pointer @ 0359EC

ELITE FOUR 2 image pointer @ 035A04
ELITE FOUR 2 image tilemap pointer @ 035A0C
ELITE FOUR 2 image palette pointer @ 035A14

ELITE FOUR 3 image pointer @ 035A2C
ELITE FOUR 3 image tilemap pointer @ 035A34
ELITE FOUR 3 image palette pointer @ 035A3C

ELITE FOUR 4 image pointer @ 035A5C
ELITE FOUR 4 image tilemap pointer @ 035A64
ELITE FOUR 4 image palette pointer @ 035A6C

"Big Red Pokeball (AM)" image pointer @ 035A90
"Big Red Pokeball (AM)" image tilemap pointer @ 035A98
"Big Red Pokeball (AM)" image palette pointer @ 035AA0
* (AM) - Advance Map
So far, that's only the separated backgrounds I've found in Emerald. Some of the images are aligned with the first ten backgrounds or the other backgrounds so be careful while repointing. Example: You have a background for the Elite Four and Champion but it relates with the Team Rocket Style background. I suggest that if you have good instincts, insert the image without repointing and just edit the pointers manually by using a HEX editor. I just gave all the information I have found so you won't be having problems dealing with Emerald background. I hope this help you a lot. Good luck!

Credits
karatekid552
RaileysXerilyasRx
Driver
Drfuji
Jambo51
Darthatron
Mat
Tajaros
Narutoactor


Creating Custom Animation Particles:
Spoiler:
Just to reiterate all the offsets are for FireRed and Emerald.

Tools Needed:

A Hex Editor (I recommend HxD, it's free and amazing)
unLZ-GBA (preferably the hacked one)
Windows Calculator, or any other Calculator that can do sums in Hex.


General Information on the structure of the table:

The table begins at 0x83ACC08 and ends at 0x83ADE18. This table contains both
the particle and palette information.

The actual particle information goes from 3ACC08 to 3AD50F.
Each particle entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the particle image at ZZ YY XX) XX YY (size of the particle YY XX) XX 28 (the index, the second byte of which will be 27 or 28, for expansion purposes it will be 28)

The palette information goes from 3AD510 to 3ADE18
Each palette entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the palette at ZZ YY XX) XX 28 (the corresponding particle index) 00 00 (padding)


STEP 1:

Using your Hex Editor, goto offset 0x83ACC08 in Fire Red or 0x8524B44 in Emerald and select 1210 blocks (hex).




STEP 2:

Copy the selected area, then find a good free space area to paste it to. Make sure you use Ctrl B (Paste Overwrite) otherwise the Rom will stop working. For this tutorial I'll be using the offset 960000, though you can realistically place it anywhere you want with realistically about 1300 bytes of free space.





STEP 3:

Now you'll have to change all the pointers to the original offset for those of your current offset. A pointer is laid out in the structure XX YY ZZ 08, wherein XX YY ZZ 08 would point to ZZ YY XX 08. Using the original offset 3ACC08 for Fire Red, the pointer would be 08 CC 3A 08. For the new offset 960000, our pointer would be 00 00 96 08. Navigate to the start of the rom and click Ctrl r (replace). Search for 08 CC 3A 08 in Fire Red or 08 44 4B 52 in Emerald and replace with 00 00 96 08 and click replace all (make sure hex values is selected). There should only be two instances of this pointer located in the 0x8072000 area for Fire Red (this is where the loading routine is located).




STEP 4:

This is the part in which we add new particles. You will need to make the majority of these yourselves, as I make them I'll be sharing them with the community. For the purposes of this tutorial I've attached the image for Wood particles.

Open up unLZ-GBA. Import your image (make sure it's indexed), and click write to rom. Make sure only 'Export Image' is selected. Type in your desired offset into the image box, for the purposes of this tutorial I'll be using 940000, and click OK.



After doing that navigate to that offset in your Hex Editor and scroll through until you reach free space again, make a note of that offset.



Return to unLZ and once again click write to rom, this time however make sure only 'Export Palette' is selected, then type the offset you just got into the palette box.




STEP 5:

Now that the particles are in the rom, we have to add them to the table. Unlike other expanded tables, the particle and palette information are part of the same table. As such we can't just add the entries to the end of the table. What we have to do first is navigate to the start of the palette information, now at 960908, and then select the rest of the table, this can be done easily by just selecting 1000 bytes (hex).



Now copy the data and paste it 8 bytes after where it originally was, in this case that would be 960910.



Now at 960908 we have to add our particle entry. As mentioned before the data is set up as a pointer, the size and then the index. First write the pointer to your image, in this case 00 00 94 08.
The size is equal to half the area of the image. eg. Our image is 32x192, which is equal to 1800 in hex. As such, our size would be half of 1800, which is 0C00, so we'd write 00 0C. Finally we'd choose our index number. The last used one in the rom is 30 28, as such anything up from there is available to be used.



Now we just need to add our palette information. This is thankfully easier, just navigate to the end of the table, this can be done easily by searching for FF bytes. If using the offsets of this tutorial it should now be 961218. As mentioned before the palette information is listed in this structure, pointer to the offset of the palette, index number, filler bytes. First write the pointer to your palette, in this A8 04 94 08, follow it up with the same index number you used for the particle in this case 31 28, and then add 00 00.



Congratulations! You've set up your first particle.

Note: For future entries, you will have to repeat the procedure, by constantly moving the palette part of the table back to allow space for entries. It is not particularly convenient, but it's not too difficult either.


STEP 6:

You may now think, great I have fully working new particles. Well that's not entirely true, first we have to alter the loading routine. If you do not, the moves will just freeze, or the rom will restart, as they will not be able to load the proper information. Luckily its easily fixed by changing a few pointers.

Navigate to the offset 0x80728B7 in Fire Red or 0x80A3D74 in Emerald, you should see two pointers. These are the pointers used in the particle loading routine and the palette loading routine respectively. The reason for this being, that the loading routine takes these offsets and then adds a variable number dependent upon the particle being used in the routine to this offset to reach the relevant area of the table.



We'll have to change these two pointers, so they now properly go to the 960000 area. As such we're going to have to start doing some calculations, so open up Windows Calculator (or an alternative) and access programming mode (alt+3). Subtract the offset of the first pointer (399388) from the original start of the table (3ACC08). You should get the number 13880.



Now substract that number from the offset in which you repointed the table to, and you'll have the offset to change the first pointer at 728B7 to. If using this tutorial, you should get the offset 94C780, and as such, the pointer 80 C7 94 08. Then change the pointer.




The palette pointer is done in more or less the same way. Because we already know the variable number (13880) that is added to both pointers, we can simply substract 13880 from the current start of the palette information, which if you've been using the same offsets will be located at 960910. You should get the offset 94D090, and as such the pointer 90 D0 94 08. Then change the pointer.

Something key to note though. Is that for every new particle you add to the table, you will have to add a value of 0x8 to the palette loading pointer. Eg. If you added an extra particle to the one already added, it would become 98 D0 94 08. You will not need to do this for the particle loading pointer.





There is one more thing to fix, and that is the Shiny Pokemon entry animation!
Otherwise, if a Shiny Pokemon is sent out into battle the game will freeze.

STEP 7:

Navigate in your hex editor to 0x80F17E8 in Fire Red or 0x8172FB8 in Emerald, you should see two pointers.
Change the first pointer from what it is to the pointer to the new offset of
the F9 27 particle, which if you followed this tutorial is 960748, for those who
did not use the same offsets, you can easily find it by searching for this string
38 87 D2 08 C0 00 F9 27.

The second pointer is the palette, so just change the pointer to the new offset
of the F9 27 palette. Because each time you extend the table the palette will
change, you'll have to add 8 to this pointer everytime you add a new particle.
To find it search for this string BC 87 D2 08 F9 27 00 00.


And there you have it! Custom particles.


I'd once again like to thank Karatekid552 for getting the ball rolling, and for his documentation.
Also credits to HidoranBlaze for finding the relevant Emerald offsets.



ASM Routine to add many Particles

Just a tip for any of you planning to add a lot of new particles at once:

You can use asm to create a table much easier than typing everything in HxD. You don't need to know any asm to do this either. Here:

Code:
.align 2 /*Make sure everything is aligned.*/
.text

main:
.word 0x08960000 /*Your pointer to an image, not reversed!*/
.hword 0xC00 /*Data size, once again, not reversed.*/
.byte 0x31 /*Particle number.*/
.byte 0x28 /*Particle table. Either 27 or 28 like mrdollsteak said.*/
So yeah, just compile this using HackMew's compiler or another ARM compiler and you will have an 8 byte entry. For more entries, you can just repeat this template over and over in the same file:

Code:
.align 2 /*Make sure everything is aligned.*/
.text

main:
.word 0x08XXXXXX /*Your pointer to an image, not reversed!*/
.hword 0xXXXX /*Data size, once again, not reversed.*/
.byte 0xXX /*Particle number.*/
.byte 0xXX /*Particle table. Either 27 or 28 like mrdollsteak said.*/
Like this:

Code:
.align 2
.text

main:
/*Particle 1*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 2*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 3*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 4*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*Particle 5*/
.word 0x08XXXXXX
.hword 0xXXXX
.byte 0xXX
.byte 0xXX

/*et cetera*/
Credits:

Mr Dollsteak
Karatekid552
HidoranBlaze


Creating New Attack Backgrounds:
Spoiler:
Extending the Number
So here's what we need:
1. FireRed Rom
2. Hex Editor (I'll be using HxD)
3. Notepad
4. Custom Background (Background must be divisible by 8 and indexed), and Tilemap.
5. VBA
6. Free Space Finder (Optional if you know how to things right)
7. NTME/DARTHTME
8. UNLZ

Ok, so first let's get it down with the table offsets.

The table starts at 0x3ADE18, and ends at 0x3ADF5B. The table are all pointers so we'll just to have put pointers for our image, pallete, and tilemap. It goes like this.

[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08]
XX = pointer to graphics
YY = pointer to palette
ZZ = pointer to tilemap



So let's get it down to extending it.

Step 1) Open your FireRed Rom in a Hex Editor




Step 2) Goto offset 0x3ADE18


Now select 0x144 or 3444 bytes.

And then Ctrl+C or simply copy.


Step 3) Find some free-space that can hold 0x144 bytes so to make things easier I'll be using 0xA00000. So goto 0xA00000.



And paste it using Ctrl+B (though in Hex Workshop you have to highlight the 0x144 bytes and then Ctrl+V)

Make sure you don't use Ctrl+V or else the size of the Rom will change but it's only in HxD.
And then Ctrl+S or Save.


Step 4) Repointing the location of our table.

since it's located at 0xA00000, we need to search for a pointer pointing to 0x3ADE18. So the pointer will be looking for is 18 DE 3A 08 Find it using Ctrl+F and change it to our current table location which is 0xA00000 so replace it with 00 00 A0 08. But since it's only one pointer I'll just give the offset of the pointer so you can change it directly. The offset of the pointer is 0x73960. So goto 0x73960...

And write our new pointer.

Then Ctrl+S or Save. And there you have it you have successfully repointed the Background Animation Table.


Ok, so originally there are 0x1A or 26 backgrounds in the game. So with that small amount we can insert many custom backgrounds as we want.

Step 5) So now we'll be inserting our new background. So for it to be easy I'm gonna use the Waterfall Animation in DP. I'll be putting out a download link for the Waterfall so you can try it out.

First make sure the image is indexed and it's size is divisible by 8 so it can be accepted by UNLZ. So Load your Rom in UNLZ.

Then Load your Background I'm gonna use the Waterfall background.

Now Click Write to Rom. I'll be using 0xA10000 and 0xA20000 for the image and pallete respectively. Make sure to uncheck the Automatically Fix Pointers Checkbox.

Then Click Ok. After that load your Raw file or Tilemap that you made using NTME. (I'm not gonna cover that here but the right size for the tilemap 32x32 just in case you don't know. And also have pallete #2 for the image.)
Now goto file and then Load Raw...


Now Click Write to Rom, make sure you uncheck everything except for Export Image. I'm gonna use 0xA30000 for the tilemap offset.

Now Click ok, and you're done inserting.


Step 6) Now will be placing the new pointers in our table.

Our Image Offset is - 0xA10000
Our Pallete Offset is - 0xA20000
Our Tilemap Offset is - 0xA30000
So we'll place 00 00 A1 08, 00 00 A2 08, and 00 00 A3 08 at the end of our table in 0xA00000.

And then Ctrl+S or Save.
By doing that the background will take up 0x1B so put that in your battle animation and test it in your game.


Step 7) Testing time



Taa Daa! Now you can Insert more custom backgrounds yourself...


Credits:
Tajaros
Chaos Rush
Jambo51
Itman
Hackmew
Darthatron
D-Throgh


Manipulating Attack Animations:
Spoiler:
There are at least two types of actions:
1) a background
2) a movement of a graphic (requires loading correct graphics)

Note: Everything in this document/tutorial is designed with FireRed in mind. There are pointers within the animation scripts, meaning that unfortunately, these have to be ROM-specific. These will work with FireRed, and only FireRed.

Here's what I've got of the scripting language so far: (credits at bottom of post for people who found these)
------------------------------------------------------------------
00 XX 27 = loads image data, XX is an argument
00 XX 28 = same thing as above, but loads from a different bank of graphics

02 = executes current animation segment
05 = waits for current animation segment to finish
06 = does absolutely nothing
07 = does absolutely nothing
08 = ends the animation script (DO NOT CONFUSE WITH POINTER!!!)

0E XX XX XX 08 = jumps to another animation, continues execution of original script when finished (can be used to combine multiple animations to play right after another)
11 XX XX XX 08 = same as above, haven't figured out the difference yet

19 XX XX = plays a sound

Display a non-scrolling, static background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 WW 17
Display a scrolling background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 WW 17 03 2D B8 0B 08 05 04 00 XX 00 YY ZZ 00 FF FF
-WW = selects which background graphics to display

Code:
Choose one of these for the WW byte:
00 = Dark-type BG, example: Faint Attack
01 = same as 00
02 = Ghost-type BG, can scroll horizontally, example: Shadow Punch
03 = Psychic-type BG, example: Psychic (EXCEPT IT DOESN'T ANIMATE)
04 = high-impact BG, light coming from top right, example: Focus Punch
05 = high-impact BG, light coming from bottom left
06 = high-impact BG, light coming from top left
07 = Horn Drill BG, can scroll horizontally and vertically, example: Horn Drill
08 = same as 07, but image is mirrored horizontally
09 = high-speed BG, can scroll horizontally, example: Mach Punch
0A = same as 09, but image is mirrored horizontally
0B = Thunder BG, can scroll horizontally, example: Thunder
0C = Guillotine BG, light coming from top right, example: Guillotine
0D = Guillotine BG, light coming from bottom left
0E = Guillotine BG, light coming from top left
0F = Ice-type BG, can scroll horizontally, example: Sheer Cold
10 = Space-oriented BG, can scroll horizontally and vertically, example: Cosmic Power
11 = Seismic Toss/Sky Uppercut BG, can scroll horizontally and vertically, example: Sky Uppercut
12 = Flying-type BG, can scroll horizontally and vertically, example: Sky Attack
13 = same as 12, but image is mirrored horizontally
14 = Aurora Beam BG, can scroll horizontally, example: Aurora Beam
15 = Fissure BG, can scroll horizontally (but it artistically makes no sense to do so), example: Fissure
16 = Silver Wind BG, can scroll horizontally, example: Silver Wind
17 = same as 16, but image is mirrored horizontally
18 = SolarBeam BG, light coming from top right, example: SolarBeam
19 = SolarBeam BG, light coming from bottom left
1A = SolarBeam BG, light coming from top left
-XX = how fast background scrolls horizontally
-YY = how fast background scrolls vertically
-ZZ = not sure but its either 00 or 01

Judging by unLZ, these backgrounds are simply tilesets+tilemaps. If we could find the table(s), we could theoretically expand them and have custom backgrounds.

To display the Psychic-background correctly, do not use the scrolling background command, instead use the 0E command, using it like this:
Code:
0E BB 59 1D 08
This will display the Psychic-type BG, while also animating it correctly.

To end any scrolling background (also works with the Psychic-BG animation):
Code:
0E C7 59 1D 08
Usually this is placed at the end of the script. If you're going to place it at the end of the script, make sure you add an extra 08 byte to the end of it, otherwise the game will freeze.

The table for the battle backgrounds starts at 0x3ADE18, and ends at 0x3ADF5B. The format goes like:
[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08] XX = pointer to graphics, YY = pointer to palette, ZZ = pointer to tilemap

Some other info (remember, these are FireRed offsets):
0x247094 = Attack names
0x250C04 = Attack data
0x4886E8 = Attack description pointers
0x1D65A8 = Battle script pointers
0x1C68F4 = Attack Animation pointers

To find the offset of an animation, follow these instructions:


1. Go to Bulbapedia's List of Moves
2. Find the move you want (for the sake of this example, we'll be using Surf)
3. According to the list, Surf is #57 in the game index
4. Open up Windows Calculator, switch to Programmer mode
5. (make sure the option on the left tab is set to, "Dec") type in 57 (or whatever number your attack is)
6. Click on "Hex"
7. Multiply it by 4
8. Add it by 1C68F4
9. Whatever the sum is, that offset contains the pointer to your animation. Open up a Hex editor, and go to that offset
10. The sum I got was 1C69D8. The bytes there are 01 FA 1C 08. The 08 indicates its a pointer.
11. If you know how to calculate pointers manually, good for you. If you don't, go find a Pointer Calculator on Google or something, or figure out how. With that said, the bytes 01 FA 1C 08 means its pointing to offset 0x1CFA01.
12. 0x1CFA01 is the Surf animation. Congratulations, you found the offset of your animation!

(To figure out when the animation starts and ends, simply make a new attack (assuming you've already looked at Jambo51's thread on adding new moves), and expand the attack animation table, and then paste the data of the Surf animation (or whatever attack) into free space and point one of the new attacks to that data. Then open up VBA, open up its Memory Viewer, and go to that data. Then replace the bytes and the end with FF, and keep testing it until the animation crashes (it should only crash when you change an 08 byte) Once it crashes, open up your hex editor, and go to the offset of the data, then make it look like how it does in VBA's memory viewer, then add an 08 at the end with the hex editor.

Eventually I will post a list of all the animation offsets, I haven't finished typing them all out yet.

Step-by-step example at creating a custom animation:
Example 1: Adding a background to an existing animation


So let's say we wanted to create a 4th Gen move. How about... Night Slash. We'll use Slash with the Dark-type background.

1. Using the steps I showed earlier in this thread, find the offset of whatever animation you want to base it by. The Slash animation is at 0x1caf7b. Insert the Slash animation data into free space, and then go to Night Slash's (or whatever your move is called) slot in the animation table and point to the animation data you just inserted.

2. For anyone else using it off of Slash's animation, this is the hex data for the Slash animation:
Code:
00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08
Right now, our animation looks exactly like Slash:


3. Now earlier in this thread, I mentioned the scrolling background animation command. Use it, and set WW as the Dark-BG. Place it at the beginning of the animation, and the Slash animation right afterwords. Our animation data should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08

Now we got the Dark-background! ...except that it doesn't disappear after the attack is done. That's because we need to add the BG-clear command.

4. As I mentioned earlier, the BG clear command is: 0E C7 59 1D 08. Remove the 08 byte from our current animation (NOT THE BG COMMAND!!!), then add the BG clear command at the end, and add an extra 08 byte to end the animation, otherwise the game will crash. Our script should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 0E C7 59 1D 08 08

Now we have a flawless Night Slash animation! And yes, the background will return to normal after execution of the attack.

Just for giggles, you can alter the second byte of the BG command (which also happens to be the second byte of our entire Night Slash animation) to change the background (I referred to it as the WW byte):


And that, is essentially how you take a non-BG animation and add a BG to it.


Example 2: Merging two animations to play right after another

Just find two separate animation hex data, and then remove the 08 byte from the end of one of them (except if its a pointer), then place the data of the second animation right after it. Alternatively, you can use the 0E or 11 command and point directly to it, but this will limit you to merging only 2 animations. By manually placing the data, you can have as many as you want, meaning you can create a move like, "Ridiculous Tackle", and have an animation that has the player Tackling the opponent 6 times.

If there's an 05 byte before the 08 byte, remove it, and then they'll play at the same time (perhaps with a slight delay)

I found that there's a special code or something to use backgrounds that are different depending on if you use the move or if the opponent does because if you use a regular command for example if you try the high power background you'll understand. I came across two pointers, one to use for the scroll flying type background and one for the high power one.

High Power - 0E 89 7D 1C 08
Flying background - 0E CF 59 1D 08

To do colored backgrounds like Giga Drain, insert the following:

02 24 7B 3E 08 02 05 01 00 SS 00 00 00 YY 00 XX XX 05

Where XX XX is the color you want, YY is the intensity (0C for Giga Drain- 10 replaces the background entirely with the given color), and SS is the speed of the transition (01 for Giga Drain, but I imagine Hyper Beam and other attacks use the same logic with a higher value). To revert the background to normal, place the following:

02 24 7B 3E 08 02 05 01 00 SS 00 YY 00 00 00 XX XX 05 0B 03 0D

The values here do not have to be the same, but I'd advise making the color and intensity the same or it will abruptly change at the start of the transition back.

This allows us to accomplish animations that benefit from backgrounds without always having to insert new ones.

Some random things:

15 17 and 15 16 appear to reset the background to normal.

21 07 XX 00 YY YY YY YY branches to YY YY YY YY if the side the attacker is on matches XX. Mega Punch's custom background operates by placing two of these in a row (with XX = 00 and 01) to branch to subroutines that set the background to the correct one and then return.

0F appears to return to where the initial script left off after a branch.

The first parameter of the 02 command always seems to be a pointer to some animation data- this structure is 24 bytes long.

The first two bytes indicate what image data to use, while the next two bytes indicate the palette. The enumeration for this is the same as that of the 00 command- in order for an effect to work properly, the 00 command must have been called for both of these- otherwise the palette and/or image will not be loaded. While the existing animations appear to always have these be the same, they don't have to be- you can for instance give the Stun Spore seeds Fire Blast's palette this way. For some animations both of these are 00- I believe these are effects that don't use images, such as Earthquake's screen-shaking.

I'm not entirely sure what the rest of the bytes do, but it appears the two pointers after these values contains more image data (I think the dimensions and how it animates, respectively) while the rest of it has to do with how the effect plays out. I've fiddled with it a bit and done some interesting things.



Credits:
Chaos Rush
Jambo51
DoestKnowHowToPlay
Darthatron
DreamEngine


To call this truncated might seem a little silly considering the length of each topic, but a lot has been removed. This is a link to the thread that contains the patch talked about in "Creating Custom Animation Particles": http :// www pokecommunity com/showthread php?t=302401(can't post full links).
Great work, Sis. Your help is invaluable, and exactly what I was looking for.

I also agree that we can't use a very flat tree model for containing all of our documentation. We'll have to think more about that.

Maybe something like this? (example)
Code:
GBA
	Overview
		BIOS
		Architecture
	FireRed
		Overview
			Binary
			Video
			Memory
			Interrupts
			Data Structures
		Graphics
			Overworld
				Sprites
					Frames
				Maps
					Blocks
					Movement Permissions
			Battle
				Move Animations
				Backgrounds
		Mechanics
			Battle
				AI
			Flags
__________________
Reply With Quote
  #22    
Old November 16th, 2014 (03:37 PM).
Sisyphean Sisyphean is offline
 
Join Date: Nov 2014
Location: California
Gender: Male
Nature: Bold
Posts: 13
Back Again, I would describe these posts as being Miscellaneous In Battle Hacks I guess.

Creating New Move Effects
Spoiler:


Step One


Open up your ROM in your hex editor and go to
address 0x1D65A8. Edit > Select Block > 856. Copy.

This is the move effect table. Right now it only goes up to 213, but by rewriting it we can make it support up to 255 (256, since 0 counts) pointers.

Step Two

Open up Free Space Finder and search for 856 bytes of free space. Go to that location (I'll use 0x910000 in my example). Edit > Select Block > 856. Paste.


Step Three

Edit > Find > A8 65 1D 08 (again, changing the pointers from the original table to our new table). I would be changing them to 00 00 91 08 (By now, I hope everyone understands how pointers work!). Replace them all.


Step Four


Go to the end of your new move effects table. The last pointer, which is 5F 86 1D 08 is actually marking the end of the table. So the pointer before that (which is FB 85 1D 08) is actually the last effect in the table (#213).

We want to add a new effect, so what we are going to to is overwrite the last pointer (5F 86 1D 08) with a new pointer. Normally you would make your move effect first, and then search for free space to put it, and then make your new pointer, but for the sake of this tutorial we are going to say that my new move will be located at 0x920000.


Step Five

Here is where we actually make new move effects.

Just a briefing, we can't (yet) create COMPLETELY new moveeffects, but we can combine and edit any of the existing ones available. With much testing and experimenting, you can create almost all of the moves from Gen 1V and V. I managed to create a working U-Turn/Volt Tackle even from editing Baton Pass's script (look at the end of this tutorial for move effects already created).

For this tutorial, I am going to make the move Hammer Arm.

Hammer Arm's effect is simple - After using it, your speed gets lowered by one. Hmmm...

Let's think for a second. What other moves have effects that can help us create this one...in reality, there are MANY. Let's go with another move that lowers your stats...

There are many, but let's go with Psycho Boost (after using Psycho Boost, your special attack is lowered by two.

Go to the location of your new move effect table. (If you followed this tutorial, it's at 0x910000). To find where Psycho Boost's pointer is, we need to first find what effect number it uses.

Psycho Boost uses effect number 204 (Same effect as Overheat). Now multiply 204*4, which is 816.

Edit > Select Block > 816.

Scroll to the end of your selected bytes. The pointer RIGHT AFTER the end of the selected blocks is the one we're looking for. This is because '0' is also a move effect. So the pointer of Psycho Boost's effect is 1B 84 1D 08, or address 0x1D841B.

Go to address 0x1D841B


Step Six

Now you are at the move effect for Psycho Boost. To know where the data ends, you need to navigate back to the pointer for Psycho Boost (where we just were before) and see the next closest pointer. I can see that another move effect has a pointer to 0x1D8426, so I know that Psycho Boost's effect is from addresses 0x1D841B to 0x1D8425.

Step Six

This is the data for Psycho Boost.

Addresses 0x1D841B - 0x1D8425


As of right now, the user of this move will have their special attack lowered two stages. But we want the user's speed to be lowered one stage! In this case, all we need to change is a single byte.

To note, most moves end with the pointers 00 69 1D 08 (0x1D6900) or 4E 69 1D 08 (0x1D694E).

If your attack does damage, it'll use the first. If it doesn't, it'll use the second.

Now, the byte we need to change is the one I bolded:


That byte (FB) is soley responsible for the special attack drop. Now, how do we turn it into a speed drop?

Here is a list of what you can do by changing this byte. These are the ones that work 100% of the time. Meaning, these effects will ALWAYS happen. There are more (I didn't test from 00-C0) but I'm sure they are the same effects, just with less of a chance of happening. I know 01 has a 10% chance of putting an opponent to sleep, 03 has a 10% chance of burning an opponent, etc...




Anyway, we want one that ALWAYS lowers speed. So if you look, D8 ALWAYS lowers the users speed by one level. So our new move code is:




Yay! We now have a working Hammer Arm!

So all we have to do is put this code where the we made the pointer for earliar in the move effect table (0x920000 in my case).




Now simply change the move effect of any move to 214 and it will use this effect!
Credit:
Itman
Jambo51


Creating New Moves
Spoiler:
Step One

Open up your ROM in a hex editor (once again, I'll be using hex workshop).

Step Two

Goto address 0x250C04.

This is the address of the original move data, which we are going to be moving to a different location.


Step Three

Edit > Select Block > 4260 Bytes. Copy.


Step Four

Open up Free Space Finder and search for 4260 Bytes of Free Space. Goto that address. For this example, we'll use 0x900000.

Free Space = FF's. Basically, anything from 0x780000 - 0xFFFFFF is free space.


Step Five


Paste the original move data in the new location.

IMPORTANT: Paste OVER the FF's. So go to Edit > Select Block > 4260, and then paste there. DO NOT PASTE WITHOUT HIGHLIGHTING THE FF'S FIRST.

WRITE DOWN THIS ADDRESS!!! So in my case, I'd write down 0x900000 = Move data.


Step Six


Change all the original pointers to the original move data to your new location.

This means, basically, that anything that is directed to the old location will be sent to the new location. So, in my case, 0x900000 is the new location. I want to first go to Edit > Find .

That is what will show up. Since the old table was located at 0x250C04, any pointer to that data will look like this
0x040C2508



So we want to search for that string of bytes in the ROM.
And then replace EVERY one with our new pointer, in my case, 0x900000, which becomes:




*Quick lesson on pointers.*

1. First look at your offset. Example offset: 0x594039
2. Break it into sets of two's: 59 40 39
3. Take the last byte and put it first: 39 59 40
-Remember, the two numbers together is one byte, so don't rearrange the byte itself, just the order.
4. Take the last byte and put it between the two other bytes: 39 40 59
5. Add 08 to the end: 39 40 59 08

Another example real quick:
0xA9EBB0 becomes B0 EB A9 08
Basically you're just reversing the bytes and adding 08.

*End of quick lesson*

So once again, we're replacing all of the pointers to 0x250C04 to 900000. Just keep on searching for that string and replacing them until there are no more left to be replaced.

Seriously, there are A LOT, so BE PATIENT.




Step Seven


Edit > Find (again).

There are ALSO pointers in the ROM to 0x250C08...for PP data. So, we once again have to replace all of those pointers with your new pointer + 4. So, 0x900000 + 4 is 0x900004.


So the pointers to 0x250C08 will look like this: 08 0C 25 08

And the replacement pointer of 0x900004 looks like this: 04 00 90 08




Now replace all of those! There are a lot of these too, so be patient.



Step Eight
Go back to the original move table data (0x250C04) and copy (12*number of new attacks) you want to add.
The maximum that the table can hold is 511. There are already 354 moves though. So in this example, I want to to the maximum; 511-354 is 157. So 12*157 is 1884.

Now do Edit > Select Block > 1884 and copy that data.

Step Nine


Return to where you put your new move data from before (in my case 0x900000). Go to the end of the data (where the FF's begin again). Once again; Edit > Select Block > 1884. And then paste.


Step Ten


Goto address 0x247094. Edit > Select Block > 4615.
Copy that data.

This is the data for attack names.

Step Eleven


Open up Free Space Finder and search for 4615 bytes of free space. To make things easier, you can put this data right after the move data. Write down the offset you inserted this at! In my case, I'm pasting it at 0x901800.

Step Twelve


Much like before, we need to change all of the pointers associated with the old location and direct them to our new location. Edit > Find.

Any pointer to 0x247094 will look like 94 70 24 08

So that's what we'll search.
Once again, there's more than one!

I'll be replacing mine with 00 18 90 08.


Step Thirteen


Go back to 0x247094 and copy (13*number of new attacks) bytes. We'll add this onto the end of the other table just like we did with the move data. Once again, we want the table to support up to 511 moves, so 157*13 is 2041.

Now do Edit > Select Block > 2041, and copy that data.

Step Fourteen


Return back to your new location for the attack names data (mine was 0x901800) and go to the end of the data. Once at the bottom, once again, Edit > Select Block > 2401 and paste.


Step Fifteen


Goto 0x1C68F4. Edit > Select Block > 1420. Copy.

This is the animation data. The new moves wouldn't work without some sort of animation to go along with them...

Step Sixteen

Open up Free Space Finder and search for 1420 bytes. (Or if you know you have room, paste this data right after the new attack names data). Edit > Select Block > 1420 and paste the data. MAKE SURE the offset you paste the data on ends with a 0, 4, 8, or C, OR IT WILL NOT WORK. So the offset I'm pasting mine it is 0x90336C.


Step Seventeen

Edit > Find > F4 68 1C 08

Yep, you guessed it, we have to change the pointer to that data to the one of our new one. I'm pretty sure there is only one, but check just to be safe. So I will change it to 0x90336C.

So my pointer will look like this: 6C 33 90 08.


Step Eighteen

Go back to 0x1C68F4 and copy (4*number of new attacks) bytes. 157*4 is 628. So Edit > Select Block > 628. Copy.


Step Nineteen

Once again, you can open Free Space Finder and search for 628 free blocks, or to make things easier once again, just post this directly underneath the third set of data that you just placed (the animation data).

A note, each move will have an animation. As of now, each move will inherit the animations of the first however many attacks you added, so new attack number 1 (#335) will have pound's animation, etc...

Step Twenty

Open up Pokemon Game Editor's INI (Should be in a folder that says "ini" that came with the program).

Or you can open up Pokemon Game Editor, go to "Help", and click "Edit roms.ini".


Step Twenty-One

Change the offsets so it knows where the new location of your attack data and such is.

The only things we need to change are these three things:

NumberOfAttacks=354
AttackData=&H250C04
AttackNames=&H247094
AttackAnimationPointer=&H1C68F4

We want to change those to our new offsets. Here is what mine will look like (and yours too, if you followed the tutorial).

NumberOfAttacks=511
AttackData=&H900000
AttackNames=&H901800
AttackAnimationPointer=&H90336C

Step Twenty-Two


Lastly, there is one limiter in the ROM. If it is not disabled, instead of saying "Bulbasaur used VenoShock!", it will say "Bulbasaur used a POISON move!".

Go to 0xD75Fc and overwrite whatever is there with:

00 00 00 00 00 00


Credit:
Itman
Jambo51


Making an XY Inverse Battle:
Spoiler:
Creating Inverse Battles

In XY, there is a new type of battle known as the Inverse Battle. In this mode, type match-ups are reversed- moves that are normally super-effective become ineffective, and moves that are normally resisted or would have no effect become super-effective. I did some poking at the type chart code recently and found that it's actually quite easy to implement these in FR.

"But that's easy! Just edit the well-documented type chart so every match-up is backwards!"

That isn't what this does. This hack hijacks the code that reads the type chart to make the game use the inverse of what's there. This means you can use a flag to have hacks with both regular and inverse battles.

The routine is as follows:

Code:
.align 2
.thumb
.thumb_func
push {r4, r5, lr}
mov r4, r0
mov r0, #0x02
lsl r0, #0x8
mov r1, #0x3D
add r0, r1
bl FlagCheck
cmp r0, #0x0
beq End
cmp r4, #0x0
beq SuperEffective
cmp r4, #0x5
beq SuperEffective
cmp r4, #0x14
beq Ineffective
b End

SuperEffective:
mov r4, #0x14
b End

Ineffective:
mov r4, #0x5

End:
ldr r5, .damageAddr
ldr r0, [r5, #0x0]
mul r0, r4
ldr r1, .returnAddr
bx r1

FlagCheck:
ldr r2, .flagAddr
bx r2


.align 2
.returnAddr: .word 0x0801e77d
.flagAddr: .word 0x0806e6d1
.damageAddr: .word 0x02023d50
.end

You can insert it anywhere. To call it, insert 00 49 08 47 at x1E770, followed by a pointer to where you inserted the method + 1. (For example, I inserted the method at x170900- I would put 00 49 08 47 01 09 17 08 at x1E770).

This code ties the Inverse Battle rules to flag x23D. If flag x23D is set, battles will use the Inverse Battle ruleset- otherwise they will work normally. If you want to use a different flag, you can change it quite easily by adjusting the values on the sixth and eighth lines. Note that in vanilla FireRed, flag x23D is used by the Pokeflute- if that script is still in the game you will want to pick a different one.

To use this hack in Emerald

Replace the addresses at the end with this:

Code:
.returnAddr: .word 0x08046f6d
.flagAddr: .word 0x0809d791
.damageAddr: .word 0x020241f0
Next, put 00 49 08 47 at 0x46f60, followed by the pointer to where you inserted the ASM + 1.

That's it! I believe flag 0x2CD is used by something in EM as well, so just change the values in the sixth and eighth line if you want a different flag.
For anyone wanting to know how to make a trainer have an inverse battle with you... here is a detailed script:

Code:
#dynamic 0x725BEF ' any free space
#org @start
'-----------------------------------
setflag 0x33D ' the flag you chose
trainerbattle 0x1 0x(battle) 0x0 @text1 0x(oldtext2) @clearinverse
msgbox 0x(oldwon)
callstd MSG_LOCK ' Built-in lock command
clearflag 0x33D ' the flag you chose
end

#org @text1
= (old intro text)\pThis will be an\nINVERSE BATTLE.

#org @clearinverse
'-----------------------------------
clearflag 0x33D ' the flag you chose
release
end
It is color coded to the parts that need to be pasted in:
Code:
#org 0x816A63E
'-----------------------------------
trainerbattle 0x0 0x8E 0x0 0x81911EC 0x8191237
msgbox 0x819126B ' You're pretty hot.\n...
callstd MSG_LOCK ' Built-in lock command
end


#org 0x81911EC
= Stop right there, kid!\pYou're ten thousand light-years \nfrom facing BROCK!

#org 0x8191237
= Darn!\pLight-years isn't time[.]\nIt measures distance!

#org 0x819126B
= You're pretty hot.\n[.]But not as hot as BROCK!
The example trainer(above) is the trainer in brocks gym, but the same parts can be copied from any trainer.

trainers using this script will not approach the player, they must be talked too.

X and Y usually ask the player if they want to continue... this script warns the player but does not let them back out. A simple yes/no script can make that happen. If you can't figure that out, you probably shouldn't be scripting.

If you are doing this for multiple trainers, you do not need to compile the '@clearinverse' section each time, you can just use the same offset where it is compiled once.

Credit:
Doesn’tKnowHowToPlay
HidoranBlaze
LocksmithArmy


Trainer AI:
Spoiler:

These seem to be the scrips that determine how trainers act during battles. It's a different bytecode than that used for NPCs, or moves, or moveanimations, or overworld effects, etc.

It runs a series of 32 scripts for each move in the moveset, the scripts can add or subtract to a score for this move depending on the circumstances and then quit.
Unlike the npc scripts there aren't serveral variables that you can access by number but only one that you can use freely, and another one that contains the id of the move being considered right now.
In case a command can use either variable as input, there are two variants of it with separate codes.
(In my notes __8 is the free variable and _2 is the move being considered, I'm renaming these however wherever I encounter them in my notes. _8, _16 and _32 refer to the lengths one byte, two bytes, four bytes)
Many of these commands are followed by one byte that specifies if it refers to the attacking pokemon (1) or defending pokemon (0).

The dispatch table is at 083F55A4. Meanings as far as I have figured them out so far are:

Code:
00 random_goto__high_param_likely
01 random_goto__low_param_likely
02 random_goto__1_in_256_chance
03 random_goto__255_in_256_chance
04 viability_score (followed by the value that should be added FF=-1 FE=-2 …)
05 jump_if_health_percentage_lt
06 jump_if_health_percentage_ge
07 jump_if_health_percentage_eq
08 jump_if_health_percentage_ne
09 jump_if_any_status1_bit
0A jump_if_no_status1_bit
0B jump_if_any_status2_bit
0C jump_if_no_status2_bit
0D 080C76F4
0E 080C7764
0F 080C77D4
10 080C7850
11 jump_if__8_lt_8
12 jump_if__8_gt_8
13 jump_if__8_eq_8
14 jump_if__8_ne_8
15 jump_if__8_lt_32
16 jump_if__8_gt_32
17 jump_if__8_eq_32
18 jump_if__8_ne_32
19 jump_if_move_id_eq_16
1A jump_if_move_id_ne_16
1B jump_if__8_in_list_8
1C jump_if__8_not_in_list_8
1D jump_if__8_in_list_16
1E jump_if__8_not_in_list_16
1F 080C7D44
20 080C7DB4
21 get_battle_turn_counter__8
22 get_some_type
23 move_get_power__2_8
24 080C7F64
25 get_move_to_execute_B
26 jump_if__8_ne_2
27 jump_if__8_eq_2
28 080C8238
29 080C8284
2A —
2B —
2C count_alive_pokemon_on_team
2D get_move_id__8
2E move_get_move_script_id
2F get_ability
30 simulate_damage_muliplier_four_times
31 simulate_damage_bonus_jump_if_eq
32 —
33 —
34 jump_if_team_as_alive_pokemon_probably
35 080C87BC
36 080C8880
37 jump_if_move_id_eq_8
38 jump_if_move_id_ne_8
39 jump_if_stat_buff_lt
3A jump_if_stat_buff_gt
3B jump_if_stat_buff_eq
3C jump_if_stat_buff_ne
3D 080C8B24
3E 080C8C20
3F 080C8D04
40 080C8DE0
41 080C8EBC
42 080C8FB0
43 080C9088
44 jump_if_or_if_not_current_move_in_encore
45 f10_or_b1011
46 080C91B4
47 f10_or_b1101
48 080C9264
49 080C92E4
4A did_just_enter_battle
4B stockpile_use_count
4C is_double_battle
4D 080C93FC
4E move_get_type__8
4F move_get_power__8_8
50 move_get_move_script_id__8
51 get_protect_endure_activity
52 —
53 —
54 —
55 —
56 —
57 —
58 080C9530
59 jump
5A f10_or_b0001_aka_exit
5B compare_attacker_defender_levels
5C jump_if_taunt_turns_ne_0
5D jump_if_taunt_turns_eq_0


Reminder regarding status1 and status2. The Pokemon Information relevant for a battle is copied from their own data structures into four structures at 02023BE4 (two for player side, two for opponent side). JPAN documented this and status1 and status2 are part of that structure.

The array of 32 pointers to such scripts is at 081D9BF4.
Code:
081D9BF4: 081D9C74 081DA445 081DBA6F 081DBA8D
081D9C04: 081DBAEF 081DBADF 081DBB16 081DBB3B
081D9C14: 081DBB3C 081DBC91 081DBCED 081DBCED
081D9C24: 081DBCED 081DBCED 081DBCED 081DBCED
081D9C34: 081DBCED 081DBCED 081DBCED 081DBCED
081D9C44: 081DBCED 081DBCED 081DBCED 081DBCED
081D9C54: 081DBCED 081DBCED 081DBCED 081DBCED
081D9C64: 081DBCED 081DBCA8 081DBCD6 081DBCDD
It's worth noting that the entry "081DBCED", that appears multiple times here, doesn't do anything and can be replaced by custom move-rating-scripts.

Here are some lightly documented examples:

Code:
// don't use moves that are negated by "soundproof"

081D9CE0 2F @ get ability of
081D9CE1 00 @ defender

081D9CE2 14 @ jump if not equal to
081D9CE3 soundproof
081D9CE4 081D9D27

081D9CE8 19 (jump_if_move_id_equals_16)
081D9CE9 mve_growl
081D9CEB 081DA433 (lower viability of move by 10)

081D9CEF 19 (jump_if_move_id_equals_16)
081D9CF0 mve_roar
081D9CF2 081DA433 (lower viability of move by 10)

081D9CF6 19 (jump_if_move_id_equals_16)
081D9CF7 mve_sing
081D9CF9 081DA433 (lower viability of move by 10)

081D9CFD 19 (jump_if_move_id_equals_16)
081D9CFE mve_supersonic
081D9D00 081DA433 (lower viability of move by 10)

081D9D04 19 (jump_if_move_id_equals_16)
081D9D05 mve_screech
081D9D07 081DA433 (lower viability of move by 10)

081D9D0B 19 (jump_if_move_id_equals_16)
081D9D0C mve_snore
081D9D0E 081DA433 (lower viability of move by 10)

081D9D12 19 (jump_if_move_id_equals_16)
081D9D13 mve_uproar
081D9D15 081DA433 (lower viability of move by 10)

081D9D19 19 (jump_if_move_id_equals_16)
081D9D1A mve_metal_sound
081D9D1C 081DA433 (lower viability of move by 10)

081D9D20 19 (jump_if_move_id_equals_16)
081D9D21 mve_grasswhistle
081D9D23 081DA433 (lower viability of move by 10)

081DA433 04 (add to viability)
081DA434 F6 (minus 10)
081DA435 5A (end)


081DAB77 5 @ jump if health of
081DAB78 1 @ attacker
081DAB79 70 @ less than 70%
081DAB7A 081DAB86 @ target
081DAB7E 0x3A @ jump if
081DAB7F 0 @ defender
081DAB80 5 @ spdef
081DAB81 3 @ ?
081DAB82 081DAB8E @ target

081DAB86 0
081DAB87 0x32
081DAB88 081DAB8E
081DAB8C 4 @ move not so viable
081DAB8D -2 @ minus 2 points

081DAB8E 6 @ jump if health of
081DAB8F 0 @ defender
081DAB90 70 @ greater than 70%
081DAB91 081DAB97 @ target
081DAB95 4 @ move not so viable
081DAB96 -2 @ minus 2 points
081DAB97 0x5A @ end
Credit:
Knizz


Move Effects List:
Spoiler:
0 = no added effect

1 = puts target to sleep

2 = posion the target

3 = abosrbs half the damage inflicted (Absorb, Mega Drain, etc.)

4 = burn the target

5 = freeze the target

6 = paralyze the target

7 = Selfdestruct, Explosion

8 = takes 1/2 of damage inflicted on sleeping foe (Dream Eater)

9 = Mirror Move

10 = raises user's Attack

11 = raises user's Defense

12 = raises user's Speed

13 = raises user's Special Attack

14 = raises user's Special Defense

16 = raises user's evasion

17 = never misses

18 = lowers opponent's Attack

19 = lowers opponent's Defense

20 = lowers opponent's Speed

21 = lowers opponent's Special Attack

22 = lowers opponent's Special Defense

23 = lowers opponent's Accuracy

24 = lowers opponent's evasion

25 = Haze (there's many effects associated exclusively with this move)

26 = Bide

27 = Thrash/Petal Dance/Outrage

28 = Whirlwind/Roar effect

29 = happens 2-5 times

30 = Conversion

31 = may cause flinching

32 = Recover 1/2 of maximum HP

33 = badly poisons foe

34 = Pay Day

35 = Light Screen

36 = may freeze, paralyze, or burn

37 = Rest

38 = 1-hit KO

39 = takes 2 turns + high critical hit ratio (Razor Wind)

40 = always cuts half of foe's current HP

41 = always do 40 HP damage (Dragon Rage)

42 = Bind/Fire Spin/Clamp/Whirlpool effect

43 = high critical hit ratio

44 = hits twice (Double Kick)

45 = if miss, then user receives 1/8 of damage it would have dealt (Jump Kick)

46 = stops stat changes (Mist)

47 = raises user's critical-hit ratio

48 = recoil damage, 1/4 of damage (Take Down)

49 = Confuse target

50 = sharply raises users Attack

51 = sharply raises users Defense

52 = sharply raises users Speed

53 = sharply raises users Special Attack

54 = sharply raises users Special Defense

57 = Transform

58 = sharply reduces foe's Attack

59 = sharply reduces foe's Defense

60 = sharply reduces foe's Speed

61 = sharply reduces foe's Special Attack

62 = sharply reduces fow's Special Defense

65 = Reflect

66 = poisons the target (again, for some reason)

67 = paralyzes the target (again, for some reason)

68 = lower opponent's Attack

69 = lower opponent's Defense

70 = lower opponent's Speed

71 = lower opponent's Special Attack

72 = lower opponent's Special Defense

73 = lower opponent's accuracy

75 = takes 2 turns, may cause opponent to flinch

76 = may Confuse target

77 = hits twice, may poison opponent (Twineedle)

78 = never misses, but attacks second

79 = Substitute

80 = immobile next turn (Hyper Beam)

81 = raises user's Attack every time is hit (Rage)

82 = Mimic

83 = Metronome

84 = steals opponent HP every turn (Leech Seed)

85 = Splash

86 = Disable

87 = damage is equal to user's level (Seismic Toss/Night Shade)

88 = amount of damage done varies (Psywave)

89 = Counter

90 = Encore

91 = Pain Split

92 = can only use this attack if user is asleep (Snore)

93 = Conversion 2

94 = next move after will not miss (Mind Reader)

95 = Sketch

97 = Sleep Talk

98 = Destiny Bond

99 = inflicts more damage if user has less HP (Flail, Reversal)

100 = Spite (cuts opponent's PP)

101 = False Swipe (will never make opponent faint)

102 = heals all status problems

103 = always attacks first

104 = attacks 3 times, gets stronger each time (Triple Kick)

105 = steal foe's held item

106 = prevents foe from fleeing/switching

107 = inflicts 1/4 damage on sleeping foe (Nightmare)

108 = raises user's evasion, receives double damage from Stomp

109 = Curse

111 = Protect/Detect

112 = Spikes

113 = Foresight

114 = Perish Song

115 = Sandstorm

116 = Endure

117 = Rollout/Ice Ball

118 = Swagger

119 = Fury Cutter

120 = Attract

121 = higher attack power if Pokemon happiness is higher

122 = Present

123 = higher attack power if Pokemon happiness is lower

124 = prevents all status problems from user

125 = thaw out if frozen, may burn target (Flame Wheel/Sacred Fire)

126 = Magnitude

127 = Baton Pass

128 = Pursuit

129 = Rapid Spin (removes Fire Spin, Whirlpool, etc.)

130 = always do 20 HP damage (SonicBoom)

132 = Morning Sun

133 = Synthesis

134 = Moonlight

135 = Hidden Power

136 = Rain Dance

137 = Sunny Day

138 = 10% chance of raising user's Defense (Steel Wing)

139 = may raise user's Attack (Metal Claw)

140 = may raise user's Attack, Defense, Speed, Special Attack, and Special Defense

142 = maximizes Attack, HP is cut in half (Belly Drum)

143 = Psych Up

144 = Mirror Coat (special version of Counter)

145 = takes 2 turns, raises user's Defense (Skull Bash)

146 = may flinch opponent, double the damage if opponent uses Fly or Bounce

147 = does double the damage if opponent is using Dig

148 = Future Sight

149 = does double the damage is opponent is using Fly or Bounce

150 = may cause flinching + attack power is doubled if opponent used Minimize

151 = takes 2 turns, unless Sunny Day is in effect. Only 1/2 the damage if Rain Dance,
Sandstorm, or Hail

152 = Thunder (there's many effects associated exclusively with this move)

153 = Teleport

154 = Beat Up

155 = takes 2 turns

156 = raises user's Defense, power of Rollout and Ice Ball is now doubled

157 = Softboiled/Milk Drink (Recover, but usable out of battle)

158 = Attacks first, causes flinching (Fake Out)

159 = Prevents sleep, attacks for 2-5 turns (Uproar)

160 = Stockpile

161 = Spit Up

162 = Swallow

164 = Hail

165 = Torment

166 = Confuses foe, but raises foe's Special Attack

167 = Burns the foe, but doesn't affect Fire types

168 = Memento

169 = Boosts Attack when burned, paralyzed, or poisoned

170 = takes 2 turns, but if hit user flinches (Focus Punch)

171 = Stronger against paralyzed foes, but heals the paralysis (SmellingSalt)

172 = Makes foes attack only the user (Follow Me)

173 = Nature Power

174 = Next electric move used is now stronger (Charge)

175 = Taunt

176 = Helping Hand

177 = Trades held items with foe

178 = copies opponent's special ability

179 = Wish

180 = attacks randomly with one of partner's moves (Assist)

181 = Ingrain

182 = lowers user's Attack and Defense

183 = Magic Coat

184 = Recycle

185 = double the damage if user was hurt by opponent in the same turn

186 = destroyes Light Screen and Reflect (Brick Break)

187 = Yawn

188 = opponent loses held item (Knock Off)

189 = Endeavor

190 = the higher user's HP, the more damage

191 = user swaps abilities with opponenet (Skill Swap)

192 = Imprison

193 = Refresh

194 = Grudge

195 = Snatch

196 = more damage on heavier foes (Low Kick)

197 = Secret Power

198 = recoil damage, 1/3 of damage (Double-Edge)

199 = confuses all Pokemon on the scene (Teeter Dance)

200 = high critical hit ratio + may cause burn (Blaze Kick)

201 = Mud Sport

202 = damage + badly poison target

203 = type and power depends on weather (Weather Ball)

204 = sharply lowers Special Attack after use (Overheat)

205 = lower's opponent's Attack and Defense (Tickle)

206 = raises user's Defense and Special Defense (Cosmic Power)

207 = can hit an opponent using Fly or Bounce (Sky Uppercut)

208 = raises user's Attack and Defense (Bulk Up)

209 = high critical hit ratio + poison

210 = Water Sport

211 = raises user's Special Attack and Special Defense (Calm Mind)

212 = raises user's Attack and Speed (Dragon Dance)

213 = Camouflage
Credit:
Chaos Rush


Updated Moves List
Spoiler:
This is a resource that will be useful for hackers who wish to modernise their battle engine, as it lists moves from the first three generations whose effects have been changed or updated in Generations 4, 5 and 6.

Code:
Whirlwind no longer works on same/higher levelled wild PKMN
ignores accuracy and evasion
bypasses protect and detect

Bind inflicts 1/8 of max. HP*

Stomp x2 base power & ignores accuracy and evasion if target has used Minimize**

Jump Kick Crash damage = 1/2 of user's max. HP, rounded down***

Thrash disrupted by: missing
sleeping
paralysis
freeze
flinching
protecting target
immune target
if disrupted on final turn of Thrash, confusion still occurs****

Roar ignores accuracy and evasion
bypasses protect and detect

Supersonic bypasses sub

Disable always lasts 4 turns
reflected by Magic Coat++

Acid 10% chance to drop Sp.D by 1 stage

Growth raises Atk and Sp.A stats by 1 stage
raises Atk and Sp.A stats by 2 stages in Sun

Surf hits all Pokémon on the field except the user

Blizzard ignores accuracy and evasion in Hail

String Shot drops Speed by 2 stages

Thunder ignores accuracy and evasion in Rain
lowered accuracy in Sun

Dig underground wild PKMN canot be captured

Toxic ignores accuracy and evasion if used by a Poison-type

Rage raging users get Attack stat boosts every time they get hit

Mimic mimicked moves have max PP, not 5 PP

Focus Energy increases crit ratio by 2 stages, not 1

Bide only endures 2 turns
hits Ghost-types, as well semi-invulnerable PKMN in Dive, Bounce or Shadow

Force
broken by sleep

Selfdestruct user faints before dealing damage +
no longer halves target's Def +

Waterfall 20% flinch chance

Sky Attack displays "<user> became cloaked in a harsh light!" instead of "<user> is glowing!" on turn 1

Transform copies shininess
fails on subs

Conversion can be stolen by Snatch
can be used on Curse (because Curse is Ghost-type)
changes the user's current type to match the type of the first of the user's moves

Substitute multi-strike moves continue after breaking sub
blocks intimidate
blocks transform
doesn't block sound-based moves

Struggle ignores accuracy & evasion
user takes 1/4 max. HP as recoil

Sketch can copy Metronome and Transform

Spider Web no longer traps Ghost-types+++

Thief doesn't permanently steal a Trainer’s Pokemon’s item
items can be stolen back

Flail base damage = (48 * CurrentHP) / MaxHP

Conversion2 changes user's type to resist target's last move, including non-damaging moves

Spite reflected by Magic Coat
always deducts 4 PP

Destiny Bond target faints after the user

Sandstorm boosts Rock-type Pokémon's Sp.D by 50%

Sleep Talk can use PP-less moves

Heal Bell bypasses sub
bypasses Soundproof

Encore lasts 3 turns
reflected by Magic Coat, but then fails

Sweet Scent lowers evasion by 2 stages

Hidden Power base power of 60

Crunch 20% chance to lower Def by 1 stage, not Sp.D

Future Sight now does Psychic-type damage
uses Sp.D stat of receiving Pokémon, not original target

Beat Up base power = (party member's base Attack) / 10 + 5
receives STAB from Dark-type users

Uproar lasts exactly 3 turns

Stockpile raises user's Def and Sp.D stat by 1 stage

Spit Up removes Stockpile boosts

Swallow removes Stockpile boosts

Torment activates the turn it is used
reflected by Magic Coat

Facade ignores Burn Attack cut

Focus Punch charging turn has +6 priority

Nature Power calls different moves

Charge boosts Sp.D by one stat

Taunt lasts exactly 3 turns
reflected by Magic Coat

Trick no longer permanently switches a Trainer’s Pokemon’s items

Wish heals for half of the user's max. HP, not the recipient's
affected by Snatch

Ingrain Ghost-types who have ingrained can switch

Recycle affected by Snatch

Magic Coat reflects Teeter Dance, Taunt, Torment

Brick Break no longer removes screens if target is Ghost-type

Knock Off deals 50% more damage if target has item

Skill Swap switch-in abilities like intimidate activate after being swapped

Secret Power different effects

Dive underwater wild PKMN canot be captured

Camouflage more types for different terrain

Tail Glow raises Sp.A by 3 stages

Mud Sport active for exactly 5 turns++++

Poison Fang 50% chance to badly poison target

Aromatherapy lists PKMN that are healed

Covet no longer permanently steals a Trainer’s Pokemon's items

Doom Desire now does Steel-type damage
uses Sp.D stat of receiving Pokémon, not original target

*applies to Bind, Wrap, Fire Spin, Clamp, Whirlpool, Sand Tomb

**applies to Stomp, Body Slam

***applies to Hi Jump Kick

****applies to Thrash, Outrage, Petal Dance

+applies to Selfdestruct, Explosion

++applies to Disable, Spite, Spkies, Foresight, Torment, Taunt, Odor Sleuth

+++applies to Spider Web, Block, Mean Look

++++applies to Mud Sport, Water Sport

Credit:
Spherical Ice
__________________
Though I'm far from a pro, I try can help you on your ROM with scripting, ASM, mapping WHATEVER.

Just ask
Reply With Quote
  #23    
Old November 16th, 2014 (04:58 PM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Progress Report:

Not quite what we promised yesterday, but we made some internal changes and user interface improvements.

I plan on implementing submissions, database, and subtopics in that order.

Again, it can be viewed at the incremental release.
__________________
Reply With Quote
  #24    
Old November 16th, 2014 (05:38 PM).
Team Fail's Avatar
Team Fail Team Fail is offline
fun in the sun
Platinum Tier
 
Join Date: May 2009
Age: 20
Gender: Male
Nature: Brave
Posts: 10,525
Quote originally posted by Synchronous:
Great work, Sis. Your help is invaluable, and exactly what I was looking for.

I also agree that we can't use a very flat tree model for containing all of our documentation. We'll have to think more about that.

Maybe something like this? (example)
Code:
GBA
	Overview
		BIOS
		Architecture
	FireRed
		Overview
			Binary
			Video
			Memory
			Interrupts
			Data Structures
		Graphics
			Overworld
				Sprites
					Frames
				Maps
					Blocks
					Movement Permissions
			Battle
				Move Animations
				Backgrounds
		Mechanics
			Battle
				AI
			Flags
That was almost exactly as I was envisioning it. It'd probably work best, although I still kinda like the traditional wiki style. It's almost exactly like this, too.
__________________
Pair 1 Pair 2 Twitter Alt 1 Alt 2 PHO Image Source Avatar Source

"On my business card, I am a corporate president.
In my mind, I am a game developer.
But in my heart, I am a gamer."

- Satoru Iwata, 1959 - 2015
Reply With Quote
  #25    
Old November 17th, 2014 (06:01 AM).
Akiba's Avatar
Akiba Akiba is offline
Crystal Tier
 
Join Date: Mar 2011
Location: 幻想郷
Age: 16
Gender: Female
Nature: Quiet
Posts: 3,625
Another thing to mention, this project will come with mobile support baked in, so it will be more accessible to everyone.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
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 UTC -8. The time now is 04:31 AM.