Page 1 of 1
4.2-rc1 entity client <-> server sync broken

Posted:
Sat Aug 11, 2012 22:13
by sapier
hello, I know entity handling has been buggy in 4.0 ever since. But in 4.2-rc1 it's gotten worse ever at least when I play it.
So what exactly am I talking about:
1) huge amount of errors like this
ERROR[ServerThread]: ServerEnvironment::deactivateFarObjects(): id=19 m_static_exists=true but static data doesn't actually exist in (0,1,-3)
2) entitys not getting loaded/unloaded correctly und chunk load/unload
3) crashes upon errors of type 1)
4) entity duplications
5) health not beeing in sync between server and client (resulting in death animation whyle entity still there)
Does anyone else experience similar problems or do only I have them?

Posted:
Sat Aug 11, 2012 22:22
by PilzAdam
1) Only in some dev states in my carts mod.
2) Yes
3) see 1)
4) nope
5) nope

Posted:
Sat Aug 11, 2012 23:13
by sapier
did you find out what triggered 1) in these dev states and how to avoid it?
addon to 4) it's not quite duplication bot more a factor 4

Posted:
Sun Aug 12, 2012 09:43
by PilzAdam
sapier wrote:did you find out what triggered 1) in these dev states and how to avoid it?
Sure. It appears when the objects are deactivatet and the code is changed. When they now are activated the new code is not compatible with the old one, wich created the deactivated objects.

Posted:
Sun Aug 12, 2012 14:02
by sapier
I'm not sure I really got it. What do you mean with "code changed" lua code or minetest code?
I thought an entity merely consists of a position, an id and the saved static data?
If this is correct changing anything within lua shouldn't do any harm?

Posted:
Sun Aug 12, 2012 14:36
by PilzAdam
sapier wrote:I'm not sure I really got it. What do you mean with "code changed" lua code or minetest code?
I thought an entity merely consists of a position, an id and the saved static data?
If this is correct changing anything within lua shouldn't do any harm?
When the object is deactivated by the engine is has a staticdata wich is create in lua. When the engine activates it again the staticdata is given to lua. Now if the staticdata is createt in an old version of the entitiy code and the object is activated in a new version of the lua code it might happen that the new code can not understand the "old" satictdata.

Posted:
Sun Aug 12, 2012 14:59
by sapier
Ok that far I'm with you ... BUT staticdata is directly passed to the entity so this message would originate from lua code and not from core. That's another problem.
If I do understand servers message corrctly it trys to save some static data which aren't existing.
In my opinion this is something like setting a flag to remember "I need to save some data later" and then when evaluating that flag not having any data available to save.

Posted:
Sun Aug 12, 2012 15:06
by PilzAdam
I now that it can cause lua errors but as I said i had this messages only in development of my carts mod when i change on_acitvate() and get_staticdata().

Posted:
Sun Aug 12, 2012 16:05
by sapier
ok i think that's another problem. I think I'm the only one doing that excessive entity usage :-)