How to build a campaign (newb)

Discussion of hacking, editing and developments in Advance Wars games.
Remember, no Rom Requests
Planet Susan

How to build a campaign (newb)

Post by Planet Susan » Wed Jan 20, 2016 5:52 am

I bet everybody is going to tell me that this is going to be too difficult, but, basically, what I want to do is to build a custom campaign mode in Advance Wars 2/DS such that it looks like and plays like a campaign mode from those games. For this, I'd want to build custom maps (using Black Hole-only properties) with custom dialogue snippets and custom win objectives/conditions. I'd like to include custom CO's if possible, but that's the least important aspect.

The thing is, I have no hacking experience whatsoever and I've been looking for guides, but I don't really have the vocabulary to know what will help me. Can anybody hold my hand, tell me it's impossible, or point me in the direction of the guide that's right for me? Thanks :)

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Wed Jan 20, 2016 1:41 pm

Nah, it's totally doable. Will probably require some hard work and a fair bit of learning on your part though.

The anatomy of the Campaign is comprised of a whole bunch of moving parts, but I'll outline most of them here briefly:
• Map Data - This is the basic element themselves. No map, no mission. You can make AW compatible maps by following this or this. This is probably the best place to start, as it works most familiarly with what you're used to in Design Maps in-game. Inventions are straightforward, they're just structures generated from a tile that occupies a larger area.
• Unit Lists - Basically what units are on the map, who they belong to, what AI types they use, how much fuel/ammo they start with, their favourite date spot, etc etc. See this down the end for more information.
• Map Headers - This is a set of data and basic rules for a map. The most important thing is that it tells the game what Map Data and what Unit Lists to use for a particular map. It also does things like how many players a map is, the default COs, number of days for an S-Rank, etc etc. There's an informational topic on it here for AW2 and here for Dual Strike.
• Campaign Headers - This is a set of campaign-specific data. This does stuff like set the pre-mission dialogue, controls the order of missions, sets the position of a particular item on the world map display, etc. A basic rundown of the AW2 version of this is here.
• Event Scripting - This does most of the heavy lifting work in the campaign and will probably be the hardest for someone new to romhacking to get their heads around because it's fairly technical and you currently have to work with it mostly on a code-type level. This does all the interesting stuff like, controls who says what dialogue at various parts of the mission, controls non-standard victory/loss conditions, tells the game to play music or SFX, do screen transitions and whatnot. I'm still trying to work all of the scripting out, but I've got a reasonable grasp of it. Simple things like playing a song then having flak and adder argue for 5 text boxes is pretty easy, more complex stuff is not.
• Text - This is separate from the scripting. It's literally just the words that appear in descriptions, conversation dialogue, etc. It is all pretty straightforward, the complex stuff is mostly handled by the scripting engine.
• Graphics - If you want a different world map, you'll have to play with this. Otherwise, just run with it.

Now in terms of skills, the most important thing I can suggest is getting fluent with hexadecimal notation, as you'll need to be able to read and understand ROM addresses to meaningfully interact with them. If you want to do some really esoteric stuff (like stuff outside of the purview of the events engine) you may have to start learning some assembly, but that might be a way off depending on what you're doing.

I'd suggest getting comfortable with making, inserting and testing maps divorced from any campaign context because that's both a fairly good introduction to the basics of dealing with romhacking and one of the most obvious areas you can see improvement early on. (Apart from text editing, which is very straightforward).

Custom COs are a different matter and require a different set of stuff if you want to build them from the ground up.
• Attributes/Stats - This is literally just the numbers for the various ranks. There's a fair bit of flexibility in the base game with this, but it'll be limited to re-arrangements of the already existing abilities.
• CO Powers - These are basically snippets of assembly code of varying complexity. For something like Max where you get some stat improvements, this will be nearly nothing that basically affects what the animation looks like, while for whole cloth new effects (for example something like Meteor Strike), you'll need to code it entirely from scratch.
• Graphics - Well, your COs have to look like something :)
• Music - This is optional, but every CO has a leitmotif as their theme. This is hard! You'll require a fair bit of hacking experience and probably some musical skill for this.
• Text - Again, pretty self explanatory. This basically covers CO Power quotes, Dossier descriptions and a few other small things.

If you've got any detailed questions, you can always post or hit me up on the IRC (web link on the front of the forums) - I'm usually awake from about 9 am Australian time for most of the day after that.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Wed Jan 20, 2016 5:41 pm

Firstly, wow, thank you. This was really really helpful.

So, my plan at the moment is to build a map using the kinds of basic features I want to be using, and build on that one map consistently until it contains all the features I want; say I want to build a mission where a particular CO captures a piece of territory as part of a greater narrative, first I'd build the actual map itself and see if I can get that playable, then try to run a given win condition, then try to add event scripting and once I've built that one map perfectly, I should know broadly what to do. Perhaps at that point, it might simply easier to build a selection of missions to be played (and bought?) in order in War Room.

I've downloaded both Map Editors you've sent to me and had a bit of a play (mixed results thus far, but that's probably just teething problems), but I feel like I'm missing something. Do I save all these separate elements and load them into a big 'combine these hacks with the original ROM' programme or...?

User avatar
MysteriousLad
Rank: Mysterious President
Location: In your computer.

Re: How to build a campaign (newb)

Post by MysteriousLad » Wed Jan 20, 2016 6:10 pm

Which editor are you using?
One of them requires a separate program to import it into the rom. That's explained in the page with the link and stuff I believe.
0x000's needs a hex-editor and then you can just copy the hex coding somewhere into the rom where you see a lot of "FF FF FF FF..." (Empty space) and change a map pointer to point towards it. This can be done manually or with Nightmare 2 which is another program which will simplify changing CO's in missions and stuff like that. Basically the map header editing Xen mentioned.
"i put on my robe and wizard hat" ~Pkdragon
"rocks fall everyone dies" ~HPD
Welcome to the optimistic world of WWN :D

And logic doesn't work on MysteriousLad... ~Kireato
Wait, wait, wait.

Organized crime is selling bagels on television? Since when? ~Dragon Fogel

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Wed Jan 20, 2016 7:06 pm

I'm having most luck with the aw map editor (as opposed to mappy/mapwin, whose tiles don't seem to load effectively for me), just am currently being surprised by how organic the proper design room creations feel as opposed to my map, whose sea looks really, really wrong. :P

I think I'll just try to finish building this map, at least roughly, and then move onto the map header editing. I've not actually gotten that far yet, so hopefully things will make a bit of sense shortly thereafter.

[though, erm, how do I actually save on aw map editor? I clicked the floppy disc icon, but it didn't seem to do anything]

User avatar
MysteriousLad
Rank: Mysterious President
Location: In your computer.

Re: How to build a campaign (newb)

Post by MysteriousLad » Wed Jan 20, 2016 7:42 pm

It saves it to a file I believe in the folder.
"i put on my robe and wizard hat" ~Pkdragon
"rocks fall everyone dies" ~HPD
Welcome to the optimistic world of WWN :D

And logic doesn't work on MysteriousLad... ~Kireato
Wait, wait, wait.

Organized crime is selling bagels on television? Since when? ~Dragon Fogel

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Wed Jan 20, 2016 7:44 pm

Any idea what it might be called or what kind of file it might be? Honestly when I click the save icon, nothing seems to really happen so I think I must be missing something?

tell a lie

sorry, I found a PNG file for my map and the map and units with corresponding .bin files. That sounds about right, doesn't it?

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Wed Jan 20, 2016 8:07 pm

So, the guide for the Map Editor I'm using says to 'insert' the map file 'into' the rom, but I don't actually know what that means. :?
Is this what the Hex-Editor is for?

User avatar
MysteriousLad
Rank: Mysterious President
Location: In your computer.

Re: How to build a campaign (newb)

Post by MysteriousLad » Wed Jan 20, 2016 10:57 pm

I've not done this in a long while so Xen may be best here.
"i put on my robe and wizard hat" ~Pkdragon
"rocks fall everyone dies" ~HPD
Welcome to the optimistic world of WWN :D

And logic doesn't work on MysteriousLad... ~Kireato
Wait, wait, wait.

Organized crime is selling bagels on television? Since when? ~Dragon Fogel

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Wed Jan 20, 2016 11:33 pm

Planet Susan wrote:So, the guide for the Map Editor I'm using says to 'insert' the map file 'into' the rom, but I don't actually know what that means. :?
Is this what the Hex-Editor is for?
Yeah, you'll need to use a hex editor for this step (there are other ways, but I'll keep it simple for now).

The file from x0_000's map editor, should be something like 'thingy.map'

You'll need to open up a ROM in a hex editor and find some free space to add it in. For AW2 (US), you can find some free space in the ROM at 0x700000. You can open the map file from the ROM into here and overwrite it. If you've got units you'll also want to paste the unit list into the ROM after the map.

This is the point where you will need to edit a map header. You can find for instance Bean Island's map header in AW2 at 0x5C77FC. A short bit away from the start of the map header you'll see four bytes of "84 0A 1B 08" - this is the pointer to the map data for Bean Island for the Bean Island Map Header. It's in little endian format, so it is in reverse order for how you'd normally read it: "0x081B0A84". If you've added the new map in the rom, edit this address to the starting point of where you added it in. E.g. if you added it to 0x700000, your entry would be 0x08700000 entered as "00 00 70 08". (The 08 at the start signifies it is in the ROM part for the GBA).

The next 4 bytes should be 00,00,00,00, then after that is another four 00,00,00,00. This is where the entry for the unit list's start goes. If you enter in the location here in the same format (0x08XXXXXX as XX XX XX 08) you can include the unit list too.

Save it, and if you've done it correctly your map should replace Bean Island.

The process is the same for AWDS, but because of the way the DS works, calculating the pointer locations to enter into the header is significantly harder.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Thu Jan 21, 2016 2:52 am

Thanks Xenesis. Your advice really gets to the heart of what I'm asking. I'll give it a go and see how I get on.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Thu Jan 21, 2016 3:12 am

Okay, what I'm seeing doesn't look right. I've loaded my ROM into HxD hex editor and I can't find a value of 0x700000 and, when you say 'free space' do you mean legit free space in the page that I can just copy and past my stuff into? My stuff entails two files; map.bin; map-units.bin; and possibly maplz77.bin. When I drag and drop my map.bin file, I get some hex code, which, if I understand this correctly, I need to copy and paste into the main ROM, in a place where it basically won't be missed - which is why you're suggesting Bean Island. Then, I add other bits of coding to indicate the Units and custom victory conditions and stuff in that same area. Is that about right?

So I think I'm doing well, I just need to work out where Bean Island is, and then I can carry on, right?

User avatar
MysteriousLad
Rank: Mysterious President
Location: In your computer.

Re: How to build a campaign (newb)

Post by MysteriousLad » Thu Jan 21, 2016 8:54 pm

Nonononono,
go to line 0x700000 and don't overwrite bean island as if your map is a different size you may end up fudging things up.
Around 0x7000000 you should see a lot of "FF FF FF FF FF FF FF FF FF FF FF .. .. (and so on)" this is basically empty space where nothing of the game has been placed. Paste your map there and then change the map header to "point" to this new location.
"i put on my robe and wizard hat" ~Pkdragon
"rocks fall everyone dies" ~HPD
Welcome to the optimistic world of WWN :D

And logic doesn't work on MysteriousLad... ~Kireato
Wait, wait, wait.

Organized crime is selling bagels on television? Since when? ~Dragon Fogel

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Mon Jan 25, 2016 5:53 am

I'm still not sure what you mean by line 0x700000? I've tried most of the ways of searching my Hex Editor for most possible configurations of that string but I just can't find it. Maybe my editor's rubbish. Who can say?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Mon Jan 25, 2016 11:51 am

Ah, sorry, I thought Mysteriouslad explained it clearly enough!

By Address 0x700000, I mean, go to position 0x700000 in the ROM (e.g. it is the 0x700000th byte in the ROM). It is a location, not a string. Use the hex editor's "go to" function.

Pointers are basically short identifying labels that tell the game which location in the ROM, RAM, whatever to look at. So you put your map data in address 0x700000, then tell any reference to the map that your data is located at that point by updating the pointer to 0x(08)700000.

Basically:
Address - Physical location a piece of data, code, etc. is located
Pointer - Reference that is used by other parts of the game that tells the game what address the data is looking for exists at.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Mon Jan 25, 2016 6:26 pm

Hrm. Can you recommend me decent (free) Hex Editing software? I'm using HxD and honestly I can't find any way to get to the 0x700000th byte and the search function honestly kind of sucks. That said, when I do search directly for the code (FF FF FF etc) the maximum amount of FF together I can find is three, but it sounds as though there should be more? Maybe it's my ROM. Any ideas?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Mon Jan 25, 2016 7:21 pm

I mostly use XVI32, but it is pretty oldschool. I'm sure there's some better programs around. HxD, Windhex, Madedit, etc. are all reasonably popular. Give them all a poke.

In a standard dumped AW2 ROM, there should be about 2 mb of 0xFF at the end of the rom (approximately 0x620000 to 0x7FFFFF). If you've trimmed it, then they might not exist, though.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Tue Jan 26, 2016 12:47 am

As far as I can tell, it's my ROM because I've not saved anything and really . I shall have a poke around to see if I can find a clean one.

There's a boatload of 00's at the end of the ROM I do have. I'm guessing that's not the same as FF? It begins on line 0040C080.

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Re: How to build a campaign (newb)

Post by x0_000 » Tue Jan 26, 2016 6:23 am

If you're using HxD (I'm assuming windows?) Ctrl+G goes to an offset of your choice.
Only in math can you buy 600 cantaloupes and not look like a nutter.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Tue Jan 26, 2016 9:01 pm

Alright then, I'm really really missing something. What exactly is an offset? Is 0x700000 line what we're calling an offset?
This is maddening, because I'm hitting CTRL+G to search for an offset, but typing in 0x700000 doesn't work in either ROM I've tried it in.

Here's a screenshot of what I'm looking at (in general), just to double-check that the third column of gibberish I'm looking at shouldn't actually be entirely meaningful details. :)

http://i.imgur.com/d4APnmX.png?1

User avatar
Satel

Re: How to build a campaign (newb)

Post by Satel » Tue Jan 26, 2016 10:10 pm

Just type in 700000, it'll take you there.
Joey wrote:i think i was mad at certain players and wanted to wave st3rn's success in their face at the most opportune moment, or something

st3rn fudge st3rn

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Tue Jan 26, 2016 11:07 pm

Okay, it's taken me somewhere, but no FF in sight. Should there be an indication on-screen that I'm at 700000?

- thanks everybody for the help, by the way.

User avatar
Satel

Re: How to build a campaign (newb)

Post by Satel » Wed Jan 27, 2016 3:45 am

Read the left column, that's where you're at.
EDIT: More explicitly, it's the location (or offset, w/e) of the first byte of the line.
Joey wrote:i think i was mad at certain players and wanted to wave st3rn's success in their face at the most opportune moment, or something

st3rn fudge st3rn

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Wed Jan 27, 2016 5:30 am

The left column is dependent on how many bytes I'm displaying in a row, though? The code in the left column reads 004______ regardless of how many bytes I'm displaying, but does always take me to the same byte: 98 (the cursor is between the 9 and the 8, if that's significant for any reason). There's still no FF in sight. What would you guys expect to see?

(using CTRL+G, it only finds anything when I search 'offset relative to end' as opposed to begin or current offset. In the latter cases, it does nothing. Is this relevant in any way?)

User avatar
Satel

Re: How to build a campaign (newb)

Post by Satel » Wed Jan 27, 2016 7:53 am

First question: yes.

You would need to search from the beginning.
Joey wrote:i think i was mad at certain players and wanted to wave st3rn's success in their face at the most opportune moment, or something

st3rn fudge st3rn

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Re: How to build a campaign (newb)

Post by x0_000 » Thu Jan 28, 2016 7:32 am

When you jump to an offset you need to make sure you pick hex as your data type and from the beginning. Also, you ideally want to set 16 bytes per row in your view.
Only in math can you buy 600 cantaloupes and not look like a nutter.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Fri Jan 29, 2016 5:21 am

When I search from the beginning, it says the file doesn't contain the offset 700000. Does that just mean that I've got two dud ROMs?

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Re: How to build a campaign (newb)

Post by x0_000 » Fri Jan 29, 2016 5:38 am

Search is a function that is distinct from Ctrl+G. Use Ctrl+G.
Only in math can you buy 600 cantaloupes and not look like a nutter.

Planet Susan

Re: How to build a campaign (newb)

Post by Planet Susan » Mon Feb 01, 2016 1:21 am

Sorry, vocabulary error: I have been using the Go To/CTRL G, but, as I say, have only been finding anything when searching from the End - not that I really understand why where you search from would change the result.

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Re: How to build a campaign (newb)

Post by x0_000 » Mon Feb 01, 2016 8:12 am

What is the name of the file you are looking at in HxD? Include the extension. If you're looking in the right file it should be around 8 MB in size. If the file you're looking at in HxD is not 8 MB you are not looking at the right file.
Only in math can you buy 600 cantaloupes and not look like a nutter.

Eliwan-guest

Re: How to build a campaign (newb)

Post by Eliwan-guest » Mon Feb 01, 2016 7:25 pm

You need to extract the ROM first!

You're hex editing a .zip, which is VERY MUCH NOT a .gba!

While Visual Boy Advance among other emulators can decode .zips on-load and treat them as ROMs, you can't EDIT it like that.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Wed Feb 10, 2016 11:50 am

I put together a series of screenshots describing the process:
Hidden Text
Starting with, I've got the AW2 ROM, plus the map output from x0_000's Map Editor
Screen Shot 2016-02-10 at 11.15.44 AM.png
We need to go to the correct address in the ROM
Screen Shot 2016-02-10 at 11.16.09 AM.png
We'll go to 0x08700000 because it is free space
Screen Shot 2016-02-10 at 11.16.39 AM.png
It should look like this
Screen Shot 2016-02-10 at 11.16.50 AM.png
We'll copy the entire contents of our map data from the editor
Screen Shot 2016-02-10 at 11.17.17 AM.png
And paste it into the new rom in overwrite mode (use overwrite, not insert so data doesn't move)
Screen Shot 2016-02-10 at 11.17.27 AM.png
Huzzah, we have added our map data to our ROM
Screen Shot 2016-02-10 at 11.17.56 AM.png
Now we need to update a map header to reference our new map so it can be played
Screen Shot 2016-02-10 at 11.19.42 AM.png
This is bean island's map header, and that's the pointer to the original Bean Island map.
Screen Shot 2016-02-10 at 11.20.10 AM.png
We'll update it to the address of our new map.
Screen Shot 2016-02-10 at 11.20.26 AM.png
Now we can play!
Screen Shot 2016-02-10 at 11.21.09 AM.png
Hopefully that helps visualise the process.
You do not have the required permissions to view the files attached to this post.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

BloodyKeyblade1994

Re: How to build a campaign (newb)

Post by BloodyKeyblade1994 » Sun Jan 22, 2017 3:26 am

Sorry for bumping, but I need some help ...
Xenesis wrote:I put together a series of screenshots describing the process:
Hidden Text
Starting with, I've got the AW2 ROM, plus the map output from x0_000's Map Editor
Screen Shot 2016-02-10 at 11.15.44 AM.png
We need to go to the correct address in the ROM
Screen Shot 2016-02-10 at 11.16.09 AM.png
We'll go to 0x08700000 because it is free space
Screen Shot 2016-02-10 at 11.16.39 AM.png
It should look like this
Screen Shot 2016-02-10 at 11.16.50 AM.png
We'll copy the entire contents of our map data from the editor
Screen Shot 2016-02-10 at 11.17.17 AM.png
And paste it into the new rom in overwrite mode (use overwrite, not insert so data doesn't move)
Screen Shot 2016-02-10 at 11.17.27 AM.png
Huzzah, we have added our map data to our ROM
Screen Shot 2016-02-10 at 11.17.56 AM.png
Now we need to update a map header to reference our new map so it can be played
Screen Shot 2016-02-10 at 11.19.42 AM.png
This is bean island's map header, and that's the pointer to the original Bean Island map.
Screen Shot 2016-02-10 at 11.20.10 AM.png
We'll update it to the address of our new map.
Screen Shot 2016-02-10 at 11.20.26 AM.png
Now we can play!
Screen Shot 2016-02-10 at 11.21.09 AM.png
Hopefully that helps visualise the process.

So, how do I know where in the code to find the header? Asking for AWDS, because for AW2 you can just auto update pointer ...

I know the header values for the maps from the overlay_0005 (because I use EUR Version), but I don't know what offset to put in the Map Inserter ... the overlay_0005 offset or the Extern WRAM Offset?

And how do I know where to find the pointer for each specific map?

Also, I didn't exactly understand how you "update" the pointer ... I saw you going to 5c77fc, but in the screen below, in the line 5c7820, you have marked the value "84 A0 1B 08". Then you replaced "84 A0 1B" with "00 00 70".
I just realized you replaced the pointer with "00 00 70" because Hex reads backwards. So it references to "70 00 00", right?

BUT you searched for "5c77fc" and ended up in "5c7820"???

But - so you "just knew" the header for Bean Island? Or how did you get to know that?
It would be important for me, so I can also get to the headers of the other maps ...

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: How to build a campaign (newb)

Post by Xenesis » Fri Sep 08, 2017 12:40 pm

BloodyKeyblade1994 wrote:
Sun Jan 22, 2017 3:26 am
So, how do I know where in the code to find the header? Asking for AWDS, because for AW2 you can just auto update pointer ...

I know the header values for the maps from the overlay_0005 (because I use EUR Version), but I don't know what offset to put in the Map Inserter ... the overlay_0005 offset or the Extern WRAM Offset?
Oh crap, I never responded to this!

I realise this response is waay too late right now, but I'll write an answer for future reference. The NDS stuff is much more complex simply because of the way the console works. Ultimately the pointer in the map header must reference where the data will end up in RAM. So the pointer calculation can be a bit complex.

So basically you need to know where the overlay is loaded into RAM - this is your base pointer. For EU AW3, overlay 5 is loaded to 0x23384C0 (so that's the base pointer). My notes say that the compressed map data is at +0x6490 in that file, so presumably Bean Island is at 0x233E950 (0x23384C0 + 0x6490) and you should be able to find Bean Island's map header by searching for 50 E9 33 02.
And how do I know where to find the pointer for each specific map?
If you can find where any specific map header is, you can find them all - assuming the format hasn't changed between EU and US versions it should still be 0xA0 bytes in length per entry and it's in order, mostly by the menu selection (so Moji Island comes after Spann Island, AW3 maps come after AW2 maps, etc). If you can find the individual map data, same deal. It's in my AW3 notes, looks like they're in overlay 5 in the EU ROM.
Also, I didn't exactly understand how you "update" the pointer ... I saw you going to 5c77fc, but in the screen below, in the line 5c7820, you have marked the value "84 A0 1B 08". Then you replaced "84 A0 1B" with "00 00 70".
I just realized you replaced the pointer with "00 00 70" because Hex reads backwards. So it references to "70 00 00", right?
Right.

There's two pieces of data here - the location of the map data itself (In AW2, Bean Island Map is at 0x1BA084, the new map I added was at 0x700000). And the map header, which is a table full of information for the game to use to set rules, alliances and also what is the actual map played. It's basically map metadata.
BUT you searched for "5c77fc" and ended up in "5c7820"???

But - so you "just knew" the header for Bean Island? Or how did you get to know that?
It would be important for me, so I can also get to the headers of the other maps ...
The map header contains a fair bit of data - I've got the format noted. Basically the entry for Bean Island map header starts at 0x5C77FC in AW2, but it's a table that contains lots of stuff. The actual pointer to the map is at +0x2C from the start of the table entry. Hence modifying at 0x5C7828 (0x5C77FC + 0x2C).

I didn't just know it - I've had the map headers documented for ages, but I found them by basically finding one map and then documenting which one it was. The structure repeats.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

Who is online

Users browsing this forum: Kim Jong-un [Bot], Multivac [Bot] and 0 guests