Desync of attached objects, stream?
#1

Hello,

I have noticed this weird bug and I am sure this is not script related.
It has to do with attached object which are attached to a vehicle. In my case, a shipobject attached to a boat.

[ame="http://www.youtube.com/watch?v=DDGFqemASAc"]http://www.youtube.com/watch?v=DDGFqemASAc&feature=*********[/ame]

Things I can say about what happened in this video:

1. Spawning has most of the time sync, depends on who has spawned (the driver or the player).
2. When Player A is driving and Player B is on the ship and is synced and leaves the position and moves around and then comes back, the player is desynced (weird velocity problems).
3. When Player A is not driving and Player B is on the ship and is desynced and leaves the position and comes back to the position WITHOUT moving when he/she changed position, the player is still desynced. (weird velocity problems when Player A drives).
4. When Player A is not driving and Player B is on the ship and is desynced and leaves the position and comes back to the position WITH moving when he/she changed position, the player is synced when Player A starts driving the boat.

My thoughts:

There is something wrong with the streaming of attached objects.
When you move location to solid objects, which aren't attached and afterwards you create those attached objects, you are synced, but once they are already created and you move location to the attached objects, there are these weird velocities problems...

What are you thoughts?

EDIT: I would like to say that when noone is driving, the boat is destroyed, once Player A drives, a boat is created.
EDIT 2: Didn't get it? I gave an explanation on irc:

Код:
<Strawhat>: Ok, I'll explain it.
<Strawhat>: When Player A and B are on a boat, which has attached objects and Player A is driving, while Player B is walking on the attached objects, they are both synced.
<Strawhat>: But once Player B teleports to a different location and walks a bit there and comes back to the ship and walks on the attached objects.
<Strawhat>: Player B has weird desync problems, weird velocity problems.
<Strawhat>: The only way to fix that, is to remove the attached objects and teleport away and back again.
<Strawhat>: If you create a ship with attached objects again after you did that, you can walk normally again on the attached objects.
<Strawhat>: I have to say that the ship vehicle does get destroyed and recreated too.
<Strawhat>: That link has a video to it though, where you can view it.
<Strawhat>: So
EDIT 3:

I found out this only happens with dynamic object, which are actually playerobjects. SA-MP 0.3e released AttachPlayerObjectToVehicle, I think something went wrong with it, since normal objects attach correctly to a vehicle and there are no velocity problems with normal objects, only with dynamic (player) objects. I think this is a great find.


EDIT 4:

Requested by Jernejl,
I've uploaded this script for you, so you can test it yourself, you can do this alone too.

/shipobject makes a normal ship, with CreateObjects.
/shipdynamicobject makes a dynamic ship, with CreateDynamicObject.

* Baboon slaps yourself up on one ship (remember which one it is) and do /savepos, move a bit around and then do /pos, you will get teleported on the ship you were on. If this is the normal ship, everything is fine, but when you do the same with the dynamic ship, you get these weird velocity problems. around a bit with a large trout.

Apart from that I've also added a /spawn command.


http://pastebin.com/4bsmy7Zv

EDIT 5:

IT also happens with normal objects (static onces). It only happens if you first destroy them and later recreate them. Normal teleporting is fine though, but once you destroy and recreate them later, you have these problems too.
Reply
#2

You should use some function which detects if player is on ship, and then sync's him along with ship. For example if you TP away, and then back, script detects that you're on the boat and re-sync's you.

Not sure if this might help, not so big pro in scripting, but thought of giving at least some help.
Reply
#3

I heard of the evil that you camp with the same issues. I hope you fixed it that way.
Reply
#4

There are some "Talks" with what it can be fixed not sure though.
You need a timer which set's the speed from "Slow" to "the real speed" so the player is standing Sync'd with the object.
If the ship moves directly fast the player will be De-sync'd.
Also i have heard that how big object then the less these sync shit.
Good luck to both.
Reply
#5

Correct. Ive informed The Evil about this. Rudy I am not sure whether that works, because i've noticed that even when the ship isnt moving, you can have this surfing bug.
Reply
#6

Editted the first post.
Check EDIT 3
Reply
#7

Cool, you found any fix yet?
Reply
#8

As i said it"s a samp bug. The temporary fix is to use normal objects instead of dynamic objects.
Reply
#9

Requested by Jernejl,
I've uploaded this script for you, so you can test it yourself, you can do this alone too.

/shipobject makes a normal ship, with CreateObjects.
/shipdynamicobject makes a dynamic ship, with CreateDynamicObject.

* Baboon slaps yourself up on one ship (remember which one it is) and do /savepos, move a bit around and then do /pos, you will get teleported on the ship you were on. If this is the normal ship, everything is fine, but when you do the same with the dynamic ship, you get these weird velocity problems. around a bit with a large trout.

Apart from that I've also added a /spawn command.


http://pastebin.com/4bsmy7Zv
Reply
#10

This is not a new bug ...
The Object surfing was bugged for ages.. Example: when you are on a moving object and you try to jump from it , you are still moving in mid air with the object. Or another one: If you are on a object , when it rotates your rotation is not set as the object rotates. Or another one: If you are for example in the corner of a square and the square starts to rotate you are not moving.

In my oppinion this should be the first necessary update to SAMP 0.3e R3 or 0.3f
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)