SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Plugin Development (https://forum.sa-mp.com/forumdisplay.php?f=18)
-   -   [Plugin] Streamer Plugin (https://forum.sa-mp.com/showthread.php?t=102865)

Incognito 17/10/2009 07:18 PM

Streamer Plugin
 
Streamer Plugin

This plugin streams objects, pickups, checkpoints, race checkpoints, map icons, and 3D text labels at user-defined server ticks. Basic area detection is also included. Because it is written entirely in C++, much of the overhead from PAWN is avoided. This streamer, as a result, is quite a bit faster than any other implementation currently available in PAWN.

Changelog

GitHub Commit History

Refer to the CHANGES file the binary package for the full changelog.

Documentation

GitHub Wiki

Additional information can be found by searching this thread.

Download

GitHub Releases Page

The Windows version requires the Microsoft Visual C++ 2015 Redistributable Package.

Sergei 17/10/2009 07:22 PM

Re: [REL] Streamer Plugin v1.0
 
I love. Switching to this right away :D

I hope you release more of your awesome plugins in the future 8)

Correlli 17/10/2009 07:22 PM

Re: [REL] Streamer Plugin v1.0
 
Sounds interesting and useful, i'll try it out. Keep up the good work. :)

Sergei 17/10/2009 07:49 PM

Re: [REL] Streamer Plugin v1.0
 
Maybe it would be useful to have a native 'CountDynamicObjects' which would return value of all the objects created, oh and OnDynamicObjectMoved would be nice callback for the future ;)

I hope it won't make problems which combination zcmd + foreach + streamer because of all redefinitions:
Code:

\pawno\include\zcmd.inc(58) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
\pawno\include\streamer.inc(75) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
\pawno\include\streamer.inc(94) : warning 201: redefinition of constant/macro (symbol "OnPlayerConnect")
\pawno\include\streamer.inc(113) : warning 201: redefinition of constant/macro (symbol "OnPlayerDisconnect")


Incognito 17/10/2009 08:07 PM

Re: [REL] Streamer Plugin v1.0
 
Yes, you are right—I actually forgot to include OnDynamicObjectMoved. That will be in the next version.

About the warnings, try the latest versions of zcmd and foreach. ****** made some recent additions to the callback hook procedure to fix that.

[NoV]LaZ 17/10/2009 08:54 PM

[REL] Streamer Plugin v1.0
 
There is no source code.
Amazing plugin, though !
________
WENDIE 99

Sergei 17/10/2009 08:57 PM

Re: [REL] Streamer Plugin v1.0
 
Quote:

Originally Posted by Incognito
About the warnings, try the latest versions of zcmd and foreach. ****** made some recent additions to the callback hook procedure to fix that.

Heh, compiles without warnings now. Thanks for reminding me to update.

Anyway, I have just got another idea for a native 'CreateDynamicVWObject'. Basically like CreateDynamicObject just with virtual world parameter, so object is shown only in that virtual world. Very useful if you use the same interior for more different types of usage with custom objects.

Incognito 17/10/2009 11:29 PM

Re: [REL] Streamer Plugin v1.0
 
LaZ: Thanks, the link has been fixed.

$€ЯĢ: That is doable.

Sergei 17/10/2009 11:50 PM

Re: [REL] Streamer Plugin v1.0
 
Quote:

Originally Posted by Incognito
Right now, as I said, it just streams objects, but it is a relatively simple matter to add support for pickups, map icons, and checkpoints at a later date (vehicles are streamed automatically in 0.3, however, so they will not be added).

Good to hear this. I was just thinking about asking if you are thinking about expanding streamer's services :)

Google63 18/10/2009 12:26 AM

Re: [REL] Streamer Plugin v1.0
 
It will really promote your plugin and help peoples decide what streamer to use if you little tests about speed and memory...
Good streamer i guess :)

potato 18/10/2009 12:39 PM

Re: [REL] Streamer Plugin v1.1
 
Great work!
I wanted to start such a project my self, but... you saved me time!
But I found my self in a weird situation that I need a filterscript along with the gamemode that has these dynamic objects.
If I include the <streamer> in both filterscript and gamemode, will this effect something? From the benchmarks point of view.
Also, will the CountDynamicObjects work in filterscript only or both on the same time? (will count filterscript+gamemode dynamic objects?)
Because I would need to destroy all filterscript objects in case of reloadfs, but that can me done my simply adding all dynamic-object-ids to an array.

Sergei 18/10/2009 01:01 PM

Re: [REL] Streamer Plugin v1.1
 
Thanks for the quick update with those useful functions ;)

Incognito 18/10/2009 01:57 PM

Re: [REL] Streamer Plugin v1.1
 
potato: Yes, you can use the include and any of the plugin's natives across multiple scripts.

$€ЯĢ: You're welcome.

I wanted to note that there seems to be some problem with the Linux version (or perhaps just a few distributions—if it is working for you, then tell me!). The streaming system works perfectly fine, but for some reason, the player objects do not appear. I will try to find a solution soon.

Angelhj 19/10/2009 07:21 AM

Re: [REL] Streamer Plugin v1.1
 
i have 7 plugins

Irc Audio Dns Streamer aMailer aEncriptPlus Filemanager

and your or another irc plugin fails whit this streamer plugin :S

Incognito 19/10/2009 09:45 AM

Re: [REL] Streamer Plugin v1.1
 
Angelhj: It works fine here with the rest of my plugins loaded, but I have not tested with the last three you mentioned.

I found the source of the problem I spoke of earlier: Peter's PawnCommand. It seems to be partially bugged in Linux. When multiple float parameters are passed to it, they all get shuffled around for some odd reason. This causes the objects to always be created in the wrong place. The only solution I can think of is to execute a public function that will create each object in the script instead. This is obviously not quite as elegant, but it is the only thing I can do short of placing the entire streaming code inside the script as well. Fortunately, the speed should not suffer tremendously (OnPlayerUpdate gets called several times a second too). I will release a fixed version soon.

potato 20/10/2009 08:00 PM

Re: [REL] Streamer Plugin v1.1
 
I would like to recommend you making a function that streams objects manually.
Stream_ObjectsForPlayer(playerid); - gets the current player location and streams objects that need to be there no matter what.
For "the lag" reducing...

Also I noticed a bug that also applies with your said.
Objects seem to appear really slow after a longer server runtime.
Some value keeps getting bigger?

Incognito 22/10/2009 10:42 AM

Re: [REL] Streamer Plugin v1.1
 
Yes, I added a native earlier that will force an update for a player. This is particularly useful if you want to stream objects immediately at some point in your script. About your bug, it is probably related to a memory leak I found and fixed yesterday in PawnCommand.

Anyway, the Linux bug I described a few posts up has been fixed as well. The streaming code has also been reorganized and made slightly more efficient (nothing will stream for the player if his position has not changed since the last update). I was initially going to commit these changes and release v1.2, but instead, I think I will will skip ahead to v2 and add support for pickup, checkpoint, and map icon streaming. The algorithm will be almost identical, so it is really just a matter of writing some additional code to support more items. Look for it here soon.

Sergei 22/10/2009 04:09 PM

Re: [REL] Streamer Plugin v1.1
 
Nice to see that pickup, checkpoint and map icon support is on its way. I hope you won't miss race checkpoints out.


Only as a suggestion for one of the future versions; it would be nice if you also added 3D text streamer.

cyber_punk 22/10/2009 09:02 PM

Re: [REL] Streamer Plugin v1.1
 
Like the sound of the update. Has anyone done an official speed/max object test with this plug-in? Kinda curious to see the results before I go and try to switch everything over. I am mostly interested in seeing how it compares to YSI.

BP13 23/10/2009 02:52 AM

Re: [REL] Streamer Plugin v1.1
 
Very nice. But somehow could make make the objects load about 1 or 1/2 a second faster. They don't seem to be loading in time for places over the sea for example.


I would also like to request CreateInteriorObject.

Gappy 23/10/2009 03:38 AM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
Very nice. But somehow could make make the objects load about 1 or 1/2 a second faster. They don't seem to be loading in time for places over the sea for example.


I would also like to request CreateInteriorObject.

You could lower the Streamer_SetTicks time and the objects would load much faster, not sure how badly it will effect your server in terms of lag.

Also I would like to request some sort of StreaObjectsForPlayer, which we could use on SetPlayerPos so the objects would load instantly so you wouldn't have to free the player for the objects to load first.

BP13 23/10/2009 04:26 AM

Re: [REL] Streamer Plugin v1.1
 
Gappy do you know how often the server checks for objects in ms?

Gappy 23/10/2009 06:06 AM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
Gappy do you know how often the server checks for objects in ms?

Default is 100

Sergei 23/10/2009 01:29 PM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
Very nice. But somehow could make make the objects load about 1 or 1/2 a second faster. They don't seem to be loading in time for places over the sea for example.


I would also like to request CreateInteriorObject.

You will have a new native which will force streaming object for a player, so you will just use that one after you teleport to that custom interior position.

Kyosaur 23/10/2009 05:55 PM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by cyber_punk
Like the sound of the update. Has anyone done an official speed/max object test with this plug-in? Kinda curious to see the results before I go and try to switch everything over. I am mostly interested in seeing how it compares to YSI.

Same here. *kyo wouldn't mind seeing how it does against xstreamer as well*

BP13 23/10/2009 11:33 PM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Note: This number does not represent any specific measurement of time
well that is not very helpful.

shady91 24/10/2009 05:04 AM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by Kyosaur!!
Quote:

Originally Posted by cyber_punk
Like the sound of the update. Has anyone done an official speed/max object test with this plug-in? Kinda curious to see the results before I go and try to switch everything over. I am mostly interested in seeing how it compares to YSI.

Same here. *kyo wouldn't mind seeing how it does against xstreamer as well*

it's faster then xStreamers i use it now i use this one its much much betetr i been waitnig for somting like this thanks so much for making this !!!! :D


EDIT: when i use on my home test server it's fine witch is windows but as soon as on my host witch is linix its not working like it says it loaded the plugin just the objects aint showing?

also after about 10 mins of being ingame it auto close my server its not my script as its fine with xstreamer i have done it all right and its 100% not my code this happens on windows and linix.

BP13 24/10/2009 07:12 AM

Re: [REL] Streamer Plugin v1.1
 
hmm this loads slower than xStreamer for me.

Gappy 24/10/2009 08:19 AM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
hmm this loads slower than xStreamer for me.

If you do Streamer_SetTicks(30); on OnGameModeInit the objects load almost instantly.

Incognito 24/10/2009 11:07 AM

Re: [REL] Streamer Plugin v1.1
 
$€ЯĢ: Yes, I have decided that I will stream race checkpoints and 3D text labels as well.

cyber_punk/Kyosaur!!: I just tested with 1,000,000 (one million) objects in my local server, and they all streamed perfectly with fine with two players connected. Memory usage was around 100MB, and when a player moved, CPU usage jumped to about 5% using the default tickrate (obviously, if you have that many objects created, you will need to raise the tickrate—unlikely, though, because it took me several hours to create them all in my script!). These numbers can be a little misleading, though. The best thing to do is to simply try it out on your server and see how it fares. At some point in the future, I will create a zoning system so that there will be less objects to iterate through on each update. By the way, there is no limit to the number of objects that can be created (well, technically, there IS, but you will probably run out of memory before reaching it).

[SU]BP13: The tickrate varies. For me, a tickrate of 100 was about 200-300ms, but for slower processors, it will probably need to be lowered to stream objects effectively. Try a few different values to see what works best for you.

Shady91: The Linux version has a bug that will be fixed in the next update.

Incognito 24/10/2009 11:08 AM

Re: [REL] Streamer Plugin v1.1
 
A small update: I expected to get the newer version out sooner, but I was busy with something else yesterday. I will test some more streamed items in a few minutes and see how it goes. Also, because of the memory leak in PawnCommand and the bug in Linux, I cannot recommend using this plugin on dedicated servers at the moment, but feel free to to test it on home servers until I finish the updated version (which should be soon).

Incognito 24/10/2009 11:09 AM

Re: [REL] Streamer Plugin v1.1
 
Edit: Ignore this post.

Kurence 24/10/2009 01:07 PM

Re: [REL] Streamer Plugin v1.1
 
I have got that bug in linux - In windows everything works great!Like the best streamer ever!But on linux only ObjectSlots are changing-i will be waiting for that update :) - i like making objects with medit so i really need it :D

shady91 24/10/2009 02:48 PM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
hmm this loads slower than xStreamer for me.

this close my server after about 5 min's of running it dose it for you? and its much much faste then xStreamers.

BP13 24/10/2009 05:01 PM

Re: [REL] Streamer Plugin v1.1
 
I only tested it on windows and it seemed to load slower I tested for about 10 minutes. I haven't tried it on Linux yet.

shady91 24/10/2009 06:12 PM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by [SU
BP13 ]
I only tested it on windows and it seemed to load slower I tested for about 10 minutes. I haven't tried it on Linux yet.

i run it on windows for about 15 mins and it close the server.

Guedes747 24/10/2009 11:33 PM

Re: [REL] Streamer Plugin v1.1
 
No diference to me.

Sergei 25/10/2009 08:16 AM

Re: [REL] Streamer Plugin v1.1
 
Quote:

Originally Posted by Seif_
Quote:

Originally Posted by Guedes_
No diference to me.

From what?

He probably refers to speed or something.

I can't wait for v2 because of checkpoint and pickup streamer :)

Incognito 25/10/2009 09:29 AM

Re: [REL] Streamer Plugin v1.1
 
Update: I finished writing the streaming code and all of the new natives for the additional items yesterday. I am currently testing what I can and fixing any bugs I can see before I release the next version (there are about 60 natives now, so I probably will not catch everything!).

Also, for some reason, my post on the previous page is not appearing, so here it is in case anyone missed it:

Quote:

Originally Posted by Incognito
$€ЯĢ: Yes, I have decided that I will stream race checkpoints and 3D text labels as well.

cyber_punk/Kyosaur!!: I just tested with 1,000,000 (one million) objects in my local server, and they all streamed perfectly with fine with two players connected. Memory usage was around 100MB, and when a player moved, CPU usage jumped to about 5% using the default tickrate (obviously, if you have that many objects created, you will need to raise the tickrate—unlikely, though, because it took me several hours to create them all in my script!). These numbers can be a little misleading, though. The best thing to do is to simply try it out on your server and see how it fares. At some point in the future, I will create a zoning system so that there will be less objects to iterate through on each update. By the way, there is no limit to the number of objects that can be created (well, technically, there IS, but you will probably run out of memory before reaching it).

[SU]BP13: The tickrate varies. For me, a tickrate of 100 was about 200-300ms, but for slower processors, it will probably need to be lowered to stream objects effectively. Try a few different values to see what works best for you.

Shady91: The Linux version has a bug that will be fixed in the next update.


Sergei 25/10/2009 11:57 AM

Re: [REL] Streamer Plugin v1.1
 
Good to see fast developement on this. If you need any more people for testing do not hesitate to contact me.


All times are GMT. The time now is 05:19 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.