Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

char doesn't move in relation to speed #2661

Open
3 tasks done
Arghann opened this issue Feb 25, 2021 · 7 comments
Open
3 tasks done

char doesn't move in relation to speed #2661

Arghann opened this issue Feb 25, 2021 · 7 comments

Comments

@Arghann
Copy link

Arghann commented Feb 25, 2021

  • I have searched existing issues (https://github.com/topaz-next/topaz/issues) to see if the issue has already been opened
  • I have checked the commit log to see if the issue has been resolved since my server was last updated
  • This issue occurs on release branch (if other branch, please specify)

Additional Information (Steps to reproduce/Expected behavior) :
appear on a fresh install and all new char
@TeoTwawki

@TeoTwawki
Copy link
Contributor

TeoTwawki commented Feb 25, 2021

I need more than this. as I explained on discord the animation speed value isn't supposed to change in relation to it, and in my tests everything animation properly at a wide range of speeds from 20 to 250.

So I need more than "doesn't move in relation" - are they animating too fast, too slow, what, exactly, is wrong?

edit: I even can even provide VIDEO of me running around at 20/40/50/60./80/80/120/140/150/160/180/200/220/240/250 and it all animating correctly, so something more is going on if thats not the case for you without that line in baseentity.

@Arghann
Copy link
Author

Arghann commented Feb 25, 2021

So after build I changed speed_mod,mount_speed_mod,mob_speed_mod to 40 then run the server and noticed that the new player I just created moves faster than it should. I check with the !speed cmd the range suppose to be 0-255 but from 220 and over to 255 the char walk.

@TeoTwawki
Copy link
Contributor

so above 220 it animates wrong for you. Can this be reproduced on a stock build of the topaz release branch (no source alterations, just confs/settings) ? If so, please note what nameflags value the test character has: this may possibly be relevant.

ref<uint16>(0x2E) |= PChar->speedsub << 1;

we do this in the packet because speedSub (thats your animation speed) is actually NOT a 16 bit value, but it doesn't alight to 8 bit in either of the 2 bytes contained in that 16 bit area...And nameflags happens to have a byte of its data at 0x2B overlapping the same space..

ref<uint8>(0x2B) = (PChar->nameflags.byte4 << 5) + PChar->nameflags.byte3;

(also several other bytes of same packet with other things between them - wtf SE?!)

@Arghann
Copy link
Author

Arghann commented Feb 25, 2021

No it animates just wrong. the !speed cmd was only to check and I noticed what I told you before. Has I said there is no src alterations : all fresh new release build - only setting and conf. (i modify the src to test long after the first run - like 3 days).

nnameflags: '67108864'

@TeoTwawki
Copy link
Contributor

nnameflags or nameflags? both exist

@SirGouki
Copy link

@TeoTwawki What I think is meant (and I'd noticed this too) is Say you change the config to change the default speed for characters. When you use the !speed command for the first time, it still lists the speed as old value: 50. Mines set to 70. My player account also seems to be at 50 by default no matter what my config is set to.

@TeoTwawki
Copy link
Contributor

the only 2 errors I have found:

  1. we fail to properly clamp so people can use invalid conf values (50+220 = 270, which is beyond max speed and wraps around past to zero again)
  2. getSpeed() is not returning expected values due to it getting the member value whiel the function does an add and return instead of updating that.

Both of these are about to change.

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

No branches or pull requests

3 participants