|
Post by johnno56 on Feb 6, 2019 7:52:57 GMT -6
I have no idea. It's an AOC monitor. Model E2262VW. I read through the 'specs' online and they may as well have been written in Jinglish... All I know is its a 22" widescreen monitor...
|
|
|
Post by tbird on Feb 6, 2019 11:17:40 GMT -6
It appears your monitor is 75hz capable
|
|
|
Post by johnno56 on Feb 6, 2019 12:54:25 GMT -6
Ok. I have no idea what that means but I believe you.
|
|
|
Post by tbird on Feb 6, 2019 14:12:50 GMT -6
Meaning your game could be refreshing at 75 fps. So possibly faster, you could just add delta time for your speeds
|
|
|
Post by kennn on Feb 6, 2019 14:35:59 GMT -6
Ok. I have no idea what that means but I believe you. Is it possible to set your monitor or your display card at 60Hz? Perhaps ordinary people's monitors are only at 60hz.
|
|
|
Post by johnno56 on Feb 6, 2019 15:25:24 GMT -6
kennn,
I cannot change the speed of the monitor's refresh rate to 60hz. I suppose by adding "delta time" as tbirds suggests, may do the trick. But the problems are two-fold. 1. I don't know how to add Delta Time and 2. I am certain that I am not the only one who's monitor is faster than 60hz. I know that RCBasic can display the frame rate on request, but as to changing it, I'm not so sure. What if a user has an old monitor that runs at 50 or 55hz, how is RCBasic supposed to increase it to 60hz? I don't know how pro game developers are able to cope with that sort of thing, but as for my feeble skills, I cannot do that....
I suppose, until I find out a better way, each user will have to modify the speed of the game to suit their own machines... Maybe one of the other forum members would have a better idea...
Oh. Maybe, just maybe, use the FPS command to adjust the delta time to simulate 50hz? Crazy? Don't know if it can be done. If it could, I have no idea how to do it... lol You may have to ignore me... Just finished my coffee and even "I" don't think I'm making any sense... lol
|
|
|
Post by n00b on Feb 6, 2019 16:44:03 GMT -6
Hey Johnno, to answer your question on how pro developers deal with this issue, most of them don't.
But here is how to achieve a targeted fps. Just copy this code, set target rate with Set_SyncRate() and use Sync_Update() instead of Update. I am not in front of my computer right now so if this doesn't work just let me know. If anybody has a better solution or sees a problem with this just let me know.
Dim sync_rate Dim last_sync Dim sync_delta
sync_delta = 0
Sub Set_SyncRate(r) sync_rate = r sync_delta = 1000 / r End Sub
Sub Sync_Update() t = timer If (t - last_sync) >= sync_delta Then Update last_sync = t End If End Sub
|
|
|
Post by kennn on Feb 6, 2019 18:20:39 GMT -6
johnno56 wrote:
n00b's code looks complex. I am not clever enough to understand. Nevertheless, I believe that you can overcome this obstacle with n00b's code. Good! In addition, after this contest is finished at last, you will become an awesome game programmer! All the knowledge gained by you from making this amazing game will be very priceless. Well done!
|
|
|
Post by n00b on Feb 7, 2019 6:29:50 GMT -6
Hey Johnno, I got a chance to run that code and it did not work that well so I made some changes. Try this.
Dim sync_rate Dim last_sync Dim sync_delta
sync_delta = 0
Sub Set_SyncRate(r) sync_rate = r sync_delta = 1000 / r End Sub
Sub Sync_Update() Update Wait(sync_delta) End Sub
Set_SyncRate(10)
|
|
|
Post by kennn on Feb 7, 2019 6:37:39 GMT -6
johnno56, hi,
I have one more opinion. There are three kinds of flying objects. Only the smallest flying objects can fire missiles. If the other two kinds of flying objects can also fire missiles, the gameplay will be more appealing to gamers. However, the speeds of the missiles fired from these two kinds of flying objects cannot be too fast.
|
|
|
Post by tbird on Feb 7, 2019 8:04:06 GMT -6
Hey Johnno, I got a chance to run that code and it did not work that well so I made some changes. Try this. Dim sync_rate Dim last_sync Dim sync_delta
sync_delta = 0
Sub Set_SyncRate(r) sync_rate = r sync_delta = 1000 / r End Sub
Sub Sync_Update() Update Wait(sync_delta) End Sub
Set_SyncRate(10)
He said he was getting around that 60 FPS, so I doubt it is an issue. Although implementing it isn't a bad idea anyways. I would like to point out that the way you are doing it, which is perfect for this type of game, slows down everything. Which as I said is perfect for this type of game, but for future reference to anyone reading, if you are making a complex game, you never want to use the 'wait' command. Instead I suggest using delta like so:
'Update the Delta Time
Function UpdateDelta()
DeltaTime = (Timer - TimeDelay) * 0.001
TimeDelay = Timer
End Function Then you simply call UpdateDelta() in your main loop, and for all your movement or rotation or anything that has to be 'visually' the same you: mySpeedX = 40 * DeltaTime. This way the rest of the game, AI, collision checks...etc. all run as fast as possible, only what's displayed gets slowed down.
On a side note if your doing things with forces or light physics then it's another ball park again. You get into interpolation and time stepping, much more complicated.
|
|
|
Post by n00b on Feb 7, 2019 9:47:35 GMT -6
Thanks for the correction TBird. I have never dealt with this particular issue. I am going to add the ability to disable vsync in a future release.
|
|
|
Post by tbird on Feb 7, 2019 12:20:03 GMT -6
Not really a correction lol. Just another way of dealing with the problem.
|
|
|
Post by johnno56 on Feb 7, 2019 14:03:48 GMT -6
This maybe a silly question but, how does this effect those that have machines that cannot run at 60 fps (say on older machines)?
|
|
|
Post by tbird on Feb 7, 2019 18:46:37 GMT -6
If you use only frames it will just run slower for anyone that cannot run it at 60fps, if you want control over movement you have to look at it in pixels per second as opposed to fps, you can't make a game run the same on all machines worrying strictly about frames, you have to have a timer.
Then whether the game runs at 20fps or 60fps the ships and shots all move the same amount, one will just look jerky.
|
|