TiltedEvolution icon indicating copy to clipboard operation
TiltedEvolution copied to clipboard

Naked NPCs

Open matorina22 opened this issue 3 years ago • 4 comments

No mods installed.

Description

Host and second player see naked NPCs around the world every now and often with disconnecting and reconnecting to the server same thing happens. Doesn't make DCing and reconnecting every few minutes a pleasurable gameplay.

Reproduction rate

Just by connecting to the server and playing, entering new zone and similar.

matorina22 avatar Jul 23 '22 22:07 matorina22

Also seeing this plenty.

cliffclick avatar Jul 24 '22 02:07 cliffclick

As a host on both an internet based connection to our server or over our local LAN this issues happens consistently to the host only. As the host when I connect alone to either type server NPCs are fully clothed. As soon as one player connects random NPCs begin to appear without any clothes in set locations. Also when some NPCs transition from one point to the next, for example walking through a door or gate they can randomly appear on the other side without any clothes.

Using the resurrect or resetinventory commands can reset their clothes. However, if they transition again they can loose their clothes again. This occurs regardless if mods are installed on not.

Crowlikedream avatar Jul 27 '22 14:07 Crowlikedream

i partially solved using various method:

1), if naked people are not so much, like one or two sometime, just open the console, click on the NPC so his ID appear in the center of the console, than type /resurrect , that make him instantly respawn at the position with clothes and weapon, this dont stop the task they are doing. Attention, only the party leader\host have to use console comand. Dont use it if you are the party member, thell your leader to do!

  1. check if this happen in single player before the connection on the server, if you have people with dress in single player, but the same one naked in multiplayer, take 10 minutes in single player to make a fast travel to the far distance point your able to reach from your initial position, then turn back, than ensure to exit almost one time in the skyrim open world, then ho to a city, enter in a closed house (i use my personal house) and then connect to the server and play

3)first close the server, than delete the server cache in the mod organizer mod folder, (where the skyrimtogetherreborn.exe e server.exe is located), found the cache folder and then the Session storage folder, empy this one (make a backup first) in my case the location is K:\Modding\MO2\mods\Skyrim Together Reborn\SkyrimTogetherReborn\cache\Session Storage After that, log in the game, do the step 2 (facoltative, but i do cause im crazy), people are more likely to spawn with dress now untill all the session, have to re do the procedure when server stop.

--> IMPORTANT thing is to make sure the party leader ALWAYS enter and exit from a zone for first. the first to log in the server, the first to enter a dungeon1city and the first to exit. Do the party only when you are near. No problems on enter \ exiting alone in city store, but, after you all make your business in the city, take a rejoin at the city exit door, ensure party still work (you see your friend healtbar) and then exit the city with the party leader first and other one after, one by one. i wait untill my party leader as finish the load to open the door for exit, etc.

Despite all that, i can continue to see some people naked time to time, i think is a server bug with some loading especially if you have armor mod, i have immersive armor and the book of uunp, anyway from have all the city naked now i have just a couple of guys time to time without dress and i can fast use the step 1 to resolve.

PS if you may have added or remove armor\clothes mod douring gameplay, wait 30 in game days to "regenerate" the spawn of inventory of npc. you can do using the waiting option, take about 10\15 minutes in real to do, or can use command /set timescale to 100000 and you make 1 day at second, after 31 of it /set timescale to 20 for returning at the correct skyrim time scaling. DO THAT ONLY IN A CLOSED PLACE WITH MINIMAL NPC STUFF AROUD, i use my personal house. dont do in a tavern or place with lot of ppl around, can ctd.

KiraMikamy avatar Jul 31 '22 23:07 KiraMikamy

@cosideci and I had a discord chat about how the naked NPC problem might be tackled (I'm Ujave in the thread). A bit meandering, but also had several good bug hunting tips so we wanted to capture it. Lightly edited for clarity and to remove side conversations.

cosideci — Yesterday at 9:51 AM @ujave alright so I have something. There's this issue that's been plaguing the mod for a long time: naked NPCs. Recently, I got around to debugging the issue. The exact cause isn't clear to me, but I do know why they appear naked: they don't have their equipment equipped. That might sound obvious, but it's not. This bug can have many different causes, like the items not being in their inventories at all (they are), or their items being equipped by the game logic, but not visually on the model itself (which doesn't seem to be the case here).

Anyway, long story short, the proper solution would be to further debug the issue, find the cause of why the equipment isn't properly equipped, and then fix that. This is very hard to pull off, since the bug isn't reproducible. Instead, we will settle for the next best "solution" (this is a very common pattern with this mod, best to get used to that :p ).

Whenever an NPC has been loaded, a timer should start. Maybe a second or two. After that, the client should ask the server what the state of the NPC's equipment is. If it mismatches, reapply the equipment.

ujave — Yesterday at 10:19 AM I've barely touched on it. Enough to know that a resetInventory on the leader system will propagate to the other players but not the reverse. And that the NakedNPC mod (it has a name like that, it's goal is to detect and equip naked NPCs) doesn't work under STR. [I was misremembering, the mod was Naked Dead NPCs, obiously only working on the dead. https://www.nexusmods.com/skyrimspecialedition/mods/99024]

I can generally make it happen, but not in a test-case way. Use AH Hotkeys mod, wait for it to corrupt JContainers (which it will do on every game exit because every game exit crashes during the save) and you have a pretty good chance of naked NPCs on the next launch. So that may very well be a clue; does anyone see naked NPCs without JContainers mod?

It may have something to do with some code saving and corrupting in the crash path is the point. And everyone sees crashes sometimes. Any other brainstorms?

cosideci — Yesterday at 10:21 AM I personally don't think it's related to crashing or save state being corrupted, as it happens during sessions as well

ujave — Yesterday at 10:21 AM Oh, one more clue: I've never seen naked NPCs on a freshly cleaned ReSaver save. Has anyone?

cosideci — Yesterday at 10:21 AM Particularly when two clients briefly fight over ownership when an NPC tries to walk from one corridor to the next Beyond that, I don't use mods, so I can't speak to anything related to JContainer or ReSaver But all solutions must be native, as we don't want to build a ton of mod dependencies for users to require to play the mod

ujave — Yesterday at 10:23 AM Ahh, don't think I've ever seen it in the middle of a "clean" session (no crashes, no disconnects/reconnects that often leave the extra zeroed-out Actor script)

cosideci — Yesterday at 10:23 AM The equip code (as in the Skyrim internal code) has a lot of quirks, and it is not meant to be used the way we use it (i.e. rapidly equip and unequip items on a large amount of NPCs in a short span of time) I can only guess as to why it breaks exactly, but trying to debug that is futile, I'd just check shortly after spawning an NPC whether they have the same equipment as the server, and then just fix it that way

ujave — Yesterday at 10:24 AM ReSaver isn't a mod, it's a tool used to inspect Saves for drek left by anything (deleted mods, crashes, Bethesda bugs, whatever0

cosideci — Yesterday at 10:24 AM Wouldn't require any reversing

cosideci — Yesterday at 10:24 AM I see Still, I don't use anything like that, very occasionally I'll use TESEdit So I can't really speak to stuff like that

ujave — Yesterday at 10:31 AM I'd just check shortly after spawning whether the NPC equipped their gear.. That's exactly what the Naked NPCs mod does, I'll see if the source is open.

cosideci — Yesterday at 10:47 AM If you feel like there's a better solution than the one I proposed, go for it man

ujave — Yesterday at 10:52 AM There are lots of distributed transaction issues in the logs; leaders and players fighting over NPCS is easy to provoke by going through a door together rather than leader first. And lots of times that provoked the "formid not found on server" message and related. Any correlation of "naked" with "not found on server" logs that ppl have noticed?

cosideci — Yesterday at 10:53 AM Possibly The actor management architecture can definitely use some.. cleanup Can be found in CharacterService

ujave — Yesterday at 10:54 AM OK, thx.

cosideci — Yesterday at 10:54 AM But it's not easy to streamline You're basically fighting the game, since the game will still try and manage actors Not only that, each client's game code will attempt to do that Disabling that part of the game code isn't easy either, since you'd have to recreate the AI scheduling and stuff on the server Lots I have to say on this topic, but I don't quite have the time for that rn, just look at the code, see if you can make sense of it, and message me here on privately if you have any questions

ujave — Yesterday at 10:56 AM Any test code that will do something like spawn an actor and make them walk somewhere? I'd rather not figure out Creation Kit if I don't have to. Need a way to create a reproducer

cosideci — Yesterday at 10:56 AM Oh no worries, neither do I, we don't use Creation Kit But we also don't really have "unit tests" or anything like that for game logic It's not trivial to do automated tests in games, let alone an environment like this You can test stuff manually of course We have a debug UI in which you can code your own debug views We use Dear ImGui for that You can also spawn actors through Actor::Create() There's some example code for that in TestService or DebugService or something Beware though that the ImGui rendering logic runs in the UI thread, you should only execute game code on the main thread, which you can do through the event system

ujave — Yesterday at 10:58 AM Still, you have some automated tests. I had to fix them for the "more behavior vars" code. That's getting solid enough I'll submit it, but not just before 1.6.x; will wait 'till after.

cosideci — Yesterday at 10:59 AM Well the automated tests are really only for the "modular" parts of our codebase, like the individual libraries We can't really test the client itself on that level Well we could probably, but it's not trivial So if you have ideas for that, by all means

croscas — Yesterday at 11:19 AM It might be worthing transforming this piece of text into an issue in Github so that it doesn't get lost if someone else wants to tackle it

rfortier avatar Mar 09 '24 17:03 rfortier

Should not occur in 1.6.5

Dragonissa avatar May 20 '24 20:05 Dragonissa