How to gain FPS

Got something that makes Armagetron look shiny? Post it here.
Word
Reverse Adjust Outside Corner Grinder
Posts: 4258
Joined: Wed Jan 07, 2009 6:13 pm

Post by Word »

I have to thank you Paladin: i have a Nvidia GeForce 8400M GS and i forgot that i can change its settings. Now it's more performance. I have always prefered quality before xD, now i have 300 fps, like you i had max 60 before. :lol:
User avatar
rumpole
On Lightcycle Grid
Posts: 43
Joined: Sat Mar 14, 2009 2:52 am

Post by rumpole »

I would like to make a comment about fps higher than the monitor refresh rate and the wasted rendering.

I have programmed on the x86 but nothing as complex as armagetron but I have programmed simpler systems like the amiga and genesis (I like 68k).

They way I do things is to have dual display buffers and a vsync interrupt with the main program doing the game calculations in a loop the way armagetron currently does.

The vsync interrupt does the following
1) switch the display buffer address (or copy buffer to screen if address switch is not possible)
2) disable vsync interrupt*
3) clear and render once into the undisplayed buffer
4) enable vsync interrupt

This reduces cpu load and gives a tear free display at the maximum display fps.

*Disable the vsync interrupt before rendering to make sure it is not interrupted while rendering on slow computers which would cause a major stack problem, this will automatically frameskip if rendering takes longer than 1 frame time.

This works for other systems and should work for armagetron as long as you can get a vsync interrupt or a timer interrupt syncronized to the vsync.
Writing code is easy. Finishing is hard.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

Small flaw there: the vsync interrupt isn't available, at least not to userspace programs. All we can do is push our stuff to the GPU, tell it to swap buffers, and wait for completion. If it's configured to wait for the vsync, it'll do that; if not, it won't. On trunk versions, we tell the GPU to wait, but there's no one generic interface for that, so it doesn't always work. Plus, these people here WANT to waste frames.
User avatar
rumpole
On Lightcycle Grid
Posts: 43
Joined: Sat Mar 14, 2009 2:52 am

Post by rumpole »

Z-Man wrote:Small flaw there: the vsync interrupt isn't available, at least not to userspace programs. All we can do is push our stuff to the GPU, tell it to swap buffers, and wait for completion. If it's configured to wait for the vsync, it'll do that; if not, it won't. On trunk versions, we tell the GPU to wait, but there's no one generic interface for that, so it doesn't always work.
Thats a shame it works so well on other systems.
Z-Man wrote:Plus, these people here WANT to waste frames.
I cant understand why people here would want to waste time rendering extra frames ?

As long as the main program is reading/writing the network and doing calculations at the fastest possible rate (1000+ times per second, what ever your cpu can manage) then thats all you need for a smooth game

Rendering more frames than your display can handle (say 60fps) is just a complete waste of resources and only serves to slow down the game.
Last edited by rumpole on Sat Mar 14, 2009 3:29 pm, edited 1 time in total.
Writing code is easy. Finishing is hard.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Well, there's a very small vsync delay, pipeline behavior (can be both positive and negative), and people who think 1000 FPS really is better.
ˌɑrməˈɡɛˌtrɑn
User avatar
rumpole
On Lightcycle Grid
Posts: 43
Joined: Sat Mar 14, 2009 2:52 am

Post by rumpole »

off topic: oO jonathan your avatar was generated by some path finding function ?

on topic: im quite happy with 30 fps or a little more, thanks
Writing code is easy. Finishing is hard.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

rumpole wrote:off topic: oO jonathan your avatar was generated by some path finding function ?
327680000 paths, off the top of my head.
ˌɑrməˈɡɛˌtrɑn
User avatar
rumpole
On Lightcycle Grid
Posts: 43
Joined: Sat Mar 14, 2009 2:52 am

Post by rumpole »

thats a lot of paths :o
Writing code is easy. Finishing is hard.
Paladin
Average Program
Posts: 99
Joined: Tue Feb 26, 2008 11:04 pm
Location: Ontario

Post by Paladin »

Plus, these people here WANT to waste frames.
Not particularly, from my end anyways. It was merely an experiment to see what frame rate my computer was capable of producing compared to my old one. 10x the amount of frames was futile yes, but also interesting. Unfortunately, none of my efforts have been able to place it back into the 60 frames per second range again. Whatever I unlocked is not what I thought I unlocked apparently. Needless to say, my next time wasting area is to figure out exactly what I did. :wink:
Post Reply