• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Crazy Hand v1.31 - Character editing program

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
Hmm, that would definitely work but I feel like it would be a lot more convenient if it just exited out of them automatically. I can also think of many bugs that could potentially arise from this. And honestly I think that what I suggested would probably be easier to implement, unless your new code (which I haven't seen so it's very possible) would complicate things.

This is what i was thinking: Whenever a function gets called that reads/writes data, We could just modify the function so that it first intializes the file, and then at the end closes the file.
What are your thoughts on this?
Yea I like your idea. I'll be implementing it later on tomorrow so I'll post something if there's any progress.
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
@ Tater Tater ,

Was the code that you put on GitHub buggy? I made the mistake of not really testing it other than checking that it didn't crash before adding in my own code. I'm having some general performance issues with it combined with my code that cause the program to act erratically at times. However, when I comment out your Special Move stuff it works fine. I'm just not sure, do you think this would have to do with the addition of my code, our was it buggy before, too?
 

Stratocaster

Smash Ace
Joined
Oct 6, 2007
Messages
672
Location
Knoxville, TN
@ Ampers Ampers the guide Achilles linked to you should be of some use, but it should basically tell you what I already told you except he copies the string offset, animation offset, and the unknown offset. I'm certain you don't have to replace the string offset, but I can't remember whether the unknown offset is important or not.

I'm pretty certain one of two things is the problem:

A) You need to move the yellow byte Phish-it points out. It indicates some movement and the Fsmash has it while bair doesn't.

B) You can't swap ground moves and aerial moves. I don't think I've ever even tried cause I assumed that wouldn't work.

See if that helps you and let me know.
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
@ Tater Tater ,

Was the code that you put on GitHub buggy? I made the mistake of not really testing it other than checking that it didn't crash before adding in my own code. I'm having some general performance issues with it combined with my code that cause the program to act erratically at times. However, when I comment out your Special Move stuff it works fine. I'm just not sure, do you think this would have to do with the addition of my code, our was it buggy before, too?

I had been having issues with menus not updating properly(Hence why I called refreshSpecialMoves so often haha) but when I sent out the special move code I remember it working properly. That being said, testing it now it is being inconsistent. I'll fix that issue soon
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
@ Ampers Ampers the guide Achilles linked to you should be of some use, but it should basically tell you what I already told you except he copies the string offset, animation offset, and the unknown offset. I'm certain you don't have to replace the string offset, but I can't remember whether the unknown offset is important or not.

I'm pretty certain one of two things is the problem:

A) You need to move the yellow byte Phish-it points out. It indicates some movement and the Fsmash has it while bair doesn't.

B) You can't swap ground moves and aerial moves. I don't think I've ever even tried cause I assumed that wouldn't work.

See if that helps you and let me know.

Alright, after doing some testing I believe I've determined that you do indeed need to change the string offset in order for the animation to work properly. This time I was testing by swapping utilt and dtilt, so it is not an aerial/ground discrepancy. When I didn't copy the string offset it results in that odd visual glitch i showed before, but when I copied over the string offset it worked like a charm. In both cases I also had that additional byte copied over. I've also found that swapping ground/aerial moves is possible without glitches.
I really wish that you were right about not needing to copy the name over, because that screws with the naming in my program... I'll have to find a way to work around that.
 

MagicScrumpy

Smash Journeyman
Joined
Feb 25, 2015
Messages
251
Location
Ann Arbor, Michigan
I replaced Captain Falcon's dash attack with forward air, so I don't think ground vs air is the problem.

I've had similar problems when trying to replace Bowser's up smash, so it could be a problem with smash moves.
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
@ Ampers Ampers

Please try this one out, I've added the feature you requested. You can now open dolphin with Crazy Hand. If you want to save more changes, you have to make sure dolphin is closed or not accessing the melee ISO.

https://www.dropbox.com/s/nv9q8cal9xz65f8/Crazy Hand V1.zip?dl=0
Fantastic work man, I'm really happy with what you've done so far. Whenever you get a chance, you wanna put that on GitHub?

By the way, I'm planning to release the next version of the program with my latest features in a day or two. If we can get our code combined and working together easily we could include your work with this update. Sound good?
 
Last edited:

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
I replaced Captain Falcon's dash attack with forward air, so I don't think ground vs air is the problem.

I've had similar problems when trying to replace Bowser's up smash, so it could be a problem with smash moves.

It may have something to do with how the game processes smash charges. I had a neat-looking bug happen when I added a smash charge to Mewtwo's forward throw:



My guess is that anything to do with the animation's coding(In this case, moving bowser up and away slightly before throwing him) is looped for the duration of the smash charge, creating graphical errors such as this. That would explain why vertices/bones/what have you from a non-smash attack animation would stretch and become disfigured if spliced onto a smash attack; They don't know to stop after a certain point.

On a related note, I'm (attempting, no promises) to read model data from the game and convert it into a Wavefront model(.obj) file. This would allow streamlined viewing of animation changes without needing to boot up Dolphin. From there, I think I could create an actual model/animation editor.

Does anyone know where models might be stored? So far, I'm assuming it's in the character's AJ file(For example, PlPeAJ.dat would be Peach's).
Looks like models are inside the .dat file containing moves and other attributes as well.
 
Last edited:

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
Fantastic work man, I'm really happy with what you've done so far. Whenever you get a chance, you wanna put that on GitHub?

By the way, I'm planning to release the next version of the program with my latest features in a day or two. If we can get our code combined and working together easily we could include your work with this update. Sound good?
Sounds good, i'm going to fork the github source and implement my work into it. I'll submit a pull request when i'm done.

Edit: I'm finished and I've sent a merge request
 
Last edited:

oksas

oak-sauce
Joined
Apr 12, 2011
Messages
458
it makes me excited how quickly this project is expanding. I mentioned it before but it's awesome to see people coming together to get all this stuff done. really excited for a new version :DDDD
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
It may have something to do with how the game processes smash charges. I had a neat-looking bug happen when I added a smash charge to Mewtwo's forward throw:



My guess is that anything to do with the animation's coding(In this case, moving bowser up and away slightly before throwing him) is looped for the duration of the smash charge, creating graphical errors such as this. That would explain why vertices/bones/what have you from a non-smash attack animation would stretch and become disfigured if spliced onto a smash attack; They don't know to stop after a certain point.

On a related note, I'm (attempting, no promises) to read model data from the game and convert it into a Wavefront model(.obj) file. This would allow streamlined viewing of animation changes without needing to boot up Dolphin. From there, I think I could create an actual model/animation editor.

Does anyone know where models might be stored? So far, I'm assuming it's in the character's AJ file(For example, PlPeAJ.dat would be Peach's).
Looks like models are inside the .dat file containing moves and other attributes as well.
.obj's for some characters already exist. @ A Anutim can give you more info.

Edit: see here
 
Last edited:

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
It may have something to do with how the game processes smash charges. I had a neat-looking bug happen when I added a smash charge to Mewtwo's forward throw:



My guess is that anything to do with the animation's coding(In this case, moving bowser up and away slightly before throwing him) is looped for the duration of the smash charge, creating graphical errors such as this. That would explain why vertices/bones/what have you from a non-smash attack animation would stretch and become disfigured if spliced onto a smash attack; They don't know to stop after a certain point.

On a related note, I'm (attempting, no promises) to read model data from the game and convert it into a Wavefront model(.obj) file. This would allow streamlined viewing of animation changes without needing to boot up Dolphin. From there, I think I could create an actual model/animation editor.

Does anyone know where models might be stored? So far, I'm assuming it's in the character's AJ file(For example, PlPeAJ.dat would be Peach's).
Looks like models are inside the .dat file containing moves and other attributes as well.
@ Tcll Tcll
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
.obj's for some characters already exist. @ A Anutim can give you more info.

Edit: see here
'Preciate it :)
Now I just have to figure out how to get animations working for those models if I use them instead of the alternative below...


It's funny that you mention him. After some googling I found his thread for UMC a few hours ago. I'm not incredibly fluent in Python and I skimmed over the source code so I only get the gist of what it's doing, but I saw animations being referenced with loading models. Not entirely sure how it works, however. Maybe @ Tcll Tcll will be able to shed some light on that.
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
hey @ Tater Tater , you got skype?? :)
Anutim wants me to add you to my UMC dev group XD

if so, add me "Tcll5850" (DarkPikachu) :)
what username am I looking for so I know you're not another bot??
lol (I've had enough bots, and my friends are more than happy to spam them offline every time I get one)

also, @anyone: if you're going to send me a contact request, don't send me anything containing just plain: "are you online?"
that's a bot, and you may be treading into the barrel of a spam-gun or DDoS attack.

EDIT:
because I'd be ruining my rep if I didn't post some docs... lol
here's my gathering's on the DAT format: http://wiki.tockdom.com/wiki/HAL_DAT_(File_Format)
the pathfinder entry is my main work where Revel8n clarified most of the structure (I've only tweaked them)

EDIT2:
but I saw animations being referenced with loading models.
I actually plan to start working on basic animation support by next update,
though I can't exactly say when the UI will show support for animation conversion...

the idea is still in the dino-age...

do note, UMC3.0a CAN'T play animations in it's viewer, but it's format can support them
(python and the GL FFP don't perform well together)
 
Last edited:

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
'Preciate it :)
Now I just have to figure out how to get animations working for those models if I use them instead of the alternative below...
The ones from Modelers-Resource are just plain .obj's without any skinning. So it would be better to use Tcll's program which also reads weight data (no good exporter yet tho :/).
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
(no good exporter yet tho :/).
I'm trying to support DAE, if only pycollada wasn't triangles only (UMC doesn't convert to triangles now)

yea, I focused on quality which is why I dropped that support...
(you wouldn't be able to edit that back in as the file would be too large).

I'm in contact with the pycollada dev, but he hardly responds, which makes things difficult for me...
(he's busy like any working man... heh)
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
@ D darkside1222 ,

Combining my code with your iso loading code seems to have caused some issues...
Everything compiles and runs without any crashes or errors, but it seems that pressing that the save button just doesn't save at all. I've been staring at the code for quite some time now trying to identify the problem but I can't seem to figure it out. You understand how the saving code is supposed to work much better than I, so do you think you could help me take a look at it to find the problem?
 

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
And your sure the latest one is synced? The one that says like "merge remote tracking... something"? That's weird
Yep it says merge remote-tracking branch etc and saving works. Does it not save subactions or something?

Maybe yours isn't synced properly.
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Weird... well I'll take a look at it again in a bit...

from what I remember it looked like that.
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Alight I've been doing a bit more testing and it seems that everything gets reverted to initial values whenever I switch characters, but it seems to retain everything before that... So if I load a subaction and change something, it will retain the new value even if I load a new subaction and then go back to it, but as soon as I switch to a new character and then switch back it goes back to default. I have no freaking idea how that makes sense...

I deleted all of my local content for the project and recloned it from github and I'm still having the same issue. I also double checked and the save listener code is identical to what you posted.



Edit: Might have found the issue... need to do some more testing to be sure.
 
Last edited:

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
@ Ampers Ampers

I have found the issue. It is getDefaultSubactions() in FileIO. I'll get back to you with a fix. I overlooked this because I was confused on why you chose to load the default subactions from the def folder of characters instead of the root folder from previous versions
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
@ Ampers Ampers

I have found the issue. It is getDefaultSubactions() in FileIO. I'll get back to you with a fix. I overlooked this because I was confused on why you chose to load the default subactions from the def folder of characters instead of the root folder from previous versions
Yes, that is the problem I've found as well. The reason that I'm using the "def" files is because in order to swap the animations of moves properly, you need to swap the name of it too. I wanted the program to display the names of what the subaction actually is, not what the animation for it is.
 

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
Yes, that is the problem I've found as well. The reason that I'm using the "def" files is because in order to swap the animations of moves properly, you need to swap the name of it too. I wanted the program to display the names of what the subaction actually is, not what the animation for it is.
Ohhh okay I understand now.

I redid it and it should work properly now.

Code:
public static String[] getDefaultSubactions() {
        RandomAccessFile file = null;
        try {
            file = new RandomAccessFile("def/102/Pl"
                    + Character.characters[MeleeEdit.selected].id + ".dat",
                    "rw");

            int numSubactions = SubAction.getNum();

            String[] subactions = new String[numSubactions];
            int tmp = 0;
            for (int i = 0; i < numSubactions; i++) {
                int offTmp = i * 6 * 4;
                int pointerLoc = Character.characters[MeleeEdit.selected].subOffset
                        + 0x20 + 4 * 0 + offTmp;
                file.seek(pointerLoc);
                int pointer = file.readInt();
                file.seek(pointer + 0x20);
                String name = "";
                char tmp2;
                int counter = 4;
                while (true) {
                    tmp2 = (char) file.readByte();

                    if (tmp2 == 00)
                        break;
                    if (tmp2 == '_') {
                        counter--;
                    } else if (counter == 1) {
                        name = name + tmp2;
                    }
                    if (counter == 0) {
                        break;
                    }

                }
                if (name == "") {
                    name = "[No Name]";
                }
                System.out.println(name);
                subactions[i] = name;

            }
            file.close();
            return subactions;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;

    }
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Ohhh okay I understand now.

I redid it and it should work properly now.

Code:
public static String[] getDefaultSubactions() {
        RandomAccessFile file = null;
        try {
            file = new RandomAccessFile("def/102/Pl"
                    + Character.characters[MeleeEdit.selected].id + ".dat",
                    "rw");

            int numSubactions = SubAction.getNum();

            String[] subactions = new String[numSubactions];
            int tmp = 0;
            for (int i = 0; i < numSubactions; i++) {
                int offTmp = i * 6 * 4;
                int pointerLoc = Character.characters[MeleeEdit.selected].subOffset
                        + 0x20 + 4 * 0 + offTmp;
                file.seek(pointerLoc);
                int pointer = file.readInt();
                file.seek(pointer + 0x20);
                String name = "";
                char tmp2;
                int counter = 4;
                while (true) {
                    tmp2 = (char) file.readByte();

                    if (tmp2 == 00)
                        break;
                    if (tmp2 == '_') {
                        counter--;
                    } else if (counter == 1) {
                        name = name + tmp2;
                    }
                    if (counter == 0) {
                        break;
                    }

                }
                if (name == "") {
                    name = "[No Name]";
                }
                System.out.println(name);
                subactions[i] = name;

            }
            file.close();
            return subactions;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;

    }

Dang, you're fast. I do believe that fixed the problem. My animation swapping code is still behaving inconsistently but I think that's just my own issue, nothing to do with yours. I'll look into fixing that.

Edit: Fixed it. turns out FileIO.isoFileSystem.replaceFile(FileIO.isoFileSystem.getCurrentFileInfo(), FileIO.f.array()); wasn't being called after updating them when it should have been.
 
Last edited:

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
Dang, you're fast. I do believe that fixed the problem. My animation swapping code is still behaving inconsistently but I think that's just my own issue, nothing to do with yours. I'll look into fixing that.

Edit: Fixed it. turns out FileIO.isoFileSystem.replaceFile(FileIO.isoFileSystem.getCurrentFileInfo(), FileIO.f.array()); wasn't being called after updating them when it should have been.
Oh btw since you added
Code:
    try {
            FileIO.isoFileSystem
                    .replaceFile(FileIO.isoFileSystem.getCurrentFileInfo(),
                            FileIO.f.array());

        } catch (IOException e) {
            e.printStackTrace();
        }
to the savelistener in MeleeEdit, you can remove it in the Script.saveData() since that would do the same thing.
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Oh btw since you added
Code:
    try {
            FileIO.isoFileSystem
                    .replaceFile(FileIO.isoFileSystem.getCurrentFileInfo(),
                            FileIO.f.array());

        } catch (IOException e) {
            e.printStackTrace();
        }
to the savelistener in MeleeEdit, you can remove it in the Script.saveData() since that would do the same thing.
Alright I figured as such but I just didn't test it yet in case it broke the program.
 

Quillion

Smash Hero
Joined
Sep 17, 2014
Messages
5,642
Is there ongoing research about implementing original animation data?

That should be the final touch that brings Melee modding very nearly up to par with Brawl modding.
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
I'm getting an OutOfMemoryError whenever I try to open an ISO with the latest build... It's happening during ISOFileSystem.setFileData() Am I doing something wrong here, or is my computer just finally getting outdated?
 

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
I'm getting an OutOfMemoryError whenever I try to open an ISO with the latest build... It's happening during ISOFileSystem.setFileData() Am I doing something wrong here, or is my computer just finally getting outdated?
Increase the allocated memory given to Crazy Hand. Etc -Xms128m -Xmx512m
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
I'm getting an OutOfMemoryError whenever I try to open an ISO with the latest build... It's happening during ISOFileSystem.setFileData() Am I doing something wrong here, or is my computer just finally getting outdated?
Have you tested either of darkside's other iso loading builds before? If so, did they run properly?
 
Last edited:

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
Have you tested either of darkside's other iso loading builds before? If so, did they run properly?

Just tested both of the builds; The first one he posted worked fine, the second build gave me the same error as the latest one does. I did notice that in the first build, he packed another crazy hand.jar inside the first one. I assume that he loaded the ISO with the first jar, then ran the actual program itself from the jar inside, making them *technically* two separate programs running on two separate threads. I think that's why I'm not getting an OutOfMemoryError from the first build. I'm going to try putting the ISO loading on a separate thread with the current build and see if that works.
 

darkside1222

Smash Cadet
Joined
Apr 22, 2010
Messages
31
Just tested both of the builds; The first one he posted worked fine, the second build gave me the same error as the latest one does. I did notice that in the first build, he packed another crazy hand.jar inside the first one. I assume that he loaded the ISO with the first jar, then ran the actual program itself from the jar inside, making them *technically* two separate programs running on two separate threads. I think that's why I'm not getting an OutOfMemoryError from the first build. I'm going to try putting the ISO loading on a separate thread with the current build and see if that works.
No that is not what I did. The ISO loading code is built in the program. I must've accidently packed two crazy hand jars lol.

In order for me to add the feature that ampers requested (opening dolphin without closing Crazy Hand) in the second build, I had to sacrifice more memory by caching the fighter files so they can be accessed whenever without the ISO and when saving is required, the program would just reload the ISO and write any new changes.

You should do what I've suggested and increase the allocated size. You can do this in eclipse and/or the run.bat by adding the following -Xms128m -Xmx512m or what ever higher value u want to allocate.

You could optimize the program though by using multiple threads too

EDIT: try this version which is on the github now:

https://www.dropbox.com/s/tzqptgc3ie93djj/Crazy Hand Tater.zip?dl=0
 
Last edited:

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
No that is not what I did. The ISO loading code is built in the program. I must've accidently packed two crazy hand jars lol.

In order for me to add the feature that ampers requested (opening dolphin without closing Crazy Hand) in the second build, I had to sacrifice more memory by caching the fighter files so they can be accessed whenever without the ISO and when saving is required, the program would just reload the ISO and write any new changes.

You should do what I've suggested and increase the allocated size. You can do this in eclipse and/or the run.bat by adding the following -Xms128m -Xmx512m or what ever higher value u want to allocate.

You could optimize the program though by using multiple threads too

I tried increasing the allocated size in every combination of 512,1024, and 1600(Highest value I could get where the program still ran) and got an OutOfMemoryError every time.

The exact error I get is:

java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(Unknown Source)
at isotool.filesystem.ISOFileSystem.setFileData(ISOFileSystem.java:48)
at isotool.filesystem.ISOFileSystem.<init>(ISOFileSystem.java:32)
at isotool.filesystem.ISOFile.createRootFolders(ISOFile.java:86)
at isotool.filesystem.ISOFile.readSectors(ISOFile.java:77)
at isotool.filesystem.ISOFile.<init>(ISOFile.java:35)
at com.FileIO.loadISOFile(FileIO.java:82)
at com.MeleeEdit.main(MeleeEdit.java:430)
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
... 8 more


Since we're caching each fighter file anyways, I think it might be a good idea to extract copies of fighter data to a folder when loading the ISO instead of caching them in the program itself. You could then use CrazyHand to edit the extracted fighter files, and then write changes from those files to the ISO.

I wouldn't suggest such a roundabout method of editing files except if I'm getting these errors I assume some other users will as well.

Thoughts or opinions on this?
 
Top Bottom