News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

frame rate

Started by arnoldemu, 14:42, 25 March 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

Interested in the fps of some games? I attempted to measure them using a bit of test code in arnold. My measurement is the first few seconds of game play only so I maybe didn't get an accurate measurement, but it's not bad for an initial measurement.

Generally the game will always have to sync to 50hz for display, so all frame rates will be a multiple of that.

50 fps = 19968 nops (1 frame)
25 fps = 39,936 nops (2 frames)
16 fps = 15,904 nops  (3 frames)
12.5 fps = 79,872 nops (4 frames)
10fps  = 99,840 (5 frames)
8.3fps = 119,808 (6 frames)
7.14fps = 159,744 nops (7 frames)

Used below:

varies - the frame rate speeds up and slows down
locked - the frame rate is fixed.

Here are some results:

Thrust - ~10fps. Varies.

xevious -  12.5fps. Locked.

mission genocide - 50fps - Locked.

action force - 50fps - Locked(?).

lemmings - ~8fps - varies.

un squadron - ~6/7fps - varies. (on average ~164,000 nops)

renegade - 16.6fps - locked.

Interesting.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Arnaud

#1
Really interesting to bench the code  :)

How can you compute the frames per second ? When something is copied in the video ram ?

arnoldemu

#2
Quote from: Arnaud on 17:07, 25 March 17
Really interesting to bench the code  :)

How can you compute the frames per seconds ? When something is copied is the video ram ?
I find the main loop of the game using the debugger in arnold - this takes a bit of time at the moment because when I break into the debugger it is often in a function. I then put a timer marker at that place.

Each time the marker is hit I record the number of cycles since the last time it was hit. I record a list of them and then calculate the min, max and average. I can view this as NOPs or FPS.

I did this with all of these games and I find this is the mostly reliable way at this time.

It is not good to time using interrupts because a game that takes 3 frames for each loop will have lots of interrupts.

In the future I hope to calculate timings for all functions in the main loop and then know how much % of the time each function takes, but this will take a lot more work to do.

EDIT: If min,max and avg are the same, then I say it is locked,but to definitely confirm I would need to verify the code.
If the frame rate is variable I can see the min/max are quite different and the average changes.


My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Arnaud

A great feature could be to put markers in the code and emulator computes the time elapse between them.

Arnaud

#4
Quote from: arnoldemu on 14:42, 25 March 17

renegade - 16.6fps - locked.


It's strange Renegade seems really smooth when playing, but the refresh rate is only three frames. However there're not too many things to animate on the screen.

arnoldemu

Quote from: Arnaud on 18:41, 25 March 17
A great feature could be to put markers in the code and emulator computes the time elapse between them.
I have added this. :)

my aim is to automatically find the main loop, identify each function and automatically add markers.
It's not as simple as adding it at the start and at a ret, and I have to be careful with any stack methods because some games like chase hq hit the stack (in fact, it was quite hard to find the main loop).

I made a measurement for chase hq, and I'm not sure about the fps. It seemed much lower than I expected :(


My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: Arnaud on 10:31, 26 March 17
It's strange Renegade seems really smooth well playing, but the refresh rate is only three frames. However there're not too many things to animate on the screen.
Yes I agree it's smooth, but I would say it is actually doing a lot.

There are a lot of enemies, there is ai for each and I guess the ai is not that simple. It's really well programmed.

un squadron is suprising. It's a scroller, with enemies in pre-defined paths, I guess it's the amount of enemies and bullets that is slowing it down, but I don't have a way to actually confirm yet.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

ivarf

#7
Quote from: arnoldemu on 14:03, 26 March 17
I have added this. :)

my aim is to automatically find the main loop, identify each function and automatically add markers.
It's not as simple as adding it at the start and at a ret, and I have to be careful with any stack methods because some games like chase hq hit the stack (in fact, it was quite hard to find the main loop).

I made a measurement for chase hq, and I'm not sure about the fps. It seemed much lower than I expected :(


I have always felt the frame rate of Chase HQ is too low. So I never have the same positive thoughts of it as much of the CPC community has. I much preferred its Mode 1 prequel Wec Le Mans

ivarf

Quote from: Arnaud on 10:31, 26 March 17
It's strange Renegade seems really smooth when playing, but the refresh rate is only three frames. However there're not too many things to animate on the screen.

I asssume you meant every third frame update

freemac

Quote from: arnoldemu on 14:03, 26 March 17
I have added this. :)

my aim is to automatically find the main loop, identify each function and automatically add markers.
It's not as simple as adding it at the start and at a ret, and I have to be careful with any stack methods because some games like chase hq hit the stack (in fact, it was quite hard to find the main loop).

I made a measurement for chase hq, and I'm not sure about the fps. It seemed much lower than I expected :(


chase hq does alternate perfectly too layers (&8000-&C000 &C000-&FFFF)

||C|-|E||

The funny thing is that nowadays we are complaining if Fallout 4 in PS4 Pro drops from 30 to 28 in certain places  :D

dragon

Super skweek shoud have good frame rate, i always view it very fluid. (excecpt maybe in puntual times with very high number of shoot in the screen).

Sykobee (Briggsy)

#12
Quote from: Arnaud on 10:31, 26 March 17
It's strange Renegade seems really smooth when playing, but the refresh rate is only three frames. However there're not too many things to animate on the screen.

Yeah, there are ways in which this recording method fails, I imagine. Imagine a single-buffered game...

For example, the game cycle is every 3 frames, but the update cycle is every frame for a subset of moving objects. What I mean by that is that the main player could move every frame, and then you take 1/3 of the moving objects and move them during the frame. I'm not saying that Renegade does this, but when you consider the player's attention is usually on the main sprite, it makes sense to update this more often and put more effort into moving it smoothly.

End result - game feels really smooth, but it doesn't have to update everything during each frame, just 1/3 or 1/2 or even 1/4 or 1/5th.


Obviously, double buffered games will do the updates over several frames too, then flip (and you can't flip until all the updates are done), but that makes it feel a bit jerky (but it does enable software scroll with animating backgrounds, lots of enemies, etc).


I'm sure that the emulator can detect calls to change the screen address for frame rate calculations for double buffered games.

Optimus

Interesting results, some of them are lower than I thought, then I look at some videos of the games and it seems so.
There is plenty of time to do cool stuff with graphics even in software rendering if you aim for 3-4 or more VBLs. And there is also plenty of space for improvement.
Some games at 3VBLs don't look so bad as long as they don't scroll. Like Renegade for example.

Prodatron

I really wonder about the frame rate of Savage and Trantor...

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

lmimmfn

Surely this is something a CPC emulator could easily provide? as it only needs to check if current display has been updated or not and count how many updates within 50 frames(vsync frames) to get current FPS and store that over time to provide the FPS stats.
6128 for the win!!!

andycadley

Quote from: lmimmfn on 15:22, 09 August 23Surely this is something a CPC emulator could easily provide? as it only needs to check if current display has been updated or not and count how many updates within 50 frames(vsync frames) to get current FPS and store that over time to provide the FPS stats.
Not really. 8-bit machines don't work like modern PCs. On a modern device a whole new frame is prepared, then buffers are flipped to make that frame visible. Count those flips and hey presto, you have a frame rate.

8-bit machines frequently cheat. Things on screen update ar different rates. Updates may be made directly into the visible screen memory and may even take several frames for everything to be completed. With no way to automatically detect the "start" and "end" of drawing, you can't really determine FPS. Anf even if you could, FPS is pretty meaningless if different elements of the game update on different cadences

e.g. If the player updates every frame, half the enemies on one frame, half in another, the score every 10 frames - what is the "frame rate"? 50fps, 25fps, 5fps? It's all a bit meaningless.

Anthony Flack

A good example would be Dragon Attack, which updates the player and player bullets every frame, but the enemy bullets only every third frame. 

andycadley

Games which continuously scroll and have detailed backgrounds are usually the easiest, since you can sample a few small sections of the screen and figure out how frequently they change. Mostly that would get you a "good enough" estimate.

For anything else you're kind of forced to either analysing the code (which is hard) or just going by gut instinct. A solid 50fps is usually easy to spot because it looks incredibly smooth, mostly because we're more used to watching TV at 25fps. Beyond that it's often just about how sluggish it feels.

From a player's perspective, a lower actual frame rate that is at least consistent is usually preferable to one that varies though. A game that runs at a solid 16.6fps will feel fine, a game that mostly runs at 25fps but drops to 16.6 when it gets busy will generate a lot of complaints about suffering from slow down.

Powered by SMFPacks Menu Editor Mod