[Include] Useful object streamer that streams objects realistically (the bigger the object, the farther it gets streamed from)
#1

Hey guys. I didn't know what prefix to choose, so [INCLUDE].
1) I have done VERY little work, it's all ****** and Incognito. ALL OF IT. I claim no credits.


READ ME:

I worked with 11, 000 objects and this streamed them fantastically, big hills streamed from far enough and small chairs when they needed to.
There is a DEFINE which you CAN EDIT to make your streaming look optimal. For me, 180 worked good enough.

pawn Code:
#define STREAM_CONSTANT 180
EDIT THIS TO WHATEVER TRIAL AND ERROR result you get to be the best streaming constant.
120 - 200 is okay.

Code:
pawn Code:
#include <a_samp>
#include <streamer>
#include <modelsizes>
#include <zcmd>
// - - -- - - DEFINES  -- - - -
#define STREAM_CONSTANT 180
new objects[11000][2], some_var = 0;

stock create_OBJECT(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
    objects[ some_var ][ 0 ] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz,-1, -1, -1, STREAM_CONSTANT + GetColSphereRadius(modelid));
    objects[ some_var ][1] = modelid;
    some_var++;
    return 1;
}
That's it !
Now use it like this:
pawn Code:
create_OBJECT( 1655, 125, 125, 125, 0, 0, 0);
And it streams good !


EXAMPLE OF STREAMING:



NOTE: This is not a release. This is something I put together.

Credits:

Full credits to ****** and Incognito, and V1cec1ty - for allowing me to test it in his server and presenting me with the challenge of making it in the first place.


INCLUDE DOWNLOADS:

Streamer
Model sizes
Reply
#2

Sounds nice
Reply
#3

Quote:
Originally Posted by vyper
View Post
Sounds nice
Yeah ! Added a pic to show the chic and smooth streaming it does.
Cheers
Reply
#4

Thanks Rajat, ****** and 90% Kalcor. This has been tested with 11,000 objects and it works great!
Reply
#5

Nice job! Good to see the model-sizes being used with the streamer like that.

EDIT: You might want to add a download for the modelsizes include.
Reply
#6

Quote:
Originally Posted by V1ceC1ty
View Post
Thanks Rajat, ****** and 90% Kalcor. This has been tested with 11,000 objects and it works great!
Quote:
Originally Posted by RealCop228
View Post
Nice job! Good to see the model-sizes being used with the streamer like that.
EDIT: You might want to add a download for the modelsizes include.
Quote:
Originally Posted by ******
View Post
Nice, though I should point out that I actually did very little for the modelsizes include either - that was 90% Kalcor!
Fantastic, thank you guys.
Also, Kalcor is automatically considered in every credits, no need to say that ! I would like anyone with a good STREAMER_CONSTANT to post here, considering a fairly well working PC.
Thanks !
Reply
#7

Oh nice i was wondering how to exactly use that include. I just converted my pawn streamer to use this and it works great. Giant stunt objects show up far away, not right in-front of you, small objects don't show until closer so it helps on the visible objects per player limit. Good job ******, Kalcor and Rajat_Pawar for showing an example.

Also this may seem like alot but used my default draw distance of 300 for the STREAMER_CONSTANT and most of the big stunt objects look like they are default objects since you can see them so far away. Pretty sure i am going to lower this tho....

Edit: Added a video http://www.xfire.com/video/5f0510
Reply
#8

Oh, 300? I'll take in the others' responses and average it out !
And, of course, thanks !
Reply
#9

Can't we use directly:
pawn Code:
#include <a_samp>
#include <streamer>
#include <modelsizes>
#include <zcmd>
// - - -- - - DEFINES  -- - - -
#define STREAM_CONSTANT 180

stock create_OBJECT( modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz )
    return CreateDynamicObject( modelid, x, y, z, rx, ry, rz,-1, -1, -1, STREAM_CONSTANT + GetColSphereRadius( modelid ) );
?

Great idea.
Reply
#10

About time someone released this!
Reply
#11

This function not lag with my 60.000 objects?
Reply
#12

Quote:
Originally Posted by totar
View Post
This function not lag with my 60.000 objects?
No, this method is only modifying the object creation, and it is created with Streamer Plugin, it don't have lag.
Reply
#13

This is the object I've found to have the largest object collision radius so far. The STREAM_CONSTANT shouldn't need to go over 250 unless someone else can find anything with a significantly larger radius.

IDE Number: 10816
COLL radius: 250.80
Model: airprtgnd_01_sfse

Reply
#14

I'm fairly certain that there are much larger objects than that.
Reply
#15

Quote:
Originally Posted by MP2
View Post
I'm fairly certain that there are much larger objects than that.
That image was cut off because it couldn't fit in the map editor window. Going though a lot of objects even larger ones, this has probably one of the largest collision radius. As I said; "This is the object I've found to have the largest object collision radius so far.". You're welcome to try find a larger collision radius.

EDIT: To add some perspective to that.
Reply
#16

There are landmasses that are bigger.


Anyway great plugin, im gonna use it.
Reply
#17

Quote:
Originally Posted by V1ceC1ty
View Post
This is the object I've found to have the largest object collision radius so far. The STREAM_CONSTANT shouldn't need to go over 250 unless someone else can find anything with a significantly larger radius.

IDE Number: 10816
COLL radius: 250.80
Model: airprtgnd_01_sfse

Took me all of 30 seconds to run some code to find that the largest radius was 330.721282 (so less than 331).
Reply
#18

Quote:
Originally Posted by V1ceC1ty
View Post
The STREAM_CONSTANT shouldn't need to go over 250 unless someone else can find anything with a significantly larger radius.
I lowered my stream constant from 300 to 250 since i noticed objects that have textures that move, like the few tube objects, water falls, and snow all do not have a animated texture since the don't support drawdistance over 300. Pretty sure i can fix that issue by making a small array of objects that have animated textures so it just limits the drawdistance at 300 if the distance that comes from the model size is bigger than 300.
Reply
#19

At Schurman, of course, we can, but I wanted to save them, feel free to not. And at others, thank you. Also, about the largest object, just for curiosity's sake, would you mind sharing the code for that? I guess a for loop, a temp var and GetObjectCollisionRadius, right?
Reply
#20

Well the array is not actually static, so I just something like this:

Code:
new
	Float:l = 0.0l
for (new i = 0; i != sizeof (MODELS_gColRadius); ++i)
{
	if (MODELS_gColRadius[i] > l) l = MODELS_gColRadius[i];
}
printf("%f", l);
That's not generally good practice in case the underlying structures change - the API (i.e. functions) will change with it.

I also just realised that you can do this:

Code:
stock bool:IsModelValid(objectmodel)
{
	if (0 <= objectmodel < sizeof (MODELS_gColRadius))
	{
		return MODELS_gColRadius[objectmodel] != 0.0;
	}
	return false;
}
However, I don't know if there are any valid objects with a radius of 0.0. I don't think there are as I'm pretty sure that even LOD objects, which have no collision, still have a bounding sphere.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)