Jump to content

Sacred 2 Downloads - DIMITRIUS'S CM PATCH ADDENDUM - 2023


Recommended Posts

  • 3 weeks later...

Hey Dmitriy:) Do you have a list of changed shader.zip files for the Addendum? I want to take a closer look at how things work there and figured it might be a good start to learn from Addendum changes, but there are nearly 500 files as a directory scan revealed.

Link to comment
On 4/14/2022 at 12:50 AM, Lindor said:

Do you have a list of changed shader.zip files for the Addendum?

Greetings! Nope, but those can be easily identified via "Changed" column in WinRAR:

unified\fx\fm_minion.shader

unified\fx\fm_minion2.shader

unified\fx\post\post_godspell1.shader

unified\object\diffPntShdMtl.shader

unified\object\diffPntMtl.shader

unified\object\ambDiffMtl.shader

unified\object\fx\elite.shader

unified\object\fx\frozen.shader

unified\object\fx\skorpionshieldmask.shader

unified\object\fx\kristallhaut.shader

unified\object\fx\skorpionshield.shader

  • Thanks! 1
Link to comment

Thx again, Dmitriy! :bow:I have a couple of questions, hope it's okay if I post them here:

First of all, I think the scripting language of the shader files is C# with Unity game engine's ECS API, which I don't understand because doesn't Sacred 2 have a custom engine? Anyway, this would explain these wierd float1-4 structs.

Look at these three lines:

s2half4 bgr = lerp(nonoffs_bgr, offs_bgr, t_mask.x);
s2half grey = dot(bgr.xyz, float3(0.222, 0.707, 0.071));
bgr = lerp(grey * param, bgr, 0.4);

bgr stands for blue, green, red color space I think and dot is the dot product for two vectors in the color space. The dot product is a scalar, not a vector!
lerp means linear color interpolation, basically in this example it's 0.4*bgr+(1-0.4)*grey*param. So it's a way to set the saturation of the resulting color.

But: grey is a scalar while bgr is a vector. This doesn't make sense, you cannot interpolate a vector with a scalar. How does that work?

Also the sum of the elements of the second vector of the dot product always seems to be 1 in the Vanilla shader files.

But in Addendum kristallhaut.shader:

s2half grey = dot(bgr.xyz, float3(0.722, 0.607, 0.001));

the numbers add to 1.330,

Why do they always add to 1.000 in the first place and why does the Addendum break this rule? If you wanted lower saturation, why not simply adjust the param?

Honestly, all of this doesn't make any sense to me. s2half grey does not look like a grey conversion to me. A bgr color vector is grey, if their three components are the same. It would make sense if it looked like this:

float greyf = dot(bgr.xyz, float3(0.333, 0.333, 0.334))
s2half grey = float3(greyf, greyf, greyf)

That would at least be a vector.:lindor:

 

EDIT: Oooh I see, param is actually a vector and not a scalar. Since when are paramaters vectors? Wierd game. Anyway, there's no information where this mysterious vector is coming from.

fragout mainPS(pixdata I,
  uniform sampler2D   texture0,
  uniform sampler2D   texture1,
  uniform sampler2D   texture2,
  uniform sampler2D   texture4,
  uniform sampler2D   texture5,
  uniform float4      target_data,
  uniform float4      param
  )

I assume it's hardcoded then? Maybe it's some kind of function output depending on the ingame sun time? Still doesn't explain why the second vector of the dot product always has 1-norm 1.000.

 

Edited by Lindor
Reason: changed s2half5 to float cause the former didn't kame any sense. Why did I wrote that?
Link to comment
On 4/17/2022 at 4:29 AM, Lindor said:

doesn't Sacred 2 have a custom engine?

From what I see, the developers used a modified Ogre 3D Engine they named Orc alongside Granny 3D. 

On 4/17/2022 at 4:29 AM, Lindor said:

I assume it's hardcoded then?

There's a group of shader processing functions in s2render.dll. Their peudocode defintions are:

int __cdecl cShaderMgr::operator new();
int __thiscall cShaderMgr::getVertexProfile(void *this);
int __thiscall cShaderMgr::getPixelProfile(void *this);
int __thiscall cShaderMgr::getShaderProfile(void *this);
int __thiscall cShaderMgr::getVertexProfileCrc(int this);
int __thiscall cShaderMgr::getPixelProfileCrc(int this);
int __thiscall cShaderMgr::getShaderPath(void *this);
int __thiscall cShaderMgr::getShaderModel(int this);
int __thiscall cShaderMgr::getAnzResources(int this);
void __thiscall cShaderMgr::prepareShaderParams(int this, void *a2);
int __thiscall cShaderMgr::getZFrustumData(void *this);
int __thiscall cShaderMgr::getfogData(void *this);
int __thiscall cShaderMgr::getShaderCache(void *this);
__int64 __thiscall cShaderMgr::getGlobalShaderLayerFlags(int this);
int __thiscall cShaderMgr::setGlobalShaderLayerFlags(int this, int a2, int a3);
int __thiscall cShaderMgr::setShadowDepthRange(int this, int a2);
int __thiscall cShaderMgr::getShadowData(int this, int a2);
int __thiscall cShaderMgr::getViewportData(int this, int a2);
int __thiscall cShaderMgr::getPs3dShaderParams(int this);

On 4/17/2022 at 4:29 AM, Lindor said:

Why do they always add to 1.000 in the first place and why does the Addendum break this rule?

The result is dependent on the general ambient lighting from all sources present, I think. And the parameter sum gets normalized against 1.0, so the in the end float3(0.722, 0.607, 0.001) equals float3(0.722, 0.278, 0.0)

  • Thanks! 1
Link to comment
  • 4 weeks later...

Some notes/questions on integration of latest Addendum into D2F:

  1. "mount_sturmangriff" CA uses animation "ANIM_TYPE_RIDERUN-HORSE" but the attack parameters were removed from all RIDERUN-HORSE animation entries. Is it not necessary?
  2.  What are _RI and _THR1 animations and why were they added to the characters?  I'm guessing THR1 is daggers/throwing axes and THR2 is bombs/stars?  I've adopted the new throwing dagger/axe models and animations but the idle animations look... wrong.
  3. Soundprofile.txt:

Every instance of event = "IDLE", id = "131075"
was changed to event = "IDLE", id = "131074"
Was "131075" not a valid event id?

      4.  v_he-m@buerger1.GR2 has some distortion/clipping issues around his head. His hair seems to spike forward through his face.

  • Thanks! 1
Link to comment
18 hours ago, Flix said:

Is it not necessary?

Correct, the particular CA mechanics is controlled by EiState and cSpellClass.

18 hours ago, Flix said:

What are _RI and _THR1 animations and why were they added to the characters?

_RI are the saberstaves. The original use of _2H animations resulted in instances of "performing harakiri" during some attack animations.

_THR1 are indeed throwing daggers/axes. To make things work properly, you have to use the Addendum models/animations for throwing daggers/axes, introduce the necessary alterations to animation.txt and itemtype.txt.

18 hours ago, Flix said:

v_he-m@buerger1.GR2 has some distortion/clipping issues around his head.

That's what a single vertex with a corrupt weight assignment can do. The fix will be present in the next iteration.   

Link to comment
On 5/17/2022 at 3:22 PM, dimitrius154 said:

_THR1 are indeed throwing daggers/axes. To make things work properly, you have to use the Addendum models/animations for throwing daggers/axes, introduce the necessary alterations to animation.txt and itemtype.txt.

You know, I did this and I just couldn't get them to orient correctly in the hand. No matter what they just stick to the hand sideways. There's nothing else needed code-wise?

===================

Unrelated question: do you happen to know what the final number in this quest.txt string might represent?

worldobjects = {
{ 1004834118,7,42 },
},

1049848203 is the worldobject ID.

7 is the quest stage, so "task awaiting" in this instance.

But the 42?

I'm trying to define a treasure chest worldobject (pre-existing) as a station0 in a reaching quest.  Right now I can get the quest to update and complete upon clicking the chest, but the chest is locked and won't open.  I wonder if the final number indicates locked/unlocked or something similar?

EDIT: I believe the final number is the "worldobjectstate". One can see what the value ought to be by checking the itemtype ID.

It looks like 42 is locked door, 43 is unlocked door.  Unlocked chests should be '8' generally.

Link to comment
15 hours ago, Flix said:

There's nothing else needed code-wise?

Nope. Hmm, try using one of the Addendum player character models.

15 hours ago, Flix said:

But the 42?

An object state, indeed. A binary flag sequence in decimal representation.

Link to comment

Приветствую тебя, Дмитрий ! Благодарю за твой труд. Мод действительно очень хорош. Но у меня есть одна проблема, один монстр слишком сильный и он встречается довольно часто, где есть нежить. Он называется "Мерзкий Осквернитель" (Чемпион/Нежить) - он в ближней бою убивает с нескольких ударов. Как его побеждать ? Играю за Стража Храма - щиты и защита очень прокачаны, но это ничего не даёт, он слишком сильно бьёт. Издалека убить можно, но в ближнем бою практически нереально. И здоровья у него не знаю сколько, но больше, чем у большинства других монстров типа чемпион. Помоги разобраться или пофиксить урон этого моба. Благодарю за твой ответ.

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

Greetings, Dmitry! Thank you for your work. The mod is really very good. But I have one problem, one monster is too strong and it is found quite often where there are undead. It is called the Vile Defiler (Champion/Undead) - it kills in melee with several hits. How to defeat him? I play as the Temple Guardian - the shields and defense are very pumped, but this does nothing, he hits too hard. You can kill from afar, but in close combat it is almost impossible. And I don’t know how much health he has, but more than most other champion-type monsters. Help to figure out or fix the damage of this mob. Thank you for your answer.

Edited by malkutus
  • Appreciation 1
Link to comment
5 hours ago, malkutus said:

The mod is really very good. But I have one problem, one monster is too strong and it is found quite often where there are undead. It is called the Vile Defiler (Champion/Undead) - it kills in melee with several hits.

Will look into it. Balance issue are bound to happen, since only the most basic testing has been performed.

Link to comment
On 5/22/2022 at 12:43 PM, dimitrius154 said:

Nope. Hmm, try using one of the Addendum player character models.

I was.  I discovered the problem today.  Daggers and axes are THR2, that's why none of my earlier tests were fruitful.

I like those new throwing axe models a lot, so I wasn't going to give up until they worked.  :D

Link to comment
6 hours ago, dimitrius154 said:

Oh, blast, should have mentioned that to you straight away... 

No problem. That being the case, I believe all the player THR1 and THR2 animations are swapped in your mod.  At least, the new Addendum THR1 animation entries seem tailored to a one-handed grip for axes and daggers, whereas THR2 has a finger-gripping animation suitable for potions and stars.

 

EDIT: Well the bad news is that stars use the same animations as daggers and axes (THR2). Only the potions use THR1.

Link to comment
8 hours ago, Flix said:

Well the bad news is that stars use the same animations as daggers and axes (THR2). Only the potions use THR1.

Hmm, my previous statement about no further code changes was false, as was my statement about throwing daggers and axes utilizing THR2. In fact, in Addendum's s2logic.dll:

SUBFAM_PRI_THROW_DAGGER - THR1 - Daggers, Axes

SUBFAM_PRI_THROW_STAR - THR2

SUBFAM_PRI_THROW_DRINK - THR2

That's what happens, when you leave a project for half-a-year. Starting to forget things.

Link to comment

This mod seems awesome. Having access to multiple overhaul mods adds so much replay value.

I love the changes to the transformation combat arts but I have a few questions.

  1. Do your attributes change when you transform?

  2. Do the skills still becomes mastered at 75?

  3. What skills do the alternate form specific combat arts use? I'm not sure if they are weapon or spell combat arts.

Link to comment

Cool, it all seems to work exactly how I was hoping for. I still wish I could tie the form to the equipped shrunken head. But that seems a bit of a stretch at the moment.

Thanks for answering my questions. I think I just have a couple more.

  1. What file had to be changed to make Fist Weapon Lore allow dual wielding?
  2. Do the extra skills and modifications for combat arts make the game to easy at later levels?

 

Link to comment
8 hours ago, JadeRabbit said:

tie the form to the equipped shrunken head

Hmm, that would mean, there's a Ker-worshipping Dryad in place. All Divine CA's are affected by the Veneration skill(changed the name from Devotion, since you can't upgrade your devotion. Unless you are a TV preacher.)

8 hours ago, JadeRabbit said:
  • What file had to be changed to make Fist Weapon Lore allow dual wielding?
  • Do the extra skills and modifications for combat arts make the game to easy at later levels?

1. S2logic.dll, the procedure controlling the weapon type dual-wielding availability.

2. Subjective, since the Addendum's balance is, as of now, unpolished. One of the reasons, it's still in the "beta" stage.

  • Thanks! 1
Link to comment
  • 3 weeks later...

Hey Dmitriy, seems like Addendum has the same bug as CM and EE, windu's mace (ID 3701) missing the final parameter for bonusgroup0.
Seems to not cause ingame issues, but messes with my lua tools and prob charon's modmerger as well.

EDIT bonusgroup1, not bonusgroup0

Edited by Lindor
  • Thanks! 1
Link to comment
  • 3 weeks later...
10 minutes ago, Lindor said:

Just found this. With my hashgenerator lua code I can do reverse engineering. The only loka ID syntax I know for quests though is "QUEST_"..questID.."_GIVER_START" (.. means concatenation of two strings). If you know other loka ID syntaxes and other unknown hashes I can do better reverse engineering. Actually I could even send you my code if you want to.

1956870315    QUEST_10_GIVER_START
3192585456    QUEST_15_GIVER_START
3977232761    no result, tested up to quest ID 20000
2120674270    no result, tested up to quest ID 20000
0121319022    no result, tested up to quest ID 20000

EDIT: Actually the last one was a scam, only no result because it had a 0 in the beginning. Corrected:

0121319022	QUEST_13_GIVER_START

 

Thanks! That pretty much confirms my hunch that those were just text fragments from non-existent quests, maybe some quests that were created as tests during development.  I scoured the vanilla quest.txt and only came up with 5 that were not restored by CM Patch:

  • Shadow "Unholy Crusade" -- now present in D2F.
  • Shadow "Plowshares to Swords" -- now present in D2F & PFP, will be in next EE release.
  • "Attack of the Undead" -- now present in D2F & PFP, will be in next EE release.
  • Shadow "Ghost Whisperings" -- not currently restored anywhere. I believe I can restore this one though. The devs left it out because they couldn't think of a way to "curse" the player, but I have at least two distinct ideas in mind. One is an item with a penalty, the other is to add an invisible, unattackable hireling with a hostile faction that will periodically debuff the player.  Cleansing the curse will disband the hireling.
  • Final phase of the High Elf's class quest was supposed to culminate in an assassination attempt, by Glydial D'Elfici, at least on the Shadow path. I don't remember seeing any text for this one though so I will probably leave it alone.

I believe I sent over a text file with the full list of Loka-ID's some time ago.

Link to comment
  • The title was changed to DIMITRIUS'S CM PATCH ADDENDUM - 2023
  • This topic was featured and unfeatured
  • The topic was featured

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up