Qbasicnews.com
October 18, 2019, 10:45:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Testers needed...  (Read 8114 times)
Anonymous
Guest
« on: April 06, 2005, 10:19:46 PM »

hi

im working on coding a project called lynns legacy as some of you know.

well, there have ben many issues about the timing of the prog, and i am starting to seriously consider the fact that the timer statement in FB is seriously flawed.

http://members.aol.com/rubentbstk/nxtll.rar

this is the latest build of the engine. everything runs smooth, perfectly on my comp. but on josiahs, it blazes out of control.

after coming up with several tests, i finally came up with this addition to the code: (keep in mind "delay#" is set to equal TIMER on the start of every loop)




Code:
 Do: inc# +=1: Loop Until Timer - delay# >= .008
? inc#
inc# = 0
? delay#
? Timer
? Date$
? time$


Now, "? Timer" should increment once a second on EVERY computer. but he said that the readout was blazing faster than he can read. this just doesn't make sense to me. Also, inc# reads as 1, meaning the loop was skipped. this makes no sense considering i sent him this code:

Code:
Screen 13
Do
p# = Timer
Locate 1:? Timer
? p#
Do:empcyc# += 1:Loop Until Timer - p# > .050
? empcyc#
empcyc# = 0
Loop Until MultiKey(1)


and it functioned correctly.

could you please try to run it and let me know how fast the PRINT TIMER goes? thanks...
Logged
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #1 on: April 06, 2005, 11:36:35 PM »

I'll gladly download lynn's legacy.  It's been something i've been looking forward to for a while.

I've noticed the timer bug(?) for a while now, but haven't said anything...  Timer just doesn't seem to do it's job...  just wait, i'll upload my example sometime...
Logged

Jumping Jahoolipers!
jsmith71
Been there, done that
*****
Posts: 1004


« Reply #2 on: April 06, 2005, 11:47:52 PM »

Quote from: "barok"
I'll gladly download lynn's legacy.  It's been something i've been looking forward to for a while.

It's gonna be awhile... :lol:
@Cha0s: TOLD you you shoulda reported the timer bug! Tongue
Logged
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #3 on: April 07, 2005, 12:36:37 AM »

If it's Windows 9x, the resolution is max 50 ms, using anything below that and it will be imprecise.. it's not much better in NT, max 10ms, if i remember.
Logged

Anonymous
Guest
« Reply #4 on: April 07, 2005, 12:43:59 AM »

okay, i updated the exe to print these 2 values

? Trim$(Str$(Int(Timer Mod 10)))
? Right$(Time$, 1)

the first one displays the ones digit of the system timer, the second displays the current second on the system clock. these numbers should increment at the exact same speed, they do not necessarily need to be the exact same number.

so anyone who downloads it tell me how close the speeds are of the 2 numbers. thx. the link again is

http://members.aol.com/rubentbstk/nxtll.rar in case you are too lazy to scroll XD




thanks


edit: i may have come up with a fix for this:


Code:
seconds = Val(Right$(Time$, 2))

Do
  pullseconds = Val(Right$(Time$, 2))

Loop Until pullseconds <> seconds

p# = Timer
setsecond = pullseconds

If setsecond = 59 Then setsecond = -1

Do
  pullseconds = Val(Right$(Time$, 2))

Loop Until pullseconds > setsecond

diff# = Timer - p#


Do
  delay# = Timer

  [do some code...]


  Do:inc# +=1:Loop Until (Timer / diff#) - (delay# / diff#) >= .007 Or MultiKey(1)

Loop



this is only tested on my machine but it works, and i think the theory is sound...


edited more:

well, that didnt work, so i tried this


Code:
seconds = Val(Right$(Time$, 2))

Do
  pullseconds = Val(Right$(Time$, 2))

Loop Until pullseconds <> seconds

setsecond = pullseconds
If setsecond = 59 Then setsecond = -1

Do
  pullseconds = Val(Right$(Time$, 2))
  f# += 1

Loop Until pullseconds > setsecond

Do

  Do
    dumb = Val(Right$(Time$, 2))
    dumber# += 1

  Loop Until dumber# >= (f# \ 200)
 
  dumber# = 0

Loop



and that seemed prettttty friggin close to 5 milliseconds.
Logged
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #5 on: April 07, 2005, 02:22:03 AM »

It works fine here on WinMe. :shifty:


...looks cool too!  Tongue
Logged
Anonymous
Guest
« Reply #6 on: April 07, 2005, 02:26:50 AM »

thanks for testing it =)

for anyone who hasnt tested it, the latest build is with (what seems to be) the universal timing method, so im still curious as to whether or not it works on ALL systems o.o thanks again to those who try  :bounce:
Logged
Nexinarus
Wandering Guru
***
Posts: 301



WWW
« Reply #7 on: April 10, 2005, 03:55:46 AM »

"Sorry, we cannot find that page" it says to me, as i try to download. Is it missing?
Logged
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #8 on: April 10, 2005, 05:33:48 AM »

I'm getting that error too. That's AOL for ya...  :roll:

No offense intended. It's a cool acting demo. Keep up the good work!  Tongue
Logged
jsmith71
Been there, done that
*****
Posts: 1004


« Reply #9 on: April 10, 2005, 05:38:18 AM »

Nope, the demo was taken down due to... Well, basically I don't like my graphics to be seen until the final product is ready, except when testing is NEEDED, and since we're fine at the moment I whined at and bugged cha0s til he took it down. Smiley
Logged
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #10 on: April 10, 2005, 05:50:23 AM »

Well, demos are great! If I would have never bought a demo of... :lol:


EDIT:

OMG... I bought a demo? That better be a typo!!!  :rotfl:
Logged
jsmith71
Been there, done that
*****
Posts: 1004


« Reply #11 on: April 10, 2005, 05:55:11 AM »

Oh, I didn't mean to imply that there won't be any demos, but I just prefer if the game isn't seen too much before a significant demo or the final game. Tongue
Logged
Atom Ant
Member
*
Posts: 78



« Reply #12 on: April 10, 2005, 10:33:06 AM »

I've had bad experiences with TIMER in FB.  It seemed like it would go out of control when I locked it at 60 FPS.  But 30 FPS or anything less would work fine.  :-|  It was really frustrating me because it had spontaneously stopped working.  Then I restarted my computer and it went back to normal again.   :rotfl:
Logged

nd remember kids, only you can provoke forest fires!
aetherfox
Been there, done that
*****
Posts: 1071



WWW
« Reply #13 on: April 10, 2005, 11:23:51 AM »

Use GetTickCount from kernel32.bi

It is precise to 1 ms AFAIK, and I use it for many programs to maintain a constant frame rate.

I can post code to use it, if you ask for it,.
Logged

~''i|~thrFx~|i''~-  
avinash.vora - http://www.avinashv.net
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #14 on: April 10, 2005, 03:29:00 PM »

just a question...  whenever i open my rpg i'm working on, my cpu shoots up to %100.  I'm sure the reason is somewhere in the fact that it's software driven, so the cpu has to work alot or something...  anyways, any way to throttle down the amount of cpu a program uses?  As nice as it sounds, i don't need to use all of my cpu to render a 3 layer map, npc's, particles and objects at 1000 fps. Wink
Logged

Jumping Jahoolipers!
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!