• 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!

Important Melee, Hacks, and You -- New Hackers Start Here, in the OP!

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
If at any point you guys think of functionality that would be useful for working with textures, please post the ideas here.

For what texture type? Or do you mean for an object, like a flag of some kind? I've been curious about the latter for a while now.
Not a texture but an object. Id suspect it to have something to do with the 070707 format since pretty much every texture structure has one.
Anyone know the offset to the background in the SSS. I think it has some transparencies worth looking in too.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Just thought I should let you guys no that brawlbox will can take a png and re encode it. And spit out a png or tex0 file which is probably really similar to the tpl format.
 
Last edited:

CeLL

Smash Lord
Joined
Jan 26, 2014
Messages
1,026
Location
Washington
Just thought I should let you guys no that brawlbox will can take a png and re encode it. And spit out a png or tex0 file which is probably really similar to the tpl format.
It can also work directly with TPLs, including encoding PNGs as TPLs.
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Yeah I noticed it opens tpl files so I checked it out. Didnt see a way to export it as a tpl though.
Edit: And now I do lol. Didnt look hard enough.
 
Last edited:

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,179
Location
Sacramento, CA
Just thought I should let you guys no that brawlbox will can take a png and re encode it. And spit out a png or tex0 file which is probably really similar to the tpl format.
Have you seen the PNG to-from TPL script here? If you're just trying to convert textures, it's surely the easiest possible way. Especially if you add the script to your right-click menu:



Give it as many files as you want of either format (png or tpl), and it'll create a copy in the opposite format of each one, right in the same directory as the originals. Barely takes a second.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Have you seen the PNG to-from TPL script here? If you're just trying to convert textures, it's surely the easiest possible way. Especially if you add the script to your right-click menu:



Give it as many files as you want of either format (png or tpl), and it'll create a copy in the opposite format of each one, right in the same directory as the originals. Barely takes a second.
Yeah thats what I normally use. Just noting that brawl box would convert between image formats for you.
Also one of the unknown pointers in the material group points towards a structure I believe is responsible for transparency. Although when I try to use it everything is completely transparent instead of partly. And the unknown value I was talking about before controls transparency values. If you find a transparent object and change the value to something higher the image will become more transparent.
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,179
Location
Sacramento, CA
Yeah thats what I normally use. Just noting that brawl box would convert between image formats for you.
Also one of the unknown pointers in the material group points towards a structure I believe is responsible for transparency. Although when I try to use it everything is completely transparent instead of partly. And the unknown value I was talking about before controls transparency values. If you find a transparent object and change the value to something higher the image will become more transparent.
Oh, interesting.

I'm not sure what unknown value you're talking about for controlling transparency though. Unless you mean shinyness, which was the last unknown value you were talking about. Are you saying the shinyness value affects transparency in some way? And actually I'm still unsure about which value you were saying the shinyness value is too. On the Mario Kart wiki page, I see several unknowns shown in the materials structure (shown below). Is this the structure both shinyness and transparency are in? Which is which? And what values have you been playing with?

upload_2015-9-14_12-39-40.png
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
What is the ASM way of converting a hex number to decimal number and vice-versa? like having a number shown in decimal for the user (in the debug menu), but converted to use as a hexadecimal for the code?
Based on:
http://stackoverflow.com/questions/12054127/how-to-convert-from-4-bit-hexadecimal-to-7-bit-ascii

Not entirely positive this is correct, given that I've not tested it.

Code:
#r3 is your storage address
#r4 is your char

hextoasc: 
li r8, 0x09
li r9, 0x0F
andi. r4, r4, 0x0F #Mask the upper bits
li r2, 0x37
cmp r4, r8
bgt L1 # if (X >9)
li r2, 0x30
L1:
add r2, r2, r4
andi. r2, r2, 0xFF
stw r2, 0(r3)
blr
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Oh, interesting.

I'm not sure what unknown value you're talking about for controlling transparency though. Unless you mean shinyness, which was the last unknown value you were talking about. Are you saying the shinyness value affects transparency in some way? And actually I'm still unsure about which value you were saying the shinyness value is too. On the Mario Kart wiki page, I see several unknowns shown in the materials structure (shown below). Is this the structure both shinyness and transparency are in? Which is which? And what values have you been playing with?

View attachment 73342
So the unknown flags is what I was playing with to give the sword that shiny effect. Its usually 0x00000014 but I noticed that somethings are 0x0000001c,0x0000002c,0x0000003c.
I havent had any success with creating a structure with flags 0x60000011, but I know that if its has a pointer to an unknown structure at 0x14 then changing it to 0x00 makes it the most solid although not entirely (limited by the image I suppose), changing it to 0x3c makes it more transparent. Ill post a pic when I get back on my desktop.

On the CSS changing arbitrary material structure flags from 0x60000011 to 0x6000003c.
GALE01-72.png

to
GALE01-71.png

And this is a change I just noticed
GALE01-75.png

Not sure which structure was responsible.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
On the SSS it has the pointer to an unknown structure at 0x14. The CSS probably has one as well but the file uses compressed structures so I dont know how to navigate it.
Changing the flags from 0x60000011 to 0x6000003c
GALE01-77.png

to
GALE01-76.png


Changing the 0x60 to 00 either makes the material completely transparent or removes it.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
@ DRGN DRGN could you explain how looking at the tpl you know the size of the data block. I thought I understood but Im doing something wrong.
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
GALE01-84.png
More so than not being able to create transparency, The structures Im creating dont support alpha. When you want to remove part of a mesh dont you insert a blank image?
 
Last edited:

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,179
Location
Sacramento, CA
@ DRGN DRGN could you explain how looking at the tpl you know the size of the data block. I thought I understood but Im doing something wrong.
Normally, imageDataLength = length x width x bytesPerPixel

You can find how many bytes each texture type uses for a pixel here.

I just replace the bytesPerPixel variable with a function call like this:

imageDataLength = int(width * height * bytesPerPixel( imageType ))

Copy/pasting from DTW3, the function call literally looks simply like this, with a dictionary look-up that gets how many bytes there are per pixel by using the image type:

Code:
def bytesPerPixel( imageType ): # Dictionary with key:value pairs of imageType:bytes-per-pixel
    bytesPerPixel = { 0:.5, 1:1, 2:1, 3:2, 4:2, 5:2, 6:4, 8:.5, 9:1, 10:2, 14:.5 }
    return bytesPerPixel[ int(imageType) ]

But I'm glad you asked, because there's something that's really been bugging me. Sometimes, the above doesn't work! It doesn't make sense because it seems to work for all texture types most of the time, and I haven't noticed any patterns for when it fails. But sometimes the actual data length seems to be mysteriously very slightly longer or shorter than this. It's as if the image data is compressed, or longer than it should be.

I've just recently tried looking into the source code of other things that can handle TPLs, but I haven't looked at it enough and figured it out yet. For example, if you look here, and search for "private byte[] fromCMP", you'll find a function for converting type _14 textures.

c[0] = Shared.Swap(BitConverter.ToUInt16(tpl, off));
c[1] = Shared.Swap(BitConverter.ToUInt16(tpl, off + 2));

if (c[0] > c[1])
{
c[2] = (ushort)avg(2, 1, c[0], c[1]);
c[3] = (ushort)avg(1, 2, c[0], c[1]);
}
else
{
c[2] = (ushort)avg(1, 1, c[0], c[1]);
c[3] = 0;
}

uint pixel = Shared.Swap(BitConverter.ToUInt32(tpl, off + 4));
Regardless of all of that, I'm leaning toward the problem being related to how the pixel data is stored in "blocks", as explained here. I'm thinking that if the width or height isn't an even multiple of blocks, then it cuts part of some off, resulting in an usual amount of used bytes. I guess that would explain why it works most of the time, since it's pretty uncommon for a texture's dimensions to not be a base 2 multiple. I haven't actually checked for a pattern relating image dimensions to this bug yet though.

If anyone could help decipher this strange little anomaly, it would be a big help.

View attachment 73445 More so than not being able to create transparency, The structures Im creating dont support alpha. When you want to remove part of a mesh dont you insert a blank image?
I've never tried removing meshes.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Ive successful imported a mesh that supports transparent images in a stage. Thinking about it I realized I couldnt think of a character that uses alpha. I believe the transparency is flagged by the bone as putting the same struct on a stage supported the transparency as the character that was failing. Will test more after class.
Should add that the 0x400000XX flags is what I assume to be alpha support.
 
Last edited:

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
btw, I should probably mention:

that unknown offset is a string offset

the string table is normally located at the end of the data section listing 0-terminated strings with no padding:

string_1.string_
2.string_3.strin
g_4.


the red dots are characters of '\x00'

EDIT:
fixed up the docs a little to include info about the string offsets, but not yet the string table.

btw guys, feel free to edit those docs, they don't edit themselves ;)
 
Last edited:

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
Just wasted 8 hours trying to figure out what I was misunderstanding when I forgot I cut a corner somewhere.
Its definitely related to shininess though. Not quite sure how the color node works along with it. Maybe it sets a max shininess or something? Anyone who knows more about this stuff works please chime in.
are you setting this in the material or color structure??

if it's the color structure, then it verifies my assumptions of shininess, but if it's part of the material your setting, then it's likely some specular-control component I know nothing about... lol
 
Last edited:

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
When I try to set a memory check point to a Float number, it doesn't break when read. Anyone have a solution for that? I test on 804D8270 with a Dolphin version (I think 4.0) compiled april 2014
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
General structure of the joint matanim section:

Bones: The root node points here. There should be just as many bones here as in the share joint root
0x00 Child Bone pointer
0x04 Sibling Bone pointer
0x08 Object group pointer

Object Groups: The number of groups here should match up with the object groups for that bone.
0x00 Next object group pointer
0x08 Texture struct

Texture struct: Those blinking eyes. Basically texture swapping
0x08 Unknown struct pointer
0x0C Image struct array
0x10 Pallet structs array
0x14 unknown flags

The unknown struct seems like a hierarchy for the swapping animations. Looking at jiggs her right eye has more structs here which I assume is because of the winking. Leaving it to @ Tcll Tcll to figure out the rest lol. From the pattern I would have expected marth to have a different pointer in the object group for object swapping his sword/sheathe but no luck there. Maybe its just a hierachy and the aj files is responsible for picking which one.
If all goes well I means I can change the order of object groups and add some to bones without the game fussing. Possibly add bones if the aj file doesnt mind.

Also steelia might have messed up of some of the locations. Looking at it the pattern here doesnt matchup perfectly with the offsets he listed. I only looked at one file, and havent tested it yet but the pattern is really promising and when I went to that offset it appeared to be referenced by what looked like a pallet structure.
 
Last edited:

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
GALE01-57.png

Why cant melee hacking be a full time job. Semesters picking though so I cant spend 8 hours a day working on this stuff anymore.
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
I think the diffuse color on this is grey so itd be the diffuse color transparency if anything.
wait a minute... the diffuse color is already RGBA, why would it need a transparency??
in OpenGL there exists shininess which normally takes a value of 25.0

glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 25.0 )

which behaves similar to your tests here:



here's test shots from UMC modifying the GL_SHININESS value from VIEWER.py:
25.0:

50.0: (seen in Melee)


however, I'm not quite enabling shininess on my script just yet as this model creates a GL error when I do:

I think those unknown material flags may have something to do with it ;)
 
Last edited:

Itaru

MasterGanon
Joined
Jun 25, 2014
Messages
279
Location
日本 茨城県
wait a minute... the diffuse color is already RGBA, why would it need a transparency??
in OpenGL there exists shininess which normally takes a value of 25.0

glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 25.0 )

which behaves similar to your tests here:



here's test shots from UMC modifying the GL_SHININESS value from VIEWER.py:
25.0:

50.0: (seen in Melee)


however, I'm not quite enabling shininess on my script just yet as this model creates a GL error when I do:

I think those unknown material flags may have something to do with it ;)
This is a stupid question. but...

How to open .dat files in the UMC?
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
it's pretty straight forward, the filter in the open dialog also selects the script the file is imported with.
you can see I'm using Hal Labs for the script in the above images.

once you have both the file (DAT) and the script selected, just hit [ Import ]

that big box is for the script's UI which will be available possibly next update,
however, I'll be changing a few things around UI-wize and making things a bit more manageable.
 

TerryJ

Smash Journeyman
Joined
Apr 12, 2010
Messages
488
Location
BEST COAST, WA
NNID
1337-1337-1337
3DS FC
1337-1337-1337

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
Hello there! I'm new to melee hacking, been doing it about a week or two and I have a lot of questions, and this is the melee hacks thread, so I should post them here, right? :u
I want to know how to make it so you can shoot something like mario's fireball at a higher rate. IE lower the end lag on the animation for shooting it, therefore being able to shoot more. (I think that's what you would do) except in CrazyHand (the program that I assume you'd use for this seeing how it's allowed me to edit a lot of moves pretty well) there is no way to edit the ending lag of that specific move, along with other projectile moves. Going to the projectile editor yields no results either, as that is just the hitboxes for the projectiles. So I'm confused.
Also in GCRebuilder I want to edit the banner, so I export it, edit it and try to re-import it, but I recieve an error saying "Wrong BMP." I even tried to re-import it without editing it and it says the same thing. ¯\_(ツ)_/¯

Tell me if I shouldn't have posted this here or these questions have already been answered and I sound stupid. :kirby64:
 

Vesne

Smash Cadet
Joined
Nov 9, 2008
Messages
35
I accidentally found how to make the hand cursor on the character select screen glow different colors and wanted to make sure this wasn't something not already known since it looks cool and I didn't see it in any of the CSS in the "Official Melee Texture Hack Thread". Yellow and Green.

Lol I was putting the colors earlier in the hex editor than I was supposed to so I thought it was odd how sometimes it would create a glow and sometime it did nothing. My B. :079:
 
Last edited:

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
Hello there! I'm new to melee hacking, been doing it about a week or two and I have a lot of questions, and this is the melee hacks thread, so I should post them here, right? :u
I want to know how to make it so you can shoot something like mario's fireball at a higher rate.
http://arcentral.net/ssbm/ssbmV12/v12move.html

This page has some codes that reduce the lag and improve various special attacks from all characters..

Normally you use a software called GCNcrypt to decrypt these codes made for some action replay softwares, but here is the decrypted version. They affect special attacks of Mario and Doc

Super Mario/Dr. Mario (Jupiter_)
044D919C 41000000
044D91A0 40000000
044D91C4 40000000
044D91E4 40000000
 

Itaru

MasterGanon
Joined
Jun 25, 2014
Messages
279
Location
日本 茨城県
it's pretty straight forward, the filter in the open dialog also selects the script the file is imported with.
you can see I'm using Hal Labs for the script in the above images.

once you have both the file (DAT) and the script selected, just hit [ Import ]

that big box is for the script's UI which will be available possibly next update,
however, I'll be changing a few things around UI-wize and making things a bit more manageable.
Where is import button?
And, my first language is not English, so, please use easy English, sorry.
無題 .png
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
oh you're using dev4.5 (the sucky-cruddy version... lol)
Ctrl+I (as stated in the README) ;)

I've stopped distributing that version though since it doesn't do anything properly... lol
(I do mean that, after designing 3.0 and rebuilding 3.0a, there's quite alot I was doing wrong in dev4.5)
^ dev5 isn't all that glorious either, it still can't quite do animation just yet, and the format is still a mess.

I don't quite have a release for dev5 yet, there's still quite alot of work that needs to be done on it...
however, you can download my actively updated repo here:
https://copy.com/DB24NZi4ejlxFo4I
(on windows: run the bat unless you actually see the exe) ;)

just stay away from SIDE for now... lol
I'm trying to work on some intellisense/code-insight for the code editor...
I still have to figure out how to get the FS to cooperate through the fake 3.0 backend


as of this post though, don't download just yet, I'm reworking the transformer to get rid of the common Singular Matrix error I keep getting.
I'll edit this post when I finish to let you know it's safe to download. ;)

EDIT:
well, everything's working properly now, and I've fixed half of the singular matrix issues... but the other half is in the verification...
gonna do a few edits to the GUI real quick...
- A-Z directory sorting for the file browser
- removing the model-export path's '...' from the top-left corner of the screen
 
Last edited:

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,179
Location
Sacramento, CA
@ Tcll Tcll , what do you use for converting textures in UMC? Something you found, or did you make the functions yourself? I looked around a little at the repo you just posted, but didn't see anything regarding them.

I was wondering if you knew anything about what I posted above on data lengths.

Also, btw, it's a small detail, but since I've noticed it in your code too... the word for the color tables is "palette" (it's French :p). A "pallet" is the small, wooden platform that you see in stores or warehouses for forklifts to hook into when they want to move things.
 
Last edited:

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
lol I've seen both terms, I picked up Pallet first before finding out years later it was really Palette ;)
so I have implementations for both.
hey Kaz yelled at me for this as well... haha :p

and for reading (not yet writing) GX texture data, I've written my own lib "RVL_IMG" for handling that stuff.
however, for handling PNG (among nearly 50 other formats), I'm using Pillow, although palette support is borked because pillow devs don't understand how to document the supported formatting... heh

and yea, data length is determined by (width*height)*data_size ;)
unless it's RGBA8 which is 32bytes RG and 32bytes BA tor each texel
and also unless it's a special format like CMPR which is 8 bytes for a 4x4 texel
 
Last edited:

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
http://arcentral.net/ssbm/ssbmV12/v12move.html

This page has some codes that reduce the lag and improve various special attacks from all characters..

Normally you use a software called GCNcrypt to decrypt these codes made for some action replay softwares, but here is the decrypted version. They affect special attacks of Mario and Doc

Super Mario/Dr. Mario (Jupiter_)
044D919C 41000000
044D91A0 40000000
044D91C4 40000000
044D91E4 40000000
Well thanks! I'll test it out to see if its fast enough but either way I'm sure its good.
 
Top Bottom