Camera locks to one position (Incam)

Bug #253720 reported by Kyle on 2008-07-31
2
Affects Status Importance Assigned to Milestone
Armagetron Advanced
High
Manuel Moos

Bug Description

OS: Gentoo x86
Clients: BZR revision 698 and a few before that did the same (i don't know where it started occurring

Using the internal camera the camera locks to one position after hitting a wall and turning away.

I found out where the problem is caused and how to stop the camera from freezing but it generates a new (actually old one from 0.2.8.2.1 is recreated) bug. i changed line 1807 in eCamera.cpp
from
if (CenterIncamOnTurn() || newmode==CAMERA_SMART_IN || newmode == CAMERA_CUSTOM || newmode == CAMERA_SERVER_CUSTOM )
        {
            // fetch the relevant turning speed
            REAL turnSpeed = ( newmode == CAMERA_IN || newmode == CAMERA_SMART_IN ) ? s_inTurnSpeed : customTurnSpeed;

            eCoord cycleDir = CenterCamDir();
            newdir=dir+cycleDir*(turnSpeed*ts);

            // test if we're looking against the current driving direction
            REAL wrongDirection = -eCoord::F( cycleDir, newdir );
            if ( Center() && wrongDirection > 0 )
            {
                // if so, turn to the side using the last driving direction
                newdir = newdir + Center()->LastDirection()*(wrongDirection*ts*turnSpeed*s_customTurnSpeed180);
            }
        }
to
if (CenterIncamOnTurn() || newmode==CAMERA_SMART_IN || newmode == CAMERA_CUSTOM || newmode == CAMERA_SERVER_CUSTOM )
        {
            // fetch the relevant turning speed
            REAL turnSpeed = ( newmode == CAMERA_IN || newmode == CAMERA_SMART_IN ) ? s_inTurnSpeed : customTurnSpeed;

            eCoord cycleDir = CenterCycleDir();
            newdir=dir+cycleDir*(turnSpeed*ts);

            // test if we're looking against the current driving direction
            REAL wrongDirection = -eCoord::F( cycleDir, newdir );
            if ( Center() && wrongDirection > 0 )
            {
                // if so, turn to the side using the last driving direction
                newdir = newdir + Center()->LastDirection()*(wrongDirection*ts*turnSpeed*s_customTurnSpeed180);
            }
        }

however now when grinding a wall using incam as in 0.2.8.2.1 the cyclespeed goes down to 0 when you turn away from the wall.

Kyle (racingmasterweb) on 2008-08-01
description: updated
Yann Kaiser (epsy) wrote :

we are talking about the 0.2.8 branch, right?

Kyle (racingmasterweb) wrote :

I think it is in all branches

the camera freezing is is 0.3.1 trunk
but the speed problem is in 0.2.8.2.1

Kyle (racingmasterweb) wrote :

Incam locks the camera at 1 position
so i switch to mer cam and it shows no cycle until i explode

it all happens when grinding a wall and turning away from it.

i could reproduce the mer camera bug with smart cam (those are the only ones i have tested)

Manuel Moos (z-man) wrote :

Could we get detailed steps to reproduce for the "speed problem"? A recording would be best, as usual.

Kyle (racingmasterweb) wrote :

The problem was when the server had CYCLE_WALL_NEAR set to 0

should be able to see problems with 0.2.8 and newer clients
different cameras have different effects

Smart cam removes to cycle but follows the walls on 0.3.* alpha

to duplicate set CYCLE_WALL_NEAR 0 on server
enter server
Grind an arena wall
turn away from it and bug happens

Manuel Moos (z-man) wrote :

Ah. There was a division by zero problem in the break boost game physics code causing NaN values to spill all over the system, the camera and rendering problems were just fallout. Fixed in 0.2.8, and the fix should propagate to the trunk.

Changed in armagetronad:
assignee: nobody → z-man
importance: Undecided → High
status: New → Fix Committed

 milestone 0.2.8.3

Changed in armagetronad:
milestone: none → 0.2.8.3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers