October 31, 2020, 04:57:56 PM

Author Topic: Setting the game frequency  (Read 763 times)

Offline GfK

  • Full Member
  • ***
  • Posts: 154
Re: Setting the game frequency
« Reply #15 on: July 05, 2020, 11:47:21 AM »
Trouble with aiming for the lowest spec PC you can think of, is that there's always plenty of people out there who will have worse.

i.e. "This gaming laptop* is pretty new, I only bought it six years ago from PC World".

* which was *never* a gaming laptop, and a bit shit on the day you bought it.
Intel I9-9900K 3.6-5.0GHz | GeForce RTX2070 8GB | 32GB RAM | 500GB NVMe M.2 SSD | 1TB HDD | Windows 10 x64.
MSI Apache Pro | I7-7700HQ | GeForce GTX1060 3GB | 8GB RAM | 128GB SSD | 1TB HDD | Windows 10 x64.

Offline hosch

  • Jr. Member
  • **
  • Posts: 83
Re: Setting the game frequency
« Reply #16 on: July 05, 2020, 05:40:15 PM »
I'm a bit late to the party, but that's the way I've done it for several years without running into problems:
Code: [Select]
Local fps% = CreateTimer(60)

Repeat

(your game code)

WaitTimer(fps)
Flip
Forever

Offline grindalf

  • Full Member
  • ***
  • Posts: 123
Re: Setting the game frequency
« Reply #17 on: July 05, 2020, 10:24:49 PM »
Im not trying to hijack the thread but.....
I can CreateTimer and WaitTimer but is there anyway to get the current state of the Timer, like a GetTimer or something. There seems to be no commands for it in the helpfile and I find it very strange that it doesn't exist.

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2822
  • elgol 2021
Re: Setting the game frequency
« Reply #18 on: July 05, 2020, 10:42:21 PM »
GetFrameTime()
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

Offline grindalf

  • Full Member
  • ***
  • Posts: 123
Re: Setting the game frequency
« Reply #19 on: July 06, 2020, 07:41:28 AM »
GetFrameTime()
That doesn't exist as a command

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2822
  • elgol 2021
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: Setting the game frequency
« Reply #21 on: July 06, 2020, 10:38:39 AM »
like a GetTimer or something. There seems to be no commands for it in the helpfile and I find it very strange that it doesn't exist.

Well, (As planed by the developer) Create/WaitTimer commands should make it easy to achieve a constant framerate.
I guess, Blitzbasic is using it internally, probably flip command is starting the timer, and waittimer() waits until the calculation has reached the target.

It is, because of the WaitTimer (which causes a delay in program execution), that GetTimer becomes useless in this case.
65536 GOTO Back2Basic

Offline grindalf

  • Full Member
  • ***
  • Posts: 123
Re: Setting the game frequency
« Reply #22 on: July 06, 2020, 06:31:47 PM »

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2822
  • elgol 2021
Re: Setting the game frequency
« Reply #23 on: July 06, 2020, 07:18:13 PM »
lol a lot here use AGK and the subject is universal.   :P
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal