|
did you make the plants in plants vs zombies giga update? |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Actually, that is incorrect. Lag doesn't occur when like 20 plants I made are in the game and active. Lag occurs when I use drag tools, and when I move them near each other because of the large amount of small parts performing collisions detection. It has nothing to do with the rendering engine. And besides, rendering multiple meshes won't do much to the rendering engine itself (other than adding a simple loop), but it will reduce lag with the physics engine, because instead of checking collisions for 40 different parts, only 1-3 parts will be checked and the rendering engine will remain unscathed by cons. Why it will remain unscathed, is because the same number of meshes are being rendered, only difference is that they are all in the same part. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Haven't heard of the giga update, I am just making them in order based on the wiki and going in the game order of PvZ, PvZ Adventures, and PvZ 2. Still not sure whether I am gonna make em free or not, but you can still see them in my models. |
|
|
Moving them causes lag not mostly from collisions (I move large amounts of bricks all the time without problems.) but from forcing RENDERING. Every time a mesh moves, it's rendering must be recalculated. The more meshes are on screen the more rendering work is already being done.
The lag caused by 40 parts is nothing. Just look at the places with THOUSANDS of parts. Rendering meshes is not as simple as a loop, it's mathematical algorithms for displaying a 3d plot of points on a 2d screen. Rendering 30-40 meshes will cause just as much lag in one part as in 30-40 parts, and the actual 30-40 parts causes almost no lag.
Why do you think they got rid of bevels? Assuming each bevel was a single slant to make a curved look, you went from 6 surfaces per block to 26 surfaces. (6 Sides + 12 Edges + 8 Corners) Rendering lots of surfaces causes lag really easy. I've worked with 3d rendering in C++ and you begin allocating a lot of processing power really fast when you start using lots of surfaces. Meshes contain TONS of surfaces. Most render algorithms like those Roblox is using can only make flat, one sided surfaces. A sphere for example is made of LOTS of surfaces to look round. Rendering takes TONS of processing power in comparison to physics for a few parts. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Example in Lua:
function RenderPart(part)
local num_meshes = GetNumberOfMeshesPerPart(part)
if num_meshes>0 then
for i,v in pairs(part:children()) do
if string.match(v.ClassName,"Mesh") then
RenderMesh(v)
end
end
end
end
And if rendering occurs locally, and physics occur between client and server physics engines only, with server sided parts (aka the plant parts I made) being moved with the server sided engine, explain why the peas from my peashooter slow down whenever passing through a plant with numerous detail parts in a small area such as another peashooter. Surely the server sided physics engine isn't being slowed down because rendering is occurring locally. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Gotta bump this yet again o3o |
|
|
That's not really how render works though. EACH surface you render takes processing power. The fact of the matter is parts don't cause much lag, surfaces do. Parts "slow down" and lag as they get further away from you, because they get updates to their positions less often from the server. If you want places using meshes to lag less, use less meshes. Grouping a bunch of meshes into a single part will not reduce lag. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
You obviously have no idea what I am talking about, nor have you seen the plants in action that I created and seen this effect yourself. Plus parts do not slow down when they are further away from you, they maintain a constant pace. And I never said the projectile peas lag when they are any distance away from me. It is when they are nearby large clusters of plants that they slow down because of all the collision detection. And as soon as they are a certain distance away from the plant cluster, they speed up again. And ever heard of featherweight parts? If you haven't, that basically means that if two parts are a certain distance away from one another, the collision detection does not run freeing up memory for other areas of the program. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Why do so many people make WNTS threads? They push the relevant ideas back o3o |
|
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
The post is only 12 lines long, and there are posts a lot longer out there, like yours for example. Nice spam btw, Ima report it now. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Bump o3o |
|
|
It was clumped together, and i couldn't find any other threads like this. :C |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Erm, okay o3o |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Bump from an alt. Got banned for a day from posting on some stalking upgrade related thread. |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Come on mods... Bump. |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Gotta get this up again. Bump. |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Bump again. |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
I am not gonna let this thread die, especially when it is so useful. |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Bump again, any more supporters? |
|
Noob0309Join Date: 2010-11-07 Post Count: 179 |
Eh, I am just gonna make a new thread in an hour or so and reformat the OP a bit to make it more readable and understandable improving the chances of being supported. |
|
CrovianJoin Date: 2012-04-17 Post Count: 321 |
Support
---TheCrovian--- |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Newer version here: http://www.roblox.com/Forum/ShowPost.aspx?PostID=109792424
Sorry for the unneeded bump of the old thread. |
|