Coder Social home page Coder Social logo

Comments (6)

doomlaser avatar doomlaser commented on July 23, 2024

opened up an issue on similar lines. Just saw this. I would love to see this game running at 60fps..

from avara.

assertivist avatar assertivist commented on July 23, 2024

@doomlaser

changing the frame timing has a lot of implications on gameplay, as a lot of the physics and animations are very simple calculations expecting a constant framerate (do a search for "frametime" in this repo to see what i mean)

This isn't to say that we haven't been working on this. There is a 'testing' branch that you can check out. This branch has a few automated tests set up to show that certain calculations have been changed to be framerate independent. It's just a question of finding every single spot there is a framerate dependent calculation and replacing it with an independent equivalent (and writing tests to make sure).

If you want to try it out, change the "frameTime" instantiation value in CAvaraGame.h. 64 is the old game's frametime, you can make the game faster by lowering this number. I believe a value of 16 would give you 60FPS.

from avara.

rherriman avatar rherriman commented on July 23, 2024

I was just responding to this myself. But yes, this issue will take a lot of work to get operating, at least at a level that we feel good about. The first order of business is refactoring a significant amount of code to make it possible to test (@jonathan-voss did a lot of this work already), then write tests for every projectile/AI/logic object/etc. at the original framerate so we can be sure we won't deviate too far from the original outcomes. Then we can take a crack at updating their calculations to be independent from frametime, and write even more tests at additional framerates to make sure they fall within some narrow threshold of the original value.

Unfortunately identifying every moving part that needs testing and actually writing tests is not particularly fun or sexy work, so it hasn't been worked on for awhile... plus, people are busy!

from avara.

assertivist avatar assertivist commented on July 23, 2024

Update on this: The tests and basic framework for changing the framerate have now been merged into
master with #38

from avara.

assertivist avatar assertivist commented on July 23, 2024

Sorry for the comment spam--the easiest way to play with it is here: https://github.com/avaraline/Avara/blob/master/src/game/CAvaraApp.cpp#L58

Change this 64 constant to a different number. 1000 divided by this number is the FPS:

  • 64 for the original 15.625 FPS
  • 32 for 31.25 FPS
  • 16 for 62.5 FPS <-- the final goal

We've made progress as far as the amount of things Avara is doing to render a given frame, so this should be achievable relatively easily. If you run make/tests and then build/tests you can see the gameplay elements that have already been fixed so that they scale with this frametime. Lots of things are still not scaled, you'll notice that jumping in particular will make you fly very far at lower values.

from avara.

rherriman avatar rherriman commented on July 23, 2024

Just wanted to note that a lot of work has been done on this in the fps-hybrid branch, though the approach does not actually decouple motion from frame time. It just updates game-play code so that it behaves correctly when different frame times (8ms, 16ms, 32ms, and 64ms) are used.

from avara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.