Skip to content

Commit

Permalink
Script_ModMe: Warn about write restrictions with Program Files
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeto committed Dec 5, 2024
1 parent bb7ab49 commit 1491f34
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/Scripts/Script_ModMe/docs/docs/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Fortunately Gothic 3 contains code to recalculate these properties, which can be
First you have to create the directory `_compiledMesh` in the Gothic 3 data directory, and within `_compiledMesh` another directory named `FixMe`.
Now Gothic 3 recalculates the above mentioned properties for all `.xcmsh`s in the `FixMe` directory on startup, when reaching the main menu. For each of the meshes, a version repaired in this way is stored in the 'FixMe' directory.

!!! caution "Attention"
To write the fixed `.xcmhsh`s, Gothic 3 needs write access to its installation directory.
Therefore, move Gothic 3 to a folder without write restrictions, i.e. outside of `Program Files`, or run the game as administrator.

# Repair animated meshes
Animated meshes (.xact), called eCResourceAnimationActor_PS within the engine, are structured as follows:
```cpp
Expand Down Expand Up @@ -64,11 +68,19 @@ Fortunately, Gothic 3 contains code to recalculate the AmbientOcclusion of an ac
First you have to create the directory `_compiledAnimation` in the Gothic 3 data directory, and within `_compiledAnimation` another directory named `FixMe`.
Now Gothic 3 recalculates the AmbientOcclusion for all `.xact`s in the `FixMe` directory on startup, more precisely when reaching the main menu. For each of the meshes, a version repaired in this way is stored in the `FixMe` directory.

!!! caution "Attention"
To write the fixed `.xact`s, Gothic 3 needs write access to its installation directory.
Therefore, move Gothic 3 to a folder without write restrictions, i.e. outside of `Program Files`, or run the game as administrator.

# Automatic scaling of Convex-CollisionMeshes
When converting a CollisionShape to the physics engine PhsyX used by Gothic 3, it is scaled with the scaling factors of its entity.
Strangely though, the code responsible for this is duplicated. Even worse, the two versions subtly differ from each other - details will follow.
For Triangle-/Convex-CollisionShapes, if required, i.e. if no correspondingly scaled version exists yet, one will be created and stored in `_compiledPhysic`. So much for the theory, but if you look closely you can see that in one of the two versions there is no automatic scaling for Convex-CollisionShapes. Even the log messages are the same. But instead of checking if an unscaled CollisionShape exists in the absence of a scaled version, it simply directly assumes that it does not and issues an error message.
This inconsistency has been removed; now scaled versions are created for Convex-CollisionShape if required.

!!! caution "Attention"
To write the scaled collision mmeshes, Gothic 3 needs write access to its installation directory.
Therefore, move Gothic 3 to a folder without write restrictions, i.e. outside of `Program Files`, or run the game as administrator.

# Box-CollisionShapes and unevenly scaled entities
The PhsyX conversion function was not able to convert Box-CollisionShapes correctly if the corresponding entity was not scaled uniformly, i.e. had different scales on X-axis, Y-axis and Z-axis. This limitation has been fixed.

0 comments on commit 1491f34

Please sign in to comment.