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

Misfeature: Gravity is currently in fractions of 60. #14

Open
zaphod77 opened this issue Feb 12, 2022 · 2 comments
Open

Misfeature: Gravity is currently in fractions of 60. #14

zaphod77 opened this issue Feb 12, 2022 · 2 comments

Comments

@zaphod77
Copy link
Contributor

zaphod77 commented Feb 12, 2022

This isn't enough precision to do TGM gravity accurately.

TGM gravity is effectively in fractions of 128.

Converting the gravity system would allow for 100% accurate gravity tables for TGM modes, and allow for more accurate sega old school (though still not perfect). Gameboy old school cannot be done in fractional gravity due to all the prime number gravity framecounts used.

Note that while every gravity can be represented, the timing of the changes require a separate table, as well as an ARE after line clear table to accurately do the modes.

@nightmareci
Copy link
Owner

nightmareci commented Feb 17, 2022

At least two systems have to be implemented, with each mode made to use the appropriate one:

  • TGM modes use fixed point arithmetic internally, 16 bits for the integer part, 16 bits for the fractional part, but the gravity tables don't use the full precision.
  • Sega's gravity internally operates in frames-per-row, which requires another system, as not all frames-per-row gravity rates can be accurately implemented in TGM's system.
  • It sounds like Game Boy's system is the same as Sega's.

Technically TGM gravity can be implemented perfectly with floating point arithmetic, because all the math operates over power-of-two fractions, which are represented exactly in floating point, but it's done with 32-bit integers originally. Frames-per-row gravity can't be represented perfectly with floating point arithmetic, however.

I don't know if the current base 60 gravity system is even originally used in any of the supported modes, if not then we don't even need it anymore.

@zaphod77
Copy link
Contributor Author

it's currently used in everything, and would still need to be used in original and simple modes. And probably also in versus. Though we may be able to remove it form simple modes, if we can get the real guideline timings. but would still need to be there fo original-beginner, master, 20g and doom.

Tomoyo-flash basic woudl use sega system, while the sakura, target and edit woudl use tgm gravity. i'm not sure waht e-heart would use.

old style uses frames per line, and never goes above 1g.

TGM modes effectively use fractions of 128, so it's reasonably simple to change 60 into 128, 59 into 127, and 30 into 64, and use integer math.

segatet can be done with great enough fraction denominator. annoyingly high, but still within the 32 bit limits.

old style GB, forget it. you MUST use frames per gravity unit. too damn many primes.

PLUS, we need to add speedchange level tables, to get all modes cloned from TGM correct. currently changes from them are every 10 levels, and that's NOT how TGM games actually work. Hebo mini does in fact do this in master-extra and devil-quake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants