Results 1 to 6 of 6

Thread: The Ultimate Modding Guide

  1. #1
    Member
    Join Date
    Mar 2010
    Location
    It depends which server board I think is which.
    Posts
    1,585

    Default The Ultimate Modding Guide



    While there is information spread across the forums, we don’t have everything in one place… so here goes nothing for the whole compilation of modding Istaria!

    Table of Contents
    • Setting Up
      → Clientprefs_Common
      → AGHviewer
    • Texture Modding
      → General Textures
      → Tinted Textures
      → Dragon Textures
    • Definition Files
      → Overview
      → The Basics
      → Applying Textures
    • Shader Files
      → Overview
      → The Basics
      → Using Shader Edit
    • Getting Things In-Game
      → In-Game Commands
      → Working Resources_Override


    Setting Up


    If you are entirely new to modding Istaria, you’ve got a few things you need to do to set up, especially if you want to work with the textures.

    Clientprefs_Common

    Firstly, while this might not be an entirely necessary step,a good idea might be to edit your Clientprefs_Common.def in \Istaria\prefs, especially if you’re encountering problems.

    Find this:
    Code:
    bool agfCompressVerts = true
    	bool convertIGBToAGF = false
    	bool updateAGHFiles = false
    	bool convertAGHDDS = false
    	bool ddsHighQuality = false
    And change it to this:

    Code:
    bool agfCompressVerts = false
    	bool convertIGBToAGF = true
    	bool updateAGHFiles = true
    	bool convertAGHDDS = true
    	bool ddsHighQuality = true
    While personally I have never experienced this line of code changing anything in my experience, I have received suggestions in the past on updating my definition file to this in case all else fails, so it’s worth including.

    AGHviewer

    The backbone of all texture modding experiences is AGHviewer! You can download it from here. Make sure to include the required DLLs! This is super important.

    AGHviewer will download as a simple executable. Create a folder wherever you want it to reside - keep in mind AGHviewer saves its converted texture files within the same folder! Place the executable and all of its DLLs in the same folder or else the program might crash the instant it starts up.


    My AGHviewer install path

    Once AGHviewer has been successfully downloaded and opened, you’re nearly good to go! This next step is required every time the program starts up! Click on “File” and then “Change Root”. Navigate to your base Istaria folder. For example, mine is at “C:\Program Files (x86)\Istaria”.

    AGHviewer will pause as it reads the files and then spew out a lovely list of folders on the left side. This is an exact mirror copy of your game’s folders. Feel free to take a moment and explore them all to get a hand of how Istaria organises things.

    When you want to view a file, just click on the folder containing it on left side, then click the filename. A preview should pop up below. Note: Unless you have “Display images flipped” checked in the “Options” dropdown, all images will be shown as upside-down.

    To convert a file, and to make your life easier, check what format you want under Options -> Default Conversion Format. Personally, I use PNG files as they retain transparency and detail which is very important for modding some textures as they require transparency.

    Next, right click and choose “Save File” or hit “Control+S” while your file is highlighted. This will export the file (UPSIDE-DOWN!) to the same folder AGHviewer sits in. You can also select a file type from the right click menu with “Save File As”.


    Saving an image from AGHviewer

    Now you should have a converted file sitting in your folder just waiting for action. Congratulations, you have learned to work AGHviewer!
    Last edited by Racktor; April 5th, 2017 at 08:21 PM.

  2. #2
    Member
    Join Date
    Mar 2010
    Location
    It depends which server board I think is which.
    Posts
    1,585

    Default Re: The Ultimate Modding Guide

    Texture Modding


    Quick Links


    Modding textures is likely one of the most common ways to go about modding Istaria. There is a lot that can be done with textures!

    As noted earlier, you must pull a texture out of the game using AGHviewer. Go out and find whichever one you want to mess with. Depending on which you choose, the steps to working with them will be slightly different. Remember to always flip your textures vertically before bringing them back in-game!

    General Textures

    Textures such as those on bipeds, terrain, and objects are all really similar. Terrain and object textures are the absolute simplest - you have little to nothing to figure out about them as all of these are just tileable squares. Rip whichever texture you want and go!

    Bipeds and enemies are a bit more complex. They use opacity much more than the prior, which is very important to preserve or you will be getting white blocks around whichever texture you edit. Paint will not preserve transparency and is pretty bad for editing textures in general. If you cannot afford something like Photoshop, GIMP is a good alternative that allows the use of layers and transparency. I made many of my mods on GIMP before moving to Photoshop nowadays.

    An important thing to note is what place on the texture corresponds to any specific part on the model. Some of this is obvious when looking at it, especially for mobs and notable parts of bipeds, such as faces, but others are rather hard to discern. A good exercise is to overlay parts of the texture with bright colors like neon green or blue and convert it into the game then look where these colors show up on the model - use it as a guide!

    Once you get something you like in texture files, go and try to bring it in-game and see how it fares! Keep adjusting it until you’re happy.

    Tinted Textures

    While tinted textures share a lot of similarities with general textures when it comes to figuring out what goes to what on the model from the texture file and the need to preserve transparency, they have an added wrench in the editing process - they receive tints from the server.

    Dragons, crabs, and scorpions are among the few creatures in the game to make use of tinting. Their textures are entirely in grayscale and get a color applied to them from the game itself. If you don’t respect this when modding your dragon character, for example, all your scales are going to turn a fugly grey when you put that texture back in-game.

    To preserve the coloration, you must save your files as Grayscale. This is a different process in most programs so google it to find more specific instructions, but it generally pops up as an option under advanced menus when creating a new file. You may have to create a blank canvas first before copying and pasting the texture onto it for some programs.

    Dragon Textures

    Dragons have textures in three main parts: head and wings; teeth, mouth, and claws; body. Some dragon textures also have colored versions, denoted with “cbase” in the texture name. Others have muscle or highlight overlays, which don’t change much, but if you’re planning on entirely changing the texture (creating feathers or fur), you might want to edit this, too. Claws, teeth, and the mouth all come in a bundle as a .png file under a different file path than the other textures. (/resources/textures instead of /resources/textures_agh)

    Markings are also an entire other file. Be careful to not draw markings out of bounds of the smallest wing membrane textures - this will cause them to overhang off of your model in pitch black. It looks very ugly. Markings require tinting, too! The only thing that doesn’t is teeth/claws.
    Last edited by Racktor; April 5th, 2017 at 08:23 PM.

  3. #3
    Member
    Join Date
    Mar 2010
    Location
    It depends which server board I think is which.
    Posts
    1,585

    Default Re: The Ultimate Modding Guide

    Definition Files


    Quick Links


    Overview

    Definition files are those billions of little text files ending in “.def” you find everywhere in your Istaria directory. As you can tell by their name, they ‘define’ things. So it tells what animations characters use, what models they use, what skeletons they use, and so on. Instance NPCs are also made in definition files, but a recent update made it so that you cannot load instance NPCs permanently through your game directory anymore.

    Regions are also written in definition files. Regions are what determine the sky dome, lighting, environmental effects, and music.

    The Basics

    Definition files are written in pretty simple code that is easy to get the hang of once you understand what X or Y means.

    A “string” is a variable type that refers to a string of letters, symbols, and/or numbers in a specific order. In layman’s terms, it usually points to a name of some sort (file names, race names, names defined in other files…)
    A “bool” is a true or false statement. This generally is used for stuff that can only be on or off. For example, “bool visible” can only be true or false. You cannot have something that is only half visible, technicalities aside.
    “Int” is short for integer and only accepts flat integers - so numbers without a decimal.
    “float” is similar to int, but also allows decimals up to 6 or 7 places. Beyond that, it’ll cut off the decimal flat.
    “vector” is another type of number-related variable type that allows coordinates in X, Y, Z format. It also allows decimals.

    There might be some more I’m missing, but that’s the gist of it. Every definition file is very different in how it’s laid out and what everything does, so I can’t really get into it. If you go into them and read, you’ll likely be able to vaguely understand it.

    One constant across all definition files, though, is units of measure. Istaria uses the metric system, so any defined distances will be in meters, not feet. Any units of time are in flat seconds, as well, and use decimals to refine them.

    In the end, really the best way to understand definition files are to fiddle until you’re happy.

    Applying Textures

    Most of the time when you’re using a definition file, you’re doing it to apply a texture to a character. An example is the sunscope mod that adds visible dragon armor or tuxedos. Another example is my underwing mod which adds color to your wing membranes. These mods use the definition files of certain visible effects to call up a texture instead of a shader or effect.

    An example of a definition file that already does that are the dragon ones for masks - dragon_head_mask_anniv10.def, for example.

    Code:
    {
    	bool bodyPart = true
    	//textures to composite
    	TCompositeTexture list compositeTextureList = 
    	{
    		{
    			string texFilename = "dragon_head_mask_anniv10.png"	//filename of texture to overlay
    			string groupName = "head"	// which triangle group's texture to draw it on
    			string layerName = "dragon_mask"			
    			string offsetName = "dragon_mask"
    		}
    	}
    	//static models to attach
    	TAttachModel list attachModelList =
    	{
    		
    	}
    	//deformable meshes to attach
    	TCharacterMesh list attachMeshList =
    	{
    		
    	}
    }
    (Again, Istaria is weird and sometimes writes .png or .tga for files that are actually .agh.)

    Simply copy and paste this file into resources_override and rename it to whatever you’re replacing. Red stance, for example, is aug_stance_red.def.

    Once that’s done, you can adjust this file to whatever you want it to be. Change the texture string to whatever the name of your texture is. The layerName refers to the layer on your target character defined in Layers.def in /resources/.

    offsetName requires you to understand how Istaria works a bit. While on dragons it doesn’t mean much, on bipeds, armor is textured by fitting in the textures of the armor itself into the texture file of the biped when it’s loaded in-game. So if you want something on the mask, for example, you have to do offsetName = “Mask00” or, for the head slot, “head”. So on and so forth.
    (Take this with a grain of salt; this is how I’ve come to understand offsetName)

    groupName refers to the “overall” texture you’re modifying. For bipeds, I believe there is only ‘body’. For dragons, there is ‘head’ and ‘body’.

    Simply adjust it how you want and then test it out in-game. Knock yourself out! If you need a reference for bipeds, all of their armor definitions are here - \resources\definitions\attach\armor
    Last edited by Racktor; April 5th, 2017 at 08:24 PM.

  4. #4
    Member
    Join Date
    Mar 2010
    Location
    It depends which server board I think is which.
    Posts
    1,585

    Default Re: The Ultimate Modding Guide

    Shader Files


    Quick Links


    Overview

    Shader files are, in my opinion, the most complex file to work with in the game that we’ll cover here. The effects editor / effect definition files are arguably worse to the point where I’m not touching it with a 20 foot pole. (I also have no experience and thus cannot talk about it)

    Shader files are the .sha files you see in /resources/textures. They dictate a lot of visual things like mapping textures to objects and creating effects.

    The difference between shader files and .rtm files/.def files for effects are that shader files work in tandem with a model while effect .def/.rtms do not. They are standalone and are called upon by spells or objects.

    The Basics

    I’m still very new to shaders, so bear with me.

    All shader files are broken up into what is called a pass - a group of texture maps and rendering effects that are rendered in one go. There can be multiple passes to layer effects upon each other; the engine will render the first pass fully, then the second pass, and layer it, rather than rendering both at once. The first pass in the file is layered on the bottom.

    Passes look like this:
    Code:
    textures/terrain/terrain_dirt_cracked_alpha_reg
    {
    	{
    		map terrain_dirt_cracked_reg_reg.tga modulate
    	
    		map terrain_detail_rough_reg_reg.png mod2x
    		tcMod scale 5.65 5.65 1
    		
    		map terrain_macro_sand_reg_reg.png mod2x
    		tcMod scale 0.15 0.15 2
    	
    		blendFunc SOURCE_ALPHA ONE_MINUS_SOURCE_ALPHA
    		rgbUseVertexColors
    		fog on
    	}
    }
    {
    	{
    		map terrain_dirt_cracked_reg_reg.tga modulate
    	
    		map terrain_detail_rough_reg_reg.png mod2x
    		tcMod scale 5.65 5.65 1
    		
    		blendFunc SOURCE_ALPHA ONE_MINUS_SOURCE_ALPHA
    		rgbUseVertexColors
    		fog on
    	}
    }
    There are two passes in this file. They are grouped with curly brackets - {}.

    Encompassed in a pass is all of the functions that define how the engine renders the shader.
    Prepare yourself for a long list of terminology for stuff that I know works. There are a LOT more parameters to these functions than I’m going to list. If I were to write everything there is to know about shaders, it would be a guide much longer than this one already is. Your best bet is to, like definition files, dig around and find what works for you.

    Do note that not every extra parameter is needed and that this is NOT every shader function. These are just the most common ones.

    map
    Map is usually used to map a texture to an object. So, for example, in that block of code up there, “map terrain_dirt_cracked_reg_reg.tga modulate” maps the cracked dirt texture to the ground. ‘Modulate’ is one of the many parameters shaders support and it essentially tells the game how to display the texture’s colors.
    Modulate or no parameter is generally the most common way I’ve seen as it displays the texture as-is for the most part, but there is also mod2x, mod4x, replace, add, subtract, addsmooth, and various others - the best way to describe this is is simply ‘toy with it’.

    envMap
    This stands for ‘environment map’ and I’ve mostly seen it used for simulating shiny things or ghostly things. An example is
    Code:
    	envMap cameraspace sphere reflect ghost_darkaura.tga modulate
    From dragonghost_u_body_00.sha.

    In this example, the game applies the ghost_darkaura.agh texture to the character and moves it with the camera across the body as if it were reflecting a sphere of the texture around it. It’s very hard to explain through text, but essentially, envMap makes the associated texture reflective and responsive to the camera/environment.

    tcMod
    tcMod stands for ‘texture coordinate modification’. There’s a lot of examples all throughout the files, but this is what gives any movement-related effect.

    The most common ones are:
    tcMod rotate [value]

    tcMod scale [scaleX] [scaleY]

    tcMod scroll [speedX] [speedY]

    rgbMod
    This function changes the color of stuff, basically. It supports constant, sin, triangle, and square. I’m honestly not sure what the numbers mean or do, so toy with it if you need/want to use rgbMod. It works alongside rgbColor or rgbUseVertexColors.

    blendFunc
    This is a very important one but also a very complex one. It determines how the model layers/renders passes.
    blendFunc [source function] [destination function]

    There will ALWAYS be two and they both use one of the values from this list:
    ZERO
    ONE
    SOURCE_COLOR
    ONE_MINUS_SOURCE_COLOR
    SOURCE_ALPHA
    ONE_MINUS_SOURCE_ALPHA
    DESTINATION_COLOR
    ONE_MINUS_DESTINATION_COLOR
    DESTINATION_ALPHA
    ONE_MINUS_ DESTINATION _ALPHA
    SOURCE_ALPHA_SATURATE

    These are impossible to explain without a visual, but most of the time you’re only going to be using ONE ZERO or a mix of the source_alpha variations.

    lighting
    This is a simple one. There’s only fullbright and shaded as variables here. Fullbright makes your character have absolutely no shading on them whatsoeover. You’ll usually use this for stuff that glows. Shaded is default.

    cull
    Any of you who have messed with 3D modeling know what backface culling is. That’s basically what this is. Cull back, cull front, or cull none are the only parameters. For those that don’t know backface culling, it basically is when you render a texture inside an object as well as outside of it.

    sort
    Sort is another one you see around but I don’t really know how to explain/what it does. Go shader diving for this.

    depthTest
    This one is what makes ghosts partly see-through. Do mess with it to get a visual, but ghosts use “EQUAL” as their test. So you’ll see:
    Code:
    	depthTest NEVER/LESS/EQUAL/LEQUAL/GREATER/NOT_EQUAL/GEQUAL/ALWAYS
    Or
    Code:
     depthTest nowrite
    For the most part.

    The capitalized ones refer to the mathematical comparisons of numbers - LEQUAL = less than or equal to, for example. Most solid stuff doesn’t really define it anywhere.

    alphaTest
    alphaTest is what decides whether textures have transparency in them or not. For things like dragons, alphaTest is needed for areas like the fins where otherwise there would be white blocks surrounding the partially transparent texture.
    alphaTest uses the same NEVER/LESS/etc parameters as above but also has a value it looks for. The value refers to the opacity % of a pixel. 0% opacity is totally clear while 100% opacity is totally opaque.
    Example from the dragon wing shader:
    Code:
    	alphaTest GREATER 0.5
    Using Shader Edit

    For any of you who have used /setpref developer true, you’ll notice there’s a ‘shader editor’ window. This CAN be helpful with messing with shaders! However, only for objects you can select.

    First, create your properly-named shader file in resources_override. Load into the game and go and find whatever you’re overriding. /setpref developer true and /loadui to get the shader edit to appear in the menu. Once you have it open you can /setpref developer false, but you might need it on to select some objects.

    Second, select your edited object and make sure your empty shader appears when you highlight the shader you’re editing. If it works, then good! If not, then, well, you might not be able to edit that or might have an issue.

    Once it all seems to be working, just edit your shader file outside of the game using any text editor. I prefer Notepad++. There is a button on the shader window to reload the shader. Hit that whenever you save the file and it should update in-game.
    Last edited by Racktor; April 5th, 2017 at 08:25 PM.

  5. #5
    Member
    Join Date
    Mar 2010
    Location
    It depends which server board I think is which.
    Posts
    1,585

    Default Re: The Ultimate Modding Guide

    Getting Things In-Game


    Quick Links


    To get things to work in-game, it’s a matter of some text commands, resources_override, and renaming files. Let’s hop to it!

    Working Resources_Override

    Resources_override is a very simple folder. Contrary to popular belief you do not need to replicate the folder paths of the file you are trying to mod/override. All you need is a modded file with the same name as the unmodded version so the game can replace it.

    So, say we have texture.agh. If you want to override texture.agh with your own mix-up of it, you have to place your edited file in resources_override with the name “texture.agh”. The game cannot detect/change the file otherwise!

    That’s really all you need to know for resources_override. Don’t bother replicating filepaths unless you’re reproducing them in definition files (ex. You have “string name = ‘resources_override/folder1/file1.png’” as a line in a .def file. Then you need the path /folder1/file1.png).

    There are also some files that cannot be overwritten with resources_override and require manual overrides of the files. However, these are files you generally will not be editing and/or should not edit.

    Every time you add a new file to resources_override, you have to relog for it to take effect.

    In-Game Commands

    Thankfully, the devs have implemented the commands needed for modding Istaria by default, so no need to mod any files for this! Woo!

    There are two important commands to know for modding Istaria’s textures. /aghconvert and /purgetex.

    /modelpeek is another useful command I’ll get into later.

    Firstly, /aghconvert is what you need to convert your edited files back into Istaria’s agh files. For Istaria to even detect your files, however, you first need to place them in your resources_override folder. The game only searches for files within that folder, so if you try trying to convert texture.png when it is in your Pictures folder, you aren’t going to have much fun. Personally, I also always rename my modded file before I convert it - it makes you life easier, as I’ll explain momentarily.

    Always remember to flip the texture you’re working on vertically or else it will be upside-down in-game, leading to issues and weird mapping to models.

    To use /aghconvert once you have your file in your resources_override folder, just log into the game and type:
    “/aghconvert filename.extension”
    So, with the example earlier, I will write:
    “/aghconvert texture.png”

    This will pop out an agh file all set for resources_override! Make sure to rename it to the file you want to override, relog, and see the magic happen.

    /purgetex is meant for adjusting your edited texture files. If you type /purgetex, the game purges all textures out of the cache and then reloads them. However, it will only reload them from the place it knows they exist, meaning you cannot /purgetex to load an .agh file in your resources_override that was added during your current play session. You can only use /purgetex in the situation where you have texture.agh in resources_override, you create a new version of texture.agh, then overwrite the original in resources_override while still in-game. Then /purgetex will reload the texture.

    Now, the reason why naming files prior to converting makes your life easier is because of /purgetex. If you have texture.png and texture.agh in resources_override, have texture.png up in an image editor, and are working with it in-game, this means that you can edit texture.png, save it, type in /aghconvert texture.png again, then type /purgetex and it’s immediately updated in-game. It makes the process much shorter, especially since /aghconvert will overwrite existing agh files with the same name in resources_override. Constant relogging is not fun if you don’t have an SSD or a faster computer!

    For modding models (switching models with existing ones), finding a texture, or finding a shader, a very useful command is /modelpeek or /mp for short. You have to type /setpref developer true first to be able to select world objects such as trees, then write /mp. You’ll get an output that lists the model(s) of the object with .agf extensions as well as a list of .tga’s or .sha’s under “[AGF_SHADER]” which should match the name of the texture in your files (albeit in .agh instead of .tga - pay no mind to the weird naming discrepancies.)

  6. #6

    Default Re: The Ultimate Modding Guide

    Awesome info here, wish I could design/draw/create



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Grand Master Crafters Ultimate suit
    By Tilithia in forum Suggestions
    Replies: 9
    Last Post: September 21st, 2016, 10:23 AM
  2. modding question ^^
    By meepsa in forum Dragons
    Replies: 7
    Last Post: July 19th, 2010, 06:47 AM
  3. vista 64 ultimate
    By Aerkk in forum General
    Replies: 8
    Last Post: May 25th, 2009, 05:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •