Jump to content

N64/Zelda hacking tools (DList conversion etc)


xdaniel
 Share

Recommended Posts

*Icy Cold-Dead Stare*

 

I know whom that was directed at XDaniel...  I'll be keeping an eye on you.

 

P.S.  Ironic, you realize Airikita's problems are probably because you never chose to properly fix the Alpha Channels.

 

Just sayin'

I don't even remember whom this was directed at, I though Airikita was the one actually... Also, I was pretty sure alpha channels were working...? I mean, even SharpOcarina already went out of its way to look for alpha channels in each texture, to select the correct modes... Hell, this converter does it, too - note the "texture.HasAlpha" bits:

 

 

 

private static List<byte> CompileModeSetups(Group group, GroupAttributes groupAttribs, Texture texture)
{
	List<byte> data = new List<byte>();

	bool isTranslucentMaterial = (texture.SourceMaterial.Color.A < 1.0);

	if (texture.SourceMaterial.TextureMap != null)
	{
		data.Append64(GBI.SetCombineLERP(
			"TEXEL0", "0", "SHADE", "0", "0", "0", "0", (texture.HasAlpha ? "TEXEL0" : "1"),
			"COMBINED", "0", "PRIMITIVE", "0", "COMBINED", "0", (isTranslucentMaterial ? "PRIMITIVE" : "1"), "0"));

		if (isTranslucentMaterial)
			data.Append64(0xE200001CC81049D8);
		else if (texture.HasAlpha)
			data.Append64(0xE200001CC8102078);
		else
			data.Append64(0xE200001CC8112078);
	}
	else
	{
		data.Append64(GBI.SetCombineLERP(
			"SHADE", "0", "PRIMITIVE", "0", "0", "0", "0", (isTranslucentMaterial ? "PRIMITIVE" : "1"),
			"0", "0", "0", "COMBINED", "0", "0", "0", "COMBINED"));

		if (isTranslucentMaterial)
			data.Append64(0xE200001CC81049D8);
		else
			data.Append64(0xE200001CC8112078);
	}

	int clearGeoMode = (GBI.G_TEXTURE_GEN | GBI.G_TEXTURE_GEN_LINEAR);
	if (groupAttribs.NoCulling) clearGeoMode |= GBI.G_CULL_BACK;
	if (!groupAttribs.Lighting) clearGeoMode |= GBI.G_LIGHTING;
	data.Append64(GBI.ClearGeometryMode(clearGeoMode));

	int setGeoMode = GBI.G_FOG;
	if (groupAttribs.Lighting) setGeoMode |= GBI.G_LIGHTING;
	data.Append64(GBI.SetGeometryMode(setGeoMode));

	data.Append64(GBI.SetPrimColor(texture.SourceMaterial.Color.ToARGB()));

	return data;
}

 

Obviously I do need to work on that more, because at least in Unicat's case, the alpha channel doesn't actually work. Please don't go around accusing me of not wanting to fix stuff, tho - me not doing it for whatever reason (ex. SharpOcarina's shitty code, in the end a lot of which Model2N64 inherited) doesn't automatically equal me not wanting to.

Link to comment
Share on other sites

At least it will work for maps and solid models, I haven't been able to test any other models with transparency yet... Unicat is now invisible, but I'm pretty sure the FC command is wrong for console. Although removing the FC command doesn't do anything for it either... I disabled other parts of Navi all except her orb, so I'm not sure why it is what it's doing...

 

My other insight was how she looks squinted at the upper-left corner of Navi's orb on console, but I made a cleaner rendition of the display list aside from the squinting by comparing it to similar attributes:

CleanButNotQuiteUnicat_zps472650de.jpg

Removing DE 00 00 00 08 00 00 00 doesn't change anything.

 

Best bets would be to find an object that uses similar F5, FD, and maybe F2 commands that has transparency, but Unicat seems to be special because there's no real match...

 

EDIT:

Uhhhhh.... why are you using a flower for FD 10 00 00 04 05 67 B0?  (maybe I'm mistaken, but I managed to get a flower in Unicat's hair when adding E8 00 00 00 00 00 00 00 before F5 50 00 00 07 01 40 60...

 

--------------------------------------------------------

 

EDIT 2:

---------

Would like it so that textures are added after the display list, that way I can inject the display list separately without having to re-point things, or measure before converting.

Link to comment
Share on other sites

It's technically not my job to check how to do this-or-that in modelling programs - it's to write this converter, which I'll have to get back to soon, I know! - but anyway... "Groups" tab on the right hand side of the window, select the group you want to rename, change the name in the textbox next to the "Rename" button, then press said button.

 

T7yYFkJ.png

Link to comment
Share on other sites

There's a multitude of modelling programs people might be using, and I really can't write down detailed instructions for each and every one of them - this is not something to hold against me. In fact, I only have Milkshape installed because either you, or someone else on here, once had another question about the program in relation to the old Model2N64.

 

If this was some uncommon option or whatever that's not supported by most modelling software, then I would certainly give more detailed information myself, but something like this really should be in the care of the user, not the developer.

Link to comment
Share on other sites

Uh-huh, and how was I supposed to know it was the same thing? I'm overworked, and there's a point in production where a team makes a project with a guideline for different tools (if any), and since you're a one-man team, you should be giving this info.

 

I know you're overworked, but how am I supposed to know it was the same thing? You should include instructions with your tool. I mean, no software comes without a manual.

  • Like 1
Link to comment
Share on other sites

Yes, I need to make documentation for this, but I've pointed you to how this works (that is, toggling lighting and culling via group names) twice or more, to the post that explains this in detail. The post keeps mentioning how it's the names of groups in the .obj standard. I used the term "group" in that post too, so you not realizing that's what I mean and that the "Groups" tab in Milkshape corresponds to that... that is not my fault.

 

Still not having proper documentation written is my fault, yes, the conversion still having bugs is my fault, yes, and so on and so forth, but a user of the program not making the connection between two identically named things in the program and their modelling program - even after specifically being pointed to a post that explains this connection - really is not and cannot be my fault.

 

I appreciate the feedback you're giving, even when it's sometimes not as detailed as I would've liked or when it has snide remarks on the side, and I really don't want to offend you or anything, but come on: You're the one who needs to know the GUI and features of the program you're using. And I've explained before how mine of the two programs works.

Link to comment
Share on other sites

New build coming in a bit, will edit this post later BELOW. Some notes:

  • Texture data after display list will have to wait, if I can get this to work cleanly at all. The display list generation code need to know each texture's offset, and I'm not sure how I'd feel about having it semi-manually modify each generated display list to change where each SetTImg command points. Will keep this suggestion in mind for the future, tho.
     
  • Fixed Unicat's alpha channel under emulation (Glide64 Final), the problem appears to have been a combination of incorrect parameters in SetRenderMode and SetCombine. I'll also post another patch of Unicat replacing Besitu's room model when I post the new build, so that those with flash cartridges can try it on hardware.
     
  • Airikita: Once I've posted that build, if you want to try inserting Unicat again and report your results, please try it on a completely fresh ROM, just to make sure there's no remnants of your previous attempts or my program's faulty conversions still in it.

Again, new build (and test patch) coming in a bit...

 

EDIT:

 

Converter: http://magicstone.de/dzd/random/Model2F3DEX2-PublicBuild0b.rar

Besitu Unicat patch: http://magicstone.de/dzd/random/unicat-besitu-2.ppf

Link to comment
Share on other sites

I'm quite sure it's correct now, ex. considering the commands that matter most (SetCombine, SetOtherMode_L/SetRenderMode, GeometryMode) match up with ex. those in the Deku Tree's first room, for the vines and wooden plank walkways. Did you try the patch, or did you manually inject her in place of Navi? If it's the former, it's something I'll have to look into soon, if it's the latter... I dunno.

 

Any chance you could try replacing a different actor's model with Unicat - say the Gossip Stones or whatever; a simpler actor with a separate object file - so that we can be sure it's not the way you're inserting her into gameplay_keep, and that it's the fault of the converter for sure?

 

Edit: Oh yeah, maybe try the ForceRGBA option first, I gotta say I'm not 100% sure CI-type textures (which Unicat gets converted to by default) and alpha channels go together well. Works in emulation, not sure about hardware.

Link to comment
Share on other sites

Having spent a few hours trying to replace Navi, I came to a few conclusions for myself:

  • Working with and/or replacing existing display lists inside gameplay_keep is a pain in the ass; finding usable space inside the file is, too.
  • Just pasting conversions created by my tool to replace Navi won't work. I do not believe this to be a problem of my program as such, but rather down to how ex. Navi's original data is structured.
  • There are a few things here and there that I think I'll have to double-check in my code, but it is not completely broken, seeing how Unicat worked fine as Besitu's room model.
  • I'm on the fence about accepting any more bug reports when replacing things inside gameplay_keep, considering the above points, as well as me being unable to verify that the user in question (no matter who it is) didn't accidentally cause any glitches inserting the data into gameplay_keep.
All that said, this patch replaces Navi with Unicat and it's not a straight up, vanilla conversion made by the program. If it works on hardware, and you'll like to use it in your project, keep in mind that I had to replace another texture that I think is unused / used by an unused actor (0x42530 in gameplay_keep, 0xFA0530 in ROM) - you might want to check if it's really not used normally.

 

 

2SOJMvl.png

 

Link to comment
Share on other sites

The patch is not just crashing on hardware, it's also crashing the game before even the intro sequence under emulation for me. Skipping that by loading a save state, then going to Hyrule Field makes the game crash when it turns nighttime (as Child Link, that is). Again, I'm on the fence regarding if it's been inserted into the ROM correctly, but for now I'm looking into it regardless...

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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