[FS-INC] SuperStream v1.1
#1

[FS] SuperStream
Presentation
Hi everyone, here's my streamer, i called it SuperStream (presumptuous i know...)

Function
This streamer shows the nearest objects to the player, the maximum distance is set to 350m, you can adjust it to your needs.
The distances of the selected objects (those nearer than 350m) are sorted with a function based on ******'s QuickSort function.

Note: This streamer doesn't take any distance parameter exept the maximum distance, this is a constant for speed and objects with distance over this are not sorted.

Improvements
You can get a better streaming by using the function StreamPlayer, you can decide the position to stream so you can stream objects for the players before they are in a place, it may be very useful for teleports.

Also, it is checking if the player is too far from last stream with OnPlayerUpdate to prevent lack of objects.

Installation
1. Place the filterscript in your filterscript folder
2. Add SuperStream to your filterscript line in server.cfg
3. Open your script containing objects and add #include <SuperStream.inc> to the top
4. Convert your objects to this format:
CreateStreamObject(model, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ);
note. It doesn't take any distance parameter, the format is very similar to MidoStream so you can use it to convert and remove distance. But, the best way to convert is probably using the CreateObject format and using CTRL+H and simply replace CreateObject by CreateStreamObject

Parameters
Parameters can be found between line 15 and line 27. Here's a short list of them:
  • MAX_PLAYERS : guess..
  • TIME_GRANULITY : If GetTickCount isn't working, i "fake" it with a timer, this is the timer delai, 50 is enough as there's no need to be very accurate.
  • MOVEMENT_UPDATE: Time between object positions update when they are moving
  • STREAMING_DELAY : Time of the main timer
  • VIEWED_OBJECTS: maximum amount of objects seens by a player at the same time
  • MAX_STREAM_OBJECTS : limit of objects
  • MAX_STREAM_DISTANCE : Maximum distance, objects too far from players are skipped
.

Download:
Solidfiles - v1.1.2 :


Pastebin - v1.1.2
[FS] SuperStream.pwn
[INC] SuperStream.inc


Log:

V1.0 : original release

V1.1 : - Bug fixe with MoveStreamObject
- added the callback OnStreamObjectMoved
- streaming adjustment

V1.1.1 : minor bug fix
V1.1.2 : constant typo fix (thanks Double-O-Seven)

Comments are appreciated
Reply
#2

Great work! mean
Reply
#3

Quote:
Originally Posted by RenisiL
Great work! mean
thanks man, if you have any suggestions, they are welcome
Reply
#4

nice job.. but streamer plugin to me is best :P
Reply
#5

nice job, one question with how many objects you have tested it??
Reply
#6

Hi,

actually i tested it with around 5000 objects, there was no problem.
if you have a lot of players and objects I don't recommand using this streamer.

i should run a test to run it to the limit soon...

EDIT: it can handle around 20 000, i tested, but only with few players, if you don't want your server to slow down it is not recommanded as there's no zones in this streamer

++Sim++
Reply
#7

Awesome work!!

but i like my streamer (C++ plugin streamer)...
Reply
#8

You've written a bug:
pawn Код:
#if defined NO_TCIK_COUNT
    #define GetTickCount()             (CurrentTick)
#endif
NO_TCIK_COUNT but it should be NO_TICK_COUNT
Reply
#9

Quote:
Originally Posted by Double-O-Seven
You've written a bug:
pawn Код:
#if defined NO_TCIK_COUNT
    #define GetTickCount()             (CurrentTick)
#endif
NO_TCIK_COUNT but it should be NO_TICK_COUNT
my bad, fixing this...

EDIT: done and thanks
Reply
#10

Very good streamer, objects are showing up correctly.
I haven,t seen any bug even with 10 000 objects.
Good quality, greatly scripted :P.
Good job guy.

++TZ++
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)