Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: [Tutorial] Texture Editing
Thread: [Tutorial] Texture Editing This thread is 2 pages long: 1 2 · «PREV
Gnoll_Mage
Gnoll_Mage


Responsible
Supreme Hero
posted July 24, 2009 11:45 AM

Quote:
I am sad to see there haven't been any updates regarding portraits, I have been trying to get my custom portraits to work for a long time now but can't figure out what I'm doing wrong.

Else I say it is a very good tutorial, though I would like to see information regarding other programs than photoshop.

Thank you. I'm afraid I'm too lazy to do any more to this (moreover, I can't really remember any of it anymore, it's been too long...).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
titanzwh
titanzwh

Tavern Dweller
posted September 17, 2009 06:20 AM

interesting~~~

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Newyork2288
Newyork2288

Tavern Dweller
posted December 28, 2009 12:57 PM
Edited by Newyork2288 at 13:01, 28 Dec 2009.

What about modern terrain textures?

In advance I am sorry for my English. It was known that game lounshed in 2007 and graphics elaboration mismatches modern standards. Whether it is possible to improve textures details, or to draw again available textures? Or can such mod already exists? Prompt please!
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
VokialBG
VokialBG


Honorable
Legendary Hero
First in line
posted December 28, 2009 01:43 PM
Edited by VokialBG at 13:45, 28 Dec 2009.

Yes, it was tried, however the mod was to big in MB's to be uploaded at the filespace and its dead (you can see screenshots here), anyway there is another mod by redwoodsprite, but it's not finished, and it will never be, you can still download what he finished here. The mod is made in 2007 as well, still better than the originals.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Carcity
Carcity


Supreme Hero
Blind Sage
posted December 28, 2009 06:48 PM

hi guys, I decided to finally get serious about trying to make my own models, now I got a program to edit them, I got a dds converter, I got winzip but I can't find the bloody files, I've searched everywhere, found a map named skeletons but it gave me names that was only a bunch of numbers and letters scrambled around. how do I find the files and how do I know which one is which?
____________
Why can't you save anybody?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Newyork2288
Newyork2288

Tavern Dweller
posted December 29, 2009 04:44 AM
Edited by Newyork2288 at 04:54, 29 Dec 2009.

Terrain textures

I think i can make water in game more better, like in elven town. Please, show me the place, where the Elven town's water textures situated!

Whether also there is a possibility to replace a water textures on those that in the elven's town&
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
VokialBG
VokialBG


Honorable
Legendary Hero
First in line
posted December 29, 2009 10:32 AM
Edited by VokialBG at 10:36, 29 Dec 2009.

Well not sure about the Sylvan town water, I think I never edited this town. The problem with town textures it that they are not put in one folder but all around the data file, it took me some time to find the Haven files two year ago when we were working on the GotP mod. Anyway here are the map water terrain textures:

data.pak -> Textures\Terrain\Water

Also the lava is here, and the swamp looking necro texture (The Sylvan town may use the same textures as well, so...).

Most of the other terrain textures are in Textures\Terrain\*Folders*
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Newyork2288
Newyork2288

Tavern Dweller
posted December 30, 2009 06:00 AM

Thanks! I ll searching.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
koser
koser

Tavern Dweller
posted July 28, 2011 06:52 AM
Edited by koser at 07:56, 05 Aug 2011.

I also can't find the texture update.I remember once i downloaded the file but somehow i misplaced it.It would be nice if some users can zip it and upload it on the free server.I am eagerly waiting for the next version of the game,hopefully the texture in the new versions will be good and would fun while playingit on the high defination led tv.
____________
lcd hdtv

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Dagon
Dagon


Adventuring Hero
posted September 08, 2014 10:30 AM
Edited by Dagon at 20:25, 08 Sep 2014.

I've recently created Polish version of Rage button.
The problem is that I dont know which options in PS should I choose to make my Background.dds work.

I've selected DXT3 int the DDS options, but the game crashes after clicking RageButton :'(

Here is the JPG of my new Rage screen.
Black color should be transparent.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hayven
Hayven


Famous Hero
posted September 08, 2014 03:15 PM

Have you changed your Rage Button both [.(Texture).xdb and .(WindowSimpleShared).xdb or so]'s sizes? In PS you'll need to export DXT3 and generate NO mipmaps. Do you want me to export it 4 U?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Dagon
Dagon


Adventuring Hero
posted September 08, 2014 09:27 PM

Ok, its workin' !!
thx!
____________
http://heroes.net.pl/ - najlepsza polska strona o serii HoMM

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
dredknight


Honorable
Supreme Hero
disrupting the moding industry
posted March 25, 2018 10:04 PM

Hey everyone! I need some help.

I have an NCF creature for which I have created a LOD texture. How to test if it really works?

Sometimes when dropping creatures in the editor I am not sure if it provides the LOD or the normal texture.

I tried changing the academy giant LOD with a lod from different creature (Rakshasa) but nothing changed in the editor.

____________
Join our official discord channel | NCF Utility Beta

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Antar36
Antar36

Tavern Dweller
posted April 15, 2020 10:01 AM
Edited by Antar36 at 10:15, 15 Apr 2020.

New Hero Portrait-Melody Academy H4

Hello Community.
I'm trying to make a portrait for the hero based on the game Heroes IV. After copying the image, I save the file to .tga. Then it converts the file to dds. Then I change the files. And here it appears instead of a portrait, I see only a black place instead of it. Does anyone know what's going on? I apologize for exploring the topic.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Relentless
Relentless


Known Hero
Shadow Elemental
posted April 20, 2020 08:39 AM
Edited by Relentless at 08:40, 20 Apr 2020.

Antar36 said:
Hello Community.
I'm trying to make a portrait for the hero based on the game Heroes IV. After copying the image, I save the file to .tga. Then it converts the file to dds. Then I change the files. And here it appears instead of a portrait, I see only a black place instead of it. Does anyone know what's going on? I apologize for exploring the topic.


For H5 you can import a custom portrait in the map editor. All you need is a .tga file with an alpha channel for the transparency. The editor automatically converts the .tga to .dds. It even stores it here as a .dds:
YourHeroes5MainFolder Editor H5MMods YourMapName Maps SingleMissions YourMapName

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parealeareed
Parealeareed

Tavern Dweller
posted November 10, 2020 06:48 AM

Gnoll_Mage said:
Texture Editing Tutorial

DISCLAIMER - the exact sequence given in part II has not been tested, it is written from experience, so I may have missed something - I'll get round to checking it at some point, and I may also upload some screenshots if anyone thinks they might be helpful.

Lets see I if can be of help here. Texture modding is one of the easiest things that we can do to HoMM, which can make a big – visible – difference. Since we can’t insert our own models and animations into the game, this is one of the best options for creating new-looking creatures (indeed we can sort of edit models through texture editing). This guide ought to be something from the ground up, suitable for (almost) total newcomers – if you already know bits of it such as how to use Photoshop or how to access the data files, please just ignore those sections. I’m not a huge expert though, so there’s bound to be problems in here somewhere…

I have found this tutorial very helpful to do in  textures and now it is very easy for me

Contents

This tutorial works through editing the Imp. The simplistic modification is in part II (check out section 16 too). Parts III and V work through more advanced changes, using the Imp -> Abberant Scourge conversion as a guide. If you want to find some other textures to play with, sections 13 and 16 will be useful I hope.

I. Preamble
1. Current guides in existence
2. Introduction
3. How the game deals with textures
4. File format

II. A retexturing – the Imp
5. Where are all the textures?
6. Creating the working environment
7. The first edit
8. Further edits
9. Getting it in-game

III. How to retexture in Photoshop
10. Basic advice
11. How to use Photoshop - return to the Imp
12. The alpha channel - transparency

IV. Appendix
13. How to find textures in the data zip
14. MIP maps
15. DDS types
16. Editing the combat texture of the Imp (and some other creatures)

V. Editing other graphical things, rather than textures
17. Animsets - back to the Imp and Scourge again
18. How to swap animations
19. Effects - yet more Imp and Scourge
20. Icons

Right at the end: how to distribute the mod.



Preamble

1. Current guides in existence

There have been many generous donations to the tome of modding knowledge. I apologise if I have duplicated anything from these and others in this, my own tutorial.

Radar’s creature appearance changing tutorial: http://heroescommunity.com/viewthread.php3?TID=24678
There's some advice here about changing icons.

sfidanza’s post on general editing including the following handy diagram: http://heroescommunity.com/viewthread.php3?TID=24582&pagenumber=2


Kronos1000’s guide: http://heroescommunity.com/viewthread.php3?TID=23393

Plus of course the modding wiki: http://www.heroesofmightandmagic.com/heroes5/modding_wiki/

In particular the extant texturing tutorial -
http://www.heroesofmightandmagic.com/heroes5/modding_wiki/modding_for_dummies:texture_modding

...and 2ndHero's GIMP tutorial: http://heroescommunity.com/viewthread.php3?TID=24612


2. Introduction

Texture editing requires a powerful graphics editor. This guide is for ADOBE PHOTOSHOP, because it’s the only thing I can use (sorry I know it’s not the easiest option for many since it’s quite costly) – in my case CS3. You will also need a DDS plugin – this is the one for Photoshop:
http://developer.nvidia.com/object/photoshop_dds_plugins.html
If you don’t have Photoshop you can use any image editor than can read and save DDS files, or alternatively convert them to a different format, edit that, then convert back. The link at * above has some info on this. GIMP is a good free alternative to Photoshop apparently – try Googling GIMP DDS to find a plug-in.


3. How the game deals with textures

As you can see from the diagram, any given creature has making up its model:
- Materials
- Skeleton
- Geometry

The skeleton is a collection of `bones` that is used to move the creature. The animset gives the instructions for how to place and move the bones (it can also scale them), and the game engine then joins the geometry – the skin – to the skeleton, moving it appropriately to give something that looks good and isn’t impossible to program. It then `paints` the right textures onto this geometry.

Of course, these are complicated 3D structures, so there’s no easy way of turning the desired texture on the model into a flat, 2D file. Imagine trying to wrap a sheet around yourself so that it follows your shape exactly – it’s just not possible. This means the game stores little pieces of texture, which it then paints on to a part of the geometry, stretching it so that it does fit perfectly. These little bits aren’t stored separately; they’re all in one single image file, jumbled up. You might find arms jammed between legs, and shoulders next to teeth. This does cause a little bit of a problem – just looking at this image (the texture file), there’s no way of knowing which part will be painted on which bit of the geometry. You can only make educated guesses based on the colours of each bit – and of course, experiment and see what happens when the game pastes on the texture.


4. File format

Texture files aren’t jpegs or bmps – they’re stored as DDS files. Not all DDS files used by the game are of the same variety – just like a HoMM savegame could be for a campaign or a single-player map, etc.. For creature textures there is a general format used, which will be looked at later. Unlike your average image file, this doesn’t just store the texture as an image, it also stores what’s called an `alpha` channel. This determines the translucency of each part of the image, see section 12.

Section 15 may also be relevant.


A retexturing – the Imp

5. Where are all the textures?

Bundled up with all the other data for Heroes – in the data folder of your game’s install directory (likely C:Program FilesUbisoftHeroes of Might and Magic Vdata, TotE has its own folder under Ubisoft and HoF has its own folder under HoMM5, dataa1). You need to get inside data.pak / dataa1.pak / whatever the TotE one’s called. Fortunately this is just a zip file, so you can open it with any program that reads the zip format. I recommend 7-zip.

Let’s pick the adventure-map Imp as a creature to retexture. You can find his DDS at: data.pak_(Model)CreaturesInfernoFamiliar_LOD-Familiar_LOD.(Texture).dds. (Yes, their names really are swapped round.) Navigate there now inside your zip program.


6. Creating the working environment

The editor loads the files in data.pak of course, but it will also load files sitting `loose` in the data folder. Create a _(Model) folder within the data folder, then a Creatures folder within that, then an Inferno one inside that. Extract the DDS from the zip to this location. The editor will now use this file instead of the one in the data.pak file, so we can edit it and see what happens. Open the editor, and create a new map. Put an Imp on it. Unsurprisingly, it looks just as it always does.

Right click on the DDS and go Properties, where you need to make sure Read-only is not checked.

Now fire up Photoshop and open the DDS file in the Inferno folder using File>Open. If the DDS plug-in is installed properly, you should be presented with another dialog box. For now, untick “Load MIP maps” (MIP map explanation coming at the end) and select “Load Using Default Sizes”. The Imp file will now open up, and as you can see, his bits are all jumbled up – some pieces are obviously a head or hand, others are a bit more mysterious.


7. The first edit

In Photoshop, go Ctrl+U. Play around with the three sliders as much as you wish to recolour the Imp, then click OK, then save – up comes a scary dialog box. From the top drop-down list, select the third item on the list (should be "DXT3..."), and also make sure “Generate MIP maps” is selected. Everything else ought to be fine left as it is. Click Save. Go back to the editor and save your map as something. You’ll notice the Imp still looks the same, because the editor has loaded his original texture into memory. Close and reopen the editor and reload the map, and this time the editor will pick up the new texture that you created. With any luck, you should see your new recoloured Imp!


8. Further edits

Do something else to the image in Photoshop – another recolour will do. To view your new texture in the editor, just click the Reload map button (on the toolbar it’s an R within an arrow). The editor ought to update with the new texture. The in-combat Imp will not look any different if you were to view it in the editor (ask if you want to know how to do this). More later on how to edit the in-combat imp.


9. Getting it in-game

The easiest method (in terms of explaining it!) is the following:
Zip up the _(Model) folder and its contents with your zip program, maintaining the folder structure, and rename its file extension to “.h5m” from “.zip”. Then simply move this file to the Maps folder within your Heroes install directory. (Don’t forget you may need to turn file extensions on to rename the extension, ask for details).

Hopefully if you now run the game, any adventure-map Imps will now have the new texture – obviously you’ll need to start a game that will have an Imp stack present in it somewhere (I don’t think loading a saved game will suffice). If you can’t find one, go back to the map you were editing in the editor and turn it into a proper map, then play that map in the game (add a hero and town for each player, give the heroes armies, the towns specialisations, name the map etc. – when you save it will tell you what else you need to do).


How to retexture in Photoshop

10. Basic advice

Normally a simple recolouring will create no wonders, although this does of course depend on the situation. At the very least, you should probably do a multiple recolouring, for example by in the Ctrl-U dialog selecting something in the drop down list, editing the sliders for that, then selecting something else in the list. There are loads of useful tools in Photoshop; in particular, off the top of my head:
- Clone tool
- Lasoo and other selection tools
- Quickmask
- Copying bits off other textures or images!

Often trying to draw things yourself with the brush and pencil tools looks bad, alas we are not all Nival graphics artists…
It’s very hard to learn to be creative, but generally keeping things colour-matching and realistic and the result should be good.


11. How to use Photoshop - return to the Imp

Well this one could take some explaining . What I'll do I think is explain how I went about making the Abberant Scourge for Tales of Karador, which was based on the Imp:
Daystar and Cepheus (I think) helped greatly here by giving me a good start - the downgraded Troglodyte texture (based on the Imp as said):



I knew the Scourge needed to be similar to the other creatures on page one of the ToK thread. Since blue looks more realistic than purple in most cases I decided first to use Ctrl+U to change the green to blue. Moving the sliders helps select just the range of colours I want to be changed (this is more precise than the drop-down list). I did this again to change the bands on the texture to dark blue, after trying purple and deciding that the colours didn't match well. Sometimes using the sliders on the dialog is not specific enough. To only change certain areas of the image you need to select them first. The lasso and magnetic lasso tools do a good job of this (the latter is like the lasso selector but `sticks` to edges) - type L to select the lasso, then Shift+L twice to go down to the magnetic lasso. The polygonal one that you can get to by doing this just once may also be useful. Once you've selected an area, Ctrl+U will only affect that area. You can still be selective about the range of colours that are being changed, as ever. IIRC, selection was needed for the Scourge.

That was the basic colouring done, but now it needed to look different from the Troglodyte. Firstly I removed the bands from the Imp's fingers. This was done using the clone tool (type S for it). Hold Alt and click on the area you want to clone. Then when you paint, it copies this area to the new area. I copied some plain skin from lower down the fingers, on top of the bands, so that they disappeared.

Nextly I wanted some glowing parts. Glows are hard to draw straight off or by using a gradient or something. Remember the problem earlier, that we weren't Nival graphics artists? Well true as it is, we can still copy their work. By this I mean, steal some texture from another creature that is suitable and also much better than something you could do yourself (image searches on the internet can also provide this facility!). For me this meant using the glowing blue of one of the Ghosts from Ghost Mode (I actually copied the glow from a screenshot). Again using selection tools I selected the area I wanted, then copied and pasted this into my Scourge File. Once there, I duplicated it multiple times using Ctrl-J. For each one, I used Ctrl-T to resize and rotate it so that it fit a certain part - for example the glow was used on the feet and hands. To allow texture to show through underneath the glow layer, I either changed the opacity of the layer in the layer palette, or (perhaps, I can't quite remember) used a different layer mode from the drop-down box next to the opacity one. Sometimes I had to mold the shape of the layer using the eraser tool (type E). Don't forget that it is okay to overlap onto the surrounding black bits of a part of the texture, since these are generally not used at all to render the creature in the game/editor.

I also needed to make the edge of the glows soft, so that they blended in with the blue skin. This is a little trickier, and requires layer masks, which I'll go into at some other point.

Don't expect the first thing you do to look perfect. This creature went through many states before I was happy - for example I tried putting lightning on the body, and the glows moved around a lot too. You always have Ctrl+Alt+Z for undo, and Ctrl+Shift+Z for redo, if you need to get rid of a change that you've just made.

Also for the Scourge, I changed the animset (see section 17) to change the shape of the creature, and gave it an effect, the lightning (see section 19).

Final image (I may upload the texture file at some point):



Cepheus made the wings transparent by using the alpha channel...


12. The alpha channel - transparency

Once you have a fair grasp of Photoshop, you ought to become aware of channels. DDS files, like many other image files, store pixels with values of red, green and blue. All screen colours are made up of different combinations. Photoshop allows you to see these individually if you click “Channels”, usually in the layers box (you may have to enable it on the Window menu first). You can click on the eyes to see the RGB channels, and you should also see an alpha channel, which you can edit like any normal image, except only using black, white and greys.

When only the alpha channel is in view, you will see these greys, otherwise it will appear as a red overlay on the image. You can use all the standard tools to edit this, but you are limited to greyscale. Bits that are red / black are invisible in the game, and you can therefore paint over bits of the texture to stop them appearing on the creature, useful for getting rid of pointy bits in the model such as wings or weapons (this method tends to leaves a hole through the geometry so it’s not suitable for much else). This is one technique for model editing.

Grey in the alpha channel creates translucency (c.f. Spectres). Daystar explains this here.


Appendix

13. How to find textures in the data zip

Dear Nival scattered the DDS textures throughout the data file, located in all sorts of places. Combined with multiple DDSs for some creatures (see section 16) and some creatures being named differently in the data to what they are in game (remember the Imp / Familiar confusion earlier), it can be hard finding what you want. I'll explain more later, for now ask if you can't find one which you want.


14. MIP maps

If you load these in when you open a DDS, you will see multiple differently sized versions of the texture. The game uses these to speed things up. Imagine if, when you zoomed out, the game still had to render as much detail as it did close up – it would get very slow! So it uses the low-resolution textures. Before, we had Photoshop generate these when we saved, but you can edit them ourselves if we like, so long as you select “Use Existing MIP maps” when saving. If you are doing a colour change, you should always use this method really, since you will affect all the different sizes at once. For more detailed changes, use the method detailed above.

The reason why you should always edit the MIP maps yourself whenever possible is that the low-resolution sections provided by the game are of a better quality than those Photoshop generates itself.


15. DDS types

Every texture file (DDS) in the data paks has a corresponding XDB file with data about the image. This tells you what DDS type the relevant DDS is. When you save in Photoshop, you need to pick something from the drop-down list that fits with the text inside "<format></format>". If you see "TF_DXT3", the choice is obvious, it's the third one down, as said. "TF_8888" requries selecting one of the "8.8.8.8" ones.


16. Editing the combat texture of the Imp (and other creatures)

Coming soon. Please note that only creatures from the original game suffer this problem. If you were to edit the texture of a HoF (or presumably TotE) creature, it would update the combat creature too.

Editing things other than textures - animsets and effects

17. Animsets - back to the Imp and Scourge again

To the best of my knowledge, we can extract animations, skeletons and geometries in various formats, such that they can be modified. However, I don't think we are yet able to load these back into the game. Investigations are ongoing, I hope! I look forward to the day that it becomes possible, but it is looking like this is unlikely to happen.

Given this, I thought it would be a good idea to see if any geometries could be mixed with another creature's skeleton to create a new-looking creature. Unfortunately, none of the combinations I tried worked at all, and I assume none of them will. However what we can do is change just the animset for a creature. This does create some working combinations.

Let's return to the Scourge. After trying just about every humanoid animset, the ones that worked were two Dwarf ones, plus the Hunter set. The animset modifies the shape of the Scourge to what it is in section 11 - no longer the standard Imp shape at all. However, the animations are not perfect - you'll see that there is a stretched panel near the neck, and the feet look a bit strange. This obviously limits the professionalism acheivable by modification of the animset. Given this Kronos decided that the ToK Beta at least would use the Imp animset. As such, I have not completely checked all the individual animations (death, attack, move etc.) of the above animsets.

18. How to swap animations

I haven't tested this yet, so I won't go into detail until I do. That's likely to be a in a fair while's time I'm afraid.

19. Effects - yet more Imp and Scourge

You'll notice from the image at the end of section 11 that the Scourge is surrounded by lightning. This is an effect, not part of the model itself.

More coming soon.

Try Eugen_Cosmarul's guide here.

20. Icons

Coming soon.



So there you go, hope this is useful to someone out there. To distribute the mod just upload the h5m file that I talked about earlier to something like Mediafire. You should probably change the ending to ".h5u" first. Don't forget to complete a texture mod you may well need to change the icon(s) for the creature etc. too - try looking at Radar's guide for now. Editing those works much like creature textures (the DDS type may be different). Section 20 will detail this at some point.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parealeareed
Parealeareed

Tavern Dweller
posted November 10, 2020 06:53 AM

Texture modding

Gnoll_Mage said:
Texture Editing Tutorial

DISCLAIMER - the exact sequence given in part II has not been tested, it is written from experience, so I may have missed something - I'll get round to checking it at some point, and I may also upload some screenshots if anyone thinks they might be helpful.

Lets see I if can be of help here. Texture modding is one of the easiest things that we can do to HoMM, which can make a big – visible – difference. Since we can’t insert our own models and animations into the game, this is one of the best options for creating new-looking creatures (indeed we can sort of edit models through texture editing). This guide ought to be something from the ground up, suitable for (almost) total newcomers – if you already know bits of it such as how to use Photoshop or how to access the data files, please just ignore those sections. I’m not a huge expert though, so there’s bound to be problems in here somewhere…

I have found this tutorial very helpful to do in  textures and now it is very easy for me

Contents

This tutorial works through editing the Imp. The simplistic modification is in part II (check out section 16 too). Parts III and V work through more advanced changes, using the Imp -> Abberant Scourge conversion as a guide. If you want to find some other textures to play with, sections 13 and 16 will be useful I hope.

I. Preamble
1. Current guides in existence
2. Introduction
3. How the game deals with textures
4. File format

II. A retexturing – the Imp
5. Where are all the textures?
6. Creating the working environment
7. The first edit
8. Further edits
9. Getting it in-game

III. How to retexture in Photoshop
10. Basic advice
11. How to use Photoshop - return to the Imp
12. The alpha channel - transparency

IV. Appendix
13. How to find textures in the data zip
14. MIP maps
15. DDS types
16. Editing the combat texture of the Imp (and some other creatures)

V. Editing other graphical things, rather than textures
17. Animsets - back to the Imp and Scourge again
18. How to swap animations
19. Effects - yet more Imp and Scourge
20. Icons

Right at the end: how to distribute the mod.



Preamble

1. Current guides in existence

There have been many generous donations to the tome of modding knowledge. I apologise if I have duplicated anything from these and others in this, my own tutorial.

Radar’s creature appearance changing tutorial: http://heroescommunity.com/viewthread.php3?TID=24678
There's some advice here about changing icons.

sfidanza’s post on general editing including the following handy diagram: http://heroescommunity.com/viewthread.php3?TID=24582&pagenumber=2


Kronos1000’s guide: http://heroescommunity.com/viewthread.php3?TID=23393

Plus of course the modding wiki: http://www.heroesofmightandmagic.com/heroes5/modding_wiki/

In particular the extant texturing tutorial -
http://www.heroesofmightandmagic.com/heroes5/modding_wiki/modding_for_dummies:texture_modding

...and 2ndHero's GIMP tutorial: http://heroescommunity.com/viewthread.php3?TID=24612


2. Introduction

Texture editing requires a powerful graphics editor. This guide is for ADOBE PHOTOSHOP, because it’s the only thing I can use (sorry I know it’s not the easiest option for many since it’s quite costly) – in my case CS3. You will also need a DDS plugin – this is the one for Photoshop:
http://developer.nvidia.com/object/photoshop_dds_plugins.html
If you don’t have Photoshop you can use any image editor than can read and save DDS files, or alternatively convert them to a different format, edit that, then convert back. The link at * above has some info on this. GIMP is a good free alternative to Photoshop apparently – try Googling GIMP DDS to find a plug-in.


3. How the game deals with textures

As you can see from the diagram, any given creature has making up its model:
- Materials
- Skeleton
- Geometry

The skeleton is a collection of `bones` that is used to move the creature. The animset gives the instructions for how to place and move the bones (it can also scale them), and the game engine then joins the geometry – the skin – to the skeleton, moving it appropriately to give something that looks good and isn’t impossible to program. It then `paints` the right textures onto this geometry.

Of course, these are complicated 3D structures, so there’s no easy way of turning the desired texture on the model into a flat, 2D file. Imagine trying to wrap a sheet around yourself so that it follows your shape exactly – it’s just not possible. This means the game stores little pieces of texture, which it then paints on to a part of the geometry, stretching it so that it does fit perfectly. These little bits aren’t stored separately; they’re all in one single image file, jumbled up. You might find arms jammed between legs, and shoulders next to teeth. This does cause a little bit of a problem – just looking at this image (the texture file), there’s no way of knowing which part will be painted on which bit of the geometry. You can only make educated guesses based on the colours of each bit – and of course, experiment and see what happens when the game pastes on the texture.


4. File format

Texture files aren’t jpegs or bmps – they’re stored as DDS files. Not all DDS files used by the game are of the same variety – just like a HoMM savegame could be for a campaign or a single-player map, etc.. For creature textures there is a general format used, which will be looked at later. Unlike your average image file, this doesn’t just store the texture as an image, it also stores what’s called an `alpha` channel. This determines the translucency of each part of the image, see section 12.

Section 15 may also be relevant.


A retexturing – the Imp

5. Where are all the textures?

Bundled up with all the other data for Heroes – in the data folder of your game’s install directory (likely C:Program FilesUbisoftHeroes of Might and Magic Vdata, TotE has its own folder under Ubisoft and HoF has its own folder under HoMM5, dataa1). You need to get inside data.pak / dataa1.pak / whatever the TotE one’s called. Fortunately this is just a zip file, so you can open it with any program that reads the zip format. I recommend 7-zip.

Let’s pick the adventure-map Imp as a creature to retexture. You can find his DDS at: data.pak_(Model)CreaturesInfernoFamiliar_LOD-Familiar_LOD.(Texture).dds. (Yes, their names really are swapped round.) Navigate there now inside your zip program.


6. Creating the working environment

The editor loads the files in data.pak of course, but it will also load files sitting `loose` in the data folder. Create a _(Model) folder within the data folder, then a Creatures folder within that, then an Inferno one inside that. Extract the DDS from the zip to this location. The editor will now use this file instead of the one in the data.pak file, so we can edit it and see what happens. Open the editor, and create a new map. Put an Imp on it. Unsurprisingly, it looks just as it always does.

Right click on the DDS and go Properties, where you need to make sure Read-only is not checked.

Now fire up Photoshop and open the DDS file in the Inferno folder using File>Open. If the DDS plug-in is installed properly, you should be presented with another dialog box. For now, untick “Load MIP maps” (MIP map explanation coming at the end) and select “Load Using Default Sizes”. The Imp file will now open up, and as you can see, his bits are all jumbled up – some pieces are obviously a head or hand, others are a bit more mysterious.


7. The first edit

In Photoshop, go Ctrl+U. Play around with the three sliders as much as you wish to recolour the Imp, then click OK, then save – up comes a scary dialog box. From the top drop-down list, select the third item on the list (should be "DXT3..."), and also make sure “Generate MIP maps” is selected. Everything else ought to be fine left as it is. Click Save. Go back to the editor and save your map as something. You’ll notice the Imp still looks the same, because the editor has loaded his original texture into memory. Close and reopen the editor and reload the map, and this time the editor will pick up the new texture that you created. With any luck, you should see your new recoloured Imp!


8. Further edits

Do something else to the image in Photoshop – another recolour will do. To view your new texture in the editor, just click the Reload map button (on the toolbar it’s an R within an arrow). The editor ought to update with the new texture. The in-combat Imp will not look any different if you were to view it in the editor (ask if you want to know how to do this). More later on how to edit the in-combat imp.


9. Getting it in-game

The easiest method (in terms of explaining it!) is the following:
Zip up the _(Model) folder and its contents with your zip program, maintaining the folder structure, and rename its file extension to “.h5m” from “.zip”. Then simply move this file to the Maps folder within your Heroes install directory. (Don’t forget you may need to turn file extensions on to rename the extension, ask for details).

Hopefully if you now run the game, any adventure-map Imps will now have the new texture – obviously you’ll need to start a game that will have an Imp stack present in it somewhere (I don’t think loading a saved game will suffice). If you can’t find one, go back to the map you were editing in the editor and turn it into a proper map, then play that map in the game (add a hero and town for each player, give the heroes armies, the towns specialisations, name the map etc. – when you save it will tell you what else you need to do).


How to retexture in Photoshop

10. Basic advice

Normally a simple recolouring will create no wonders, although this does of course depend on the situation. At the very least, you should probably do a multiple recolouring, for example by in the Ctrl-U dialog selecting something in the drop down list, editing the sliders for that, then selecting something else in the list. There are loads of useful tools in Photoshop; in particular, off the top of my head:
- Clone tool
- Lasoo and other selection tools
- Quickmask
- Copying bits off other textures or images!

Often trying to draw things yourself with the brush and pencil tools looks bad, alas we are not all Nival graphics artists…
It’s very hard to learn to be creative, but generally keeping things colour-matching and realistic and the result should be good.


11. How to use Photoshop - return to the Imp

Well this one could take some explaining . What I'll do I think is explain how I went about making the Abberant Scourge for Tales of Karador, which was based on the Imp:
Daystar and Cepheus (I think) helped greatly here by giving me a good start - the downgraded Troglodyte texture (based on the Imp as said):



I knew the Scourge needed to be similar to the other creatures on page one of the ToK thread. Since blue looks more realistic than purple in most cases I decided first to use Ctrl+U to change the green to blue. Moving the sliders helps select just the range of colours I want to be changed (this is more precise than the drop-down list). I did this again to change the bands on the texture to dark blue, after trying purple and deciding that the colours didn't match well. Sometimes using the sliders on the dialog is not specific enough. To only change certain areas of the image you need to select them first. The lasso and magnetic lasso tools do a good job of this (the latter is like the lasso selector but `sticks` to edges) - type L to select the lasso, then Shift+L twice to go down to the magnetic lasso. The polygonal one that you can get to by doing this just once may also be useful. Once you've selected an area, Ctrl+U will only affect that area. You can still be selective about the range of colours that are being changed, as ever. IIRC, selection was needed for the Scourge.

That was the basic colouring done, but now it needed to look different from the Troglodyte. Firstly I removed the bands from the Imp's fingers. This was done using the clone tool (type S for it). Hold Alt and click on the area you want to clone. Then when you paint, it copies this area to the new area. I copied some plain skin from lower down the fingers, on top of the bands, so that they disappeared.

Nextly I wanted some glowing parts. Glows are hard to draw straight off or by using a gradient or something. Remember the problem earlier, that we weren't Nival graphics artists? Well true as it is, we can still copy their work. By this I mean, steal some texture from another creature that is suitable and also much better than something you could do yourself (image searches on the internet can also provide this facility!). For me this meant using the glowing blue of one of the Ghosts from Ghost Mode (I actually copied the glow from a screenshot). Again using selection tools I selected the area I wanted, then copied and pasted this into my Scourge File. Once there, I duplicated it multiple times using Ctrl-J. For each one, I used Ctrl-T to resize and rotate it so that it fit a certain part - for example the glow was used on the feet and hands. To allow texture to show through underneath the glow layer, I either changed the opacity of the layer in the layer palette, or (perhaps, I can't quite remember) used a different layer mode from the drop-down box next to the opacity one. Sometimes I had to mold the shape of the layer using the eraser tool (type E). Don't forget that it is okay to overlap onto the surrounding black bits of a part of the texture, since these are generally not used at all to render the creature in the game/editor.

I also needed to make the edge of the glows soft, so that they blended in with the blue skin. This is a little trickier, and requires layer masks, which I'll go into at some other point.

Don't expect the first thing you do to look perfect. This creature went through many states before I was happy - for example I tried putting lightning on the body, and the glows moved around a lot too. You always have Ctrl+Alt+Z for undo, and Ctrl+Shift+Z for redo, if you need to get rid of a change that you've just made.

Also for the Scourge, I changed the animset (see section 17) to change the shape of the creature, and gave it an effect, the lightning (see section 19).

Final image (I may upload the texture file at some point):



Cepheus made the wings transparent by using the alpha channel...


12. The alpha channel - transparency

Once you have a fair grasp of Photoshop, you ought to become aware of channels. DDS files, like many other image files, store pixels with values of red, green and blue. All screen colours are made up of different combinations. Photoshop allows you to see these individually if you click “Channels”, usually in the layers box (you may have to enable it on the Window menu first). You can click on the eyes to see the RGB channels, and you should also see an alpha channel, which you can edit like any normal image, except only using black, white and greys.

When only the alpha channel is in view, you will see these greys, otherwise it will appear as a red overlay on the image. You can use all the standard tools to edit this, but you are limited to greyscale. Bits that are red / black are invisible in the game, and you can therefore paint over bits of the texture to stop them appearing on the creature, useful for getting rid of pointy bits in the model such as wings or weapons (this method tends to leaves a hole through the geometry so it’s not suitable for much else). This is one technique for model editing.

Grey in the alpha channel creates translucency (c.f. Spectres). Daystar explains this here.


Appendix

13. How to find textures in the data zip

Dear Nival scattered the DDS textures throughout the data file, located in all sorts of places. Combined with multiple DDSs for some creatures (see section 16) and some creatures being named differently in the data to what they are in game (remember the Imp / Familiar confusion earlier), it can be hard finding what you want. I'll explain more later, for now ask if you can't find one which you want.


14. MIP maps

If you load these in when you open a DDS, you will see multiple differently sized versions of the texture. The game uses these to speed things up. Imagine if, when you zoomed out, the game still had to render as much detail as it did close up – it would get very slow! So it uses the low-resolution textures. Before, we had Photoshop generate these when we saved, but you can edit them ourselves if we like, so long as you select “Use Existing MIP maps” when saving. If you are doing a colour change, you should always use this method really, since you will affect all the different sizes at once. For more detailed changes, use the method detailed above.

The reason why you should always edit the MIP maps yourself whenever possible is that the low-resolution sections provided by the game are of a better quality than those Photoshop generates itself.


15. DDS types

Every texture file (DDS) in the data paks has a corresponding XDB file with data about the image. This tells you what DDS type the relevant DDS is. When you save in Photoshop, you need to pick something from the drop-down list that fits with the text inside "<format></format>". If you see "TF_DXT3", the choice is obvious, it's the third one down, as said. "TF_8888" requries selecting one of the "8.8.8.8" ones.


16. Editing the combat texture of the Imp (and other creatures)

Coming soon. Please note that only creatures from the original game suffer this problem. If you were to edit the texture of a HoF (or presumably TotE) creature, it would update the combat creature too.

Editing things other than textures - animsets and effects

17. Animsets - back to the Imp and Scourge again

To the best of my knowledge, we can extract animations, skeletons and geometries in various formats, such that they can be modified. However, I don't think we are yet able to load these back into the game. Investigations are ongoing, I hope! I look forward to the day that it becomes possible, but it is looking like this is unlikely to happen.

Given this, I thought it would be a good idea to see if any geometries could be mixed with another creature's skeleton to create a new-looking creature. Unfortunately, none of the combinations I tried worked at all, and I assume none of them will. However what we can do is change just the animset for a creature. This does create some working combinations.

Let's return to the Scourge. After trying just about every humanoid animset, the ones that worked were two Dwarf ones, plus the Hunter set. The animset modifies the shape of the Scourge to what it is in section 11 - no longer the standard Imp shape at all. However, the animations are not perfect - you'll see that there is a stretched panel near the neck, and the feet look a bit strange. This obviously limits the professionalism acheivable by modification of the animset. Given this Kronos decided that the ToK Beta at least would use the Imp animset. As such, I have not completely checked all the individual animations (death, attack, move etc.) of the above animsets.

18. How to swap animations

I haven't tested this yet, so I won't go into detail until I do. That's likely to be a in a fair while's time I'm afraid.

19. Effects - yet more Imp and Scourge

You'll notice from the image at the end of section 11 that the Scourge is surrounded by lightning. This is an effect, not part of the model itself.

More coming soon.

Try Eugen_Cosmarul's guide here.

20. Icons

Coming soon.



So there you go, hope this is useful to someone out there. To distribute the mod just upload the h5m file that I talked about earlier to something like Mediafire. You should probably change the ending to ".h5u" first. Don't forget to complete a texture mod you may well need to change the icon(s) for the creature etc. too - try looking at Radar's guide for now. Editing those works much like creature textures (the DDS type may be different). Section 20 will detail this at some point.


I get it very helpful to do Texture modding

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 2 pages long: 1 2 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1797 seconds