Author Topic: View Bobbing in First Person (Addon?)  (Read 1480 times)

I don't know why I never noticed View Bobbing isn't in Blockland.

Incase you don't know what view bobing is, here is an example:
https://www.youtube.com/watch?v=g_XmByqVU1I
Its an example of Minecraft with view bobbing on/off.


I think it would be a nice addition, if it can be made.
Hopefully clientsided.


There was already a recent topic on this.
Yea but that version was done in a sort of hacky way, aside from that its really buggy.


I'm sure someone may be able to figure out how to implement it without it having that many problems.
Given with time that is.

Yea but that version was done in a sort of hacky way, aside from that its really buggy.

Not really hacky, and buggy only because they managed to find the absolute oldest version of it that existed.

Not really hacky, and buggy only because they managed to find the absolute oldest version of it that existed.
Well that explains much, I just feel this should of been implemented into the game, even though in all the years I have played Blockland I never noticed it not being there.

But now when I play all the other games like Gmod, Minecraft, TF2, CS:GO, ect, I began to notice the lack of view bobbing even more.

Nothing that I can't ignore, but It would be nice to have this eyecandy/ functionality.

function updateScreenOffset()
{
   cancel( $updateScreenOffset );
 
   if ( !isObject( %sc = nameToID( "serverConnection" ) ) )
   {
      $dofX = 0;
      $dofY = 0;
 
      return;
   }
 
   %co = %sc.getControlObject();
 
   if ( !( %co.getType() & $TypeMasks::PlayerObjectType ) || !$firstPerson )
   {
      $dofX = 0;
      $dofY = 0;
 
      $updateScreenOffset = schedule( 16, 0, "updateScreenOffset" );
      return;
   }
 
   %vl = %co.getVelocity();
   %fv = %co.getForwardVector();
 
   %vx = getWord( %vl, 0 );
   %vy = getWord( %vl, 1 );
 
   %fx = getWord( %fv, 0 );
   %fy = getWord( %fv, 1 );
 
   %nx = mClampF( %vx * %fy + %vy * %fx, -1, 1 );
   %ny = mClampF( %vy * %fy + %vx * -%fx, -1, 1 );
 
   %ny = 0;
   %nz = %nx * 4;
 
   %dx = mClampF( mAbs( %nx - $dofX ), 0, 2 );
   %dy = mClampF( mAbs( %nx - $dofY ), 0, 2 );
   %dy = mClampF( mAbs( %nx - playGUI.cameraZRot ), 0, 2 );
 
   %sx = mClampF( %dx / 2, 0.01, 1 );
   %sy = mClampF( %dy / 2, 0.01, 1 );
   %sz = mClampF( %dz / 2, 0.01, 1 );
 
   %rx = 0.2 * %sx;
   %ry = 0.2 * %sy;
   %rz = 0.2 * %sy;
 
   if ( $dofX < %nx )
   {
      $dofX += %rx;
 
      if ( $dofX > %nx )
      {
         $dofX = %nx;
      }
   }
   else if ( $dofX > %nx )
   {
      $dofX -= %rx;
 
      if ( $dofX < %nx )
      {
         $dofX = %nx;
      }
   }
 
   if ( $dofY < %ny )
   {
      $dofY += %ry;
 
      if ( $dofY > %ny )
      {
         $dofY = %ny;
      }
   }
   else if ( $dofY > %ny )
   {
      $dofY -= %ry;
 
      if ( $dofY < %ny )
      {
         $dofY = %ny;
      }
   }
 
   if ( playGUI.cameraZRot < %nz )
   {
      playGUI.cameraZRot += %rz;
 
      if ( $dofX > %nz )
      {
         playGUI.cameraZRot = %nz;
      }
   }
   else if ( playGUI.cameraZRot > %nz )
   {
      playGUI.cameraZRot -= %rz;
 
      if ( playGUI.cameraZRot < %nz )
      {
         playGUI.cameraZRot = %nz;
      }
   }
 
   $updateScreenOffset = schedule( 16, 0, "updateScreenOffset" );
} there ya go

I don't think you really read the topic. That's the horrible implementation we're talking about.