Camera locks to one position (Incam)

Bug #253720 reported by Kyle
2
Affects Status Importance Assigned to Milestone
Armagetron Advanced
Fix Committed
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.

Revision history for this message
Kyle (racingmasterweb) wrote :
Kyle (racingmasterweb)
description: updated
Revision history for this message
Yann Kaiser (epsy) wrote :

we are talking about the 0.2.8 branch, right?

Revision history for this message
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

Revision history for this message
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)

Revision history for this message
Manuel Moos (z-man) wrote :

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

Revision history for this message
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

Revision history for this message
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
Revision history for this message
Yann Kaiser (epsy) wrote : Re: [Bug 253720] Re: Camera locks to one position (Incam)

 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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.