SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Includes (https://forum.sa-mp.com/forumdisplay.php?f=83)
-   -   [Include] Optidraw (https://forum.sa-mp.com/showthread.php?t=672784)

algorhitmically 29/02/2020 02:57 PM

Optidraw
 
General

Addon for Incognito's streamer.
This include will help you with map optimization.
Download: https://github.com/algorhitmically/optidraw


Required dependencies

[Streamer]
[Model-Sizes-Plus]
OR
[Model-Sizes-SQL]


Methods

These are optimization methods that you need to define before including optidraw:

METHOD_BOX
METHOD_SPHERE

Use

#define OD_METHOD your_method

Tips

Choose optimization method. Example: #define OD_METHOD METHOD_BOX
Include optidraw below streamer!
You can disable static objects with: #define OD_DISABLE_STATIC_OBJECTS
You can disable startup messages with: #define OD_DISABLE_STARTUP_MESSAGE

Chaprnks 01/03/2020 04:48 AM

Re: Optidraw
 
90% of the time, I see a new post on the RSS feed from SA-MP forums & I think "yet another useless filterscript that should have been a snippet" or a mapping without the download link.. but I was pleasantly surprised! I'm glad someone took another stab at making a dynamic draw distance (the previous dates way back to 2013 I think, and has bugs.. like objects that are small only show within a foot of you). Going to test this out and get some good feedback on how well it works! Thanks again for the release!


EDIT:
I know that this plugin uses chunk based streaming, but is there a way to put a hard limit on the number of objects streamed in? Like having like 10 or so object slots reserved (for those invisible "player objects" like seen in /flymode filtercript)

algorhitmically 01/03/2020 07:16 AM

Re: Optidraw
 
Thank you for your feedback - I really appreciate it. There is no warranty that this will work properly on every server but it's good to try both methods and there are few servers that are already using this and it's doing great job.
About the invisible objects, I think that there is no way to do that without doing data manipulation through streamer plugin itself. Maybe, you can create so-called player objects when the player connects and attach them to player or do whatever you want to do so they stay streamed for that player.

NaS 04/03/2020 06:10 PM

Re: Optidraw
 
Quote:

Originally Posted by Chaprnks (Post 4132935)
EDIT:
I know that this plugin uses chunk based streaming, but is there a way to put a hard limit on the number of objects streamed in? Like having like 10 or so object slots reserved (for those invisible "player objects" like seen in /flymode filtercript)

The streamer only uses 500 of 1000 player objects by default. You can change that limit with Streamer_VisibleItems for all or specific players if needed.

Ontopic: Nice include. I'm using the diameter from CA_GetBoundingBox and multiply it by a value relative to the maximum diameter of all the object models that were used (which seems to give pretty similar results). I also use lower streaming priorities for non-collidables so they pop in last but that can bring some issues when a place gets too stuffed.

You could add an optional define to disable the static objects though, since on some maps you might use a lot of large flat objects in one place which would automatically prioritize those over other objects even though they may not be used as ground surface. If I use for example 250 large planes as invisible barriers, those 250 objects will exist permanently and lower the free slots available for streaming all other objects for no good reason.
You could additionally check rx/ry to see if they are used as ground or wall (in which case they don't need to be static).

algorhitmically 04/03/2020 11:27 PM

Re: Optidraw
 
Quote:

Originally Posted by NaS (Post 4133253)
The streamer only uses 500 of 1000 player objects by default. You can change that limit with Streamer_VisibleItems for all or specific players if needed.

Ontopic: Nice include. I'm using the diameter from CA_GetBoundingBox and multiply it by a value relative to the maximum diameter of all the object models that were used (which seems to give pretty similar results). I also use lower streaming priorities for non-collidables so they pop in last but that can bring some issues when a place gets too stuffed.

You could add an optional define to disable the static objects though, since on some maps you might use a lot of large flat objects in one place which would automatically prioritize those over other objects even though they may not be used as ground surface. If I use for example 250 large planes as invisible barriers, those 250 objects will exist permanently and lower the free slots available for streaming all other objects for no good reason.
You could additionally check rx/ry to see if they are used as ground or wall (in which case they don't need to be static).


Thank you for advice! I have added an option in Update v1.0.1 so you can disable static objects in this include.
More info at: https://github.com/algorhitmically/optidraw

Uberanwar 07/03/2020 04:19 AM

Re: Optidraw
 
What are the benefits of using this include?

algorhitmically 07/03/2020 09:51 AM

Re: Optidraw
 
Well, if you have problems with object loading or you don't have time to optimize maps you can use this include and the job will be done for you. You don't need to care about cars and other items falling through the lining objects. Your objects will be drawn almost the same as default GTA objects.

Mobtiesgangsa 07/03/2020 03:33 PM

Re: Optidraw
 
Like'd the concept you wrote it OnYSIStandart();

Uberanwar 08/03/2020 03:39 AM

Re: Optidraw
 
Quote:

Originally Posted by algorhitmically (Post 4133525)
Well, if you have problems with object loading or you don't have time to optimize maps you can use this include and the job will be done for you. You don't need to care about cars and other items falling through the lining objects. Your objects will be drawn almost the same as default GTA objects.

Well done! Just tried it out yesterday, works flawlessly.

VasicFTW 04/06/2020 11:49 PM

Re: Optidraw
 
Good job! Keep it up. :)


All times are GMT. The time now is 10:26 AM.

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