• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 26, 2024, 10:09:33 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Map Editor: Ganesha 0.60 Released

Started by gomtuu, March 12, 2009, 01:40:11 pm

Seth

WTH is this Now?
[attachment=0:20ir602e]ERROR.jpg[/attachment:20ir602e]
HALP!

gomtuu

Quote from: "Seth"WTH is this Now?
Unfortunately, I don't have a clue... I'll try to look into it, though.

Quote from: "Cheetah"So I tried to import a texture and the program throw me a giant error and crashed. Has anyone successfully important new textures? I even tried an unedited png that I had just exported from a different map and it didn't work. I have attached the error message.
This bug was surprisingly hard to track down, yet incredibly simple. The next release, due out any day now, will include the fix.

The next release will also allow easy point-and-click editing of polygons' UV coordinates. Stay tuned!

Cheetah

YESSSSSSSSSSS!!!!!!!!!!! Just in time for my summer break too :D.
Current Projects:

LastingDawn

Oh... I like the sounds of these new edits!
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

gomtuu

Version 0.60 is here! Download it at the Ganesha website:

http://gomtuu.org/fft/Ganesha/

Changes include:
  • Added code to detect and fix broken polygons created in 0.55. (Like this.)
  • Put new polygons at maxY+12 instead of maxY+1.
  • Added ability to edit UV coordinates in a popup window.
  • Fixed texture import bug when used in Windows.
  • Fixed bug that prevented Guess Normal Coordinates from working on triangles.

See the instructions for information on how to use the new UV Coordinates window.

LastingDawn

Looking good! Can't wait to try it out!
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

Kokojo

I keep leaving, I keep coming back. Boomerang boy.

Cheetah

The update fixes the texture issue and I'm making some progress with textures with my map. I have to say though Gomtuu there are a few features I would like to see.

1) Copy paste of palettes and individual colors. It takes me about 10-15 minutes to do each row manually.
2) Copy paste of polygons. I often after multiple maps open at once just taking bits from other maps, and this would save so much time.
3) Rotating polygons by 45 degrees.
4) An automated feature to automatically have the U&V coordinates represent a size equal to that of a new polygon.
5) A similar quick adjust for UV coordinates like what you have for polygons.

It is going to take me forever to do the textures for my map, even if I end up not using anything original. Gives me a whole new appreciation for the graphics in this game, the textures most have been the hardest part for the creators too, they are just so amazingly detailed.

Regardless this program is still amazing and has to be the best custom map hacking tool on the net.
Current Projects:

LastingDawn

As wonderful as this tool is, there is a surprisingly much more comprehensive tool for Zelda 64, called Utility of Time. I'm not sure if it would be Any help as a template. But if you have the time Gomtuu, you should look it up. There might be something in its design that might help you.

When it comes to PSX specifically... yes. Ganesha is By Far the best (and only I think...?) Map hacking tool.
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

Cheetah

Wow I posted my concept for this map over a year ago, and am still using it as a base. Well texturing is hard with a completely custom map. I am doing a color concept sketch with different pieces from different maps, and then I find/make the same thing in the gray palette so that it can actually be used and put that into the maps texture file. Then you have to actually go to each polygon and reassign everything and mentally rotate and flip everything so that it is on the actual polygon. So all I have done with two days of work is a 7th of the ground floor... Even though I'm bitching, it is still SO MUCH FUN!!! The level of control and detail is amazing, I'm looking through all the maps for textures and I'm like "oh that knot on the plank would look great on the chocobo stable" or "oh is that a puddle, that would be great to add so that I can have a mud terrain panel".

But I have a problem. I was under the impression that each standard polygon used a 20x20 pixel texture. However, I'm noticing that they are often assigned one pixel less per side, and that with all my careful laying out that an additional row/column of pixels is showing up even though it isn't in the coordinates I assigned it. There are a few reason this might be happening in my estimation:

1) So I'm not sure if this is something that ganesha is doing or if it is innate to the map building and I need to adjust.
2) There is also the possibility that Map2gl is causing the error because that is where I'm seeing the extra pixel and not in Ganesha.
3) So far I'm applying this stuff mostly on new polygons and perhaps some of the unknown values correct for this.

I haven't tested this in game yet, and that might answer more questions. Thoughts Gomtuu?
Current Projects:

gomtuu

Quote from: "Cheetah"But I have a problem. I was under the impression that each standard polygon used a 20x20 pixel texture. However, I'm noticing that they are often assigned one pixel less per side, and that with all my careful laying out that an additional row/column of pixels is showing up even though it isn't in the coordinates I assigned it.

Yeah, I noticed that too while I was working on the UV window. At first, I thought it was a bug in my code, but here's a comparison of Ganesha's 3D view, Ganesha's UV view, and an in-game screenshot from ePSXe 1.7.0.

[attachment=1:2prybft0]texture-accuracy.png[/attachment:2prybft0]
Notice how the right (red-blue) side of the water texture only includes one pixel of the dark (that is, dark when the palette is applied, but light when grayscale) border part of the texture... It seems wrong, but the in-game screenshot is the same way.

HOWEVER, now that I think about it, I'm pretty sure ePSXe is doing it wrong. I seem to remember reading that the PSX doesn't sample textures from the top-left corner of each texture pixel, it samples them from the center of each texture pixel instead. Imagine moving that UV polygon down by half of a texture pixel and to the right by half of a texture pixel. Then the border on each side would be 1.5 pixels wide. That's what map2gl is doing, if I remember correctly. I'd love it if someone verified this by playing the original game on a real Playstation 1. It would also be nice to know what the PS2, PS3, and PSP do. These screenshots are from the SW corner of MAP056, if you can't tell. :)

This would also explain why the monastery's buttresses have that ugly blue fringe in ePSXe:

[attachment=0:2prybft0]texture-fringe.png[/attachment:2prybft0]
If that UV polygon was moved half a pixel down and to the right, then it wouldn't include that black stuff, which shows up blue in-game. And indeed, when I view this map in map2gl, I don't see those blue fringes. This seems like pretty good evidence that ePSXe is wrong. (And so is Ganesha.)

Here's what I would suggest: You probably can't go wrong doing what the original game designers did, so just make the right edge of your UV polygons 1 pixel left of where it seems like it should be, and make the bottom edge 1 pixel higher than it seems like it should be. This is because Ganesha displays every point in the UV polygon half a pixel too high and half a pixel too far to the left. Unfortunately, this means the default UV coordinates for new polygons created by Ganesha 0.60 and earlier are one pixel bigger than they should be in both dimensions...

I'll fix Ganesha so it creates new polygons properly, displays the textures properly in 3D, and displays the UV polygon properly in the UV window. It won't match up with ePSXe anymore, but it should be more correct.

Nice catch, Cheetah! Thanks!

Cheetah

So specifically, which corners/sides am I decreasing by one pixel? Just because it is constantly changing depending on the rotation of the polygon.

Thanks for the quick and thorough answer as always though Gomtuu. I'm excited to be making real progress on my map again, though it is daunting and sooo time consuming. I need to be working on a different machine, emulating through Parallels on my iMac just isn't fast enough.
Current Projects:

gomtuu

Quote from: "Cheetah"So specifically, which corners/sides am I decreasing by one pixel? Just because it is constantly changing depending on the rotation of the polygon.

Regardless of the orientation of the polygon, the right and bottom edges are the ones that need to be adjusted (for an exception, see the note below). Here's another image to show what I mean:

[attachment=0:1ghyrlmz]uv-shift.png[/attachment:1ghyrlmz]
Ganesha 0.60 displays the UV polygon as shown in the left side of the above image. It should (and the next version will) display it as shown in the right side of the image. Notice how the whole polygon is shifted down and to the right by half of a texture pixel. For the top and left edges of the polygon, this doesn't make much of a difference (again, see the note below for an exception), because even though a bit of the texture is being cut off, it's still showing at least part of the top row and left column of texture pixels. But for the right and bottom edges, there is a significant difference, because the texture now includes half a column of pixels on the right and half a row of pixels on the bottom that didn't seem to be included in the UV polygon on the left side of the image.

Exception: In the buttress image from my previous post, Ganesha 0.60 would have given you the impression that the texture would include some pixels from that black area at the top-left edge of the polygon, so if you were making a similar polygon, you might be inclined to move the blue point down one pixel and/or the green point right one pixel in order to avoid the black pixels, but this is not necessary because Ganesha is displaying those points incorrectly: the "real" position of those points (and the red one, too) is half a pixel down and to the right of what Ganesha is showing.

I hope this makes sense. And in the next version of Ganesha, you won't need to worry about it, because the UV window will more accurately show the texture area that the PSX would use.

Cheetah

Well I understand the answer to my question, but I don't understand the exception at all. Bottom line though is that if I just subtract a pixel from the two edges you indicated, then it will all work out. Also, will making these adjustments mess things up when imported into a newer version of Ganesha, or is it all good?
Current Projects:

gomtuu

Quote from: "Cheetah"Bottom line though is that if I just subtract a pixel from the two edges you indicated, then it will all work out.
Most of the time, yes. The point of the exception was that, in some cases, the fact that Ganesha displays the UV polygon too far to the left and top by a half a pixel could also affect the left and top sides of the UV polygon. But this is relatively rare, and even if you get it wrong, the effect is small.

Quote from: "Cheetah"Also, will making these adjustments mess things up when imported into a newer version of Ganesha, or is it all good?
No, you should go ahead and make the adjustments to your polygons. The newer Ganesha won't change your UV data at all, it'll just represent it more accurately.

Speaking of accuracy, here's what I've found so far. The following all sample textures from the center of texture pixels:
  • Playstation 2 (original CD)
  • Playstation 3 (original CD)
  • PSP (PSX ISO running on CFW)
  • PSP (War of the Lions UMD)
  • map2gl
  • The next version of Ganesha
I don't have an original PSX available to test it, but I'm willing to bet it would be in this first category, too.

Therefore, the following all sample textures incorrectly (from the top-left corner of texture pixels):
  • Ganesha 0.60 and earlier
  • ePSXe 1.7.0 (I tested Pete's OpenGL2 Driver 2.7 and P.E.Op.S Soft Driver 1.17)
  • pSX 1.13
  • PCSXTrace 1.5a

Cheetah

Wow those are some impressive findings, I bet the programmers of those emulators would appreciate hearing about this, it might clear up a lot of minor graphical glitches going on. Great work as always Gomtuu. I will keep making progress on my map and look forward to the new Ganesha.
Current Projects:

gomtuu

Quote from: "Cheetah"1) Copy paste of palettes and individual colors. It takes me about 10-15 minutes to do each row manually.
2) Copy paste of polygons. I often after multiple maps open at once just taking bits from other maps, and this would save so much time.
I'll look into adding copy/paste features, although I'm not sure how easy it would be to copy and paste between two separate instances of Ganesha...

Quote from: "Cheetah"3) Rotating polygons by 45 degrees.
45 degrees? Wouldn't you normally want to rotate polygons in 90-degree increments (around the Y axis) or by increments that correspond to slope angles (around the X and Z axes)?

Quote from: "Cheetah"4) An automated feature to automatically have the U&V coordinates represent a size equal to that of a new polygon.
5) A similar quick adjust for UV coordinates like what you have for polygons.
New polygons already start with an appropriately-sized UV polygon, don't they? (I mean, except for the bug we've been discussing, where they're one pixel too big in each dimension.) And while a quick-adjust feature might be useful, your question makes me wonder: Did you know you can click and drag the UV polygon? You can either click inside the polygon and drag the whole thing, or click and drag the individual points. You just have to zoom in first by rolling the mouse wheel up while the mouse pointer is over the UV window.

Quote from: "Cheetah"Wow those are some impressive findings, I bet the programmers of those emulators would appreciate hearing about this, it might clear up a lot of minor graphical glitches going on.
Yeah, that would be cool! I asked about it on the ePSXe forums, so we'll see. It seems unlikely to me that nobody would've figured this out before, though, given that coding a PSX emulator would take more technical knowledge than I have and that there are thousands of users to report graphical problems... Maybe there's some reason why emulators sample textures this way.

Quote from: "LastingDawn"As wonderful as this tool is, there is a surprisingly much more comprehensive tool for Zelda 64, called Utility of Time. I'm not sure if it would be Any help as a template. But if you have the time Gomtuu, you should look it up.
I took a quick look at a tutorial video on YouTube. You know, the basic design of the program, with the 3D area on the left and the editing panel on the right, is something I considered for Ganesha early on (since it's fairly common for 3D editors), but I assumed it would be hard to get the 3D stuff and the editing stuff in the same window, so I never tried it. I experimented with it this weekend, though, and it's easier than I thought. I've already added a menu bar with options for saving/loading map files, importing/exporting textures, adding polygons, etc. All the same functionality is still there, but it's all in menus so you don't have to remember keyboard shortcuts, which I think makes things easier.

[attachment=0:2wovzdfe]ganesha-menus.png[/attachment:2wovzdfe]
Now, I could make an editing panel on the right side of the main Ganesha window and move all the stuff from the pop-up windows into that panel (with tabs or something to make it all fit), but I'm not entirely sure that's an improvement. Keeping everything together in one window would make Ganesha easier to use, I guess, but you'd lose the flexibility of being able to move the windows around wherever you want and let them overlap if they don't quite fit on your screen...

What do you guys think?

ffta707

I think you should add it. It would be way more flexible. I like the idea of that.

Cheetah

1 & 2) Well even if I had to move between maps to copy paste it would still likely be faster for most things.
3) This should relate to rotating the UV coordinates as well. For rotating the polygon though yeah, there are likely several different rotations and flips that would be nice. I think rotating by 45 degrees on the X, Y, and Z axis would cover all the main possibilities though right?
4) I have a few larger and odd shape polygons that have stretched textures. Maybe I created those polygons before Ganesha did this?
5) WHAT!? You already have that implemented? Man I should have at least tried. The quick move isn't quite as necessary then. A rotate and a flip would still be very useful though since the polygons don't always have the same orientation and the same texture is often used multiple times from different angles and orientations. Of course we can do this manually now, but doing the math in my head was hurting my brain.

More comments soon about your other thoughts.
Current Projects:

LastingDawn

I fully think you should add a drop down menu, it would make it much easier for the layman (me) to use, and increase versatility. I'm glad to see UoT helped in some small way.
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!