SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 29/02/2020, 02:57 PM   #1
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 35
Reputation: 22
Default 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

Last edited by algorhitmically; 04/03/2020 at 11:31 PM. Reason: Update v1.0.1
algorhitmically is offline   Reply With Quote
Old 01/03/2020, 04:48 AM   #2
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 598
Reputation: 69
Default 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)
__________________

Last edited by Chaprnks; 01/03/2020 at 05:29 AM.
Chaprnks is offline   Reply With Quote
Old 04/03/2020, 06:10 PM   #3
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Location: 🇩🇪
Posts: 1,784
Reputation: 621
Default Re: Optidraw

Quote:
Originally Posted by Chaprnks View Post
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).
NaS is offline   Reply With Quote
Old 04/03/2020, 11:27 PM   #4
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 35
Reputation: 22
Default Re: Optidraw

Quote:
Originally Posted by NaS View Post
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
algorhitmically is offline   Reply With Quote
Old 01/03/2020, 07:16 AM   #5
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 35
Reputation: 22
Default 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.
algorhitmically is offline   Reply With Quote
Old 07/03/2020, 04:19 AM   #6
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 893
Reputation: 63
Default Re: Optidraw

What are the benefits of using this include?
Uberanwar is offline   Reply With Quote
Old 07/03/2020, 09:51 AM   #7
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 35
Reputation: 22
Default 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.
algorhitmically is offline   Reply With Quote
Old 08/03/2020, 03:39 AM   #8
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 893
Reputation: 63
Default Re: Optidraw

Quote:
Originally Posted by algorhitmically View Post
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.
Uberanwar is offline   Reply With Quote
Old 07/03/2020, 03:33 PM   #9
Mobtiesgangsa
Big Clucker
 
Mobtiesgangsa's Avatar
 
Join Date: Oct 2016
Location: The Strip
Posts: 155
Reputation: 16
Default Re: Optidraw

Like'd the concept you wrote it OnYSIStandart();
__________________
Klick here > neobux

Mobtiesgangsa is offline   Reply With Quote
Old 04/06/2020, 11:49 PM   #10
VasicFTW
Little Clucker
 
VasicFTW's Avatar
 
Join Date: Mar 2019
Location: Serbia
Posts: 7
Reputation: 0
Default Re: Optidraw

Good job! Keep it up.
__________________
Pawno Developer
Since 2014
VasicFTW is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:56 PM.


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