East India Company Modding Instructions

14

Transcript of East India Company Modding Instructions

Page 1: East India Company Modding Instructions
Page 2: East India Company Modding Instructions

Hello to everyone!

My name is Niko Pesonen and I’m the Lead Animator at Nitrogames. In the first parts we’ll focus on modding the game graphics, but later on we’ll pay more attention to things like AI, audio, weather etc.

Basicly all the textures in EIC can be modified. These include ships, characters, buildings, terrain surface, particle textures and the whole GUI (user interface). You can also make modifications to the weather, time of day and waves. But before we go through any of that I’ll start with the basics of modding textures in Photoshop.

Texture locations

First of all you need to locate the texture files. So here goes.

The default installation folder is:c:\program files\paradox interactive\east india company\

The sub-folders are found as shown below.

Terrain textures:Data\Textures\Terrain\

Particle textures:Data\Textures\Particles\

Decals:Data\Textures\Decals\

Characters:Data\Models\Characters\

Flags:Data\Models\Flags\

Ships:Data\Models\Ships\

GUI:Data\GUI\

In the folders you see diffuse textures as well as normal maps. Normal maps are usually labeled xxx_NM.dds. Some models also use specular maps. To see which model uses which textures you can open up the 3D model file (.3DS) in hex editor. The textures are usually listed in the beginning of the file. In most cases the textures are stored in the same folder with the model file and named accordingly so you don’t need hex editor to figure out which textures belong to certain 3D model.

If you don’t have a hex editor, you can use Notepad ++ - download it from here:http://notepad-plus.sourceforge.net/uk/download.php

DDS plug-in

Since all the textures are in dds-format (DirectDraw Surface) you first need to download and install the plugin from Nvidia:http://developer.nvidia.com/object/photoshop_dds_plugins.html

Import to Photoshop

Now we are ready to import files to Photoshop.

1.In Photoshop click File->Open...2.Then select the dds-file of your choice.3.Now the plug-in ask you about the read properties of the file. We’ll choose the settings shown below. If you want to import the image with-out MIP maps, just uncheck the Load MIP maps.

Now you are ready to start editing the texture of your choice.

Here’s an example (Data\Models\Characters\NavalOfficer\01\Na-valOfficer_Body_DM_01):

. Texture Basics .

Page 3: East India Company Modding Instructions

As you can see there’s a larger image and then smaller versions of the same texture. These are called MIP maps and are used when the texture is further away from the camera. The MIP maps are also used when us-ing lower texture detail level in game options.

Note:In most cases its best to open the image without “Load MIP maps” se-lected and let the plugin generate the MIP maps once saving the file.

Saving the File

There are a few important things you need to know when saving the file because there are several format options to the dds-file.

It’s strongly recommended to flatten the layers in the image before sav-ing it as dds file.

Fist click File->Save As...

Now, you’ll get a list of options to choose from. (below)

In here you need to choose the right options for a specific im-age. If you are saving an image which doesn’t have an aplha channel (transparency) you need to choose DXT1 RGB 4 bpp no alpha. If the image has an alpha channel, you need to select DXT5 ARGB 8 bpp inter-polated alpha. For the GUI tex-tures you would want to choose the 8.8.8.8 ARGB 32 bpp un-signed.

You also have to select the right option for the MIP Map Generation. If you are saving a file which doesn’t contain MIP maps, but you want them to be generated, choose Generate MIP maps.

If the image already has MIP maps and you want to use the existing MIP maps, choose Use Existing MIP maps.

If you don’t want to use MIP maps at all, choose No MIP maps.

After choosing the correct options here you are ready to save! Run EIC and see how the changes you made appear ingame.

So thats all for today. I’ll hope this helps you getting started with modi-fying the textures in EIC. Next time we’ll go into more detail about edit-ing the images.

Best,Niko

. Texture Basics .

Page 4: East India Company Modding Instructions

Hi all!

I though it would be nice for those of you that are interested in making modifications to the game but do not yet have all the knowledge how to go about it, to give you an idea how to start modding the textures.

This time around we are going to take a look at a simple modification to a Naval Officers clothes in Photoshop.

Ok. Here we go.

In the last tutorial we looked at opening and saving files, so I’m not going to go through much of that. First of all you have to open up the appropriate file in Photoshop. I’m going to use the Naval Officer found in: ...Data\Models\Characters\NavalOfficer\01\NavalOfficer_Body_DM_01.dds.

We are not going to make any changes to the mipmaps, so load the im-age without them and choose Load Using Default Sizes.

So

this is what it looks like:

As you can see this is just the body, so if you want to make changes to the head you’ll have to open up the head file. We are going to leave the head as it is for now.

Modding this kind of a texture could be a little taunting task. It is some-times very hard to see what’s going on in the image. Basically the tech-nique is to take pieces of the 3d-model and lay them down on a flat surface and start painting on them. Unfortunately you can’t see the polygons that make up the model in photoshop so this takes a little

time to get used to. There’s always some guesswork and trial and error involved in modifying existing textures.

Ok. I’m not going to scare you anymore :)

Let’s take a look at the texture and make some adjustments to it.Basically you can do anything you want to it. It all depends on your skill level.I’m just going to give a simple demonstration how to change the color of the jacket an paint a logo on the back.For the color change we’ll use the Replace Color adjustment:

. Character Texture .

Page 5: East India Company Modding Instructions

Now you’ll have to choose a color you want to replace by using the eye dropper tool and selecting e neutral blueish color as shown with the red circle.

Adjust the fuzziness to somewhere around 55. The fuzziness controls the amount of tolerance you have in your selection. The bigger the number, the more colorinformation it selects. The areas or color you have chosen

is represented with the black and white image. You can also add more color to your selection with the eye dropper with the + -sign next to it.

As you can see, we have selected most of the blue color and now it’s time to replace those areas with another color.We’ll do that by adjusting the three bottom sliders. (Hue, Saturation and Lightness)By adjusting hue you basically change the color. Saturation equals the amount of color you want.-100 = grayscale image, +100 = fully saturated image.Lightness is for making the selected area darker or brighter.

I’ll adjust the Hue to +150 to replace the blue color with a red. And here’s what it looks like now:

This is of course just one way to change the color and surely not always the best way. But this is not the forum to teach photoshop. :)

What we’ll do next to finish the texture, is to add a logo on the back of the character.We’ll need another layer. So to do that press Shift+Ctrl+N.Now we have created another layer and to that layer we are going to cre-ate a simple image.

Choose the Custom Shape Tool from the toolbar and select the color you want for your shape:

Select “Fill pixels” and select the shape you want from the dropdown menu as shown below:

Then just draw the shape on top of the image.Here’s what it looks like:

. Character Texture .

Page 6: East India Company Modding Instructions

I’ll rotate the shape 90 degrees clockwise by choosing: Then position the shape and blend the shape to the texture by using for example a soft light -mode in the layers panel:

So here’s the final result:

Since we didn’t open up the the image with the mipmaps, we are able to save all these changes to all the mipmap -levels by simply saving the file with “Generate MIP maps” on. This way the dds plugin generates the mipmaps from this single image.

Word of Warning:Do not replace the original files with the modified ones before you have made a copy of the original one!!!

Final words.

Again I have to point out that this was by no means the perfect and only way to approach this.You, who already master photoshop will propably figure out much “cool-er” ways to produce the textures you want. I still hope this example gives you the main idea behind modding the characters’ textures. Later on we’ll look at modifying the normal maps and some other types of tex-tures. So it’s bye for now, and I’ll post more examples soon!

Oh! By the way, there is a section in the EIC forum titled EIC- User Modi-fications.If you have any questions or ideas about a topic or whatever, go the and we we’ll look into it and see what we can do for you.

Best,Niko

. Character Texture .

Page 7: East India Company Modding Instructions

Welcome to the 3rd part of modding.

This time we are going to take a look at the GUI (Graphical User Inter-face).Again, all the GUI-elements are moddable as are the model textures.

I’ve opened up the tactical_gui_2_48px.dds and here’s what it looks like:

You can see there are all the graphical elements you get in the games tactical view.

You can basically do anything here, but you still have a few rules.First of all the picture is divided into 48 by 48 pixel blocks. To see these “blocks” you have to turn on the grid in Photoshop. View -> Show -> Grid.

After that you have to adjust the grid to the correct size by choosing Edit -> Preferences -> Guides, Grid and Slices... From here you have to ad-just the Gridline to 48 pixels and the Subdivisions to 1.

Now you are able to see how the picture is divided into blocks. Some of the elements take only one block, some multiple.The next thing you’ll notice is that some of the graphical elements look a bit weird.

There might be some “garbage” around them. In this case it doesn’t matter because the image has an alpha channel, which controls the

opacity of the image. To see the al-pha channel, select the channels tab next to Layers and click on the eye icon next to the Alpha 1.

The alpha channel is just a gray-scale image which represents the transparency of the image. White color will reveal the image 100% and the black 0%.

By default the alpha channel is represented as a red color on top of the image with a 50% opacity. If you want to adjust the amount of red you see in the image, doubleclick the Al-pha 1 icon and adjust the opacity of the alpha. Note that this does not af-fect the alpha and how it works, but only the transparency of the alpha image on top of the picture.

If you want to see just the Alpha channel, just turn off the eye icon next to the RGB channel. This way you’ll see only the black and white alpha image.

This of course means that if you modify the GUI elements so that the shapes change, you have to take care that the alpha is also modified accordingly.

So lets make a simple change in the GUI. A simple thing to do here would be to change a flag to another country’s flag, so here goes.

. GUI .

Page 8: East India Company Modding Instructions

Zoom in to the flag you want to change and turn it into another one. I’ll just draw a Finnish flag on top of the Danish one.

So here’s before and after:

As you can see, the flag elements are inside their own “blocks”. This means that the element is read from that block and you cannot draw anything that goes outside this block.Since we didn’t change the shape of the element, there is no need to adjust the alpha channel.

If you want to create more radical changes to the GUI you can always modify the alpha as needed.For example here I’ve created a few cracks in the panel by drawing black in the alpha channel, so that part of the panel is hidden by the black and making little adjustments to the image itself.

Here’s the image and the alpha:

Now you are ready to save the image. Save the original one, so that you can revert to that whenever you need to!!! When saving, remember to use the 8.8.8.8 ARGB 32 bpp unsigned and choose no MIP maps.

And here’s shots from the game:

Again, your imagination is the limit here. Lets see some Star Wars -themes out there !!!

Best,Niko

. GUI .

Page 9: East India Company Modding Instructions

Hi all, and welcome to the fourth modding tutorial.

My name is Samppa Rönkä and I work as an AI programmer here at Ni-tro Games. Today I’m going to demonstrate how to add a new port into the game.

Adding a dummy port model

First we’ll add a dummy port model to the map. Open this file with your favorite text editor:

Data\Missions\Generic02\generic02_units.dhps

Now go to the very bottom. The last “addUnit” block adds Madras to the game. It should look like this:

addUnit uTOWN_indianaddUnitRootPart pTO_ind3setUnitIdString uid_town_madrassetUnitSpawnCoordinates s,918.458,-402.004setUnitAngle 291setUnitScript generic02_script41

Copy those lines and paste them back to the file just below Madras. We’ll call our new port simply “new” and position it to Madagaskar. I hope you all have more imagination here! So, make the following changes and save the file:

setUnitIdString uid_town_newsetUnitSpawnCoordinates s,-220.0,-1025.0setUnitAngle 65

If you start the game now you should see a new port at Madagaskar. It’s just an empty shell though - the game doesn’t see it yet.

Linking a port to the game

Open the following file into your text editor: Data\AI\tradeareas.txt

This file contains different MTI areas and their ports. The structure looks like this: europe{ london { } goteborg { } ...}

africa_1{ tabou { } ...}

Ifaty is a port in Madagaskar and it belongs to the africa_5 area. Find ifaty from the tradeareas.txt and make a copy of it’s “block” right below it. It will be longish as item pricing at the port needs many lines.

Wherever you see “ifaty”, change them to “new”. You should change at least the block name, “name” and “unitIdString” parameters. UnitId-String must match with the one you used at the first file. You should end up with something like this:

new{ name = str_PORT_NAME_NEW mission = Data/Missions/India_03/india_03.dhm

portCam_x = -214.0 portCam_y = 30.0 portCam_z = 7.2 portCam_beta = 34 portCam_dir = 257.0 timeofday1 = 12 timeofday2 = 15 timeofday3 = 18

unitIdString = uid_town_new

lvlTownHall = 4 lvlGarrison = 4 ...and so forth...}

Save the file and move on to the next chapter!

. Adding a port into the game .

Page 10: East India Company Modding Instructions

Adding a pier

If you tried to start the game you might have noticed that the pier was missing from the port. In the original game, the piers are terrain ob-jects fixed to a world map. We’ll have to create a pier dynamically.

First, paste the following to a new file: (you’ll need to do this only once)

part : Soli{ id=pPIER_01 type=Soli model=”Data/Models/Strategic/Towns/Pier01.s3d” name=”pPIER_01”}

Save this as Data\Parts\Solids\Towns\pPIER_01.dhpPaste the following to a new file: (you’ll need to do this only once)

unit : ArmorUnit{ name=”uPIER” unitid=33030303 bones=none animation=none scale=3}

Save this as Data\Units\uPIER.dhu

Then open Data\Missions\Generic02\generic02_units.dhps again and add this below your new port stuff at the bottom of the file.

addUnit uPIERaddUnitRootPart pPIER_01setUnitIdString uid_pier_newsetUnitSpawnCoordinates s,-265.0,-1050.0setUnitAngle 335

Now the port has a pier so let’s move on to the final chapter.

Final touches

Open the file Data\Locales\en\_strings.txt and add the following line somewhere there: (this will be the actual visible name of the port in game)

str_PORT_NAME_NEW = New Port

Open the file Data\AI\diplomacy.txt and add following: (the number is a port’s value in diplomacy)

new = 5000

That’s it! Now start the game and go see your brand new port. This may not have been the simplest of things but it’s part of the fun and luckily you don’t have to do this every day.

In case of any questions or problems see our modding forum.

- Samppa

. Adding a port into the game .

Page 11: East India Company Modding Instructions

Hi all!

This time we are going to take a look at the terrain textures in the stra-tegic view of EIC. So, to get started I’ve opened up two texture files: desert.dds and desert_NM.dds. You can find them from: ...\Data\Tex-tures\Terrain\Strategic.

Here’s how the two images look:

The first one is just a simple texture file that is drawn on the strategic map. The blue one is a normal map for that texture. All textures that have a normal map have the letter NM at the end of the file name. As you can see this particular normal map has just one color so it’s basi-cally not affecting the texture. For those who aren’t familiar with normal maps, here’s a short explanation: Normal maps are used for creating the illusion of height differences in the 3D-model. If you are familiar with 3D-programmes you compare normal maps to bump maps. Both are used to create bumpiness or height differences in the 3D-model. They work differently, but I’m not going to go any deeper into the techni-cal stuff here.

So let’s get back to the base image. This texture is generated so that it

is tilable. What whis means is that copies of the image can drawn next to each other so that there are no visible seams. Here’s what two desert images would look next to each other:

As you can see there is no seam between the two of them. Let’s look at a simple way to accomplish this. First you need an image you want to work with. I’m going to use this sand texture here:

Because I’m going to replace the original desert texture with a new one I’ll copy this image on top of the original one. Then you propably want to resize/reposition it.

Here’s what mine looks like now:

Now it’s time to flatten the image. Otherwise the thing we are going to do next will not work. Now let’s make this image tilable. The easiest way to do this is to apply an Offset filter. (Filter ? Other ? Offset...) With this filter we can move the image to any coordinate in our canvas and it automatically starts to tile itself. Here’s what it looks like with Offset’s horizontal and verti-cal set to 256, 256. (Make sure wrap around is on.)

As you can see the tiling is crearly visible here as expected. A quick way to remove the tiling is to use a clone stamp tool and paint away the seams. I’m assuming here that you are familiar with clone stamp tool. If not, there is plenty of information and tutorials on photoshop in the Internet.

This is what it looks like after the clone stamp treatment:

You might want to use the offset again to make sure the seams are gone. Let’s pretend that the image is in perfect shape :)

Now it’s time to move on to the normal map. Let’s copy the new desert image on top of the

. Editing terrain textures .

Page 12: East India Company Modding Instructions

normal map image. Again, flatten the image. You can either apply the normal map filter to the coloured image or convert it to a grayscale image first. The normal map is basically generated accordingly to the bright-ness values of the image so making the image grayscale helps to see the contrast of the image a little bit better. So let’s do that. (Shift+Ctrl+U) You can now adjust the image to your liking but I’m just going to use this grayscale image. Apply the normal map filter. (Filter ? NVIDIA Tools ? NormalMapFilter...)

To be able to control the normal map generation we have to look at a few things in here.

1.Filter Type - The bigger the sample, the less detail you get for the nor-

mal map. 2.Scale - The bigger the scale, the more elevation you get

Let’s leave the rest to their default settings.

Here’s the result:

If you don’t want the normal map to be that crisp you can always blur it with the gaussian blur for example. Save both files as DXT1 - no alpha and you are ready to go!

So this concludes today’s tutorial. Sure, you want to see how it looks like in the game. Here’s a screenshot:

Best,Niko

. Editing terrain textures .

Page 13: East India Company Modding Instructions

Hi there!

Welcome to the sixth modding tutorial! Today we learn how to translate the East India Company to your own language. This includes not only ed-iting the strings in game but also editing the GUI (graphic user interface) to make room for long words in some languages.Existing translations

East India Company ships in english, french, german, spanish, russian and japanese languages. At the time of writing, our player community has volunteerily made the following translations:

* Polish translation by delra * Turkish translation by oguzkonya

Also, the dutch version is work in progress.

The process

Translating the game can be roughly divided to four parts:

* Translating the ingame strings * Proofreading * Editing the GUI * Voice acting

Translating the ingame strings

This step is the most important one and maybe the only thing you really need to do to get most of the game localized. Open Data/Locales/en/_strings.txt into your favourite text editor. I use Notepad++ myself. Please note that the file must be in UTF-8 format. The file looks like this:

str_LOADGAME = Load Gamestr_OPTIONS = Optionsstr_EXITTOWINDOWS = Exit to Windowsstr_EXITTOMAINMENU = Exit to Main Menu

On the left hand side there’s an id for every sentence and on the right side the actual text which is visible in the game. Do not touch the id’s, just translate the text on the right. The above example looks like this in finnish language:

str_LOADGAME = Lataa pelistr_OPTIONS = Asetuksetstr_EXITTOWINDOWS = Poistu Windowsiinstr_EXITTOMAINMENU = Poistu päävalikkoon

Some sentences contain variables such as %s, %d or %i. Removing those or changing their order will cause the game to crash, so be care-ful.

str_SOME_STRING = Upgrade %s in %s to level %d before %d

Above translated without touching the variables:

str_SOME_STRING = Päivitä %s satamassa %s tasolle %d ennen vuotta %d

Proofreading

Translating the game is a huge task and some typos will appear no matter how careful try to be. Have someone else to read through the sentences you’ve translated and to look for mistakes. Play the game to make sure the sentences fit into the context.

Editing the GUI

Sometimes the word you have translated is too long to fit into the ele-ment. Here’s an imaginary situation at the strategic level:

If you can’t use any shorter word, you may be able to make the element wider. All GUI elements such as windows and buttons are defined in scripts found in the same folder as the _strings.txt. I won’t go into too much detail here, but for example a popup window in strategic view is defined in strategic_info.txt. At the bottom of the file there’s a block for “ok” button:

btnok{ render = 5 componenttype=frame framefile=Data\Locales\en\base_button.txt x = root.x + root.width/2 - root.block y = root.y+root.height - this.height -root.marg*3.5 width = 100 caption = str_OK }

. Localizing the game .

Page 14: East India Company Modding Instructions

Our example case is solved by changing the width parameter to 160.

Voice acting

You’ll find the speeches at Data/Sounds/Voices folder. Just replace the voices with new ones. Speech samples should be in 16-bit mono.Finally

I hope this tutorial gave you a basic understanding about localizing the East India Company. In case of any questions or problems don’t hesi-tate to ask at our modding forum.

See you next time!- Samppa

. Localizing the game .