PlaneShift

  • Status Closed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Engine → NPC
  • Assigned To
    Kenneth Graunke
    Mike Gist
    Keith
  • Operating System
  • Severity Critical
  • Priority
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: PlaneShift
Opened by Lanarel - 08.11.2009
Last edited by Lanarel - 19.11.2009

FS#3283 - [Release blocker] ALL entities gone after teleport

WHen teleporting, there are no npcs entities. AFter some time (probably going to another sector and back), they are back again.
Confirmed by Weltall.

Marked release blocker because this possibly also happens with normal players (as noticed by Peeg) and when walking to another map (as I noticed once). THis is not only for NPCs. Also players and objects are not visible after teleporting.

Closed by  Lanarel
19.11.2009 19:35
Reason for closing:  
Additional comments about closing:  

FIxed 5 times by XOrdan :)

peeg commented on 08.11.2009 23:03

I've had it happen with a player char, too.

Project Manager
Lanarel commented on 14.11.2009 01:22

After looking at the code for quite some time, I did not manage to find how to fix this. THis is what I found:
- in the server (gemActor::Teleport in gem.cpp), gemActor::UpdateProxlist is called. In that function of all nearby objects and actors, it is checked if they are close enough (and some other things) and if they are not yet on the watch list, they are added. In that case alone, a psPersistActor message is send to the client. So in case of a teleport, each npc sends a message once about its existence. It will not do so again until the npc changes (or moves) or if UpdateProxlist is called with force=true. The latter happens for example when you do "/set me invisible off", or when you move a lot. Both make all npcs re-appear if they were gone.

In gemActor::Teleport, UpdateProxlist is called BEFORE doing ForcePositionUpdate, which triggers the loading of the new map. The server sends the psPesistActor messages before the load seems to start. My idea was that all those messages were ignored until the loading is finished. When moving the call to UpdateProxlist to after the FOrcePositionUpdate, more npcs appear. Also, when things are slowed down by printfs and debugging, even more NPCs are seen, but often still not all. This seems to agree with my idea that not all messages reach the client, but more do when sending them is delayed.

However, I cannot find how this happens clientside. In psCelClient, the messages are put in newActorQueue in psCelClient::HandleMessage. This que is processed in ForceEntityQueues or CheckEntityQueues, where via psCelClient::HandleActor and AddEntity the actor is put in a list of entities. The thing that I do not get is that it nicely contains all 67 objects and npcs from npcroom even when I see none. This entitities array is only used in a few places, and all of them that do things other than print entitylabels do a nice loop over 67 entities, with meshes that are not null. I have no clue where this list is transfered to anything that should be drawn when view→Draw() is called, so I give up :). I hope someone else will understand that part.

Project Manager
Lanarel commented on 14.11.2009 01:40

Assigning to Kayden and Venge, hoping they know where to look since they touched part of this code before.

weltall commented on 17.11.2009 07:53

adding xordan this isn't a proxylist problem, altough forcing resend of entities helps. the items are in the client and sent just they never get out of the nullmesh status, it seems.

ok something more: it seems whathever the server sends while the loading map screen is showed never gets loaded in the client entirely (like it stays in a nullmesh status). this explains why forcing a proxy list update and teleporting again in the same place "fixes" it as everything is resent and that fast to load maps like npcroom get all the entities right even tough some are still amiss till the entities are resent (probably because they were the first to be sent as a matter of fact only entities which appear after the map is loaded are the one which are visible later)
note this is also probably the problem with the labels not following npc!

Project Manager
Lanarel commented on 18.11.2009 00:56

Fixed by Xordan!

Project Manager
Lanarel commented on 18.11.2009 01:24

I was too quick :(
On local server, where I had npcs gone 100% of the time when teleporting from npcroom to blackflame and back, the problem was gone. Then on ezpc, when teleporting away from Raithen elsewhere and back, Raithen was gone again. So re-opening for more testing. This may also explain why his label was at his knee.

Kenneth Graunke commented on 18.11.2009 06:10

I think labels sometimes being at knee-height is because they're getting set at the height of the nullmesh (1m cube). But sometimes the art is already loaded (gets loaded in time?) and it is set to the real mesh's height.

Project Manager
Lanarel commented on 18.11.2009 07:24

Yes, that is what we thought too (see  bug 3314  for that, which Xordan thought he fixed). This one seems even more complicated though.

Mike Gist commented on 19.11.2009 00:32

I think this is working well enough for release. Lanarel reported a few instances of npcs still missing, but on the whole it's working correct.

Project Manager
Lanarel commented on 19.11.2009 00:39

Actually, the teleport still did not work on ezpc. I hope it will not happen often when just walking somewhere though, so for player testing this should do for now. For gms/devs, doing some /set me commands should make npcs appear.

Mike Gist commented on 19.11.2009 01:31

Okay, please test again with my latest attempt :)

Project Manager
Lanarel commented on 19.11.2009 07:38

Sorry, same. In local server sometimes all npcs appear, sometimes none. On ezpc no npcs. Teleporting to jayose, the whole city there is empty. Tried with bgloading off and models.

weltall commented on 19.11.2009 08:25

looks fixed here i get the npc 100% of the times on the test server and also the labels are fixed

Project Manager
Lanarel commented on 19.11.2009 19:34

Silly me. DId not rename psclient_static.exe to psclient.exe this morning. It's fixed!

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing