Infinite stamina and open-desert exploration

Started by Knightmare, May 13, 2012, 10:42:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Knightmare

I found the trick to FC2's desert fatigue and pass-out effect.  This little section in gamemodesconfig.xml shows that it's the draining of stamina that triggers the player to pass out:

<StaminaDesertDrainFilters RadiusKill="30">
   <Level Min="0" Max="0" Filter="desert_collapse" />
   <Level Min="1" Max="29" Filter="desert_heavy" />
   <Level Min="30" Max="64" Filter="desert_medium" />
   <Level Min="65" Max="99" Filter="desert_light" />
</StaminaDesertDrainFilters>

So the key to open up the desert is to disable stamina drain.

This section under DefaultCounterService in the same file sets the curves for stamina drain:

<Stamina
   Max="Curves.PlayerSicknessCurves.StaminaMax"
   ActionThreshold="Curves.PlayerSicknessCurves.StaminaSprintThreshold"
   NearZeroFX="Curves.PlayerSicknessCurves.StaminaNearZeroFX"
   RegenRate="Curves.PlayerSicknessCurves.StaminaRegenRate"
   SprintDrain="Curves.PlayerSicknessCurves.StaminaSprintDrain"
   LowDrain="Curves.PlayerSicknessCurves.StaminaLowDrain"
   HighDrain="Curves.PlayerSicknessCurves.StaminaHighDrain"
   SwimDrain="Curves.PlayerSicknessCurves.StaminaSprintDrain"
   DrownHealthDrain="Curves.PlayerSicknessCurves.HealthDrownRate"
   JumpDrain="Curves.PlayerSicknessCurves.StaminaJumpDrain"
/>

What's needed is to replace those curves for lowdrain, highdrain, sprint, etc. with a zero-value curve.  These curves are defined in 05_Curves.xml.  So copy it into your mymod/patch folder, and add it to patch.xml.  Open it up and paste this definition for a zero-curve right before the last /object tag:
Spoiler

  <object hash="256A1FF9"> <!-- Knightmare added -->
    <value name="Name" type="String">PlayerSicknessCurves.StaminaNoDrain</value>
    <object type="Entity">
      <value name="hidName" type="String">Curves.PlayerSicknessCurves.StaminaNoDrain</value>
      <value name="disEntityId" type="UInt64">236</value>
      <value hash="D2B3429E" type="String">CCurve</value>
      <value name="hidEntityClass" type="Hash">68745CCF</value>
      <object type="curveCurve">
        <value name="hidNumKnots" type="UInt32">2</value>
        <object type="Knots">
          <object type="Knot">
            <value name="Value" type="Vector4">
              <x>0</x>
              <y>0</y>
              <z>0.5</z>
              <w>0</w>
            </value>
            <value name="Info" type="Vector4">
              <x>6.2832</x>
              <y>1</y>
              <z>0</z>
              <w>0</w>
            </value>
            <value name="Type" type="UInt32">0</value>
          </object>
          <object type="Knot">
            <value name="Value" type="Vector4">
              <x>5</x>
              <y>0</y>
              <z>0.5</z>
              <w>0</w>
            </value>
            <value name="Info" type="Vector4">
              <x>6.2832</x>
              <y>1</y>
              <z>0</z>
              <w>0</w>
            </value>
            <value name="Type" type="UInt32">0</value>
          </object>
        </object>
      </object>
    </object>
  </object> <!-- end Knightmare -->

Now go back into gamemodesconfig.xml, comment out that stamina section, and paste this after it:

<Stamina
   Max="Curves.PlayerSicknessCurves.StaminaMax"
   ActionThreshold="Curves.PlayerSicknessCurves.StaminaSprintThreshold"
   NearZeroFX="Curves.PlayerSicknessCurves.StaminaNearZeroFX"
   RegenRate="Curves.PlayerSicknessCurves.StaminaRegenRate"
   SprintDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   LowDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   HighDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   SwimDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   DrownHealthDrain="Curves.PlayerSicknessCurves.HealthDrownRate"
   JumpDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
/>

Build your patch as usual, and have fun exploring the desert and running without fatigue!  Just don't go off the edge of the map, or you'll get stuck ;)

Alternately, if you just want to increase the player's endurance for running, you can edit the curves.  Find PlayerSicknessCurves.StaminaSprintDrain in 05_Curves.xml and change the y values of -10 to something closer to zero:
Spoiler

  <object hash="256A1FF9">
    <value name="Name" type="String">PlayerSicknessCurves.StaminaSprintDrain</value>
    <object type="Entity">
      <value name="hidName" type="String">Curves.PlayerSicknessCurves.StaminaSprintDrain</value>
      <value name="disEntityId" type="UInt64">187</value>
      <value hash="D2B3429E" type="String">CCurve</value>
      <value name="hidEntityClass" type="Hash">68745CCF</value>
      <object type="curveCurve">
        <value name="hidNumKnots" type="UInt32">2</value>
        <object type="Knots">
          <object type="Knot">
            <value name="Value" type="Vector4">
              <x>0</x>
              <y>-10</y> <!-- edit here to extend sprint endurace -->
              <z>0.5</z>
              <w>0</w>
            </value>
            <value name="Info" type="Vector4">
              <x>6.2832</x>
              <y>1</y>
              <z>0</z>
              <w>0</w>
            </value>
            <value name="Type" type="UInt32">0</value>
          </object>
          <object type="Knot">
            <value name="Value" type="Vector4">
              <x>5</x>
              <y>-10</y> <!-- edit here to extend sprint endurace -->
              <z>0.5</z>
              <w>0</w>
            </value>
            <value name="Info" type="Vector4">
              <x>6.2832</x>
              <y>1</y>
              <z>0</z>
              <w>0</w>
            </value>
            <value name="Type" type="UInt32">0</value>
          </object>
        </object>
      </object>
    </object>
  </object>

nexor

Quote from: Knightmare on May 13, 2012, 10:42:41 AM
Alternately, if you just want to increase the player's endurance for running, you can edit the curves. 

I like this one for sure, thanks Knightmare   :-))

PZ

Outstanding w@&k, Knightmare, kudos  :-X

By chance, have you tried going south to Bowa before the normal transition using your modification?

As I read your description, I was wondering if you could go south at any time during the game.  That would be ultra cool.

PZ

UPDATE:  I modified the files as Knightmare specified and immediately went south.  You know the point where the map changes from Leboa to Bowa? ... the point where the screen blanks and the game switches maps?  We can now go past that area without triggering the map change.  However there is a limit to how far you can go - you can see the edge of the world, and if you pass it, you become stuck as Knightmare indicated.

Now we can explore much more of the desert than ever before, and an added benefit is that we don't become fatigued as we run.  :-X

Knightmare

I did some more experimentation, and found that you need only change the LowDrain and HighDrain values in the stamina section to remove the desert fatigue.  You can still pass out if you over-exert yourself by running or jumping too much in the desert, which maintains some realism.  But stamina now regenerates when in the desert, so you won't pass out by default.  Here's the updated section in gamemodesconfig:

<Stamina
   Max="Curves.PlayerSicknessCurves.StaminaMax"
   ActionThreshold="Curves.PlayerSicknessCurves.StaminaSprintThreshold"
   NearZeroFX="Curves.PlayerSicknessCurves.StaminaNearZeroFX"
   RegenRate="Curves.PlayerSicknessCurves.StaminaRegenRate"
   SprintDrain="Curves.PlayerSicknessCurves.StaminaSprintDrain"
   LowDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   HighDrain="Curves.PlayerSicknessCurves.StaminaNoDrain"
   SwimDrain="Curves.PlayerSicknessCurves.StaminaSprintDrain"
   DrownHealthDrain="Curves.PlayerSicknessCurves.HealthDrownRate"
   JumpDrain="Curves.PlayerSicknessCurves.StaminaJumpDrain"
/>

Leaving this change in might break the opening "Escape from Pala" section of the game, I'll need to test this there.

Art Blade

very interesting :) thanks and.. slap on the back  :-() :-X
[titlebar]Vision without action is a daydream. Action without vision is a nightmare.[/titlebar]What doesn't kill us, makes us weirder.

Knightmare

Nope, it didn't break the opening section in Pala.  You still pass out when you get too far from town.

PZ

Another good one, Knightmare  :-X ;)  Kudos

Tags:
🡱 🡳

Similar topics (1)