Jump to content

Recommended Posts

Posted

Hello everyone, I’m currently making a mod to replace armor for kotor1

1259-1773225499-1850090134.png

and I have a few questions:
1. how reflections work in the game and on armor in particular, how to achieve this effect
2. it is possible to add something like displaying what is being worn (belt, shield, weapon, it doesn’t matter) and, if possible, dynamically changing it
3. Is it possible to determine what texture each specific armor will use?
4. how does the physics simulation for armor work and does it work at all?

thank you for your time

  • Like 1
Posted
4 hours ago, NiNoStyle said:

how reflections work

There are no reflections. There's not even any specular. Just cubemaps, which the game refers to as environment maps or envmaps for short. You create a mask in the alpha channel of the diffuse map which defines what parts of the texture the envmap will affect. Then you specify the use of the envmap in the texture's TXI, which holds various render instructions. The TXI data is included in the texture itself when using Bioware's own texture container variant of DDS, known as TPC for the PC version (TXB for the Xbox), but is a loose text file (with TXI extention, hence the name) when using TGAs. Check out the Sith trooper textures. They are the most extreme example.

4 hours ago, NiNoStyle said:

it is possible to add something like displaying what is being worn (belt, shield, weapon, it doesn’t matter) and, if possible, dynamically changing it

They original planned on a belt model slot, but that was removed. The only options you have are a body model plus separate head model, or a single full body model.

Notionally you can dynamically change appearances using disguises via scripting, but it's not particularly practical, especially for something as minor as what you're suggesting. I'm assuming you want sheathed weapons to hang from the belt?

4 hours ago, NiNoStyle said:

Is it possible to determine what texture each specific armor will use?

In its UTI, armour is assigned a class, which determines its protection level and what appearance column in appearance.2da it uses. It is also assigned a texture variation number, which determines what texture it will used based on the root texture name assigned in the 2DA. For example, take armour class C. A male player would have three separate appearance rows for the three starting classes, which each get their own model assignment with varying heights. In this case, PMBCS, PMBCM, and PMBCL (small, medium, large, or Smuggler, Scout, Soldier). Each model is then assigned a texture root name, which is typically the same for all three rows, PMBC in this case. For a given UTI using that slot, let's say it specifies texture variation 3. That means the game would assign PMBC03 as the texture. The texture variant value is a single byte, so 256 is the maximum value possible. The vanilla game typically only goes into the high single digits at most.

4 hours ago, NiNoStyle said:

how does the physics simulation for armor work

There are no physics. The game doesn't even have collision meshes in the models. It uses extremely basic dynamic cylinder collision which is defined in appearance.2da by the perspace / creperspace columns, which from memory is a radius value from the root of the character.

There is no ragdolling or anything like that. Everything uses canned animations.

Posted (edited)
8 hours ago, DarthParametric said:

They original planned on a belt model slot, but that was removed. The only options you have are a body model plus separate head model, or a single full body model.

Notionally you can dynamically change appearances using disguises via scripting, but it's not particularly practical, especially for something as minor as what you're suggesting. I'm assuming you want sheathed weapons to hang from the belt?

I was thinking about something like a crutch with a texture change from PFBC01 to PFBC01A, for example, while putting on a belt and shield... I did the same for the armor, all the armor elements are already present on the model, but the unnecessary elements are transparent

8 hours ago, DarthParametric said:

There are no physics. The game doesn't even have collision meshes in the models. It uses extremely basic dynamic cylinder collision which is defined in appearance.2da by the perspace / creperspace columns, which from memory is a radius value from the root of the character.

There is no ragdolling or anything like that. Everything uses canned animations.

I just wanted to achieve a slight displacement of the clothing mesh when moving. I tried adding the constrains group, but it all looks terrible in the game

 

8 hours ago, DarthParametric said:

There are no reflections. There's not even any specular. Just cubemaps, which the game refers to as environment maps or envmaps for short. You create a mask in the alpha channel of the diffuse map which defines what parts of the texture the envmap will affect. Then you specify the use of the envmap in the texture's TXI, which holds various render instructions. The TXI data is included in the texture itself when using Bioware's own texture container variant of DDS, known as TPC for the PC version (TXB for the Xbox), but is a loose text file (with TXI extention, hence the name) when using TGAs. Check out the Sith trooper textures. They are the most extreme example.

if I understood correctly if I add this effect I will lose transparency

thanks for the clarification

 

Edited by NiNoStyle
Posted
51 minutes ago, NiNoStyle said:

I just wanted to achieve a slight displacement of the clothing mesh when moving

Yeah there are no cloth dynamics. They do have what they call danglymeshes, which fake movement by vertex displacement, but it's purely a rendering trick. They use if for minor elements like hair. If you want moving clothing though then you'll need to skin it. Depending on the specifics, you may need to use JC's TSL supermodels mod as a dependency so you could use its larger array of bones and supporting animations.

51 minutes ago, NiNoStyle said:

if I add this effect I will lose transparency

Yes. At least tetxure-based alpha transparency. You can use mesh transparency, but that obviously affects the entire mesh, so it's not useful for cutouts like hair planes and the like.

51 minutes ago, NiNoStyle said:

I was thinking about something like a crutch with a texture change from PFBC01 to PFBC01A, for example, while putting on a belt and shield... I did the same for the armor, all the armor elements are already present on the model, but the unnecessary elements are transparent

In TSL there's an added script function that lets you switch a creature's appearance, which would make this sort of thing more practical, but still extremely clunky. In K1 there's only the scripted disguise route, which is really not advisable because of potential issues disguises can cause.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines.