Accel GA

Questions / Announcements area for beta tests of Allegiance's future updates.
Broodwich
Posts: 5662
Joined: Fri Oct 19, 2007 3:48 am
Location: Raincity

Post by Broodwich »

We all know the issue, accel ga lowers boosting top speed
Imago mentioned he didnt notice this so I'm posting here in the hope thatit gets fixed for r5!
QUOTE Drizzo: ha ha good old chap
Drizzo: i am a brit
Drizzo: tut tut
Drizzo: wankarrrrrr
Drizzo: i only have sex whilst in the missionary position[/quote] Fas est et ab hoste doceri - Ovid
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

I was under the impression from the in-game chat that the code responsible for this had already been identified?

Also if this is such a well known issue, where is the data that has been collected to substantiate this?
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Broodwich
Posts: 5662
Joined: Fri Oct 19, 2007 3:48 am
Location: Raincity

Post by Broodwich »

http://www.freeallegiance.org/forums/index...st&p=332267
here is a discussion from the cc forum we had
http://www.freeallegiance.org/forums/index...=47196&st=0
here's the big one from general, most is just voobs bickering pretending they know how to fly ints. Look for compellor's, juckto's and Clay's posts for any real info
QUOTE Drizzo: ha ha good old chap
Drizzo: i am a brit
Drizzo: tut tut
Drizzo: wankarrrrrr
Drizzo: i only have sex whilst in the missionary position[/quote] Fas est et ab hoste doceri - Ovid
Icky
Posts: 1436
Joined: Sat Jan 21, 2006 8:00 am

Post by Icky »

Broodwich wrote:QUOTE (Broodwich @ Aug 11 2009, 06:01 PM) most is just voobs bickering pretending they know how to fly ints.
From the thread:
Broodwich wrote:QUOTE (Broodwich @ Jan 7 2009, 05:05 PM) *whiny tirade about various faction's ints*
But what do i know about ints
Terran wrote:QUOTE (Terran @ Jan 20 2011, 03:56 PM) i'm like adept
Broodwich wrote:QUOTE (Broodwich @ Jun 6 2010, 10:19 PM) if you spent as much time in game as trollin sf might not be dead
TheDevil
Posts: 771
Joined: Mon Dec 22, 2008 8:04 pm
Location: London, UK

Post by TheDevil »

Oh the IRONY
:P
Image
Paradigm2
Posts: 1594
Joined: Tue Jul 01, 2003 7:00 am
Location: College Station, TX

Post by Paradigm2 »

imago, i was making a joke about kgjv if that's what you're referring to.
-Paradigm2
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

@para: huh?


Ok, I've read the 2 topics in detail...
I can't say that I'm surprised it went NOWHERE but DOWNHILL and FAST.
Nothing seems to have been accomplished after ALL THOSE POSTS.


There is only ONE function that deals DIRECTLY /w "brood's accelerate issue". All the other ones are for displaying the crap in the loadout screen and the one pointed out by Compellor is OBVIOUS.


CshipIGC::ExecuteShipMove

This nasty bastard function moves us around. I will post the WHOLE THING because you guys are LAZY $#@!S and don't bother to SEARCH THE CODE :iluv:

Code: Select all

void    CshipIGC::ExecuteShipMove(Time          timeStart,
                                  Time          timeStop,
                                  Vector*       pVelocity,
                                  Orientation*  pOrientation)
{
    if (timeStop > timeStart)
    {
        //Adjust ship's heading, velocity, etc. based on its control settings.
        float   dT = timeStop - timeStart;
        assert (dT > 0.0f);

        float   thrust = m_myHullType.GetThrust();
        float   thrust2 = thrust * thrust;

        //Conversion factor ... Newtons to deltaV
        assert (GetMass() > 0.0f);
        float   thrustToVelocity = dT / GetMass();

        //No maneuvering if ripcording
        /*
        {
            float   tm = GetTorqueMultiplier() * thrustToVelocity;
            float   maxDelta = tm * m_myHullType.GetTurnTorque(c_axisRoll);

            if (maxDelta < m_turnRates[c_axisRoll])
                m_turnRates[c_axisRoll] -= maxDelta;
            else if (-maxDelta > m_turnRates[c_axisRoll])
                m_turnRates[c_axisRoll] += maxDelta;
            else
                m_turnRates[c_axisRoll] = 0.0f;
        }
        else
        */
        if (!m_pmodelRipcord)
        {
            //constrain the desired yaw/pitch/roll rates to an sphere rather than a box
                float   l = m_controls.jsValues[c_axisYaw]   * m_controls.jsValues[c_axisYaw] +
                        m_controls.jsValues[c_axisPitch] * m_controls.jsValues[c_axisPitch] +
                        m_controls.jsValues[c_axisRoll]  * m_controls.jsValues[c_axisRoll];

            if (l > 1.0f)
                l = 1.0f / sqrt(l);
            else
                l = 1.0f;

            float   tm = GetTorqueMultiplier() * thrustToVelocity;
            for (int i = 0; (i < 3); i++)
            {
                float   desiredRate = m_controls.jsValues[i] * l * m_myHullType.GetMaxTurnRate(i);
                float   maxDelta = tm * m_myHullType.GetTurnTorque(i);

                if (desiredRate < m_turnRates[i] - maxDelta)
                    m_turnRates[i] -= maxDelta;
                else if (desiredRate > m_turnRates[i] + maxDelta)
                    m_turnRates[i] += maxDelta;
                else
                    m_turnRates[i] = desiredRate;
            }
        }

        pOrientation->Yaw(   m_turnRates[c_axisYaw] * dT);
        pOrientation->Pitch(-m_turnRates[c_axisPitch] * dT);
        pOrientation->Roll(  m_turnRates[c_axisRoll] * dT);

        // Re-normalize the orientation matrix
        pOrientation->Renormalize();

        const Vector&   myBackward = pOrientation->GetBackward();

        float   speed = pVelocity->Length();
        float   maxSpeed = m_myHullType.GetMaxSpeed();

        assert (maxSpeed > 0.0f);

        //What would our velocity be if we simply let drag slow us down
        Vector  drag;
        {
            // double   f = exp(-thrust * thrustToVelocity / maxSpeed);
            double   f = exp(double(double(-thrust) * double(thrustToVelocity) / (double)maxSpeed));  // mmf type cast changes

            //New velocity = old velocity * f
            //drag = thrust required to create this change in velocity
            drag = *pVelocity * float((1.0 - f) / double(thrustToVelocity));
        }

        m_engineVector.x = m_engineVector.y = m_engineVector.z = 0.0f;    //Zero out the thrust

        bool    afterF = (m_stateM & afterburnerButtonIGC) != 0;
        float   thrustRatio = 0.0f;
        {
            IafterburnerIGC*    afterburner = (IafterburnerIGC*)(m_mountedOthers[ET_Afterburner]);

            if (afterburner)
            {
                float   abThrust = afterburner->GetMaxThrust();
                if (afterF) {
                    thrustRatio = abThrust / thrust;
                }
                afterburner->IncrementalUpdate(timeStart, timeStop, false);

                float power = afterburner->GetPower();
                if (power != 0.0f)
                {
                    //Factor the afterburner thrust into drag (so that it will factor into the engine thrust)
                    drag += (power * abThrust) * myBackward;
                }
            }
        }

        //no maneuvering while ripcording
        if (!m_pmodelRipcord)
        {
            Vector  localThrust;
            if (m_stateM & (leftButtonIGC | rightButtonIGC |
                            upButtonIGC | downButtonIGC |
                            forwardButtonIGC | backwardButtonIGC))   
            {
                //Under manual control: find out which direction to thrust in
                //get the throttle setting, but ramp between 0.2 and 1.0 (instead of 0.0 & 1.0)
                int   x = ((m_stateM & leftButtonIGC)     ? -1 : 0) + ((m_stateM & rightButtonIGC)   ?  1 : 0);
                int   y = ((m_stateM & downButtonIGC)     ? -1 : 0) + ((m_stateM & upButtonIGC)      ?  1 : 0);
                int   z = ((m_stateM & backwardButtonIGC) ?  1 : 0) + ((m_stateM & forwardButtonIGC) ? -1 : 0);

                if (x || y || z)
                {
                    //thrusting in at least one direction
                    localThrust.x = (thrust * (float)x);
                    localThrust.y = (thrust * (float)y);
                    localThrust.z = (thrust * (float)z);
                }
                else
                    localThrust = Vector::GetZero();
            }
            else
            {
                if ((m_stateM & coastButtonIGC) && !afterF)
                    localThrust = pOrientation->TimesInverse(drag);
                else
                {
                    float   negDesiredSpeed;
                    if (afterF)
                        negDesiredSpeed = maxSpeed * (-1.0f - thrustRatio);
                    else
                        negDesiredSpeed = (-0.5f * (1.0f + m_controls.jsValues[c_axisThrottle])) *
                                          ((speed > maxSpeed) ? speed : maxSpeed);

                    Vector  desiredVelocity = myBackward * negDesiredSpeed;

                    //Find out how much thrust is required to obtain our desired velocity,
                    //accounting for drag
                    // mmf added zero check and debugf
                    if (thrustToVelocity == 0.0f) debugf("shipIGC.cpp ~2394 thrustToVelocity = 0 about to devide by zero\n");
                    localThrust = pOrientation->TimesInverse((desiredVelocity - *pVelocity) / thrustToVelocity + drag);
                }
            }

            {
                //Clip the engine vector the the available thrust from the engine
                float   sm = m_myHullType.GetSideMultiplier();
                // mmf added zero checks and debugf
                if (sm == 0.0f) debugf("shipIGC.cpp ~2403 sm = 0 about to devide by zero\n");
                if ((m_myHullType.GetBackMultiplier()==0.0f)&&(localThrust.z<=0.0f)) 
                    debugf("shipIGC.cpp ~2405 backmultip = 0 about to devide by zero\n");
                Vector  scaledThrust(localThrust.x / sm,
                                     localThrust.y / sm,
                                     localThrust.z <= 0.0f ? localThrust.z : (localThrust.z / m_myHullType.GetBackMultiplier()));

                float   r2 = scaledThrust.LengthSquared();

                if (r2 == 0.0f)
                    m_engineVector = Vector::GetZero();
                else if (r2 <= thrust2)
                {
                    //No clipping of engine thrust required
                    m_engineVector = localThrust * *pOrientation;
                }
                else
                {
                    //Trying to thrust too much ... clip it back.
                    m_engineVector = (localThrust * *pOrientation) * (thrust / (float)sqrt(r2));
                }
            }
        }


        *pVelocity += thrustToVelocity * (m_engineVector - drag);
        // mmf added log msg for large velocity^2, mmf 10/07 increased threshold to 800^2 as some cores commonly have ships with speeds in the 500's
        if ((*pVelocity * *pVelocity) > 640000.0f) {
            debugf("mmf pVelocity^2 = %g ship = %s\n",(*pVelocity * *pVelocity),GetName());
        }

        // mmf other velocity checks were added for debugging, this one was definitely being tripped
        // replaced assert with log msg
        if (!(*pVelocity * *pVelocity >= 0.0f)) {
            debugf("mmf pVelocity^2 < 0.0 ship = %s\n",GetName());
            debugf("pVelocity x=%g y=%g z=%g\n",(*pVelocity).x,(*pVelocity).y,(*pVelocity).z);
            debugf("Igc shipIGC.cpp debug build would have called assert and exited, commented out for now\n");
            // cause an exception for debugging
            // (*(int*)0) = 0;
        }
        // assert (*pVelocity * *pVelocity >= 0.0f); // mmf commented out 
    }
}


THE START

..blah blah blah newton crap....

float thrust = m_myHullType.GetThrust(); - Contains the value after any GA is applied, as Compeller LAZILY pointed out

...blah blah blah turn rate crap....

...blah blah blah drag/speed setup crap....

bool afterF = (m_stateM & afterburnerButtonIGC) != 0; - Are we BOOSTING?

float thrustRatio = 0.0f; - Watch this son of a bitch

if (afterburner) - Do this next crap if we have a BOOSTER mounted

float abThrust = afterburner->GetMaxThrust(); - The boosters value (core specific, static)

if boosting,
thrustRatio = abThrust / thrust; - FUBAR!

...blah blah blah more crap setting up drag if we got a booster....

... blah blah now we're out of the "when we have afterburner" specific code
NOTICE THAT ThrustRatio is still in SCOPE

now it gets fun

Vector localThrust; - Watch this son of a bitch

...blah blah everything seems fine when applying thrust in any direction.... like (i think) CP mentioned hold down forward thrust changes this issue's behavior

if ((m_stateM & coastButtonIGC) && !afterF) - coastbutton WTF? ANYWAYS i usually hold down the boost key so i'm going to the else...

float negDesiredSpeed; - ahh crap, watch this son of a bitch also.

if (afterF) negDesiredSpeed = maxSpeed * (-1.0f - thrustRatio); - so, if im holding down the boost key the sons of bitches converge


... blah blah blah cap the velocity....

THE END



MY RECOMMENDATION: (DISCLAIMER: I HAVEN'T TRIED THIS!) :D

Change:

thrustRatio = abThrust / thrust;

To:

thrustRatio = abThrust / thrust_noga;



thrust_noga could be defined near the top, next to the reegular 'thrust':
float thrust_noga = m_pHullData->thrust


DON'T KNOCK IT UNTIL YOU TRY IT


:ninja:
Last edited by Imago on Wed Aug 12, 2009 5:50 am, edited 1 time in total.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

I also should point out there are two other functions in the alleg source that are effected by this (but they aren't responsible for moving us around)
just displaying crap in the loadout screen..


the same fix can be applied (use the non-ga modified thrust value when dividing into the afterburner thrust value)


void UpdateAfterburnerPartInfo(IpartTypeIGC* ppartType) (load.cpp)
...blah blah...
float maxSpeed = hullSpeed * (1.0f + (pdat->maxThrust / hullThrust));

and

float PartWrapper::GetAfterburnerTopSpeed() (consoledata.cpp)
..blah blah..
return pht->GetMaxSpeed() * (1.0f + (maxAfterburnerThrust / thrust));
Last edited by Imago on Wed Aug 12, 2009 6:00 am, edited 1 time in total.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Compellor
Posts: 994
Joined: Fri Jul 06, 2007 12:56 am
Location: Columbus, OH

Post by Compellor »

I went through a brief period where I thought I might be able to get a vague grasp of what a given piece of code does if it seemed to be at all straightforward. Rather embarrassing in retrospect, though I'm not sure how it was lazy as opposed to pointless and incompetent.
Last edited by Compellor on Wed Aug 12, 2009 6:20 am, edited 1 time in total.
Any job worth doing with a laser is worth doing with many, many lasers. -Khrima
Beyond a shadow of a doubt if you don't watch them like a hawk they will stack their collective balls off - MrChaos on Alleg players
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

relax compeller I'm just picking on you cause i :iluv:
more importantly, what do you think about the proposed change?
I'm messing with unrelated issues (parcival's artwork also sound wav + ogg issues) at the moment and was hoping the concerned people won't be LAZY :biggrin: and actually try it. http://www.freeallegiance.org/FAW/index.ph...ding_the_source
and for what it's worth I'm eternally in your "brief period" you describe hahha i just think it's worth it if @#(! gets done even if it's at the expense of my embarrassment.
Last edited by Imago on Wed Aug 12, 2009 6:47 am, edited 1 time in total.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Post Reply