|
-
Benutzer, die ihr Benutzerkonto per E-Mail bestätigen müssen
Slow Motion in Gothic 1
Hi,
bei Gothic 2 gibt es diesen Slow Motion Effekt wenn man Sumpfkraut oder schwarzes Erz benutzt. Ich könnte diesen Effekt für Gothic 1 gut gebrauchen. Er lässt sich nämlich auf für ein Zeitraffer einsetzen. Die Frage ist, ob die alte Engine das schon bringt?
In Gothic 2 steht in VisualFxInst.d
Code:
INSTANCE SLOW_TIME(CFx_Base_Proto)
{
// userstring 0: world time scaler
// userstring 1: player time scaler
visName_S = "time.slw";
userString[0] = "0.5";
userString[1] = "0.5";
emFXLifeSpan = 30; // achtung, zeitdauer ist hier skaliert mit dem time scaler
emFXTriggerDelay = 6; // achtung, zeitdauer ist hier skaliert mit dem time scaler
emFXCreate_S = "SLOW_TIME_CHILD";
emTrjOriginNode = "BIP01";
};
INSTANCE SLOW_TIME_CHILD(CFx_Base_Proto)
{
// userstring 0: world time scaler
// userstring 1: player time scaler
visName_S = "SMOKE_JOINT_SLOW_TIME";
emFXTriggerDelay = 6; // achtung, zeitdauer ist hier skaliert mit dem time scaler
sfxid = "MFX_Telekinesis_StartInvest";
sfxisambient = 1;
emFXCreate_S = "SLOW_TIME_CHILD2";
};
INSTANCE SLOW_TIME_CHILD2(CFx_Base_Proto)
{
// userstring 0: world time scaler
// userstring 1: player time scaler
emFXTriggerDelay = 6; // achtung, zeitdauer ist hier skaliert mit dem time scaler
emFXLifeSpan = 30; // achtung, zeitdauer ist hier skaliert mit dem time scaler
visName_S = "morph.fov";
userString[0] = "0.8";
userString[1] = "1.0";
userString[2] = "120";
userString[3] = "90";
};
In PfxInstMagic.d steht
Code:
INSTANCE SMOKE_JOINT_SLOW_TIME (C_PARTICLEFX)
{
ppsvalue = 300;
ppsscalekeys_s = "1 1 1";
ppsissmooth = 1;
ppsfps = 10;
shptype_s = "POINT";
shpfor_s = "object";
shpoffsetvec_s = "0 0 0";
shpdistribtype_s = "UNIFORM";
shpdim_s = "10";
shpmeshrender_b = 1;
shpscalekeys_s = "1";
shpscaleissmooth = 1;
dirmode_s = "RAND";
dirfor_s = "OBJECT";
dirmodetargetfor_s = "OBJECT";
dirmodetargetpos_s = "0 0 0";
dirangleheadvar = 180;
dirangleelevvar = 180;
velavg = 0.00999999978;
lsppartavg = 2000;
lsppartvar = 100;
flygravity_s = "0 0 0";
visname_s = "HEAVENLIGHT.TGA";
visorientation_s = "VELO3D";
vistexanifps = 18;
vistexaniislooping = 1;
vistexcolorstart_s = "0 255 100";
vistexcolorend_s = "255 0 100";
vissizestart_s = "2 50";
vissizeendscale = 30;
visalphafunc_s = "ADD";
visalphastart = 150;
useemittersfor = 1;
};
In Gothic 1 habe ich den Code in VisualFxInst.d bzw. in PfXMagic.d kopiert. Die roten Stellen habe ich wegen unmittelbarer Fehlermeldungen auskommentiert. Der übliche Aufruf geschieht dann mit
Code:
Wld_PlayEffect("SLOW_MOTION", self, self, 0, 0, 0, FALSE);
Leider passiert absolut nichts. Liegt das an der Engine, oder lässt sich da etwas machen?
Edit: Übrigens könnte man in Mods den Slow-Motion-Effekt dramaturgisch verwerten, beim Tod von Bossgegnern oder wenn der Held stirbt. Ist nur so eine Idee. Mir geht es wie gesagt um Zeitraffer.
Edit2: Die Sache hat sich im Wesentlichen erledigt. Ich habe eine andere Lösung gefunden.
Geändert von Walter Faber (07.08.2010 um 11:16 Uhr)
-
Lehrling
Hi, wie hast du es geschafft, dieses Problem zu lösen?
-
Walter Fabers letzter post war in 2013, ist unwahrscheinlich das er diesen thread sieht.
Sektenspinner hatte mal eine Skriptlösung gepostet um Zeit schneller oder langsamer verstreichen zu lassen, möglicherweise funktioniert das auch in Gothic 1:
https://forum.worldofplayers.de/foru...1#post14841249
-
Lehrling
Mit dieser Funktion können Sie nur die Geschwindigkeit der Änderung der Tageszeit ändern, aber die Geschwindigkeit der Zeichen ändert sich nicht. Ich muss die Zeit verlangsamen, wenn ich in Gothic 2 einen Bogner rauche. Ich bin auch an der Wirkung interessiert, den Bildschirm zu verzerren, der beim Tauchen und im zweiten Gothic beim Rauchen und Kommunizieren mit den Suchenden gespielt wird.
-
Tut mir leid das ich dir eine komplett unbrauchbare Antwort gegeben habe, ich hatte den post falsch verstanden.
In Gothic 1 funktioniert der cheat (F2):
Code:
ztimer multiplier 0.2
Es gibt also definitiv die Möglichkeit das Spiel in slow motion ablaufen zu lassen.
Wo man das skriptseitig aktivieren und deaktivieren könnte weiß ich nicht.
I am sorry for giving you a completely unhelpful answer, i misunderstood that post.
In Gothic 1 the cheat(F2):
Code:
ztimer multiplier 0.2
does work.
So there definitely is a way to have the game play out in slow motion.
How to activate and deactivate this with script commands, i do not know.
edit:
Ikarus Engineclasses:
Code:
class zCTimer {
var int factorMotion; //zREAL //nicht zu klein machen. Sonst: Freeze bei hoher Framerate!
maybe this?
Geändert von Cryp18Struct (19.10.2018 um 21:05 Uhr)
-
G1 Slow Motion ?
This would be something that's definitely interesting for me as well
Besides 'zTimer multiplier f' console command there are 3 cheat codes, which are also affecting game time. First 2 are basically doing same thing as zTimer multiplier. You can activate these same way as Marvin, hit B and type:
SOUTHPARK - everything will be fast
CLERKS - everything will be slow
But here comes something I would like to understand how it works within engine:
HIGHLANDER - NPC in your focus becomes faster than any other NPC !
I would like to use same principle - but instead of speeding up NPC I would like to slow it down. So player would be able to freeze NPC in time by a spell for example.
You can play around with this to get some interesting behavior:B MARVIN Press 'O' to control any NPC Turn your controlled NPC so it would have HERO in focus B HIGHLANDER - this will speed up hero Press 'O' to control HERO F2 console command zTimer Multiplier 0.5 - hero is now moving a little bit faster than normally, while every other NPC in the world is moving 1/2 normal speed
But question is - how does this work, is someone able to find out what this HIGHLANDER cheat code is doing using IDA ?
(I've never used it actually )
Geändert von F a w k e s (19.10.2018 um 21:58 Uhr)
-
HIGHLANDER: focus->GetModel()->SetTimeScale(3.0f);
EOWYN: focus->GetModel()->SetTimeScale(0.4f);
SOUTHPARK: ztimer.SetMotionFactor(3.0f);
CLERKS: ztimer.SetMotionFactor(0.4f);
ZTIMER MULTIPLIER: ztimer.SetMotionFactor(PickWord(3))
ZTIMER REALTIME: ztimer.SetMotionFactor(1.0f)
oCVisualFX::SetVisualByString (G2!): if (visName_S.Search(".SLW")!=-1) { ztimer.SetMotionFactor(userString[0]); origin->GetModel()->SetTimeScale(userString[1] / ztimer.GetMotionFactor()) }
Ich gehe aber davon aus, dass einiges davon nicht konsistent in G1 funktionieren wird (z.B. Spieler benutzt MOB), da die korrekte Behandlung der zeitskalierenden Effekte erst in G2 implementiert wurde.
"Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
Geändert von NicoDE (22.10.2018 um 08:27 Uhr)
-
Geändert von F a w k e s (25.10.2018 um 15:26 Uhr)
-
Zitat von F a w k e s
I couldn't find an address of this function SetTimeScale
There seems to be no one (at least in the Player-Kit 1.08k).
Very likely because the getter/setter is implemented in the header and has always been inlined.
Like in HandleResultString:
Code:
.text:004313B0 @@CLERKS:
.text:004313B0 cmp edi, 68160
.text:004313B6 jnz short @@EOWYN
.text:004313B8 test esi, esi
.text:004313BA mov zCTimer ztimer, 0.40000001
.text:004313C4 jz loc_00432171
.text:004313CA lea ecx, [esp+0CCh+var_B9]
.text:004313CE push ecx
.text:004313CF push offset `string' ; "CLERKS"
.text:004313D4 lea ecx, [esp+0D4h+var_B4]
.text:004313D8 call std::string::string(char const *,std::allocator<char> const &)
.text:004313DD mov [esp+0CCh+var_B8], ebp
.text:004313E1 mov byte ptr [esp+0CCh+var_4], 30h
.text:004313E9 jmp @@view_PrintTimed
.text:004313EE @@EOWYN:
.text:004313EE cmp edi, 50112
.text:004313F4 jnz @@HIGHLANDER
.text:004313FA mov ecx, [esp+0CCh+focus]
.text:004313FE test ecx, ecx
.text:00431400 jz loc_00432171
.text:00431406 call oCNpc::GetModel(void)
.text:0043140B test esi, esi
.text:0043140D mov dword ptr [eax+1D0h], 0.40000001
zCModel.timeScale directly follows the model flags (isVisible, isFlying, ...). For 2.6 only the field offset differs:
Code:
.text:00433E48 call oCNpc::GetModel(void)
.text:00433E4D test esi, esi
.text:00433E4F mov dword ptr [eax+1FCh], 0.40000001
"Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
-
G1 NPC_SetTimeScale
Hi NicoDE,
Brilliant stuff! Thank you
To be honest ... I have no idea what above assembler functions are doing lol, but kind of guessed that this is what I have to do:
Code:
FUNC INT oCNPC_GetModel (var C_NPC npc)
{
//00695300 .text Debug data ?GetModel@oCNpc@@QAEPAVzCModel@@XZ
const int oCNPC__GetModel = 6902528;
CALL__Thiscall(_@(npc), oCNPC__GetModel);
return CALL_RetValAsInt();
};
FUNC VOID NPC_SetTimeScale (var C_NPC npc, var int f)
{
var int ptr; ptr = oCNPC_GetModel (npc);
//1D0h = 464
MEM_WriteInt (ptr + 464, f);
};
var int f;
f = divf (mkf (4), mkf (10));
var C_NPC Diego;
Diego = Hlp_GetNPC (PC_THIEF);
NPC_SetTimeScale (Diego, f);
And it works!!
-
Combination of both - everyone is slow, player slightly slower than normally ... however behavior is super weird, I am able to run away from camera !
Code:
FUNC VOID Use_Joint ()
{
if (NPC_IsPlayer (self) == TRUE)
{
var int f;
f = divf (mkf (2), mkf (10)); //Slow down everything 5 times
zCTimer_SetMotionFactor (f);
f = mkf (5); //Increase hero's speed 5 times
NPC_SetTimeScale (hero, f);
};
};
Geändert von F a w k e s (27.10.2018 um 21:31 Uhr)
-
G1 Slow Motion !
Video quality is sh*te, but still wanted to show how it looks in action
https://youtu.be/nX7RqgjcE8Q
-
Thank you for the video!
I think the strange camera is somewhat appropriate for being high on swampweed
-
-
G1 Slow Motion !
Hello folks,
I was almost able to achieve what I was looking for:
- Hero's turning speed is increased.
- Camera moves with hero - it's pinpointed to his back. However if camera crashes with any obstacle - it is turning like crazy.
https://youtu.be/-M85U80XqK0
Code:
//00607640 .text Debug data ?SetMotionFactor@zCTimer@@QAEXM@Z
const int zCTimer__SetMotionFactor = 6321728;
FUNC VOID zCTimer_SetMotionFactor (var int f)
{
CALL_IntParam (f);
CALL__thiscall (MEMINT_zTimer_Address, zCTimer__SetMotionFactor);
};
FUNC VOID NPC_SetTimeScale (var C_NPC npc, var int f)
{
if (!Hlp_IsValidNPC (npc)) { return; };
var int ptr; ptr = oCNPC_GetModel (npc);
if (ptr)
{
//1D0h = 464
MEM_WriteInt (ptr + 464, f);
};
};
/*
Converted to G1 from SektenSpinner's function:
https://forum.worldofplayers.de/forum/threads/879891-Skriptpaket-Ikarus-2/page13?p=14886885#post14886885
Increases hero's turning speed. (Default for G1 0.1)
*/
FUNC VOID PC_SetTurnSpeed (var int f)
{
//G1
//007D1110 .rdata Debug data __real@3dcccccd
const int G1_HeroTurnSpeedAdr = 8196368;
MemoryProtectionOverride (G1_HeroTurnSpeedAdr, 4);
MEM_WriteInt (G1_HeroTurnSpeedAdr, f);
};
...
/*
I am calling this code with each frame:
1. oCGame__SwitchCamToNextNpc - switches to available NextNPC - and somehow reset's camera position.
2. zCAICamera__SetTarget - switches camera Target back to hero.
Pros:
This combo pinpoints camera to hero - so camera is always behind heros back
Cons:
You cannot turn camera vertically, it only turns left and right.
If camera collides with any object - it will go crazy - it will be turning angles insanely :-O
*/
FUNC VOID FRAME_FUNC ()
{
if (Timer_SlowMo_Potion > 0)
{
Timer_SlowMo_Potion -= 1;
//Turn Off SlowMo effect
if (Timer_SlowMo_Potion == 0)
{
//float 1 default Motion factor for G1, zTimer Multiplier 1
zCTimer_SetMotionFactor (mkf (1));
//float 1 is default for G1
NPC_SetTimeScale (hero, mkf (1));
//float 0.1 - default for G1
PC_SetTurnSpeed (divf (mkf (1), mkf (10)));
} else
{
/*** Put camera behind heros back ***/
//Switches camera to next available active NPC, and puts camera behind its back
//0065EDD0 .text Debug data ?SwitchCamToNextNpc@oCGame@@QAEXXZ
const int oCGame__SwitchCamToNextNpc = 6680016;
CALL__thiscall (_@(MEM_Game), oCGame__SwitchCamToNextNpc);
//Get current Camera AI
var int aiCam;
aiCam = MEM_ReadInt (zCAICamera__current);
//Switch camera target to hero
//00499BC0 .text Debug data ?SetTarget@zCAICamera@@QAEXPAVzCVob@@@Z
const int zCAICamera__SetTarget = 4824000;
CALL_PtrParam (MEM_InstToPtr (hero));
CALL__thiscall (aiCam, zCAICamera__SetTarget);
};
};
};
...
/*
Called when hero drinks SlowMo_Potion
*/
FUNC VOID Drink_SlowMo_Potion ()
{
if (NPC_IsPlayer (self))
{
//Slow down everything 10 times
f = divf (mkf (1), mkf (10));
zCTimer_SetMotionFactor (f);
//Increase hero's speed 10 times
f = mkf (10);
NPC_SetTimeScale (hero, f);
//Increase hero's turning speed
PC_SetTurnSpeed (FLOATEINS);
Timer_SlowMo_Potion = 80;
};
};
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|