samp-streamer-plugin icon indicating copy to clipboard operation
samp-streamer-plugin copied to clipboard

Objects disappearing

Open BartNWD opened this issue 5 years ago • 21 comments

Hello,

I've been using Incognito's plugin since 2012, and I've always had this problem in my script. I have many dynamic objects (and static objects too, CreateObject I use for objects that can't be streamed, such as floors to avoid vehicles falling through the dynamic objects). I have systems where players can place furniture objects in their houses, police men can place roadblocks, and admins can place objects around the map. They all work with dynamic objects, but when someone places a roadblock, furniture, or object, the object just dissapears after a few seconds.

It's not destroyed by the script, it just dissapears. Oddly enough, this only happens with objects created on the run, and not OnGameModeInit (initial maps), such as the ones I mentioned, roadblocks and furniture and dynamic objects placed by admins. This isn't a limit problem, since this also happens when placing an object in the desert with nothing scripted there.

I have a Ubuntu server in the latest streamer version. This problem is mortifying me and I am looking for a solution.

Thanks, beforehand.

BartNWD avatar Oct 10 '18 23:10 BartNWD

Make sure that:

  1. You are using one of the latest Streamer Plugin versions.
  2. You recompiled all of your scripts (gamemode + filterscripts) with the correct include - in some past SA-MP version the drawdistance was messed up by some change and everything had to be recompiled, but this is probably not the case here.
  3. You aren't actually creating too many global objects (CreateObject) - this may explain why they go away in desert.
  4. There's actually no difference between dynamic objects created in OnGameModeInit or objects created anywhere else. When CreateDynamicX is called, the item is simply added in the memory and then, an internal timer checks if a player is close to the position of any object position added in memory. So, because of this, it may be possible that in OnGameModeInit you create them with some fine settings (such as correct streamdistance and drawdistance), while in commands, dialogs and other things you are creating them with weird and incorrect properties (streamdistance too small, maybe, or any other similar thing).

Double check if you are actually reaching the limits. Count all of your CreateObject functions which are applied at any time and check the statistics available when you press the F5 button. Streamer_CountVisibleItems may also help.

IstuntmanI avatar Oct 19 '18 14:10 IstuntmanI

In total, there are 7 CreateObject, the bug is actually the plugin, and I fight with it a long time. All scripts are compiled in the correct version.

I changed to version 2.8.2 recently, and it looks a little better. It takes time to happen, but it happens the same way. But this version does not have DynamicActors and I had to pass all my systems to the CreateActor.

Another thing I noticed is that when the object disappears, its rotation is modificated. For example, a player's balloon, when created, stay in normal position 10 seconds, is placed in the opposite rotation, lying on the ground and then disappears. This is very fast, matter of milliseconds between changing the rotation and disappearing.

Here are some videos:

https://www.youtube.com/watch?v=xCUTFcLqGsk https://www.youtube.com/watch?v=Lbpzl2oV9TQ

BartNWD avatar Oct 20 '18 00:10 BartNWD

Can you reproduce that in an empty script?

samp-incognito avatar Oct 24 '18 07:10 samp-incognito

I've tried filterscripts, clean gamemodes, and the same thing happens. With few players this does not happen.

BartNWD avatar Oct 24 '18 17:10 BartNWD

If you do have a simple script that reproduces this, then it would be helpful if you would share it. Otherwise, you should probably try to figure out exactly what your script is doing when these objects are disappearing.

samp-incognito avatar Oct 24 '18 18:10 samp-incognito

This problem also happens to me. Create furniture on different virtual world, The object dissapears after a few seconds. The problem is not going to happen if there are only a few players. If restart server let object initial to gamemode It will be permanently displayed.

qqwrv-f10eq avatar Oct 27 '18 07:10 qqwrv-f10eq

I have the same problem ... The objects created by commands randomly come out, they only stick when loaded next to Gamemode. (I am also creating objects in different worlds.) The more online players, the greater the occurrence of this problem.

Not only objects, but textlabels also disappear sometimes.

Is the allocated memory already used by one object being used by another object?

Have an solution?

MacLove13 avatar Jan 22 '19 17:01 MacLove13

Same on v2.9.2 and v2.9.3. A new dynamic object takes the id from another already created even if that one was not deleted yet. Even map's objects charged by FS at the beginning disappears. bb

Darkeen avatar Jan 27 '19 06:01 Darkeen

Same, still fighting with this for months..

Gpro25 avatar Jan 25 '20 01:01 Gpro25

Also having this issue on the latest version.

I create around 18000 objects at server startup, and they never disappear. However, objects that are added after startup (such as house furnishing) do disappear after some time, one by one, in order they were created. Reloading those objects from the database and creating them again doesn't fix the issue - they still disappear sooner or later.

@samp-incognito @IstuntmanI any way to fix this?

Hoxxy avatar May 05 '20 13:05 Hoxxy

I'm almost positive it's because you're getting object IDs mixed up somewhere. This is the most common scripting problem I've seen, especially when an object is destroyed and the old ID continues to be used. The fact that the objects don't "disappear" if they're created at startup is telling. I'm assuming they aren't assigned to any variables and thus never get modified in any way. Check your script carefully to see how you're handling IDs.

Otherwise, if it truly is a plugin problem, then the only way it can be fixed is if you've somehow found a way to reproduce it.

samp-incognito avatar May 07 '20 20:05 samp-incognito

RESOLVED. See edits of this post to know what I said before.

My particular problem was resolved for reasons I'm not sure about, after changes to the enviroment where the server was running. It might have been an issue with libraries in the old docker container. It's worth noting at the same time I added safeguards to 2 unchecked DestroyDynamicObject calls too, but I really doubt these two alone were the reason that so much havoc started happening out of a sudden.

markski1 avatar May 08 '20 15:05 markski1

Hello,

After 2 years of creating this issue, I can confirm that this problem continues to happen with objects created after the server started. With objects attached to vehicles and players mainly, but also with objects like life machines, balloons, and more.

Few months ago, we solved this problem with another problem, using this:

CreateDynamicObject(19300,0.00000000,0.00000000,0.00000000.0.00000000.0.00000000.0.00000000);

However, this is not solving the problem anymore. @samp-incognito

BartNWD avatar May 09 '20 19:05 BartNWD

Hey, I got this problem too. Have you got any ideas to fix? @BartNWD

Ranneciva avatar May 26 '20 23:05 Ranneciva

No, until today the problem has not been solved. On the contrary, it gets more and more strange and random. I tested old versions of the plugin, since 2.7.2, and the problem persists.

Some more strange happenings that I captured:

Balloons creating on vehicle attached objects slot: https://www.youtube.com/watch?v=9011-OFezZ0

After disappearing, go to point 0: (using / goto object command) https://www.youtube.com/watch?v=qCUOWeW0mz4

The fire when firing nitro in vehicles never stabilizes: https://www.youtube.com/watch?v=euT_EJAqe0U

I think the problem is not even in DestroyDynamicObject, because I have already reviewed all mine and they are being used correctly, without interference from IDs. I think the problem is in the internal manipulation of data.

NOTE: The smaller the number of players, the fewer occurrences. With 1 player everything just happens perfectly. In version 2.7.2 it is also possible to notice a reduction in occurrences.

Note²: I use streamer in gamemode and 2 filterscripts.

BartNWD avatar May 27 '20 19:05 BartNWD

Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?

Ranneciva avatar Jun 01 '20 01:06 Ranneciva

Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?

I didn't solve :c

BartNWD avatar Jun 05 '20 11:06 BartNWD

Here's a tip! For localobjects use player names.

Hauswart avatar Nov 15 '21 20:11 Hauswart

Note²: I use streamer in gamemode and 2 filterscripts.

ThIs is the problem.

Hauswart avatar Nov 15 '21 20:11 Hauswart

Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?

I didn't solve :c

Have you solved this issue?

Kutuy avatar Jul 20 '22 15:07 Kutuy

I'm experiencing the same problem, apparently with no effective resolution yet.

raedman90 avatar Oct 26 '23 00:10 raedman90