Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame rate / limiting -- what is a 'frame'? #56

Open
Kroc opened this issue Jun 20, 2019 · 4 comments
Open

Frame rate / limiting -- what is a 'frame'? #56

Kroc opened this issue Jun 20, 2019 · 4 comments
Labels
help wanted Extra attention is needed speed More sanics

Comments

@Kroc
Copy link
Owner

Kroc commented Jun 20, 2019

Original Elite has no real concept of frame limiting, the main loop just goes as fast as it can and the physics/A.I. and rendering all run one after the other.

Elite 128 by Uz has an imperfect frame-limiter, but given that we have a complete disassembly with the freedom to modifying code drastically, we should look at what would be an ideal frame strategy.

My own vague opinion is that the physics & A.I. should be run on interrupts (probably throttled to 15fps), and have the 'main loop' running the screen rendering permanently. This should allow the rendering speed to scale smoothly and to extremes. i.e 20 MHz SuperCPU. A potential flaw with this idea is the confusion of a different set of lines to draw being generated whilst the renderer is already half-way through the set. A line buffer would be needed and this may increase memory demand considerably.

@Kroc Kroc added help wanted Extra attention is needed speed More sanics labels Jun 20, 2019
@Kroc Kroc pinned this issue Jun 20, 2019
@dyme6510
Copy link
Collaborator

dyme6510 commented Jun 20, 2019

It is probably much easier to keep alternating between animate and draw, but to allow the physics to

  1. 'catch up' to the desired game speed by skipping a draw phase.
  2. emulate double or only half a time slice when drawing was fast.

So e.g enable the physics to run 50/25/10 fps and count the screen cycles, choosing the right emulation and repeat if still not up to game speed.

@mrdudz
Copy link

mrdudz commented Jun 20, 2019

is there even "physics"? iirc its all pretty linear and simple, so making it run at smaller steps (on a faster cpu) shouldnt be too hard

@Kroc
Copy link
Owner Author

Kroc commented Jun 20, 2019

Actually, if we can run at 50/60fps (e.g. with SuperCPU or emulator turbo), then we should be aiming to run the logic at 50/60fps and scale the logic according to frames missed; but, this does raise the question of what should / shouldn't be scaled to full-speed -- A.I. decisions for example should probably be kept to 15fps to retain the feel of the original game.

@Kroc
Copy link
Owner Author

Kroc commented Mar 18, 2020

A note that Uz's Elite 128 2.0 has been released https://csdb.dk/release/?id=185931 and this adds support for various accelerators and a frame-rate limit of 12.5fps (PAL) / 15fps (NTSC)

@Kroc Kroc unpinned this issue Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed speed More sanics
Projects
None yet
Development

No branches or pull requests

3 participants