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

frozen minions, portal problems & teleport problems #75

Closed
jpw1991 opened this issue Feb 5, 2023 · 10 comments · Fixed by #198
Closed

frozen minions, portal problems & teleport problems #75

jpw1991 opened this issue Feb 5, 2023 · 10 comments · Fixed by #198
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed needs testing Steps to reproduce are unclear.
Milestone

Comments

@jpw1991
Copy link
Owner

jpw1991 commented Feb 5, 2023

Describe the bug

Reported on Nexus:

Right so the new update 1.7 that made the minions stay in place and wait now permanently makes them stay in place, like after going through portal and coming back any skeletons are just frozen in place, even if they're told to follow again and even the teleport command doesn't work on them they just flicker as if teleporting and then just stay in the same spot, I can summon new ones but then after I leave and come back they also just get frozen.

EDIT: ok this seems to happen when my friend is in the area and i leave with them there, once my friend leaves the area and i return the skeletons get unfrozen and respond to a follow command

Key points

  • Minions appear frozen after player teleports
  • Has some connection to nearby players in the area

Desktop (please complete the following required information):

  • OS: Unknown
  • Mod version: 1.7.0
  • Game version: Unknown

Leads to investigate:

Pfhoenix — Today at 3:49 PM
sounds like there's an edge case issue with network ownership changing when a player that owns the zone leaves it
and ownership switches to another player still in the zone
Hugo the Dwarf — Today at 3:57 PM
yeah you might need an RPC or something to telly them, sounds like what Pfhoenix mentioned
Cheb Gonaz — Today at 4:01 PM
Ok thanks
Pfhoenix — Today at 4:02 PM
you may need to look at your code and do ZNetView ownership checks
yeah, it's definitely an ownership issue
what I'm not sure of is how ownership works when you spawn your skellys while not the zone owner
if your client owns the skellys, then that'd definitely explain the behavior you're seeing
Cheb Gonaz — Today at 4:15 PM
hmm, yeah I think they do own them
so the server should own them? makes sense..
Pfhoenix — Today at 4:16 PM
is your code looking for things the client should own and having the client take ownership?
Hugo the Dwarf — Today at 4:19 PM
server will only own something if no players are nearby, ownership is given to 1st server, 1st come basis
so it's a zone by zone ownership
if a player uses a portal and he was the "owner" of that zone, the other player is the owner, so making calls like "teleport this" doesn't work
unless you do an RPC or w/e to find the real owner of the zone to run the command
Pfhoenix knows a bit more, but that's my understanding
Pfhoenix — Today at 4:21 PM
you're correct
might be an interesting test to have the client find the skellys it thinks it should own and take ownership
see what happens
Hugo the Dwarf — Today at 4:22 PM
I ran into this issue with my own mod for "commandable tames (All tames)" my buddy didn't install the mod, when I was the owner, I could command follow all I want, when he was the owner it'd say I told it to follow, but it didn't actually do the command for real
hmm... that'd be interesting, client A owns zone, Client B owns Skellies
what would happen?
what was the command to force ownership of a ZDO/ZNV?
Pfhoenix — Today at 4:23 PM
ZNV.setowner, I think
nope, it's via ZDO
ZDO.SetOwner
and you pass the ZDOID
well, ZDOID.GetHash
Hugo the Dwarf — Today at 4:24 PM
ZDO.SetOwner(Player.m_localPlayer.m_znv.GetZDO().GetID())?
lol
Pfhoenix — Today at 4:24 PM
or is it the userID?
Hugo the Dwarf — Today at 4:24 PM
idk I'd hav eto crawl with DNSpy
Pfhoenix — Today at 4:24 PM
since userID is a long
I'm looking through the code right now
Margmas — Today at 4:25 PM
Well the quickest way is ZNetView.ClaimOwnership();
Pfhoenix — Today at 4:25 PM
that sounds familiar, try that 🙂
Margmas — Today at 4:26 PM
SetOwner is needed when giving control to a different player
Pfhoenix — Today at 4:26 PM
right
somewhat unrelated, do you know of a way to go from ZDOID to gameobject?
ZDOID gets you the ZDO, but I'm not finding an easy link back from ZDO to gameobject
Margmas — Today at 4:27 PM
Yeah, gameObject.GetComponent().m_zdo.m_uid
Pfhoenix — Today at 4:27 PM
no, that's from gameobject to id
Margmas — Today at 4:27 PM
You mean the other way
Pfhoenix — Today at 4:27 PM
reverse that
in other words, the easiest way to uniquely identify a network object
Margmas — Today at 4:28 PM
ZNetScene.instance.FindInstance(targetId)
Pfhoenix — Today at 4:28 PM
ahhh thanks
Hugo the Dwarf — Today at 4:29 PM
ZDOMan can't find it either?
or is that the faster way using the ZNS
Pfhoenix — Today at 4:29 PM
I didn't see anything in ZDOMan
ZDOMan seems to be more about managing just the ZDO data specifically
Margmas — Today at 4:29 PM
yep
Hugo the Dwarf — Today at 4:30 PM
so is the ZDOID the "targetId"
Margmas — Today at 4:30 PM
yes
Pfhoenix — Today at 4:30 PM
yep
I have an idea for when you capture a creature
going to have them shrink into the spirit stone
need to run it on every client independently, so going to disable basically every component that does something on the gameobject
Hugo the Dwarf — Today at 4:31 PM
so what happens when it's picked up and destoryed to become ItemData inside the inventory
Pfhoenix — Today at 4:32 PM
the customdata lives on in the itemdata
zdo saves into a zpackage and then I grab the base64 string and shove that into the m_customData dictionary
Hugo the Dwarf — Today at 4:33 PM
but if the creature shrinks down and is parented to the spirit stone...
Pfhoenix — Today at 4:33 PM
as well as a couple other things
nope, no parenting changes
just an animation event
well, animated event
no mesh animation
code driven scale and position changes
Hugo the Dwarf — Today at 4:33 PM
sails have that, idk if it's a unity thing, or an IG utils thing
scaleto
or something
Pfhoenix — Today at 4:34 PM
I'll check it out
if I don't have to write the code, that's fine
but it's not complicated code, so I may just do it myself and save the time digging around
Hugo the Dwarf — Today at 4:34 PM
they have scaling and rotation, idk about position
Pfhoenix — Today at 4:34 PM
oh, I should totally rotate it too
that'd be funny to see
it'd be really neat if there were a custom motion blur post-process effect at the same time
get a ghostbusters style capture thing going

@jpw1991 jpw1991 added the bug Something isn't working label Feb 5, 2023
@jpw1991 jpw1991 added this to the 1.7.x milestone Feb 5, 2023
@jpw1991 jpw1991 self-assigned this Feb 5, 2023
@jpw1991

This comment was marked as outdated.

@jpw1991

This comment was marked as outdated.

@jpw1991 jpw1991 added the needs testing Steps to reproduce are unclear. label Feb 13, 2023
@jpw1991

This comment was marked as outdated.

@jpw1991
Copy link
Owner Author

jpw1991 commented Feb 21, 2023

I think this is related to restoring the ZDOs. Maybe try it not only in awake but on enable, or check periodically, idk

@jpw1991 jpw1991 added the help wanted Extra attention is needed label Mar 2, 2023
@Kherae
Copy link

Kherae commented Mar 5, 2023

have had this issue (or similar) with the server i'm playing on, with some friends. main problem is related to jankiness with the game's networking implementation being basically peer 2 peer (even with a dedicated server)
one of the ways it triggers is if player 1 is host with their minions summoned, with player 2 on site...player 1 goes through portal, game switches player 2 to host, player 1 comes back....minions are dissociated or bugged and cannot be summoned...it's possible to get them to 'follow' but they will rubberband back

@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 11, 2023

@Kherae thanks for your assessment. Yeah, I have no idea what's causing this or how to fix it... It's mega annoying.

@Kherae
Copy link

Kherae commented Mar 11, 2023

the most I can think of is "bad data handoff on host transition", unfortunately.

@jpw1991 jpw1991 pinned this issue Mar 31, 2023
@jpw1991 jpw1991 changed the title 1.7.0: portal problems & teleport problems frozen minions, portal problems & teleport problems Mar 31, 2023
@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 31, 2023

This is unfortunately still a problem and is the biggest problem facing the mod. I hope I can figure out how to fix it soon.

@jpw1991
Copy link
Owner Author

jpw1991 commented Apr 20, 2023

Idea: see if adding something to the Update/FixedUpdate can help

@jpw1991
Copy link
Owner Author

jpw1991 commented Apr 22, 2023

I think this is finally fixed

@jpw1991 jpw1991 unpinned this issue Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed needs testing Steps to reproduce are unclear.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
  翻译: