• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Period calculation

Status
Not open for further replies.
Level 8
Joined
May 9, 2010
Messages
266
Hi guys.
It looks like i`m stupid, but i got a problem.
That`s how my variable calculates.
JASS:
set udg_SS_SpeedFactor = udg_SS_SpeedFactor * Pow(bj_E, (-udg_SS_SlowLiquidFactorX  * udg_SS_LiquidResistance  * udg_SS_Period / udg_SS_Mass )) -  udg_SS_SlowFactor *  udg_SS_g * udg_SS_Period
So every SS_Period time this variable recalculates.
Question: should this variable be the same with different value of SS_Period?
  • Set SS_Period = 0.02
  • Set SS_Period = 0.01
I guess yes, but SS_SpeedFactor downs x2 times faster with Period = 0.01. What`s my problem?
Here`s full triggers if u need.
JASS:
function GroupCounter takes nothing returns nothing
set udg_SS_GroupInteger = udg_SS_GroupInteger + 1
endfunction
function TouchGroupFilter takes nothing returns boolean
return (GetFilterUnit() != udg_SS_Orb1) and (GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0) and (GetUnitAbilityLevel(GetFilterUnit(),udg_SS_OrbDefinitor) != 0)  
endfunction
function SS_EnumActions takes nothing returns nothing
    set udg_SS_GroupInteger = 0
    call ForGroup(udg_SS_group, function GroupCounter)
    if ( udg_SS_GroupInteger != 0 ) then
        set udg_SS_Orb2 = GetEnumUnit()
        set udg_SS_OrbLocation2 = GetUnitLoc(udg_SS_Orb2)
        set udg_SS_EnumKey = GetHandleId(udg_SS_Orb2)
        set udg_SS_SizeEnum = LoadReal(udg_SS_hash,udg_SS_EnumKey,StringHash("Size"))
        set udg_SS_SpeedFactorEnum = LoadReal(udg_SS_hash, udg_SS_EnumKey,StringHashBJ("SpeedFactor") )
        call TriggerExecute( gg_trg_Nearing_main_trigger )
        call RemoveLocation(udg_SS_OrbLocation2)
        set udg_SS_OrbLocation2 = null
    endif
endfunction
function SS_LoopActions takes nothing returns nothing
    local group g = CreateGroup()
    local boolexpr TouchGroupBoolexpr = Condition(function TouchGroupFilter)
    set udg_SS_Orb1 = GetEnumUnit()
    set udg_SS_x = GetUnitX(udg_SS_Orb1)
    set udg_SS_y = GetUnitY(udg_SS_Orb1)
    set udg_SS_OrbLocation = Location(udg_SS_x, udg_SS_y)
    set udg_SS_key = GetHandleId(GetEnumUnit())
    set udg_SS_RA = LoadReal(udg_SS_hash,udg_SS_key,StringHash("Angle"))
    set udg_SS_SpeedFactor = LoadReal(udg_SS_hash,udg_SS_key,StringHash("SpeedFactor"))
    set udg_SS_DamageFactor = LoadReal(udg_SS_hash,udg_SS_key,StringHashBJ("DF"))
    set udg_SS_Size = LoadReal(udg_SS_hash,udg_SS_key, StringHash("Size"))
    set udg_SS_Density = LoadReal(udg_SS_hash,udg_SS_key,StringHash("Density"))
    set udg_SS_SlowFactor = LoadReal(udg_SS_hash,udg_SS_key,StringHash("SlowF") )
    set udg_SS_EnergyFactor = LoadReal(udg_SS_hash,udg_SS_key, StringHash("EF"))
    set udg_SS_LiquidResistance = LoadReal(udg_SS_hash, udg_SS_key,StringHash("LR"))
    set udg_SS_SlowLiquidFactorX = LoadReal(udg_SS_hash,udg_SS_key, StringHash("SLFX") )
    call SaveBoolean(udg_SS_hash, udg_SS_key, StringHash("ISOBS"),  false  )
    set udg_SS_Mass = ( ( 4.00 / 3.00 ) * ( bj_PI * ( Pow(( udg_SS_Size / 1000.00 ), 3.00) * udg_SS_Density ) ) )
        if ( udg_SS_IsSphereOnBounceStage == false ) then
            if (udg_SS_SpeedFactor>udg_SS_StopFactor) then
                set udg_SS_SpeedFactor = udg_SS_SpeedFactor * Pow(bj_E, (-udg_SS_SlowLiquidFactorX  * udg_SS_LiquidResistance  * udg_SS_Period / udg_SS_Mass )) -  udg_SS_SlowFactor *  udg_SS_g * udg_SS_Period
                call SaveReal(udg_SS_hash,  udg_SS_key, StringHash("SpeedFactor"), udg_SS_SpeedFactor )
                call DisplayTextToForce( GetPlayersAll(), R2S(udg_SS_SpeedFactor) )
                call SetUnitTimeScale( udg_SS_Orb1,  udg_SS_AnimationFactor * udg_SS_SpeedFactor*0.01  )
                call SetUnitFlyHeight( udg_SS_Orb1,  udg_SS_Size * Pow(( 1 + udg_SS_SpeedFactor ), 0.50)  / udg_SS_HeightFactor , 5000.00 )
                call SaveReal(udg_SS_hash, udg_SS_key, StringHash("SLFX"),1.00)
                else
                    call SaveReal(udg_SS_hash,  udg_SS_key, StringHash("SpeedFactor"), 0 )
                    set udg_SS_SpeedFactor = 0
                    
                call SetUnitTimeScale( udg_SS_Orb1,  0  )
            endif
        endif

        if (udg_SS_SpeedFactor>0) then
                set udg_SS_xn = udg_SS_x + udg_SS_SpeedFactor*Cos(udg_SS_RA*bj_DEGTORAD)
                set udg_SS_yn = udg_SS_y + udg_SS_SpeedFactor*Sin(udg_SS_RA*bj_DEGTORAD)
            set udg_CP_Point = Location(udg_SS_xn, udg_SS_yn)
            call TriggerExecute( gg_trg_Check_Walkability )
            if ( udg_CP_PointIsWalkable == false ) then
                call TriggerExecute( gg_trg_Wall_bounce_main_trigger )
            endif
            set udg_SS_IsSphereOnBounceStage = LoadBoolean(udg_SS_hash, udg_SS_key,StringHash("ISOBS"))
            if ( udg_SS_IsSphereOnBounceStage == false ) then
                call SetUnitPosition(udg_SS_Orb1, udg_SS_xn, udg_SS_yn)
            endif
            call RemoveLocation(udg_CP_Point)
        endif
        call GroupEnumUnitsInRangeOfLoc(g, udg_SS_OrbLocation, udg_SS_TouchKoefficient  * udg_SS_Size, TouchGroupBoolexpr)
        call ForGroup( g, function SS_EnumActions )
        call DestroyBoolExpr(TouchGroupBoolexpr)
        call DestroyGroup(g)
        call RemoveLocation(udg_SS_OrbLocation)
        set g = null
        set udg_SS_OrbLocation = null
endfunction

function SS_MainLoop takes nothing returns nothing
    set udg_SS_GroupInteger = 0
    call ForGroup(udg_SS_group, function GroupCounter)
    if ( udg_SS_GroupInteger!= 0 ) then
        call ForGroup( udg_SS_group, function SS_LoopActions ) 
    else
       call PauseTimer(udg_SS_Timer)
    endif
endfunction
function SS_Run takes nothing returns nothing
    local location CasterLoc = GetUnitLoc(GetTriggerUnit())
    local location TargetLoc = GetSpellTargetLoc()
    set udg_SS_RA = bj_RADTODEG * Atan2(GetLocationY(TargetLoc) - GetLocationY(CasterLoc), GetLocationX(TargetLoc) - GetLocationX(CasterLoc))
    set udg_SS_Unit = CreateUnit(GetTriggerPlayer(),udg_SS_UnitType, GetLocationX(CasterLoc) + udg_SS_BasicOffset * Cos(udg_SS_RA * bj_DEGTORAD),GetLocationY(CasterLoc) + udg_SS_BasicOffset * Sin(udg_SS_RA * bj_DEGTORAD), udg_SS_RA)
    set udg_SS_HandleId0 = GetHandleId(udg_SS_Unit)
    call SetUnitPathing( udg_SS_Unit, false )
    set udg_SS_SpeedFactor = ( udg_SS_SpeedFactor * udg_SS_Period )
    set udg_SS_LiquidResistance = 6.00 * bj_PI  *  udg_SS_SlowLiquidFactor * udg_SS_Size/100 
    call SaveUnitHandle( udg_SS_hash,udg_SS_HandleId0, StringHash("Unit"),  udg_SS_Unit  )
    call SaveReal( udg_SS_hash , udg_SS_HandleId0, StringHash("Angle"),udg_SS_RA )
    call SaveReal( udg_SS_hash, udg_SS_HandleId0, StringHash("DF"), udg_SS_DamageFactor)
    call SaveReal(udg_SS_hash, udg_SS_HandleId0, StringHash("SpeedFactor"),  udg_SS_SpeedFactor )
    call SaveReal( udg_SS_hash,udg_SS_HandleId0 , StringHash("Size"), udg_SS_Size  )
    call SaveReal( udg_SS_hash, udg_SS_HandleId0, StringHash("Density"), udg_SS_Density )
    call SaveReal( udg_SS_hash, udg_SS_HandleId0, StringHash("SlowF") ,udg_SS_SlowFactor  )
    call SaveReal(udg_SS_hash, udg_SS_HandleId0,StringHash("EF"), udg_SS_EnergyFactor    )
    call SaveReal(udg_SS_hash, udg_SS_HandleId0,StringHash("SLFX"), 1.00    )
    call SaveReal(  udg_SS_hash,  udg_SS_HandleId0,StringHash("LR"), udg_SS_LiquidResistance )
    call SaveInteger( udg_SS_hash ,udg_SS_HandleId0,StringHashBJ("STD"), udg_SS_SpellTypeDetector)
    call SaveStr( udg_SS_hash, udg_SS_HandleId0,StringHash("OnEO") ,udg_SS_OnExlodeOrder  )
    call SaveInteger(udg_SS_hash, udg_SS_HandleId0, StringHash("OnES"),udg_SS_OnExplodeSpell   )
    call SaveStr( udg_SS_hash ,udg_SS_HandleId0, StringHash("StrikeSFX"), udg_SS_StrikeSFX )
    call SaveStr(  udg_SS_hash,udg_SS_HandleId0, StringHash("WallBounceSFX"), udg_SS_BounceSFX)
    call SaveBoolean( udg_SS_hash , udg_SS_HandleId0,StringHash("ISOBS"), false)
    call SetUnitMoveSpeed( udg_SS_Unit, 0.00 )
    call GroupAddUnit( udg_SS_group,udg_SS_Unit)
    call UnitAddAbility( udg_SS_Unit,udg_SS_FlyingAbility )
    call UnitRemoveAbility( udg_SS_Unit,udg_SS_FlyingAbility )
    call SetUnitScale(udg_SS_Unit, udg_SS_Size * 0.01, udg_SS_Size * 0.01, udg_SS_Size * 0.01)
    call SetUnitTimeScale( udg_SS_Unit, ( udg_SS_AnimationFactor * udg_SS_SpeedFactor*0.01 ) )
    call SetUnitFlyHeight( udg_SS_Unit, ( udg_SS_Size / udg_SS_HeightFactor ), 100.00 )
    call RemoveLocation(CasterLoc)
    call RemoveLocation(TargetLoc)
    call TimerStart(udg_SS_Timer,udg_SS_Period,true,function SS_MainLoop)
    set CasterLoc = null
    set TargetLoc = null
endfunction


//===========================================================================
function InitTrig_engine_initiate_main_Jass takes nothing returns nothing
    set gg_trg_engine_initiate_main_Jass = CreateTrigger(  )
    set udg_SS_Timer = CreateTimer()
    call TriggerAddAction( gg_trg_engine_initiate_main_Jass, function SS_Run )
endfunction
edit: yeah, btw if u find any leaks or problems in this code (they are gonna be there absolutely, cuz i`m just learning JASS), please tell me ! =)
 
I'm not sure if I understand your question correctly.

Set SS_Period = 0.02
Set SS_Period = 0.01

"SS_Period" is still "SS_Period" but is now assigned with "0.01".
And if a trigger/function runs periodicly with "SS_Period", then yes
it surely will run now each 0.01 seconds, so twice as often as with 0.02.

What is exactly the problem?
 
Level 8
Joined
May 9, 2010
Messages
266
I'm not sure if I understand your question correctly.

Set SS_Period = 0.02
Set SS_Period = 0.01

"SS_Period" is still "SS_Period" but is now assigned with "0.01".
And if a trigger/function runs periodicly with "SS_Period", then yes
it surely will run now each 0.01 seconds, so twice as often as with 0.02.

What is exactly the problem?

eehhhm... We have a function like SS_SpeedFactor = SS_SpeedFactor - Const*SS_Period
There`re two different situations. look
1) the cycle runs every 0.02 s. For example
SS_SpeedFactor = SS_SpeedFactor - 0.02*Const
every 0.02 s
2) the cycle runs every 0.01 s.
SS_SpeedFactor = SS_SpeedFactor - 0.01*Const

right?
Sooo we dont care, is SS_Period = 0.02 or 0.01
but there is a x2 times difference beetween this situations. And i cant get why :vw_wtf:
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
You can safely use 0.03 or 0.03125 without noticing any difference between that and 0.01 (or 0.02).

Everything that matters is if your calculation is right.

I see that you want to move a unit with it. Which is perfectly fine.
However, if you mean to change it with acceleration, you have to add half of the acceleration to it as well.
 
Level 8
Joined
May 9, 2010
Messages
266
You can safely use 0.03 or 0.03125 without noticing any difference between that and 0.01 (or 0.02).

Everything that matters is if your calculation is right.

I see that you want to move a unit with it. Which is perfectly fine.
However, if you mean to change it with acceleration, you have to add half of the acceleration to it as well.

what do u mean talking about half of the acceleration? Oo

My system is kind of moving ball affected by liquid and dry friction, so there is it. Could u tell me some more?
 
Level 20
Joined
Jul 14, 2011
Messages
877
Imagine this:
-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance * udg_SS_Period / udg_SS_Mass
as:
udg_SS_Period * (-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance / udg_SS_Mass)

When udg_SS_Period is 0.02, you get one value but when it is 0.01 = 0.02/2 you basically divide the whole thing by 2 and get half of that.

E:I think you want to divide by udg_SS_Period instead of multiplying, if I get your question right.


uum, I got really confused I think
 
Level 8
Joined
May 9, 2010
Messages
266
Okey guys,
Maybe its pretty hard to talking about it with this count of factors etc.
JASS:
set udg_SS_SpeedFactor = udg_SS_SpeedFactor  -  udg_SS_SlowFactor *  udg_SS_g * udg_SS_Period
Lets talk about this situation, okey?
Here`s just dry friction.
U know, here`s SS_g = 9.81
SS_SlowFactor is kinda 0.07-0.11, its "mu"
And here we have this period.
EDIT:
If I were you, I'd rather just calculate the acceleration of the orb and apply that one to the velocity each interval.

Now we just have linear discreasing of the speed and I dont think that calculating of the acceleration is matter here (if I get u correctly)

So we do have this situation and it still does have this difference =(

Imagine this:
-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance * udg_SS_Period / udg_SS_Mass
as:
udg_SS_Period * (-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance / udg_SS_Mass)

When udg_SS_Period is 0.02, you get one value but when it is 0.01 = 0.02/2 you basically divide the whole thing by 2 and get half of that.

E:I think you want to divide by udg_SS_Period instead of multiplying, if I get your question right.


uum, I got really confused I think


hmm.. dividing by 0.02? my orb will stop immediately =) But i`l try the stuff u say tomorrow

Edit: i`m going to sleep now, tomorrow is pretty hard day for me
dont leave me pls xD
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
No, I never divide... at least... as few as possible.
I multiply with the inverse if I can.

However, there is a certain acceleration or deceleration in this case, which applies over your orb.
Your orb slows down by 40 units per second for example. (units are point spots in the game. Same how you have 600 units range or 300 units area of effect, etc.)

Anyway, that acceleration never changes without any change of factors.
For example, your acceleration of dry friction never changes until you change surface or change pressure against that surface.
I assume that at least the second one never changes, whenever the first one changes, you re-calculate acceleration.

So there is no reason why you want SS_Period to be inside the calculation right?

So try to create another variable which is "a" acceleration (aX, aY, aZ).



Now let me explain the problem about the half on bonus acceleration.

In real life, we do not live in intervals... even not intervals of 1*10^-99999999999.
We live in Real Life Time.
That means that speed of our projectiles is not changed per interval but in a flowing motion.

That said... lets imagine gravity:
3KkaAMg.png


That shows you a little bit of what happens.
But lets explain on a much more intense scale:
WwEKuRz.png


What happens here is that you move your projectile (orb) in the angle which is the same as the starting angle.
You move it with 0.03*SpeedPerSecond towards that angle.
It is only then that you change your angle and you change it accordingly to your Real Life Time counterpart and make them move paralel to each other again... but the Real Life Time one changes again and you have to wait 0.02999 seconds more before you change.
So you move paralel to the Real Life Time trajectory but you never adjust accordingly.

What you need to adjust is the average that you are required to have.
Lets bring the acceleration a bit more into the light.
The projectile accelerates in the Y axis by -9.8 (aka gravity) per second.
This means that after 1 second my Real Life Time projectile has moved in an average speed of "(InitialVelocity + FinalVelocity) *0.5" = "(50 + 40.2) *0.5" = 45.1

Your Game Time projectile has moved 50 units in the Y axis instead and will never again adjust.
When you apply half of the acceleration in return, you do this exact calculation instead.

So instead of
set x = x + aX*INTERVAL
you do
set x = x + aX*INTERVAL*1.5

This will be giving you a speed of not 50 but 45.1 which is the exact same as we need.
 
Level 20
Joined
Jul 14, 2011
Messages
877
Dont listen to my first post. It wasnt the question that confused me, it was me getting confused when I cant view the whole thing at once (it gets a scroll bar), and me being premature with my answer.

Pretty sure your problem is still here though:
Pow(bj_E, (-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance * udg_SS_Period / udg_SS_Mass ))

E: Man, I write so slow :goblin_cry:
 
Level 8
Joined
May 9, 2010
Messages
266
No, I never divide... at least... as few as possible.
I multiply with the inverse if I can.

However, there is a certain acceleration or deceleration in this case, which applies over your orb.
Your orb slows down by 40 units per second for example. (units are point spots in the game. Same how you have 600 units range or 300 units area of effect, etc.)

Anyway, that acceleration never changes without any change of factors.
For example, your acceleration of dry friction never changes until you change surface or change pressure against that surface.
I assume that at least the second one never changes, whenever the first one changes, you re-calculate acceleration.

So there is no reason why you want SS_Period to be inside the calculation right?

So try to create another variable which is "a" acceleration (aX, aY, aZ).



Now let me explain the problem about the half on bonus acceleration.

In real life, we do not live in intervals... even not intervals of 1*10^-99999999999.
We live in Real Life Time.
That means that speed of our projectiles is not changed per interval but in a flowing motion.

That said... lets imagine gravity:
3KkaAMg.png


That shows you a little bit of what happens.
But lets explain on a much more intense scale:
WwEKuRz.png


What happens here is that you move your projectile (orb) in the angle which is the same as the starting angle.
You move it with 0.03*SpeedPerSecond towards that angle.
It is only then that you change your angle and you change it accordingly to your Real Life Time counterpart and make them move paralel to each other again... but the Real Life Time one changes again and you have to wait 0.02999 seconds more before you change.
So you move paralel to the Real Life Time trajectory but you never adjust accordingly.

What you need to adjust is the average that you are required to have.
Lets bring the acceleration a bit more into the light.
The projectile accelerates in the Y axis by -9.8 (aka gravity) per second.
This means that after 1 second my Real Life Time projectile has moved in an average speed of "(InitialVelocity + FinalVelocity) *0.5" = "(50 + 40.2) *0.5" = 45.1

Your Game Time projectile has moved 50 units in the Y axis instead and will never again adjust.
When you apply half of the acceleration in return, you do this exact calculation instead.

So instead of
set x = x + aX*INTERVAL
you do
set x = x + aX*INTERVAL*1.5

This will be giving you a speed of not 50 but 45.1 which is the exact same as we need.

Okey, thank you man for so great explanation =)
I got the thing about difference between intervals and real life. It seems logical, but pretty... weird anyway. You know, the solution of the differential equation tells me, that i can work with intervals easily Oo. But i`l multiply my stuff by 1.5 =)
I`l try to create "a" variable at the evening, maybe it should help =)
btw: for now i have only 2D engine, i have no "az", but nvm

Dont listen to my first post. It wasnt the question that confused me, it was me getting confused when I cant view the whole thing at once (it gets a scroll bar), and me being premature with my answer.

Pretty sure your problem is still here though:
Pow(bj_E, (-udg_SS_SlowLiquidFactorX * udg_SS_LiquidResistance * udg_SS_Period / udg_SS_Mass ))

E: Man, I write so slow :goblin_cry:

Yeah, i was thinking about that. So i have tried to remove the liquid friction (this Exp()) and it still has difference between calculations =)

Edit: Btw i have tried to do like this: i changed formula from this: V(t) = V(t) - a(t)
to this V(t) = V0(t) * S(t) and it didnt worked =(
just think u find it matter

Edit2: i`ve tried to make system work with calculating of acceleration first in Run trigger:
JASS:
set udg_SS_Acceleration = udg_SS_SlowFactor * udg_SS_g
and then
JASS:
set udg_SS_SpeedFactor = udg_SS_SpeedFactor -  udg_SS_Acceleration  * udg_SS_Period
it`s not working =(
ahhh:ogre_icwydt:
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,658
I think that I know the problem...
Am not really sure though.
set udg_SS_SpeedFactor = udg_SS_SpeedFactor - udg_SS_Acceleration * udg_SS_Period
Isnt that one supposed to be
set udg_SS_SpeedFactor = udg_SS_SpeedFactor - udg_SS_Acceleration * udg_SS_ElapsedTime
?

afaik, there is no way that you want the variable SS_Periodic inside your calculations on the interval.
 
Level 8
Joined
May 9, 2010
Messages
266
I think that I know the problem...
Am not really sure though.
set udg_SS_SpeedFactor = udg_SS_SpeedFactor - udg_SS_Acceleration * udg_SS_Period
Isnt that one supposed to be
set udg_SS_SpeedFactor = udg_SS_SpeedFactor - udg_SS_Acceleration * udg_SS_ElapsedTime
?

afaik, there is no way that you want the variable SS_Periodic inside your calculations on the interval.

Well i already thought about this case =)
But u meant
set udg_SS_SpeedFactor = udg_SS_SpeedFactor0 - udg_SS_Acceleration * udg_SS_ElapsedTime i guess?
Where udg_SS_SpeedFactor0 is starting MS of the orb. Right?
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
no sorry, this one was right.

It is quite hard to read the code without whitelines and "proper" names.

SpeedFactor seems to be 3D-Velocity (total velocity through space, but you dont use Z so this is also the 2D-Velocity)

However... try to place Pow() and everything behind it inside "()" those.
You first multiply it by the resultof that power and then you decrease it by the result of that last part.
If you place it inside those () thinghies, then i would make more sense.
 
Level 8
Joined
May 9, 2010
Messages
266
no sorry, this one was right.

It is quite hard to read the code without whitelines and "proper" names.

SpeedFactor seems to be 3D-Velocity (total velocity through space, but you dont use Z so this is also the 2D-Velocity)

However... try to place Pow() and everything behind it inside "()" those.
You first multiply it by the resultof that power and then you decrease it by the result of that last part.
If you place it inside those () thinghies, then i would make more sense.
Woops, i`m sorry
I`m not sure that i`ve got u correctly. There`s a problem with my variable names etc. Yeah, its cuz i dont know english well enough =)
And this brackets... What`s wrong with them? xD

Also, lets talk about the stuff u said before. Swapping SS_Period and SS_TimeElapsed
I still think that there should be SS_SpeedFactor0
Because then SS_SpeedFactor will descrease as SS_SpeedFactor = Const- Const2*Time. There will be accelerated acceleration. Isn`t it?
 
Level 8
Joined
May 9, 2010
Messages
266
you do "set SpeedFactor = SpeedFactor + ..."
What happens is "set SpeedFactor = (SpeedFactor + Pow(...)) - ..."

Are you sure it is not supposed to be "set SpeedFactor = SpeedFactor + (Pow(...) - ...)"?

This Pow() is just a coefficient between [0;1]
(you know exp(-a*x) )
so we have this Pow() multiplied with SS_SpeedFactor
So what`s exaclty the point? :psmile:
Btw, here`s the link with well-formed formula
https://yadi.sk/i/LnKOqMedhVSDy
 
Status
Not open for further replies.
Top