generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How many parts cause lag.

Previous Thread :: Next Thread 
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:05 PM
Okay so I have this builder and he built me a map. I counted 8340 parts that aren't unions and 2340 unions. Will that be laggy?
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
16 Jan 2017 05:08 PM
Depends on a lot of things. If this was an easy question to answer a part limit would probably already be built into ROBLOX.
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
16 Jan 2017 05:09 PM
Upload it and test it out for yourself
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:10 PM
The thing is, by itself it doesn't lag. But it does lag when I fire my machine gun. The machine gun doesn't lag in my test map which only has 20 parts.
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
16 Jan 2017 05:12 PM
How many parts is your machine gun?

Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:18 PM
Only around 40
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:19 PM
I did try reducing the count to 5 just for testing and it still lagged.
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:26 PM
Okay I don't think it's the map. I have one script that can control all my guns, but it only lags with this certain machine gun...
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
16 Jan 2017 05:30 PM
Could be the scripts inside the gun. Look at their performance
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
16 Jan 2017 05:31 PM
It's your computer.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
16 Jan 2017 05:32 PM
Console og f9 to see script performance and ctrl+shift+f6 micro profiler


Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
16 Jan 2017 05:37 PM
Okay, lets say I have 10k parts parented directly as children of workspace and fire a bullet.

Well, now ought to calculate bullet physics; the standard kinematic equations make this trivial, but what about collision detection? For every frame of its life we have to do collision detection with 10k parts. Not pleasant.

Okay, so how do we fix that?
- Fewer Parts
- Proper use of models


If we assume that fewer parts is not an option, then we have to use models wisely. What does that even mean?

Let's create another hypothetical. Let's say we have 144 tiles arranged as a square floor (12x12). If we break up the tiles into 4 models (aka treat 6x6 as larger tiles) then if we were to drop something on floor then we have at most 148 collisions to test (testing the 4 bounding boxes + all 144 tiles) and 40 at least (testing all 4 bounding boxes + the 36 tiles in the one model we've collided with). If what we've dropped isn't near the floor, then we only have to test 4 collisions.

Note this assumes that our object we're dropping is about the same size as one tile, if not smaller.

If we go a step further and sub divide each group into 3x3 sections then we have 4 groups of 4 groups of 9 tiles (4*4*9 == 144). If we revisit our worse case it's 4+16+4*9 == 56 collision checks. And our best case (assuming we are hitting the floor) is 4+4+9==17 checks. And if we miss the floor entirely, 4 checks.


This 2D case I'm describing is called a quadtree; it can be extended to 3D which would be an octree. If done well it should vastly reduce the overhead required for collision detection, which is where your 'lag' is coming from when you fire your machine gun.
Report Abuse
emantsevich1 is online. emantsevich1
Joined: 01 Apr 2011
Total Posts: 374
16 Jan 2017 05:38 PM
I got a map with 20k + instances and it runs smoothly with my computer specs
Report Abuse
emantsevich1 is online. emantsevich1
Joined: 01 Apr 2011
Total Posts: 374
16 Jan 2017 05:39 PM
However a lot of parts in addition to the game mechanics/tools can become an issue
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
16 Jan 2017 05:40 PM
^^^ Lmao this isn't a "who has the best PC" competition
Report Abuse
emantsevich1 is online. emantsevich1
Joined: 01 Apr 2011
Total Posts: 374
16 Jan 2017 05:40 PM
My pc is average if not below
Report Abuse
emantsevich1 is online. emantsevich1
Joined: 01 Apr 2011
Total Posts: 374
16 Jan 2017 05:41 PM
Approaching 10 years old with some parts not having been replaced
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:44 PM
@KriticalGuns
I've already used both before. Haven't looked at the script performance part of f9 yet though. Mostly used it for debugging.

@Casualist, I'm not using projectiles. Using raycasts so everything you just wrote is irrelevant. Sorry XD
Report Abuse
SunTzu16 is not online. SunTzu16
Joined: 10 Jul 2012
Total Posts: 999
16 Jan 2017 05:46 PM
When featherweight parts came out, I tested how many parts could be in a place before my CPU usage would increase or my framerate would drop.

The part count never affected my framerate or CPU usage, it just used more and more RAM. I only had a 6 GB laptop at the time, so the game crashed around 554,000 parts, no lag prior to the crash, just a crash because I ran out of memory.

Meaning, parts that aren't moving or aren't changing, or featherweight parts, don't harm your performance very much at all. Now if you're maybe attempting to render them all at once, it might cause a problem. Even entering a place with 200k parts didn't take too long for my friends who joined in my testing.

(Eventually telamon popped in the place and I got 200 visitors, so it seems like the devs liked how I was testing the limits of their new feature).

Anyway... moving parts, textures, particles, scripts... these things will cause latency. Part count will rarely have any noticeable effect on performance. 8k parts is nothing. Years ago before featherweight, 8k parts was about the highest you'd want to go before the game would lag for most people.

Now 8k is child's play. 100k parts might be difficult for some computers. I don't know the details of how the rendering works, but computers with less RAM might not like it. (I don't even know if players share the memory load or not, so that might be a nonfactor).

You'll be fine at 8k parts. (Note though, that prior to them improving performance on the materials/textures, 20k textured parts rendered the place unplayable, the framerate dropped drastically).
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
16 Jan 2017 05:46 PM
"Using raycasts so everything you just wrote is irrelevant. Sorry XD"

Except it's not. Ray are lines in space and to determine collision you have to check where faces of objects intersect the ray. The expensive part of raycasting and/or physics is the collision detection.

Reducing the overhead collision detection == less lag.
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:49 PM
The really weird thing is that lag only occurs I'm using one specific machine gun. My other one doesn't lag at all. They are both using the exact same script and the gun that lags actually has less parts.
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
16 Jan 2017 05:50 PM
Whenever it lags, microprofiler always shows high usage of "Scene, prepare, render"
Report Abuse
SunTzu16 is not online. SunTzu16
Joined: 10 Jul 2012
Total Posts: 999
16 Jan 2017 05:50 PM
Could be the welding process or or maybe they're different scripts, idk.

Find guns that don't lag, :p

It's not hard to code guns that don't lag.
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
16 Jan 2017 05:55 PM
It has very little to do with the number of parts in the gun, by you're own admission it's only when you it. So it's clearly linked to whatever it's coded to do.
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
16 Jan 2017 06:03 PM
#### has very little to do with the number of parts in the gun, by your own admission it's only when you use it. So it's clearly linked to whatever it's coded to do. Solid 5/7 proofreading ability.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image