Tutorial: How to make a mod for Grandia II Anniversary Edition

Donation

My main motivation is for the gamer and to make Grandia II, that is one of my favorite games of all times, more pleasant to play. However, if you really think this tutorial helped you, please consider donating to help me offset my costs and time. Even the smallest amount will be appreciated.

Paypal ID: leandroeidi@gmail.com


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

So, you want to make a mod to Grandia II, like my HD Mod for Grandia II Anniversary Edition and my Ryudo Super Saiyan mod for Grandia II Anniversary Edition.

One good thing about it being ported from the DC version is that most of the game's assets are open for us to change, making it easier for us to mod the game. The bad thing is that it's not enough to just change the file and save them to make them work.

The first thing to know is that the game uses .dds texture files. This extension cannot be opened by "common" programs, so I'll put two options here:

Photoshop Plugin - This is a plugin made by Nvidia for Photoshop. It allows Photoshop to open and save .dds files.

Paint.Net - It's a free painting program that can open and save .dds files. I didn't use it too much to say how good this program is.

I use the Photoshop plugin, but if you don't have Photoshop or you prefer to use other programs, you could probably open the files in Paint.Net, copy the image, change them in other program, and paste it back to Paint.Net to save it.

In my tutorial, I'll use Photoshop. Let's try first the file f_radar.dds in folder [Grandia II root folder]/data/afs/f_wintex, since it's the first one I changed.

Before opening the .dds file, make a copy of it. It's not just to have a backup in case you make something wrong. You really need the untouched original file for reasons I'll explain later. Name the copy something like "f_radar - original version.dds", or even copy it to another folder.

Make a copy of the original file!!! Even bigger just to make you understand how important this is.

When you try to open the file, the plugin will show you this window:


For now, leave the settings as they are and click OK. This is what you'll see.



You can basically start changing it now. Just remember that the game maps the textures by their position in the file. So think that every part of the image has a "square" that limits them. If you go outside them, they won't appear in game, or worse, they might invade the area of another texture. Example:

Well, it's good and all, but in my case, I wanted an HD mod, what would be impossible with its original 256x256 resolution. So you can raise the resolution in menu Image > Image Size (or the shortcut Ctrl+Alt+I). Just remember that it has to be a power of two because of .dds constraints. E.g.: 64x64, 128x128, 256x256, 512x512, 1024x1024...)

When raising its resolution, you might want to choose "Nearest Neightbor (preserve hard edges) in the "Resample Image" option to keep the hard edges, since the blur applied in a smoothed resize may make it more difficult to see where the texture really ends.


After you are satisfied with your art, you'll have to change the alpha channel of the image. It can be seen in the "Channels" tab. If you don't see it, you can choose menu Window > Channels.


It'll look something like this. My alpha channel is the layer named "Alpha 1" in my example. If you click the checkbox in front of it, you'll see that some areas in your image will get a red tint. They are the areas that will be invisible when you use this file in the game. If you didn't make your art match the exact pixels of the original file (what you probably didn't), you'll see that some parts of the image that you want in the game will be red, and other parts that you don't want in the game will not be red.

To correct it, click on the name of the layed (in this case, Alpha 1). The black and white image in the canvas will be your alpha channel. The black parts are the invisible areas, and the white parts are the areas that will be shown. You have to make it match your image.

The way I like to do it is:
1 - First click on the "RGB" layer in the channels list to go back to the normal image. 
2 - Then I go to the layers tab and choose the layer in which my image is (if your images are in different layers, you'll have to merge them together to do it the same way I do)
3 - I make a duplicate of the layer.
4 - After that I choose menu Image > Adjustments > Hue/Saturation (or Ctrl+U), and I put Lightness to +100, making all the existing pixels to turn white. Click OK.
5 - I select the whole image (Ctrl+A) or just the part I'm changing, do a Ctrl+C.
6 - Then I go back to the alpha channel in the Channels tab, click on the name of the channel to select it.
7 - I make a black square over everything I want to erase the information that's already there (the area I selected in step 5).
8 - Then I choose menu Edit > Paste Special > Paste in Place (or Ctrl+Shift+V) to paste it to the same place.

And that's it. Your visible areas should match you image now. You can go back to the layers tab and erase the white duplicate of your image.

It should work if there are transparent areas in the image you created. If you drew in the same layer of the original image, or there are pixels in sreas that should be transparent, then you'll have a little more work to make your alpha channel. What you have to know is: in the the alpha channel, you want the white areas to match the parts of your image that you want to be shown in the game.

After your image is ready and your alpha channel matches it, it's time to save. Choose Save As... in the File menu, and in the "format" drop-down list choose "D3D/DDS (*.DDS;*.DDS)". Save it with the same as the original one (you made a copy of the file, didn't you??), in this case, f_radar.dds. Choose to overwrite the file if you need. You will be shown this screen:


Change the settings to match mine. (DXT5, 2D Texture, No MIP MAPS). Save the file.

For the radar, it's basically it. Copy your newly created file to the folder [Grandia II root]/data/afs/title_data and overwrite the f_radar.dds file that's already there. If you run the game, you newly created image should be there.


Perfect, right? Not so much. For the radar specifically, it will work. But for 95% of the files you'll change, you still have to do one thing, or else the game may not even start or cause graphical glitches.

You have to hex edit your file.

Download the HxD Hex Editor program, run it, and open you new f_radar.dds file in it. It should look something like this:


What are all these numbers? Oh, my god! I give up!

Easy there. Breathe. You don't have to understand any of it. It's actually pretty simple what you have to do.

Open the original file, which you made a copy in the beginning of all this (right??). It should look like this:


The red part is the only part you need to care about (lines with offset 00000020, 00000030 and 00000040). Select this part with your mouse (click in the beginning of the 3rd line / offset 0000020 and drag it to the end of the 5th line / offset 0000040). It should look like this.


Do a Ctrl+C to copy it. Now go to your modified file, select the exact same area in that file and do a Ctrl+V, overwriting the content for the ones from the original file. It should look like this:


Save the file (Ctrl+S), and the red part will turn black. And... that's it! Your new texture is ready to be used! Copy it to the appropriate folders and it will show in the game. Remember to hex edit your texture every time you change it!

Well... I lied. It's not exactly over. There are a few exceptions and things to remember. Keep reading this tutorial until the end.


Things to keep in mind:

1 - Duplicates
- There are duplicates of the most used textures in different folders, and since the game loads from each location depending on the moment (e.g.: it loads some textures from f_wintex when the game starts, but when getting into battle the game reloads them from title_data). So if you don't copy your modified files to the necessary folders, the game may load the wrong version, or load the right one when the game opens but reload the wrong version ofter a battle.
    > Files in the data/afs/f_wintex folder need to be copied to data/afs/title_data folder.
    > Files in data/afs/sys need to be copied to data/afs/sys_hardmode for them to appear in hard mode.
    > Textures used in characters have duplicates all over. Ryudo's texture have duplicates in 20 different folders. You'll actually need a program like DupeGuru to find them.

2 - Imperfect texture mapping
Because the game is old and in low resolution, the texture mapping is not perfect. If you changed the radar texture to a higher resolution, you'll see that the black circles that go around the radar probably is showing part of the grey circle that's on its side in the f_radar.dds file. When seeing it in higher resolution, it's more obvious. If you run the game with the original texture and really look at the radar, you'll see that the problem is really there even with the original texture! It's just less obvious because the texture is in such a low resolution.

Sometimes you'll think the texture is perfect, but in the game a line of pixels from it will be missing, looking like it's been "cut". Sometimes the same texture is perfect in one place, but in another place the same texture is used, it also has a line or two of pixels missing.

You'll have to decide what to do. Ignore it? Make the imagem a liiitle smaller? There's no correct answer to it. Sometimes I choose one, other times I choose other.

3 - Not completely opaque or transparent pixels
If your image has pixels that are have some alpha value, it will also have the color of the layers behind it. E.g.: if you draw a blue ball in front of a white background, if the borders of the ball are anti-aliased, in game it will have a thin white border. If you don't want it to happen, what I do is, after the image is ready and the alpha channel is done, I draw a little "outside the borders" to keep the "different borders" from happening.
Example:


The first line is the images that I made. The second line is the alpha channel. The third one is the "drawing outside the border" to avoid the borders. Since the alpha channel limits what will be shown, the extra border won't appear. And if there are pixel with some alpha on the borders, it won't appear white.


One last thing:

Do you remember the "MIP Maps" options when opening and saving your dds file? Well, sometimes you'll have to use it. Please open the file f_icon_32.dds that's in the folder data/ads/f_wintex. Keep the "Load MIP maps" option checked and click OK. You should see this:


What the heck is this? Why are smaller copies of the main image there on its side?

MIP maps are used by games on objects that are far from the camera. Why waste processor and GPU power in detailed textures on objects that are far from the camera?

Well, some of the textures in Grandia II use MIP Maps. The catch? You can't just edit this image and try to save as a dds texture, since it doesn't have one of the accepted resolutions (128x128, 256x256, 512x512...). Even if you did, you'd have to change the smaller images, too.

What I do is: I open every image with "Load MIP maps" selected. When I see that it really has MIP maps, I close it, and I open it again with that option unchecked. That way, it'll load only the bigger image. Then, when I finishd editing it, I have to remember to check "Generate MIP maps" on the save screen.


What if you do forget to check this option? Will the game crash?

Probably not. I've forgotten to check it a couple of times, and nothing really bad happened. Some objects just felt a little strange, like the texture was too big for the small object. But better be safe than sorry, right?
Página Anterior