Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, dr_panther, Quad), 935 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: Exponential increase/decrease of a value... [Re: Chaeon] #241437
12/16/08 11:17
12/16/08 11:17
Joined: Oct 2006
Posts: 36
BigM Offline
Newbie
BigM  Offline
Newbie

Joined: Oct 2006
Posts: 36
Hi again,
Sorry Chaeon, bad choice of words. What I meant by 'Chaeon's implementation' was your implementation of my equation.

I did not analyze your equation in detail but it does seem to be compatible with the parabola, and if it works, it is far better than any other aproach grin

I can't comment on the rest of your code.

Re: Exponential increase/decrease of a value... [Re: BigM] #241542
12/16/08 22:35
12/16/08 22:35
Joined: Nov 2007
Posts: 50
C
Chaeon Offline OP
Junior Member
Chaeon  Offline OP
Junior Member
C

Joined: Nov 2007
Posts: 50
Alright! ive got all i need then! thanks for playing people, its been interesting. one step closer to completiooon..

bigM fixed the last bug in his power method and it works perfectly: i don't really understand it but that can come a little later.

camera.x += (target.x - camera.x) * (1 - pow(1 - reductionpersecond,time_step/16))

thank you bigM

and i finally thought of an appropriate signature:

"i HEART 3dgs."

Re: Exponential increase/decrease of a value... [Re: Chaeon] #241617
12/17/08 17:08
12/17/08 17:08
Joined: Oct 2006
Posts: 36
BigM Offline
Newbie
BigM  Offline
Newbie

Joined: Oct 2006
Posts: 36
Glad I could help,

A minor improvement:

camera.x += (target.x - camera.x) * (1 - pow(1 - reductionpertick , time_step))

This is essentially the same equation, but there is no need to divide every frame by 16, which speeds things up a bit. Note that you'll have to use much smaller values for reductionpertick than for reductionpersecond ( reductionpertick = 1 - (1 - reductionpersecond)^(1/16) )

Because this will be calculated every frame another slight improvement may be calculating (1 - reductionpertick) beforehand:

leftdistancepertick = (1 - reductionpertick)

and use that result in the equation:

camera.x += (target.x - camera.x) * (1 - pow(leftdistancepertick , time_step))

Page 3 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1