Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2013-03-03 02:23:50

theoblivinator
Member
From: Iowa
Registered: 2012-08-20
Post 75/98

Conceptual Question with Advice Needed.

This isn't really a specific question, more conceptual right now. I apologize if it is unneeded.

I want to start a new project. I have lost interest in my old project, and I'm looking to start a fresh, more interesting project. I'm looking to create a new region with new towns, cities, and routes with an entirely new story/plot weaved into it coupled with new dialogue, new NPC's, new trainers etc.... I could still do all the fancy revamps that I started in my original hack, like buffing weaker Pokemon so they are appealing to the players, balancing out some move-sets and stats; all that jazz. I understand that is what many hackers try to do and ultimately fail, but I still want to give it a shot.

Instead of just jumping right into it and getting way over my head, I want to try a certain approach to this. Since I don't really know how most people start off with these kinds of projects, here is how want to go about it:

1.) Clear out all data in the ROM that I plan on re-creating. Since I'm going to create all my events from scratch, I won't need any of the original event data. Since all of the NPCs will have dialogue I created, I won't need any of the exiting dialogue. Since I'm going to be revamping all the trainers, and probably creating new trainers classes, most of the trainer data could probably go too.

2.) With all the banks cleared of unused data, it should be easy to add/code whatever I want to put into my hack without having to overwrite existing code, or re-pointing code to free space at the end of banks, ideally maxing out on efficiency.

I think this process might take a whole lot of longer, but I feel like it would make the ROM a lot cleaner. I wouldn't have to have loads of notes about where stuff is re-pointed, or where I moved certain bytes; everything would just be laid out exactly how I want it. Clean and concise.

So my question, mostly directed towards the veteran hackers of this community that have successful hacks, is this the right way to go about it? Did you guys follow a similar format when starting something like this, or did you guys do something completely different, and if so could you lay out your ideas on how to approach this?

Again I apologize for not having a definite question and instead mostly just laying out an idea and seeing what feedback I might receive. Also I apologize on the length of the post.

Thanks for the help everyone!

Offline

#2 2013-03-03 08:24:28

Miksy91
Member
Registered: 2010-10-16
Post 1,545/2,308

Re: Conceptual Question with Advice Needed.

I feel like being the only one even doing this but since I am, might as well post about it.

I personally started off by leaving all the existing data in the game. Not a wise choice, because I like removing all the unused data from the game and so I can't keep things as organized as I wanted to. Leads me into thinking that I can't re-write data starting at that specific rom address which is "in the way" of the data I'm just writing because it may be something I have written there, but can't be sure.

So I'd say, go for it and clear all the existing event, script and text data. This process can even be done very easily, you'll just have clear all the data between 0x108000 and 0x18BFFF. Start copy pasting one unused rom bank to fill that rom area with 00's, that's all.

Then again, I do recommend leaving the original map data around. When you need more space for a map, just fill its data with 00's too and repoint it elsewhere. As for myself, I've repointed all the necessary map data in rom bank 6F which is starting to get filled up (used from 0x1BC000 to 0x1BFA00 or so), should switch to using another one.

Also a good approach into making a new map,
1) Plan out what's going to happen there; does something have to be loaded from the script header, how many events of each type are around
2) Put the script header and event data next to each other, their pointers can even point to the same rom address if you execute nothing from the script header
3) Put all the scripts of that map following the event data but leave a little bit of space between them, for example 13 bytes so you can insert a new person event between them if needed
4) Write the scripts, leave at least 3 bytes blank space after each one that might have to be expanded later on (2call / 2jump "3-byte").
5) Write the text data after the scripts by filling some junk there and loading that address with Poketext. Put 2 marks between each message you write, so you can fill them with "57 00" with a hex editor in the next phase.
6) Fix those 2 marks and adjust the text pointers (before writing the text data, you should have the text pointers as "15 28" loading "Object event").

One map done.


Also one thing to note, Bit Numbers.
You should start using Bit Numbers starting at 0800. And don't let the game activate bit numbers at the start of the game with 0C 18 00, that was one mistake I did which also wasn't a good idea.

If you want a certain person event be hidden from the start, you should write a script to be loaded in the beginning which writes for example "FF" to ram addresses D7B8, D7B9, ..., D7BC. That would already give you 40 bits (0800, 0900, ...) to be used for people events to be made hidden in the beginning. Or, you could just hide/show them related to what's being called from the map's script header but this kind of an approach can turn out complicated at times.

Last edited by Miksy91 (2013-03-03 08:36:11)

Offline

#3 2013-03-03 16:32:05

theoblivinator
Member
From: Iowa
Registered: 2012-08-20
Post 77/98

Re: Conceptual Question with Advice Needed.

Once again Miksy saves the day. Thanks man for your response. Best part about it is that I understood everything you said except I'm confused by one thing.

The bit table starts at $D7B7 right? So why not start clearing bits out at the beginning of the table? Why start clearing them out at $D7B8 stating with bit number 08?

And again I'm getting ahead of myself. I'm not even sure I want to go through and do all of this yet. But I like the idea of planning out the maps ahead of time before building them. Right now I have a notebook that I carry around with me a lot, and I've been filling it with ideas for the plot and dialogue and such. Time to start adding in map ideas too! :D

Offline

#4 2013-03-03 18:10:12

Tauwasser
Member
Registered: 2010-10-16
Post 349/447

Re: Conceptual Question with Advice Needed.

Hi,

I used to start doing the things you mentioned -- cleaning the ROM, removing all unused data -- some years ago, too.

The biggest issue I had was that bit flags were used in the original code using various look-up methods and using various calls to check for them. For instance all the HM code, the Pokémon code that lets you control them in battle, the telephone code, the room decoration code, the PokéCenter flags, the PokéRUS flags etc. All that (and probably more) is pretty much hard-coded and you would need to know all the places to properly deactivate them if you don't want to ruin your game.

In my game, all Pokémon ended up having the PokéRUS after the first battle, because some bits that needed to be set (or reset) were now used for random/different events.

Miksy91 wrote:

Also one thing to note, Bit Numbers.
You should start using Bit Numbers starting at 0800. And don't let the game activate bit numbers at the start of the game with 0C 18 00, that was one mistake I did which also wasn't a good idea.

Well, the originals never go up to 0x0800 IIRC. The bits you use might end up not being copied into the save game or some parts that you use for the table might actually be some buffer that is used for some other rarely-visited feature. I'd advise against randomly using numbers you know nothing about.
I once did a recursive list of all the used bit numbers on maps for trainers, hidden items and so on. IIRC, a huge chunk in the 0x0400-0x0600 (or maybe earlier even!) never turned up that way. They were used for internal stuff in some ASM only or something.

cYa,

Tauwasser

Offline

#5 2013-03-03 18:25:36

Miksy91
Member
Registered: 2010-10-16
Post 1,546/2,308

Re: Conceptual Question with Advice Needed.

Tauwasser wrote:
Miksy91 wrote:

Also one thing to note, Bit Numbers.
You should start using Bit Numbers starting at 0800. And don't let the game activate bit numbers at the start of the game with 0C 18 00, that was one mistake I did which also wasn't a good idea.

Well, the originals never go up to 0x0800 IIRC. The bits you use might end up not being copied into the save game or some parts that you use for the table might actually be some buffer that is used for some other rarely-visited feature. I'd advise against randomly using numbers you know nothing about.
I once did a recursive list of all the used bit numbers on maps for trainers, hidden items and so on. IIRC, a huge chunk in the 0x0400-0x0600 (or maybe earlier even!) never turned up that way. They were used for internal stuff in some ASM only or something.

cYa,

Tauwasser

I have gotten a habit of referring to pretty much everything in little-endian format unless I happen to state otherwise.
But just so that I won't confuse theoblivinator what this sentence is about, go and start using bits starting at the beginning of the bittable (even so if you keep all the original bits around by activating them in the beginning which sounds like a good idea related to what Tauwasser said here).

So after bit number "08 00" (or 9th bit in bittable1), go with "09 00" (or 10th bit in bittable2) and so on. // 00 00 = 1st bit, 01 00 = 2nd, ...

Offline

#6 2013-03-03 19:12:24

theoblivinator
Member
From: Iowa
Registered: 2012-08-20
Post 78/98

Re: Conceptual Question with Advice Needed.

So in a broad sense, you guys were advising to that if I were to clear out a bit table, clear out bit table 1, since bit table 2 is mostly used for hard-coded features that if cleared might ruin the game (Pokerus, phone codes, breeding pokemon egg codes, stuff like that) right? Then this part from Misky confused me.

Miksy91 wrote:

So after bit number "08 00" (or 9th bit in bittable1), go with "09 00" (or 10th bit in bittable2) and so on. // 00 00 = 1st bit, 01 00 = 2nd, ...

I haven't really learned much about what separates the two different bit tables, just that there are two, bit table 1 and bit table 2. I also know that the bit table starts at $D7B7, though I never knew if that was bit table 1's starting point or bit tables 2's starting point. I know the structure looks something like this:

Each byte of the bit table consists of 8 bits.

D7B7 =
00 00
01 00
02 00
03 00
04 00
05 00
06 00
07 00

D7B8 =
08 00
09 00
10 00
0A 00
0B 00
0C 00
0D 00
0E 00
0F 00

D7B9 =
10 00
11 00
12 00
13 00
14 00
15 00
16 00
17 00

How is bit table 1 separated from bit table 2? Does one table start at $D7B7 and the other start somewhere else? Can you explain a little more in detail for me here please?

And again this is a little off topic, but I'm curious now.

Offline

#7 2013-03-03 19:46:31

Tauwasser
Member
Registered: 2010-10-16
Post 350/447

Re: Conceptual Question with Advice Needed.

Bit table 1 is just a general purpose table. All flags reside in a contiguous space of WRAM (and are copied to SRAM upon saving). Bit table 2 uses a look-up table in ROM to know where to find the individual bits for the flags. So they don't reside in a contiguous space somewhere in WRAM, but rather it's "a bit here, a bit there" etc.

And I also meant that only using bits from table 1 will fuck you over sooner or later become a problem. For instance, many of the 0x0200dreds are used for decoration options in your PC. These values are hardcoded into the ASM for some and in a special table for other.
You will have to find and edit that code or not use these bits or not use the functionality.
IIRC PokéRUS (or some intermediate setting for it) also resides in table 1 when checking at the PokéCenter.

cYa,

Tauwasser

Offline

#8 2013-03-03 20:00:31

Miksy91
Member
Registered: 2010-10-16
Post 1,547/2,308

Re: Conceptual Question with Advice Needed.

Whoa, looks like I've been careless about this issue too.
Luckily, I started following Koolboyman's bit number guide by only using these documented bit numbers for my own hack: http://www.pokecommunity.com/showthread.php?t=127374

So as a new advice from me, start off by using bit numbers between E202 and FF02 which are mostly for the wild pokemon traps of Mahogany. Then move forward using that list and you shouldn't run out of usable bit numbers in a very long time, or most likely ever. Besides, there is unused part of ram starting at DEC0 which could also be used for bit numbers in need but it would be a better idea to reserve this for all the possible add-ons you're going to need ram memory for.

Last edited by Miksy91 (2013-03-03 20:01:43)

Offline

#9 2013-03-03 20:08:02

theoblivinator
Member
From: Iowa
Registered: 2012-08-20
Post 79/98

Re: Conceptual Question with Advice Needed.

That sounds like a good idea. Again I was getting ahead of myself, so thanks for the advice guys. If I have other questions or confusion I can just ask. :)

Offline

#10 2013-03-04 06:44:42

emaj30
Member
From: Indigo Plateau
Registered: 2012-12-29
Post 331/463
Website

Re: Conceptual Question with Advice Needed.

Ow! It's pretty tough huh, I once thought of replacing bytes with 00 so I can start a clean rom but didn't knew where to start.

Offline

Board footer

Powered by FluxBB