Jump to content
Mr. Green Gaming

View Range Script(integrate this if possible)


Recommended Posts

Hey guys, so, yeah, im a somewhat active member here, dont really post, rather just playing occasionally, but this annoys me quite a lot.

So, the draw distance. Im sure many of us play this game with current gen graphics cards, or even if its not current gen, basically the average PC is more than enough to run MTA.  Yet we dont have draw distance for MTA models that is more than like 10 car lenght sometimes. Especially barrels and stuff like that, load so close you cannot even avoid it at higher speeds. (and trollmaps love this)

So, i've made a really easy scirpt example, im sure you could do this as well, but yet still it isnt on the server.

You currently have however a farclip script which is nice, i was thinking the same integration of this script as well. 

So, lets talk about What this script does is basically cloning every single object on the map as a LOD object. LOD objects dont have collisions, therefore not hooking CPU as much, but they can be rendered from higher distances, up to 5x times further than non LOD objects, making it possible to actually be amazed how cool maps look from distance.  Ofc the slider would be here so people with weaker PC can lower the value, or even disable this completly. But so far, i havent noticed any FPS drop on my system.(i have a really weak outdated i5 maxed at 3.4ghz) 

I attached a file, if you want me to make it as proper function feel free to tell, i didnt do it because im sure you have unique way of itegratin this anyway.

 

jpog.jpg

client.lua

Link to comment
Just now, hulpje said:

Wouldn't this script re-render every object every map again and again?

What it does is clones all the objects as LOD's of themselves. By default MTA Objects dont use lods, thats why they cant be seen from the distance. SA objects use their LODS so they can be seen from further away. 

Ofc, this script should always clear the objects before making new ones, so, for example, on every map start, it should delete every single object it created, which can be done, if they are saved in a table.

Link to comment
On 10/1/2017 at 8:19 AM, Iwasawa said:

Especially barrels and stuff like that, load so close you cannot even avoid it at higher speeds.

True. Barrels and lampposts, it all comes suddenly if I’m in high speed, making it hard to avoid. (Idk if it happens to everyone but on my laptop it’s like that.)

Link to comment

Well you got me intrigued so I added a quick command in the test resource. Everyone can test it out. You need to do it on every map.

/lodrange 300

Works really great on titten 2 @hulpje

 

This is the code (yes only one line sue me im a vago)

addCommandHandler('lodrange', function(p,dis) for k,v in ipairs(getElementsByType'object') do engineSetModelLODDistance(getElementModel(v), tonumber(dis)) end end)

I don't think you need to create a new object @IwasawaengineSetModelLODDistance only increases the distance attribute of an object before the lod is loaded (or becomes invisible if no LOD), it doesn't make it a LOD object. Great job though, nice thinking.

Link to comment
9 minutes ago, SDK said:

Well you got me intrigued so I added a quick command in the test resource. Everyone can test it out. You need to do it on every map.


/lodrange 300

Works really great on titten 2 @hulpje

 

This is the code (yes only one line sue me im a vago)


addCommandHandler('lodrange', function(p,dis) for k,v in ipairs(getElementsByType'object') do engineSetModelLODDistance(getElementModel(v), tonumber(dis)) end end)

I don't think you need to create a new object @Iwasawa, engineSetModelLODDistance only increases the distance attribute of an object before the lod is loaded (or becomes invisible if no LOD), it doesn't make it a LOD object. Great job though, nice thinking.

Actually, you have to make a new object, i tested that. The problem is, if you make an object as LOD it wont have collisions and stuff, but i can be loaded from 5x300(max distance).

If you dont create it as lod, it can only be loaded from 300units and has collisions. So, you have to create a LOD for every object. Sadly. It would be nice if MTA could use the LODS that are in the model file, just as GTA uses them on originally placed objects.

Link to comment
Guest F1MADKILLER
22 minutes ago, BlueYoshi97 said:

This works so well. Better yet, no race player reads this topic so I can use this command to my advantage.

HACKS! Shall 1 tag a race player Yoshik so your secrets will be up

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...