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

Smooth out gliding so movement isn't (as) jerky #11159

Merged
merged 3 commits into from Aug 29, 2015

Conversation

MrPerson
Copy link
Contributor

Only applies to non-ghost, non-camera mob movement. Scales automatically to any fps and any move delay.

Also took this oppurtunity to remove tickcomp because it was USELESS and shit.

All the rounding is because of floating point imprecision. round(2.7, 0.9) != 2.7, for example. 2.7 + world.time would wind up being < than world.time 3 ticks later even though they should be equal.

Only applies to non-ghost, non-camera mob movement. Scales automatically to any fps and any move delay.

Also took this oppurtunity to remove tickcomp because it was USELESS and shit.

All the rounding is because of floating point imprecision. round(2.7, 0.9) != 2.7, for example. 2.7 + world.time would wind up being < than world.time 3 ticks later even though they should be equal.
@RemieRichards
Copy link
Contributor

Interesting 👍

@GunHog
Copy link
Contributor

GunHog commented Aug 12, 2015

Add a .gif, please?

@RemieRichards
Copy link
Contributor

@GunHog

smooth movements
gif

rofl.

@GunHog
Copy link
Contributor

GunHog commented Aug 12, 2015

Ehh, that was a dumb statement. A video, then?

@MrPerson
Copy link
Contributor Author

github doesn't support webm

Plus I'm awful at recording them.

@Fox-McCloud
Copy link
Contributor

correct me if I'm wrong, but isn't havin wonky movements, in part, due to you guys manually setting the oudated glide_size var on all atoms?

@MrPerson
Copy link
Contributor Author

glide_size is only outdated if one doesn't use pixel movement, which we don't

@WJohn WJohn added the Feature Exposes new bugs in interesting ways label Aug 12, 2015
@MrStonedOne
Copy link
Member

Some notes, I think the rounding out of the world.ticklag might be doing you more harm then good.

Rounding out loses preciseness, called rounding errors as I'm sure you know. Doing multiplication or division with these rounded out numbers compounds the rounding error. I noticed some times with slower movements, it could be choppy, like the glide was too slow compared to the move speed, and I'm thinking these rounding errors might be to blame.

at fpses of 24 or 60, you have world.ticklags of 0.4166666666 and 0.1666666666. in the case of 24, you round to 25, in the case of 60, you round to 50.

This also leads to issues with running anything above 75fps as this will round out to 100fps, a rather big jump

@MrPerson
Copy link
Contributor Author

There may not be a perfect solution (for now) because byond enforces glide_sizes in whole numbers anyway, but yeah, I'll do something about the rounding.

@RemieRichards
Copy link
Contributor

if you need a whole number, and thus NEED to round, then you should do it after all the calculations, so you're rounding the "final" number, this mitigates rounding errors in the rest of the calculations as much as possible.

Rounding now happens after calculations instead of before. The delay is also unrounded.
@MrPerson
Copy link
Contributor Author

Should be right now

@MrStonedOne
Copy link
Member

Something is messed up in the math, glidesize is much too high on higher move speeds, and too low in lower move speeds.

Edit: figured it out, byond floor()s glide_size, so 0.9 == 0, 1.9 == 1, etc. (and 0 is the same as no glidesize) mixed with the ceiling() for ticks. MORE COMPOUNDING! =P

You can fix that by just checking if mob.glide_size is glide_size, and rounding if it isn't.

In fact, I'm testing that as a fix and gonna pr it to you if it works

Edit2: Actually, you want it to ceiling() glide_size since it's better to get to the square before your next move, then to get to it late and 'jump' to it during the next move.

@MrStonedOne
Copy link
Member

@MrPerson
Copy link
Contributor Author

I don't really want to have to redo this after http://www.byond.com/forum/?post=1882348#comment16384168

Nice 404 MSO

@MrPerson
Copy link
Contributor Author

There we go, exactly as requested. It does feel a bit better in testing with odd fps's and slower movement speeds.

@Steelpoint
Copy link
Contributor

Continue to merge this now please.

theOperand added a commit that referenced this pull request Aug 29, 2015
Smooth out gliding so movement isn't (as) jerky
@theOperand theOperand merged commit 137f0e0 into tgstation:master Aug 29, 2015
@WJohn
Copy link
Contributor

WJohn commented Aug 29, 2015

There's some big visual problems when dragging or grab-dragging people or objects, mrperson.

@ChangelingRain
Copy link
Contributor

smooths movement
movement gets more jerky

very good excellent

@AnonymousNow
Copy link
Contributor

As somebody actually playing on the server right now, the amount of lag is absolutely incredible, and judging by what I've heard from people, sourced to this here update.

@theOperand
Copy link
Contributor

No it didn't. It sourced to MSO increasing the FPS massively, which means
that EVERYTHING processes much more
Op 29-aug.-2015 22:27 schreef "AnonymousNow" notifications@github.com:

As somebody actually playing on the server right now, the amount of lag is
absolutely incredible, and judging by what I've heard from people, sourced
to this here update.


Reply to this email directly or view it on GitHub
#11159 (comment)
.

GoryMoon pushed a commit to Ravenholdt/hdstation that referenced this pull request Oct 25, 2020
Smooth out gliding so movement isn't (as) jerky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Exposes new bugs in interesting ways
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants