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

TDRR's ezpz guide to stage imports (upd. 17/07/2020)

TDRR

Smash Journeyman
Joined
Sep 18, 2017
Messages
286
Location
Venezuela
UPDATE 17/07/2020: Added a missed step in making collisions (Calculate Range). If you had random collision bugs on your stage after following this guide, that might be the cause.

Since HSDraw has been out since last year now and so few people are working on stage imports (likely since there's no tutorial so far), I decided I would share what I know about the process. This goes over the process of importing a stage made for Brawl, but generally the same method can be used for completely custom stages (like I did with Literally a Stage and Hurtland, for example).

This method isn't the most advanced one and has it's limitations, but it's the absolute easiest way to get custom stages into Melee with barely any trouble and should work with practically any modelling program that can export to .obj, .dae and .fbx (fbx is barely tested but it appears to do the job). This tutorial will show how the process goes with Blender, but you should be able to make it work with any other modelling program you're familiarized with. I might also explain how the process goes with Maverick Model if there's any Blender haters for some reason, lol.

Stuff we'll need:
-HSDraw (You'll want to update every few days, as updates come out extremely often!).
-Blender 2.79b (3dsmax reportedly also works, Maverick Model 3D also works with .smd converted to .dae with Noesis, but newer Blender versions don't appear to work).
-Noesis (to convert Blender .fbx to .dae that can work correctly with HSDraw, or MM3D .smd > .dae).
-DAT Texture Wizard (GCRebuilder works, but DTW is far more convenient and easy to use).
-The desired stage in .obj format (any format works but .obj makes it easier).
and optionally BrawlBox v0.78 if we're getting the stage from Brawl (BrawlCrate should also work, but I've never gotten it to work without constant crashes).

Main limitations:
-Stages should usually be no more complex than 40k verts and 40k tris (though even that is pushing it a bit, 30k is usually best for 60fps w/ 4 players target), not sure what's the actual precise limit before it starts to chug, though, I just recommend those because they worked great for me.
-Texture resolution is best left as power-of-two and shouldn't be larger than 1024px (I doubt the GC GPU is limited to either but this likely became the norm for a reason).
-.dat filesize should be exactly 3MB or less (3.2MB is theoretically the limit, but certain character combinations may hang on loading), I recommend 2.6MB or less for max compatibility with other mods.
-The resulting stage won't have any animations or movement (this could be done with rigging and such but I've never done that for stages).
-Vertex coloring (also known as baked-in vertex lighting) is lost with Blender. 3dsmax should be able to export it, though.

Now, to the guide itself.
1) Open up BrawlBox and load up your desired stage .pac file. You'll see one or more ARC files, with a + sign beside them, so just click on it to see more. You'll most likely see many ModelData files, so do the same until you find the 3D models you want (highlighting them will give you a preview on the right).
To export the 3D models, right-click on them and press "export", then make sure the format on the bottom right is set to ".dae".

2) Now we need the textures. Usually, they're in a separate TextureData brres, and if that's the case, you can just right-click that brres, press "export all", select the same folder where you put the model(s) and it'll export all the textures for you. Do the same again if there's more Texturedata brres files.

1) Make sure all your textures have 256 colors or less. Since CMPR currently doesn't work, we're limited to only being able to use CI8 for now, which has a 256 color palette limit. Make sure to take note if any textures have transparency or not.
If you REALLY need more color depth, there's RGB565 but it takes WAY too much space, so use very sparingly.

NOTE: This limit can be technically worked around by using DTW to inject the textures into the desired places and then editing the reference headers, but it's really not worth it for what little gain it gives.

2) (optional) You can put everything into a single model (the skybox and actual stage, I mean) so then you can safely use "Clear all POBJs" on the .dat stage models you won't use, and only need to import one model.

1) We need a stage .dat file to import over. You can use DAT Texture Wizard to extract these, click on the "Stages" shortcut at the top and you'll see a listing of stages. The best idea is always importing over mostly static or completely static stages, like Temple, Final Destination, Battlefield, Target Test stages, etc.
While it's possible to import over more dynamic stages like Brinstar Depths, Pokemon Stadium, and more, they're more difficult and might require removing extra models and sometimes even disabling hurtboxes and that kind of stuff.

Once we have our desired stage .dat, it can then be opened in HSDraw.

2) Now, we need to find the models we want to replace. So, let's assume we have Hyrule Temple, so we go into map_head, then into the models folder.
There, we have 3 extra folders, so we open one by one by highlighting each RootJoint with our mouse and pressing enter. Once we find the one we want, we can go into the options in the viewport window, and press "export model to file". Choose .dae or .obj, this model is gonna be used merely as a scale reference so we don't really need the bones.
Make sure to memorize the amount of bones the original model has (scroll to the bottom of the JOBJ list and use the number of the last JOBJ +1).

3) The stage model should now be opened in Blender or whatever your program of choice is. Import our custom model(s) into the same scene and scale it if necessary so it won't be too big or too tiny in-game. You normally don't need to rotate it but if you notice the orientation is off, then rotate to match the Melee stage too.
Some Brawl stages may have their piece locations set with animations or stagePosition, so if some models aren't in the right place, we can just move them to the correct place.

Create an armature and add bones to it. With Hyrule Temple, you don't need to have the same amount of bones, but many other stages with collision links to JOBJs will indeed crash, so you need to add bones until you have the same amount of bones as the original stage. Do NOT parent any of the models to this armature, and avoid rigging anything (you'll just waste time for nothing).

Now, you can delete the Melee stage models (usually named something like JOBJ_0_DOBJ_0 or something to that effect), the Blender Camera and Light objects and leave just your custom stage model(s) and armature.
Export your stage as .fbx, and use Noesis to convert to .dae, no special options are needed, besides disabling "Add Leaf Bones" when exporting.

NOTE: Some stages have duplicate models (Rainbow Cruise most notably) and I really don't know what has to be done with those, but likely replacing both is the best idea.

4) Go back to the same viewport preview window, then press options again, and "Import model from file", choose your model. In the options window that pops up, leave everything the same, but disable "Import Rigging", scroll down and in the texture format make sure CI8 is the image format, and if any of your textures have transparency set the palette to RGB5A6, or set it to RGB565 if no textures have transparency.

If everything went fine, you'll see a progress bar that goes from "Importing model with assimp", through "Processing nodes" and finally "Processing mesh #" which will take a while, so be patient. Once it's imported and if you set the correct palette, the stage will have all the correct render flags set and this model should be basically done.

5) Repeat steps 3 to 4 for other models you want to replace, like the skybox in this case.
NOTE: When importing the skybox, make sure to disable "enable diffuse" in the import options, or else weird lighting bugs will occur on real console only.

After all these steps, you can save your .dat. Optionally, you can jump in-game to see if the models display correctly.

0) the super duper important note that I'm mentioning first because it's that important:
PRESS THE "SAVE" BUTTON AT THE TOP LEFT OF THE COLL_DATA WINDOW AFTER YOU'RE DONE OR ELSE NO CHANGES WILL BE SAVED!!!!


1) Inside your .dat file in HSDraw, there's a "coll_data" struct. Highlight it by clicking on it and then press enter, then go into the coll_data tab if it didn't go there automatically.

2) The easiest way to make sure the game won't crash, is by just going into "lines", using shift+click to select all the lines and then pressing the "delete" button in the "selected" tab at the middle of the window.
You'll notice that there's still their polygon groups, but we should leave those as they are so the game won't crash or move the incorrect lines (which are our custom collision).

3) We can drag the "coll_data" tab from the top to the right hand side of the HSDraw window, so we'll have it handy while we're in the viewport.

4) Let's go back and look for our stage model, which we imported earlier. Open it in a preview like we did before, but after doing so, click "view" (it's under the RootNode tab), and then "show in viewport".
Now, when you go into the viewport, you should now see your model there, too, so the collision is easier to map.

5) Actually explaining how the collision editor works can't be really tutorialized, but here's an explanation of the more important tools:
-In the "groups" tab, the "+" sign will add another polygon group. Most stages should work perfectly fine with only one, so don't worry about adding more than one. After that, scroll down the list to the last polygon group (which will always be the one you made), and highlight it, now it's selected so we can work on it.

-In the "lines" tab, the "add" > "line/point" will add a line or a point, depending on which select mode is used, I believe. So, for the first line, set select mode to "line" and press this button. It'll
add a line to the currently selected group. If you have a line or point selected at the moment of doing this, the new line will have it's first point attached to the selected line's.

-To move lines/points, you can select them by double-clicking (ctrl+left mouse button drag selection is a bit easier), then use alt+left mouse button drag to move it around.
I recommend only moving point-by-point, since moving lines is kinda weird and hard to control. To deselect all, just doubleclick where there aren't any lines or points.

-To join two points together, select both with ctrl+lmb drag, and press "edit vertex" > "fuse selected lines". Alternatively, you can add a line between both, by using "create line from selected" in the same menu.

-To separate two lines, select the point that joins them and use "edit vertex" > "split selected", now you can use double-click to select (not drag select because that'll select both!) and then move this point separately. Using this with add new lines is helpful for making separate platforms, but I recommend just deselecting everything and adding a new line, it's less troublesome.

-If editing the material, collisionflag, and other flags of the line is necessary, you can either select them in the "lines" tab (it'll still highlight the selected line in the viewport), or double-click/ctrl+lmb select them and both will give you the same properties in the "coll_data" window.

6) CollisionFlag values:
-Top: For ground you're supposed to stand on.

-Left: Left walls. I'd say the limit for these should be facing 45 degrees down, any angle with stronger downward inclination should be Bottom instead.

-Right: Ditto but for right walls.

-Bottom: The bottom of the stage. Pretty self-explanatory, you won't be able to get past this from under and you can bounce on it if you get knocked into it.

-Disabled: This + any other flag (set as Flag1,Flag2 I mean, so Top,Disabled for example) will disable the collision. Don't recommend doing this, deleting the line works better.

7) Flag values:
-DropThrough: Platform you can drop through by tilting the control stick down.

-LedgeGrab: Needs to be set on the "top" line right beside the "left/right" line(s), but ONLY on that line. If that's the case, you'll be able to grab the left/right points of this line as if they were ledges (because they are :p).
I recommend checking out a pre-existing stage's setup so you can understand it better.

-Unknown: The tin says it all, we don't know what this does. Never seen it actually used so I doubt it's very useful, so just avoid it for now.

-0: If you set the flag to this, it won't have any special behavior and just act as solid geometry.

8) Material values:
Yeah, no I'm not gonna write all that because it's not very useful. Just keep in mind that "Ice" will make the floor more slippery, and the others only change footstep sounds.

9) After finishing the collisions, go to your custom polygon group (the one containing all your custom lines), go into "options" > "calculate range". This updates the collision range so every line is properly detected in-game and you don't get "ghost" collisions which only work occasionally.
It's advisable to do this every time you change the collisions.

10) the super duper important note that I'm mentioning again because it's that important:
PRESS THE "SAVE" BUTTON AT THE TOP LEFT OF THE COLL_DATA WINDOW AFTER YOU'RE DONE OR ELSE NO CHANGES WILL BE SAVED!!!!

Open your .dat file, and go into map_head, then into GeneralPoints. You'll see some "Array_#: GeneralPoints" entries, and normally it's only one but Target test stages may have two or more. As always, highlight it by clicking it with the mouse, and press enter to preview and edit them in the viewport.
Then, all the general points (the blastzones, spawn points and some more things) will be there. Just double-click on each (or select them in the General Points tab which is easier to identify since they're named there) and use alt+lmb drag to move them around to the desired places in the viewport window. Avoid removing or adding any if not strictly necessary, because that causes a lot of weird bugs, bugs that I don't know a consistent fix for yet.

A couple non-obvious things you may want to know:
-TopLeft/BottomRightBoundary: The limits of the camera, so if a character gets beyond this point, the camera won't follow them. Should be closer to the stage than the blastzones.

-TopLeft/BottomRightBlastzones: These are the blastzones, which is where a character loses a stock if they reach this point.

-DeltaAngleCamera: The place the camera will turn around (or something like that), it's always at center stage a bit higher than the main platform.

-Player#Spawn/Respawn: The places players will spawn/respawn at. There only needs to be one of each, but I recommend having 4 Player#Spawns, though a single Player1Respawn is enough.

-Item#Spawn: Item spawn points. No one cares about items anyways so don't sweat it if you don't want to fix these. Items don't spawn on Target test stages, even with these points.

After doing all that, our .dat file may be a bit too large. This is because all the original stage's textures are still there and taking up precious space! Don't fret, we can fix this.
Under map_head of our .dat file, sometimes there's a MOBJ folder. We can expand it, then expand the MOBJs themselves, many of which may have a "Texture" object under them. Just right-click > delete that Texture object. Repeat for all Texture objects you can find in there. If we replaced all models and/or used "Clear POBJs" on the ones we didn't replace, this shouldn't cause any issues.

That deleted the texture references, but some (all?) of the actual image data may be stored at the top of the file. Normally, these have "_image" or "_tlut" at the end of their name, and might also have the format noted there too right before the "_image" part (most common ones are CMPR and CI8). We can safely delete these.

You can now save again and your .dat file should be smaller now.

Q1: The stage's awesome shaders don't work here, what gives?
A: For Brawl stages, the shader doesn't export with the .dae file, so HSDraw doesn't know that it exists. Fixing this usually involves modifying the TEV struct and changing the texture image flags so if it's a multi-texture effect it should blend correctly, but I don't know how each works. If anyone with more knowledge of these does, please share so some info about working with these can be added. You can still ask and I'll try to help with what little I know so far.

Q2: The stage crashes in real console, but works in Dolphin, why?
A: This can have a ton of causes, but a lot of the time just having the .dat open in HSDraw, then in the top bar, going into "edit" > "trim excess data" should do the trick.

Q: My question isn't here/wasn't fixed with any of the previous ones!
A: Tell me about the problem by posting here, so I can help you.

And here's some special thanks to those who helped (mostly in indirect ways).
-PloAJ/Furil: Made HSDraw. Also is an expert troubleshooter and helped me more than once, thanks for that.

-zankyou: First guy to ever import models AFAIK. Not sure how much he had to do with the advancements as of late but he certainly did an awesome job and got me all motivated to make more stages.

-ConnorRentz: Provided some help with general points weirdness.

-The guys at the Melee Workshop's #models channel: For asking for a guide more times than what I could count with my hands. This one's for you, guys :p

Well, that should be about it. If you couldn't understand something or have a suggestion to add, please tell me by posting here.
 
Last edited:
Top Bottom