Jump to content

(ZAO-ADD) Z64 Automated Actor and Object Adder


Jason777
 Share

Recommended Posts

Currently only for OoT Debug ROM
Tested using Nemu64 and PJ64

Okay, I tried to make this tool as noob-friendly as possible! Let me give you a run down of what this program does...

I think it's safe to assume that every has needed to add a few more actors of objects to a map file but just couldn't get the hang of any tutorials. Well, this tool completely obliterates the need to learn those tutorials and even the need to know how to inject the map file into the ROM. Basically, it does everything for you without you even needing to know anything about the format of the map file, how to fix pointers for the actor list, or where free space in the ROM is. Everything is done for you. List of features:

  • The ability to add actors or objects to a map file
  • The ability to automatically search for free space in the ROM
  • If you don't trust the automated space-finder, you can manually define the injection offset
  • The ability to automatically inject and fix all pointers pertaining to the map file
  • The ability to choose between verbose and non-verbose "modes"
  • Writes important data concerning the modified map file to a DAT document

Possible Bugs:

  • If the map doesn't contain a 0x01 or 0x0B header command I haven't added any code to insert a new command; the program just closes.
  • The automatic free space finder isn't terribly thorough or advanced. It looks for the highest offset found after searching through the scene table, actor table, object table, and general file table; it doesn't try to "squeeze" the map file between other files if there is enough space.
  • Even though the though ROM doesn't need it, it updates the file table with a new pointer to the map file. I can see that this may lead to issues if someone tries to compress the ROM since I seriously doubt that the "virtual offsets" and the "physical offsets" should be the same.
  • I wouldn't recommend choosing the automated injection offset finder if you happen to have ASM hacks laying around in the ROM after 0x35CE040.

NOOBS: If you don't like a bunch of information spewing on your computer screen, I would recommend running the program in non-verbose mode. You would do this by typing 'n' when the program asks you "Do you want program's output to be detailed? (y / n) : ".

I included a verbose mode for people who want to see if the program is grabbing information correctly or to learn just exactly what is going while we modify the map file. It's useful for finding errors/debugging.

Also, the program creates a DAT file after it's done making changes to the ROM to let you know where the map file is in the ROM and what space is now free for general use.

The only thing that the user is required to do besides input in the program is to go fix the CRC of the ROM afterwards if you want to use it in an emulator like PJ64 and to specify the actor number, variable, XYZ position, and XYZ rotation using a program like SayakaGL or Utility of Time.

zaoadd.jpg

Anyways, here we go! Downloads!
(v1.0) Downlaod: http://www.mediafire.com/?p6f2ei616bz11me
(v1.0) Source (Developed with Code::Blocks): http://www.mediafire.com/?ghd5jyrgfmeiffy
(v1.1) Download: http://www.mediafire.com/?8c3umdr9ptqbs1y
(v1.2) Download: http://www.mediafire.com/?0zpncm2ll7bwey8

ZAO-ADD v1.3 Download: http://www.mediafire.com/download/xew8rgxrcjcdbzp/ZAO-ADD_(v1.3).zip
ZAO-ADD v1.3 Source: http://www.mediafire.com/download/bd43ybd41dnk11d/ZAO-ADD_(v1.3)_Source.zip
^^ WinRAR or 7-Zip to extract

Possible Future Updates:

  • Add in code to add 0x01 or 0x0B commands if they aren't present in the map file.
  • Be able to go into alternate map headers.
  • Automatic CRC recalculation.
  • Possible removal of the file table pointer fixing if it causes people too much trouble.
  • Possibly make a Java GUI for the program and have detailed data be displayed on a seperate console window. This will be a seperate GUI from haddockd's that I will personally develop.

 

Update log:

 

Sunday, March 03, 2013



ZAO-ADD (v1.1) Download: http://www.mediafire.com/?8c3umdr9ptqbs1y
^^ Use WinRAR or 7-Zip to extract

I believe I've taken out most of the bugs present in the initial release.

  • You're able to specify whether or not you would like to update the file table pointer if possible (since that can lead to bugs).
  • It automatically updates the ROM CRC if you choose to update the file table pointer.
  • You can specify what object values to add.
  • It gives all default added actors the value of "Magenta Flame".
Things that are going to be present in the next release:
  • The ability to navigate and add actors/objects to alternate map headers.
  • Addition of 0x01 or 0x0B commands if they aren't present in the map header.
Once I'm finished implementing everything that I had hoped to have in this program, I'll turn it into a JAVA GUI to make it look cleaner and less intimidating. Oh yeah, I've decided that I won't be releasing the updated source code until the final release. :P

 

 

Saturday, April 27, 2013

ZAO-ADD Version 1.2 Release

In this release, there are very few updates:

  • Added in command-line support. You can see the arguments below.
  • A GUI has been implemented... sort of. I'm waiting on haddockd :P
  • A readme file has been added (finally).
Command-line Arguments:

ZAO-ADD.exe [ARGUMENTS]

-r [ROM FILE] : Specify a ROM to modify and doesn't do anything if it is the only argument
-s [sCENE NUMBER] : Specify a scene number (if used as the only argument, it prints the number of maps as a decimal number)
-m [MAP NUMBER] : Specify a map number and doesn't return anything if it is the last argument (use in conjunction with -s)
-a : Prints the amount of actors in the specified map as a decimal (use in conjuction with -s and -m)
-o : Prints the amount of objects in the specified map as a decimal (use in conjunction with -s and -m)
-A [ACTOR ADD] : Specify the amount of actors to add (use in conjunction with -s and -m)
-O [OBJECT ADD] : Specify the amount of objects to add (use in conjunction with -s and -m)
-i [OFFSET] : Manually specify an offset to inject at (use in conjunction with -s, -m, and -A/-O)
-f : Try to fix file table offsets if possible (use in conjunction with -s, -m, -A/-O, and/or -i).

For example, say you wanted to find out how many maps were in scene 109:
ZAO-ADD.exe -r ZELOOTMA.Z64 -s 109

Say you wanted to find out how many actors were in scene 109 map 0 (the same could be applied for objects using the -o argument):
ZAO-ADD.exe -r ZELOOTMA.Z64 -s 109 -m 0 -a

Say you wanted to add 2 actors to the actor list in scene 109 map 0 (the same could be applied for objects using the -O argument):
ZAO-ADD.exe -r ZELOOTMA.Z64 -s 109 -m 0 -A 2

Say you wanted to add 2 actors to the actor list in scene 109 map 0 and inject the map at 0x35CE040:
ZAO-ADD.exe -r ZELOOTMA.Z64 -s 109 -m 0 -A 2 -i 0x35CE040

Say you wanted to try to fix the file table entry as well:
ZAO-ADD.exe -r ZELOOTMA.Z64 -s 109 -m 0 -A 2 -i 0x35CE040 -f


Download: http://www.mediafire.com/?0zpncm2ll7bwey8

I will link to the Master GUI as soon as haddockd has ZAO-ADD implemented.

 

 

Friday, July 19, 2013

Alrighty, time for a new release.



ZAO-ADD Version 1.3 Release

Updates:

  • Added in the ability to add actors and objects to alternate headers
  • Even more space is able to be freed from the ROM. Yay for free space!
  • This is probably the final version of the console application form of this program
  • Source code released.
Here are the current command-line arguments:

ZAO-ADD.exe [ARGUMENTS]
-r [ROM FILE] : Specify a ROM to modify and doesn't return anything if it is the only argument
-s [sCENE NUMBER] : Specify a scene number and returns the number of maps as an integer
-m [MAP NUMBER] : Specify a map number and returns the number of alternate headers as an integer 
-h [HEADER INDEX] : Specify an alternate header to use and doesn't return anything
-a : Returns the amount of actors in the specified map as an integer
-o : Returns the amount of objects in the specified map as an integer
-A [ACTOR ADD] : Specify the amount of actors to add
-O [OBJECT ADD] : Specify the amount of objects to add
-i [OFFSET] : Manually specify an offset to inject at
-f : Try to fix file table offsets if possible


Future Updates:
  • Java GUI
  • Add code to be able to add 0x01 and 0x0B commands if they don't exist
  • Random bug fixes
  • Random optimzations
And here we are...
ZAO-ADD v1.3 Download: http://www.mediafire.com/download/xew8rgxrcjcdbzp/ZAO-ADD_(v1.3).zip
ZAO-ADD v1.3 Source: http://www.mediafire.com/download/bd43ybd41dnk11d/ZAO-ADD_(v1.3)_Source.zip

 

  • Like 1
Link to comment
Share on other sites

Okay, I actually got it to work! I tried out your example in the picture above, and added two new objects into 106. Which is 122 in the rom. (http://wiki.spinout182.com/w/Zelda_64_Scene_Listings:_Debug_ROM These are the right scene listings right, I tried doing this to 081, but didn't work for me, the program closed immediately)

 

It also added another Link, is this the default actor that spawns when you add objects?

 

Otherwise, looks really awesome if I can get this to work right--I really need more objects in Hyrule Field as an adult!

Link to comment
Share on other sites

Yeah, the other Link is the default actor whenever it adds on to the actor list... I should probably change that to avoid Z-buffer issues. And in the other case, scene 81, you just tried adding 2 new objects or actors? I can find out what's going on right away.

 

Heh, I knew I was forgetting about something... Alternate headers and the default actor number/variable!

Link to comment
Share on other sites

Yeah, the other Link is the default actor whenever it adds on to the actor list... I should probably change that to avoid Z-buffer issues. And in the other case, scene 81, you just tried adding 2 new objects or actors? I can find out what's going on right away.

 

Heh, I knew I was forgetting about something... Alternate headers and the default actor number/variable!

Yep, I tried adding two new objects to Hyrule Field. I also don't get how you choose the number. In Dark Link room it's easy, it's just 0, but what about the field, there's choices 0-16. How do I specify Adult/child sections? Sorry if I'm annoying about the questions >.<, just tryin' to learn it. I would really love to get this to work.

  • Like 1
Link to comment
Share on other sites

Yep, I tried adding two new objects to Hyrule Field. I also don't get how you choose the number. In Dark Link room it's easy, it's just 0, but what about the field, there's choices 0-16. How do I specify Adult/child sections? Sorry if I'm annoying about the questions >.<, just tryin' to learn it. I would really love to get this to work.

Knowing what room to select would require knowledge on the user's end. However, Hyrule Field has 17 maps? 0.o That's new... I'll look into that later today after school. And don't worry about asking too many questions- I want to get this program to a state where you can use it without complications!And thanks, Three_Pendants! I'll probably be updating it later today to help with the things giadrosich is having trouble with.
Link to comment
Share on other sites

IIRC there's a limit of 16 objects and 64 actors per room, which we encountered with SM64toZ64 - http://code.google.com/p/ozmav/source/browse/trunk/sm64toz64/main.c#88 - you might want to double-check this again to make sure, tho.

 

Besides that (and that I haven't actually tried it...), good job with the program! Adding actors and objects to existing rooms has always been a bit of a problem :P

Link to comment
Share on other sites

If you do end up making a Java GUI build of this tool, I'd be interested in taking a look at the source, seeing as how I'm currently in a class for that language. I might be able to offer some feedback or input on it, depending on how well the section on GUIs goes.

Link to comment
Share on other sites

Knowing what room to select would require knowledge on the user's end. However, Hyrule Field has 17 maps? 0.o That's new... I'll look into that later today after school. And don't worry about asking too many questions- I want to get this program to a state where you can use it without complications!

 

And thanks, Three_Pendants! I'll probably be updating it later today to help with the things giadrosich is having trouble with.

Looking at the listings, I think it might have something to do with the cutscenes? Not really sure. From what I've learned shouldn't each map have an adult/child day/night equivalent for each? Oh, and quick thing--what exactly IS CRC? XD

Link to comment
Share on other sites

Both scenes and rooms can have multiple headers, the one being using depending on adult/child Link, day and night, or the cutscene that's supposed to be played. And that said, I believe Hyrule Field has around 10 or so each, not 17, and certainly not 17 rooms.

Okay, I must be doing something wrong then. I just tried the program again and put in 081 for the field and it gave me this:

 

actorobject_zpsa6f18283.png

 

Now it's just giving me the 0 choice. >.< I swear, I'm the least technical person alive.

Link to comment
Share on other sites

Room headers do not equal rooms. Rooms (or maps if you prefer) are those "####_room_#" files you see if you extract the ROM or if you're using ex. SayakaGL. Hyrule Field only has one room, spot00_room_0 to be exact, so I assume that a, well, "choice" of only one room there is correct. A room can contain multiple "configurations", the headers, which are what determine ex. adult/child Link actors.

 

Edit: Apparently, multiple headers aren't supported yet considering "Be able to go into alternate map headers." under Possible Future Updates in Jason's first post.

Edited by xdaniel
Link to comment
Share on other sites

Room headers do not equal rooms. Rooms (or maps if you prefer) are those "####_room_#" files you see if you extract the ROM or if you're using ex. SayakaGL. Hyrule Field only has one room, spot00_room_0 to be exact, so I assume that a, well, "choice" of only one room there is correct. A room can contain multiple "configurations", the headers, which are what determine ex. adult/child Link actors.

 

Edit: Apparently, multiple headers aren't supported yet considering "Be able to go into alternate map headers." under Possible Future Updates in Jason's first post.

Choosing the 0 room causes the program to close immediately when I put all my other inputs in... I guess I'll have to wait until he takes a look at.

Link to comment
Share on other sites

Giadrosich, try running the program in detailed/verbose mode, type in "81" (not "081") as the scene and then take a picture of the program's output up until the map choice. I'm going to see if it grabs the data correctly.

 

If anything, I'll go home after class today and look at the program's source and play around wth Hyrule Field myself.

Link to comment
Share on other sites

I'm not Jason, but I can at least tell say it looks like the program fetches the data correctly - those are the first scene and room header of Hyrule Field.

 

(Also disregard/be wary about my comment regarding 64 actors, 16 objects... Hyrule Field has 73 actors. Where did those numbers come from then? <.<)

Link to comment
Share on other sites

I've used this a bit now and when it closes automatically a file is added called Scene81_Map0.dat this is according to the instructions above just a manner in which to remind the modder what they changed and where these new offsets are located. And I can say with surety that this does work! Loaded up Sorata, went to Hyrule Field and save five new actors without any overflow issues.However... when I tried it in game the game immediately crashed. This may have something to do with adding more actors to an already full Hyrule Field (73 to 78) so the fault likely lies with me in that regard.

Link to comment
Share on other sites

I've used this a bit now and when it closes automatically a file is added called Scene81_Map0.dat this is according to the instructions above just a manner in which to remind the modder what they changed and where these new offsets are located. And I can say with surety that this does work! Loaded up Sorata, went to Hyrule Field and save five new actors without any overflow issues.However... when I tried it in game the game immediately crashed. This may have something to do with adding more actors to an already full Hyrule Field (73 to 78) so the fault likely lies with me in that regard.

Did you make sure to fix the ROM CRC? I imagine you're trying to use PJ64 as emulator. If you don't want to bother with that then you'll have to use nemu64.

 

(Also disregard/be wary about my comment regarding 64 actors, 16 objects... Hyrule Field has 73 actors. Where did those numbers come from then? <.<)

The game seems to like throwing curve balls, eh? :P

 

http://i107.photobucket.com/albums/m286/lionofjudah_2006/actorobject2_zps59906f69.png

 

Then when I hit n and enter, the program closes instantly.

I should probably make sure the program pauses before closing when encountering an error, huh... You could always manually define an injection offset (0x35CE040 will do). Once I finally do get home I'll get to work on it right away.

 

Man! I was so sure that the program didn't have any bugs when I first released! It's kind of embarrassing to find out immediately afterwards that there seems to be problems... lol.

 

An update where I remove the file table pointer fixing is definitely coming soon. Thinking of it now... it was probably a dumb idea to have put into the program.

Link to comment
Share on other sites

 

Man! I was so sure that the program didn't have any bugs when I first released! It's kind of embarrassing to find out immediately afterwards that there seems to be problems... lol.
It could just be me. I seem to have this problem of programs not liking me. XD When I was working, the office programs always crashed on my computer, never anyone else's. I'm cursed or something.
 
 
EDIT!
 
I did get it to work in Gerudo Valley, so there must be something weird with Hyrule Field, I dunno. I've also run across the problem of not being able to edit the objects.
 
I added two new objects into Gerudo Valley. They are Link by default, so I went into ZAP2 to replace them. I actually could not save the object changes at all. They always reverted back to 0000 whenever I left the area. I even made sure to save to ROM/RAM, close it out and then open it back up again. Still there. I can put 0001 objects in of course like flames, but I tried putting the wooden posts in, and it wouldn't save.
 
Kinda weird. I don't think that's your program, but I haven't had a problem like that before.
 
EDIT 2!
 
And then I got this:
 
holyhell_zps773989a3.png
 
I tried it out in Lost woods, and replaced the Link object with 0076, and then saved to ram, went out, went back in and GONE.
  • Like 1
Link to comment
Share on other sites

Alright, guys, I've spent a good amount of time trying to sniff out all the problems (why it only works with one level like Sutaru and not one like Hyrule Field, why the Z-buffer is all messed up if you load the map right away without changes, why the game crashes immediately upon loading if you make any changes to Hyrule Field, why fixing file table pointers was a dumb idea, etc)... And I believe I have worked them all out! I basically spent the day conducting manual tests on maps like Hyrule Field, Gerudo Valley, and Lost Woods in order to see what I was doing wrong... I found out that it was a problem with what the program wasn't coded to do! Basically, I neglected situations that might arise such as a map having alternate headers whose actor or object list pointers point to the (now empty space; 0x00) original actor/object list or the fact that having object repeats can lead to crashing. You should be a expecting a proper update either tomorrow or saturday where I address a lot of issues.

Link to comment
Share on other sites

Alright, guys, I've spent a good amount of time trying to sniff out all the problems (why it only works with one level like Sutaru and not one like Hyrule Field, why the Z-buffer is all messed up if you load the map right away without changes, why the game crashes immediately upon loading if you make any changes to Hyrule Field, why fixing file table pointers was a dumb idea, etc)... And I believe I have worked them all out! I basically spent the day conducting manual tests on maps like Hyrule Field, Gerudo Valley, and Lost Woods in order to see what I was doing wrong... I found out that it was a problem with what the program wasn't coded to do! Basically, I neglected situations that might arise such as a map having alternate headers whose actor or object list pointers point to the (now empty space; 0x00) original actor/object list or the fact that having object repeats can lead to crashing. You should be a expecting a proper update either tomorrow or saturday where I address a lot of issues.

 

Huzzah! I guess that's why the Lost Woods went all funky.

 

I look forward to using this program! :D *dance*

Link to comment
Share on other sites

 

ZAO-ADD (v1.1) Downloadhttp://www.mediafire.com/?8c3umdr9ptqbs1y

^^ Use WinRAR or 7-Zip to extract

 

I believe I've taken out most of the bugs present in the initial release.

  • You're able to specify whether or not you would like to update the file table pointer if possible (since that can lead to bugs).
  • It automatically updates the ROM CRC if you choose to update the file table pointer.
  • You can specify what object values to add.
  • It gives all default added actors the value of "Magenta Flame".
Things that are going to be present in the next release:
  • The ability to navigate and add actors/objects to alternate map headers.
  • Addition of 0x01 or 0x0B commands if they aren't present in the map header.
Once I'm finished implementing everything that I had hoped to have in this program, I'll turn it into a JAVA GUI to make it look cleaner and less intimidating :P

 

Oh yeah, I've decided that I won't be releasing the updated source code until the final release.

Link to comment
Share on other sites

So, dumb question: this is meant to be used in conjunction with xDan's newest actor placement tool (forgive me but I am unsure which one it is named, he has so many great tools :) )...correct? Or does your tool handle the movement of actors inside said map?

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.