View Full Version : PPL too fast?
Mike Halliday
10-06-2009, 05:18 PM
I have come across a situation where my code is too fast when run. :D
I have similar code in blitz basic that runs smooth as silk. In PPL, the screen updates happen sooo fast that you cant see what is going on.
I know I have asked Alain before about a WAIT VERTICAL BLANK command or something similar that will sync the program with the refresh of the monitor, but how? can I slow my program down to make it update at the correct speed?
I have changed the last 2 variables in the INITGameAPIEX function, but this makes it judder and jump!
Thanks
Mike.
kornalius
10-07-2009, 01:10 AM
I thought I gave you an answer already on this. I believe I added it to the pocketfrog library internally. I will have to check that again. I will add it to my todo list just in case.
kornalius
10-07-2009, 01:12 AM
Btw the ppl engine core as been rewritten and should be even faster. :) It's nice to hear that ppl is too fast though.
Mike Halliday
10-07-2009, 07:22 AM
You are right, you have included it in 1.60 and 2.11
For some reason I did not get the eMail update for that thread (http://forums.arianesoft.ca/showthread.php?p=11909#post11909) :(
Will give it a go and see what sort of results I get! :)
Mike.
Mike Halliday
10-07-2009, 01:30 PM
OK, so I have determined that it is not a speed issue as such;
What I think is happening is the Math in PPL is different to the Math in Blitz Basic.
Here is my code;
for (cnt$, 0, 720)
qcos$[cnt$] = cos(cnt$);
qsin$[cnt$] = sin(cnt$);
end;
Here is the blitz basic code;
For count = 0 To 720
qcos#(count) = Cos(count)
qsin#(count) = Sin(count)
Next
Technically there is no difference; Have a look at the attached image and you will see that the numbers generated in COS and SIN are completely different. Now my math is rubbish, but I know that COS and SIN tables are standard (Otherwise they would be no use to anyone), so how come I get different values?
PPL help states that COS "returns the cosine of parameter X as a double" where as blitz basic help states that COS "returns a number between -1 and 1. This value represents the "X" coordinate of point x,y"
It seems failry obvious that PPL handles COS and SIN differently, but what the difference is I cant seem to find out.
Can anyone shed any light on this for me? - Am I being stupid and completely missing something here?
Cheers - Mike.
Nicknack
10-07-2009, 01:57 PM
are you completely missing cos360 and sin360? they return the standard values between -1 and 1 ;)
Mike Halliday
10-07-2009, 02:04 PM
Holy Moly!
You da man! - thats great - works a treat!
Now why did I not think about those!
See its true. A fresh pair of eyes on the problem .. works every time.
Thanks NickNack - you are my saviour!
M.
kornalius
10-07-2009, 05:09 PM
Oh great, thanks NickNack, I did not have an answer for that one! :)
Nicknack
10-07-2009, 06:33 PM
I had the same problem a long time ago, but...you don't forget those where you really had to rack your brain over it that easily :D
Donone
10-09-2009, 08:26 PM
I notice Mike that on 10-7 you comment...
You are right, you have included it in 1.60 and 2.11
Do you refer to the expected version 1.60 (to follow 1.53) and if so, has it been issued yet?
Thanks
Mike Halliday
10-09-2009, 09:49 PM
I notice Mike that on 10-7 you comment...
Do you refer to the expected version 1.60 (to follow 1.53) and if so, has it been issued yet?
Thanks
Hi Donone,
Nope, 1.60 has not been released yet. Alain is still busy with V2.2 beta.
Its my typing. 2.11 has been released because we are on 2.2 beta 13 at the moment. 1.60 is still some way away yet I think.
Sorry to get your hopes up. - I really must re-read my typing before clicking submit! rofl.
Mike.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.