Jump to content

NEW Project: Sacred 2 Purist Fixpack


Flix

Recommended Posts

3 hours ago, Flix said:

Uh oh, if it's affecting NPC's too, then it's not a texture problem.  Do you still have PFP s2render.dll removed from your install?

I do. Happens even with the vanilla s2render.dll

But it must have something to do with how textures react to light. Just compare the 2 screenshots side by side. In vanilla, everything is a bit more bright, compared to the PFP, which is slightly muted in comparison. From characters through ground to random objects, everything has a slightly different hue.

Although it is probably a couple of seconds of time difference. I think the High Elf campaign starts at dawn so a couple of seconds of difference could be the cause of the slightly different hue. Ignore the above.

 

EDIT:

The good old brute force method revealed the culprit file. It's surface.txt in the client scripts. Upon restoring that one to the vanilla, it looks as it should.

Scanning through the file indeed seems like it's related to texture properties and surface definitions.

Comparing the 2 files shows that the vast majority of differences were done by adding additional surface flags to a ton of entries. In the vast majority of cases, the added surface flag is SURFACE_FLAG_DOUBLESIDED (almost all the changes are just adding this flag to a surface, compared to vanilla). Might be the cause of the issue.

 

EDIT 2:

Yes, that's it. Tried removing the DOUBLESIDED flag for the default High Elf surfaces and voila, it's back to looking as it should. It seems like this flag has been added to pretty much any surface that did not have it for some reason. The comparison software showed 10 261 differences, with probably 99% of them being the addition of this flag. Other than that, also spotted a very minor number of a couple of other flag edits/additions/deletions here and there (didn't seem relevant) and there are also 2 extra object definitions at the start in the PFP file compared to vanilla ("obj_d_s_b_lava" and "obj_d_s_b_mtllava").

But the problem is the DOUBLESIDED flag. I assume it affects how surfaces cast shadows or something, which causes the weird line effect in game.

Was this file taken over from the CM Patch? Can't remember if it was happening there too.

Edited by idbeholdME
Link to comment
4 hours ago, idbeholdME said:

Was this file taken over from the CM Patch? Can't remember if it was happening there too.

Nope, the application of the flag "en masse" was taken from the more recent Addendum releases.  Originally I applied this flag selectively in earlier EE releases whenever I noticed how this would fix things like equipment appearing transparent when viewed from one side. 

That was so damn time consuming to copy all those flags over, and now I must undo them.  I'm going to start with just the player characters.   Thanks for your help in pinpointing the cause.

its-always-sunny-in-philadelphia-migrain

 

 

@dimitrius154  You might want to be aware of the last few posts here, unless you've taken some other step to alleviate the problem with the doublesided flag in Addendum.

 

 

 

  • Like! 1
Link to comment
6 hours ago, dimitrius154 said:

try adding:

render = {
    autoCollectRadius = 230,
    shadowMapDepthBias = 0.004,
}

to scripts\optionsDefault.txt.

The entire affair has to do with the shadow application in Sacred 2 engine. Perhaps, going for lower shadow quality is optimal. 

That seems to alleviate the problem to become unnoticable.

Thanks for sharing.

 

highelf_new.thumb.png.4afa6a9bbeebf55d61ab0fd0b138f00f.png

Link to comment
10 hours ago, Flix said:

Nope, the application of the flag "en masse" was taken from the more recent Addendum releases.  Originally I applied this flag selectively in earlier EE releases whenever I noticed how this would fix things like equipment appearing transparent when viewed from one side. 

That was so damn time consuming to copy all those flags over, and now I must undo them.  I'm going to start with just the player characters.   Thanks for your help in pinpointing the cause.

It does seem to mostly be visible on the base character models. The effect is much less pronounced when it comes to armor pieces.

So just removing it from the base character models should be sufficient for now, as an immediate fix.

I'd leave the rest, like the NPCs, for later.

 

57 minutes ago, Vishanka said:

What was the doublesided flag added for if I may ask? Just curious.

As Flix said:

Originally I applied this flag selectively in earlier EE releases whenever I noticed how this would fix things like equipment appearing transparent when viewed from one side

Edited by idbeholdME
Link to comment
4 minutes ago, idbeholdME said:

Originally I applied this flag selectively in earlier EE releases whenever I noticed how this would fix things like equipment appearing transparent when viewed from one side

Thanks, I missed that. :bow:

Link to comment
13 hours ago, Flix said:

Nope, the application of the flag "en masse" was taken from the more recent Addendum releases.

(...) 

That was so damn time consuming to copy all those flags over, and now I must undo them.

In those kinds of cases I can always help with a script. Selectively comparing and replacing only a single property of two defineclasses, like the doublesided flags from PFP to EE surfaces, is super easy to do with lua. I mean it won't be necessary thx to Dmitriys awesome help, but for future:wink:

Link to comment
53 minutes ago, Lindor said:

I mean it won't be necessary thx to Dmitriys awesome help, but for future:wink:

Perhaps, going for lower shadow quality is optimal.

What about this though? Wouldn't it be better to fix it instead of sacrificing shadow quality for it?

Link to comment
Just now, idbeholdME said:

What about this though? Wouldn't it be better to fix it instead of sacrificing shadow quality for it?

you have to judge what's more important to you: good shadow quality or not having onesided transparent textures. I think best would be the option to choose. Or having both, but I don't know if that's possible.

Link to comment
6 minutes ago, Lindor said:

you have to judge what's more important to you: good shadow quality or not having onesided transparent textures. I think best would be the option to choose. Or having both, but I don't know if that's possible.

Personally, I'd just start removing the flag from stuff where it's noticeable. So for now, base character and NPC models. There is no need to remove the flag from everything where it's been added, just stuff that causes visible issues.

Edited by idbeholdME
Link to comment
23 minutes ago, idbeholdME said:

Wouldn't it be better to fix it instead of sacrificing shadow quality for it?

The deficiency is at the core level of the Sacred 2 graphics solution. Shadows have been a weak spot for 3D graphics engines for a very long time. Aside from downright buggy behaviour(Sacred 2 uses a transitional year 2007-2008 Granny 3D solution), the main problem is the FPS/eyecandy trade-off. 

Link to comment
17 minutes ago, dimitrius154 said:

The deficiency is at the core level of the Sacred 2 graphics solution. Shadows have been a weak spot for 3D graphics engines for a very long time. Aside from downright buggy behaviour(Sacred 2 uses a transitional year 2007-2008 Granny 3D solution), the main problem is the FPS/eyecandy trade-off. 

Oh, I didn't mean "fix" as in fix the way the game renders shadows. I mean fix as in just removing the flag for surfaces where it causes issues.

I am not sure what the workaround you posted above does exactly, but the mention about "lower quality shadows" had me worried that it would lead to a needless quality loss.

Link to comment
22 minutes ago, dimitrius154 said:

Shadows have been a weak spot for 3D graphics engines for a very long time. (...) the main problem is the FPS/eyecandy trade-off. 

I wonder why that is. Raytracing seems like such an obvious solution to me. Why did no one implement it? Is it really that calculation heavy?:lindor:

Also I wonder wether it's possible to change/implement new rendering algorithms into Sacred 2? The best would be to go completely away from granny and use smth blender-friendly instead, so that the modeling can be done by a wider array of modders.

Link to comment

@Flix (and to everyone else interested): I have done the algorithms. From what my program says, there are only five surfaces in PFP which have the additional doublesided flag compared to EE 3.1. The Program removed them. You can insert them manually into PFP or use my inserter:

Spoiler

newSurface = {
  name         = "he-diamond-torso-mtl-var3_n",
  texture0Name = "maps/heroes/highelve/sets/diamond/i_helve-diamond-torso-var3_d.tga",
  texture1Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_h.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_mtl,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var1_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var1_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var1_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var2_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var2_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var2_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var3_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var3_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var3_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

 

Also let me ask you: only five entries does not seem to be such a super heavy abuse as you mentioned? Is it because EE 3.1 already has the heavy DOUBLESIDED flag abuse? If that is the case, then to which version of EE should I go back?

BTW there are no PFP entries that are not also present in EE 3.1, no need to worry about that. If so, my program would've extracted them for manual checking.

Link to comment
1 hour ago, Lindor said:

@Flix (and to everyone else interested): I have done the algorithms. From what my program says, there are only five surfaces in PFP which have the additional doublesided flag compared to EE 3.1. The Program removed them. You can insert them manually into PFP or use my inserter:

  Reveal hidden contents




newSurface = {
  name         = "he-diamond-torso-mtl-var3_n",
  texture0Name = "maps/heroes/highelve/sets/diamond/i_helve-diamond-torso-var3_d.tga",
  texture1Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/diamond/n_helve-diamond-torso_h.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_mtl,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var1_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var1_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var1_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var2_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var2_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var2_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx-var3_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var3_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/i_helve-pearl-torso-var3_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

newSurface = {
  name         = "helve-pearl-torso-fx_a",
  texture0Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_d.tga",
  texture1Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_n.tga",
  texture3Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-torso_hx.tga",
  flags        = SURFACE_FLAG_OPAQUE ,
  shader       = obj_d_s_b_skin,
}
mgr.surfCreate(newSurface);

 

Also let me ask you: only five entries does not seem to be such a super heavy abuse as you mentioned? Is it because EE 3.1 already has the heavy DOUBLESIDED flag abuse? If that is the case, then to which version of EE should I go back?

BTW there are no PFP entries that are not also present in EE 3.1, no need to worry about that. If so, my program would've extracted them for manual checking.

You are an outright LUA magician :D 

This should make it much easier on Flix. For reference, try running it on the vanilla surface.txt vs the one from PFP to see just how many surfaces had that flag added. But if Flix has a surface.txt from EE version on hand before the flag was slapped on everything, then your program will be a life saver.

And the image for the program download mad me laugh out loud. LUA LUA LUA LUA LUA.

Edited by idbeholdME
  • Like! 1
Link to comment
33 minutes ago, idbeholdME said:

For reference, try running it on the vanilla surface.txt vs the one from PFP to see just how many surfaces had that flag added.

MANY!

5194 on comparing PFP with CM 1.60 :lol: For reference, there is a total of 10883 surfaces in PFP defined.

34 minutes ago, idbeholdME said:

And the image for the program download mad me laugh out loud. LUA LUA LUA LUA LUA.

Lua-Logo.svg

:D

 

 

No serious, it's the thumbnail I usually slap on all my lua programs xD But I worked on a new one the last hour, it now shows what the program does in a decision diagram. Honestly, it was just an excuse for not working on my textures:D

Link to comment

CM Patch 1.60 is a decent baseline for comparison.  To my knowledge the doublesided flag was never used as a fix until after that point.  It's been used in EE selectively since 2.0, and 3.0 saw the massive introduction.  I keep all previous versions backed up going back to the first beta, so I should find some use for the tool.

EE and PFP are currently neck and neck in terms of fixes.  D2F is a few versions behind.  Every time I try to work on it the other two projects call my attention instead.

Link to comment
8 hours ago, Lindor said:

I wonder why that is. Raytracing seems like such an obvious solution to me. Why did no one implement it? Is it really that calculation heavy?

Ray tracing seems indeed THAT calculation heavy, compared to rasterization the games typically use. And according to https://www.techcenturion.com/ray-tracing#:~:text=Ray casting is a computational,use the ray casting technique. it's existing solutions are still restricted to a specific group of NVIDIA videocard models.

 

8 hours ago, Lindor said:

Also I wonder wether it's possible to change/implement new rendering algorithms into Sacred 2?

That would require to completely rewrite and recompile s2render.dll. The Sacred 2 source code was lost in 2009, I believe.

Link to comment

A couple of new things:

1) Elite Brigand Leader's AI is buggy. He has both a bow and sword available. However, any time he pulls out a bow, he behaves like if he had a melee weapon. Meaning that instead of shooting you at range, he always runs into melee range and swaps to a sword mid-swing. After this happens, only then does he occasionally start to shoot you. Although making him shoot at all is extremely hard as 99% of the time, he just prefers chasing you with the sword after that first buggy attack.

It's this guy:

brigand.thumb.jpg.5790b1e8113103a1b1737370d7f53f9b.jpg

 

2) Currently playing voice lines get cancelled when you use a Combat Art. They only continue playing when using basic attacks. Was that always the case?

And if so, would it be possible to somehow prevent the game from interrupting voice lines at all? Would be great if they could continue playing normally, regardless of whether you are using a CA or basic attack.

 

EDIT:

Besides the general combat taunts and race specific ones (there is quite a lot of them), all the characters also have unique things to say at many moments in the campaign (both Light and Shadow) and you can easily skip them if you aren't careful in situations where a fight starts immediately after a conversation or such.

It seems like the grunts the character makes during various CAs count as a voice line and cancel out the regular voice line already playing as only one can be playing at a time.

But let me say again, I am not sure whether this is because of the PFP or it's how the game always was. Just something I noticed happening quite a lot, especially once you get your CA cooldowns very low.

Edited by idbeholdME
Link to comment
1 hour ago, idbeholdME said:

Elite Brigand Leader's AI is buggy.

It's probably due to how most elites have a hard hit attack, but the fightdistance for hard hit it set to melee range, so first they move into melee range, then their AI kicks in triggering them to switch to a melee weapon since they're now in range.

 

1 hour ago, idbeholdME said:

Currently playing voice lines get cancelled when you use a Combat Art. They only continue playing when using basic attacks. Was that always the case?

And if so, would it be possible to somehow prevent the game from interrupting voice lines at all? Would be great if they could continue playing normally, regardless of whether you are using a CA or basic attack

@dimitrius154  Do you think the above could be due to the SHOUT parameters being added to player combat arts?

Link to comment
2 hours ago, idbeholdME said:

It seems like the grunts the character makes during various CAs count as a voice line and cancel out the regular voice line already playing as only one can be playing at a time.

Yeah I'm pretty sure the situation is this: those combat shouts were bugged and never present before, now they work in PFP and count as voiced lines.  Your character isn't going to be able to say two things at once. 

EDIT: I might be able to change the shout volumegroup assignment in soundresources.txt so it doesn't overlap with the voiced quest dialogue.  We'll see.

  • Like! 1
Link to comment

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