suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
49 stars 11 forks source link

[Suggestion]Rootmotion support for monster entity #2257

Closed moepi2k closed 11 months ago

moepi2k commented 11 months ago

Would be great if monster would support rootmotion. For attacks, gethit, death and so on.

insthync commented 11 months ago

Did you try to use CharacterControllerEntityMovement as a monster's entity movement?

moepi2k commented 11 months ago

No never tried that. Im in vocation atm and thinking about how to expend monster to make it more interesting with attacks. So though rootmotion is a cool thing. But i will try your idea

moepi2k commented 11 months ago

i tested rootmotion for monster with CharacterControllerEntityMovement, in Singelplayer it works great (without pathfinding) need to implement something else i think. but in mmo the monster always teleport back when walk.

so i tested it also for player with rootmotion, and there is a weird behavior also. check here two clients with rootmotion. https://gyazo.com/36c3404bd7568a48357757eb10f1781b

rootmotion on local player works fine, but sometimes the player not stop serverside which leads to teleport character

insthync commented 11 months ago

Which kind of entity movement, and character model, how can I reproduce it?

insthync commented 11 months ago

Try latest commit, works for non secure only

moepi2k commented 11 months ago

For player and monster i use CharacterControllerEntityMovement and PlayableCharacterModel.

Ok i will test latest when at home. So means rootmotions cant be used with server auth?

moepi2k commented 11 months ago

ok i tested 185b, same issue with rootmotion while using server auth movement. i dont recommend non secure because you can hack, even when there is speedhack protection. i tried in editor and u can just move player to any position.

the server auth rootmotion issue i think is simple to fix. its just that on serverview the player sometimes not stop moving. something changed somewhere but i cant find what.

insthync commented 11 months ago

Then try to fix it and make a pull request

moepi2k commented 11 months ago

Ok i try

moepi2k commented 11 months ago

i tried to debug it and figured out that the issue only occure when use WASD. PontToClick is fine and player stop.

do i look in the right place? -> BuiltInEntityMovementFunctions3D.cs ?

insthync commented 11 months ago

Yes, you may try to just increase stopping distance

insthync commented 11 months ago

It is not easy because it can't find next move distance from root motion animtaion

moepi2k commented 11 months ago

ok got it, thought its just a serverside thing not register the stop movement.. i saw ur commit and tested it, now the rootmotion is more broken then before (out of sync and player walk circles) even with non secure

https://gyazo.com/ce6b9c8cb81573951920d74415839307

what exactly changed in the last few kit version? before rootmotion worked better, maybe we can redo those changes?

insthync commented 11 months ago

10 hours to do it, and it is broken, very tried, what did you do and did you found something?

moepi2k commented 11 months ago

I saw ur commit, im really sorry that u invest so much time and its not working. Its first time i messed with the movement code from kit so it took time to understand where to check and still i dont understand it, because its really complex. I thought theres a simple missing thing which should stop the player serverside but itsseems its not. Dont get me wrong i not want to force u to fix it. Its still the best kit out there and i just want to report bugs when i found some, so that the kit can be improved.

I used rootmotion for movement for a prototype projct 2 years ago and i remember that there was nlt an issue, but maybe i dont tested it not that mucj like now.

I think the problem in this case is. People always try to use those features which provided by kit, and when they notice its buggy they will make reports :(

insthync commented 11 months ago

Did you try the latest one? it should be better.

moepi2k commented 11 months ago

Im at home in few mins and test it

moepi2k commented 11 months ago

ok tested, non secure looks good now, serverauth not working. serverside the player never move.

insthync commented 11 months ago

Try my test project, https://github.com/suriyun-mmorpg/UnityMultiplayerARPG_TestRootMotion

moepi2k commented 11 months ago

hmm yeah strange. in ur testproject CC and CC_P is working fine, the RB has same issue like my player in my project. seems nothing to do with secure or non secure. need to check then whats going on.

thank you very much