Total Miner Forums

Total Miner => Total Miner Discussion => Topic started by: Craig on April 26, 2013, 08:44:40 AM

Title: Tips for reducing lag on large builds
Post by: Craig on April 26, 2013, 08:44:40 AM
Once a map gets built up significantly, the GPU can start struggling to draw all the graphics, causing lower frame rates or draw lag.

It's all about visible faces. A face is the side of a block. If the side of a block is exposed to air, that side is a visible face and the game must draw it. The more visible faces the game has to draw, the more work it has to do; the more likely the map will start to hit the limits of the graphics hardware.

1. Hidden visible faces. How can visible faces be hidden? These are faces inside enclosed areas. The game does not know if a face is inside an enclosed area, all it knows is if the face is exposed to air. Significant landscaping can create enclosed areas. e.g. if you build a flat surface over a non flat terrain, this can leave empty areas underneath the flat surface you built, down to the ground. Any face inside this enclosed area will still have to be drawn, even though players will never see them. So to remove these hidden visible faces, fill in the enclosed areas. The Creative Fill tool is a great way to do that.

2. While the sunrise/sunset effect is active, the GPU is executing a lot of extra commands to create the effect. If you freeze the day/night cycle so that the sunrise/sunset effect is always active, the GPU is working much harder than it is during normal day or night time. If your map is experiencing draw lag, freezing the day/night cycle outside the sunrise/sunset effect can help.

Title: Re: Tips for reducing lag on large builds
Post by: RF Inn The Jet on April 27, 2013, 01:14:30 PM
thank you craig, this will be very helpfull
Title: Re: Tips for reducing lag on large builds
Post by: N0T Original on April 27, 2013, 11:56:28 PM
Thanks for sharing that! Now I'm more likely to completely flatten land when building something... ;)
Title: Re: Tips for reducing lag on large builds
Post by: Kitty on April 28, 2013, 10:27:03 AM
Thanks for the Info Craig, very helpful.
Title: Re: Tips for reducing lag on large builds
Post by: DecadentBeaver on April 28, 2013, 05:04:28 PM
If I ever build a flat surface over non flat terrain, I always fill it up. But the other tip is very handy to know.
Title: Re: Tips for reducing lag on large builds
Post by: Whereiswaldo114 on April 29, 2013, 05:57:50 AM
I have a question. DO Sunblocks by any chance create lag when used in large quantities?
Title: Re: Tips for reducing lag on large builds
Post by: pulse1motion on April 29, 2013, 10:55:39 PM
thanks for those tips they are very help full
Title: Re: Tips for reducing lag on large builds
Post by: DiamondBack662 on May 01, 2013, 05:44:29 PM
I have a question. DO Sunblocks by any chance create lag when used in large quantities?

I just got through removing a bunch when creating a component map... they seem to increase the size quite a bit as well.. removing them helped reduce the size of the map for me (I was using them to line up components, thus I didn't need to keep them.. Had thousands)

Good info on leaving voids on the map.. I'll be filling in some of those.
Title: Re: Tips for reducing lag on large builds
Post by: Craig on May 01, 2013, 06:38:16 PM
I have a question. DO Sunblocks by any chance create lag when used in large quantities?
No they don't create lag. But like DB said, they will increase the save file size because they add light, which is data, which needs to be stored.
Title: Re: Tips for reducing lag on large builds
Post by: Holiday on February 06, 2014, 11:58:02 AM
Once a map gets built up significantly, the GPU can start struggling to draw all the graphics, causing lower frame rates or draw lag.

It's all about visible faces. A face is the side of a block. If the side of a block is exposed to air, that side is a visible face and the game must draw it. The more visible faces the game has to draw, the more work it has to do; the more likely the map will start to hit the limits of the graphics hardware.

1. Hidden visible faces. How can visible faces be hidden? These are faces inside enclosed areas. The game does not know if a face is inside an enclosed area, all it knows is if the face is exposed to air. Significant landscaping can create enclosed areas. e.g. if you build a flat surface over a non flat terrain, this can leave empty areas underneath the flat surface you built, down to the ground. Any face inside this enclosed area will still have to be drawn, even though players will never see them. So to remove these hidden visible faces, fill in the enclosed areas. The Creative Fill tool is a great way to do that.
Quote

 How does that work with the grass and flowers? If I use flood and it fills in around grass and flowers does it leave a visible face? How about water if I flood over water how does the system handle that? Should I fill in the water first or does it not matter?
Thanks for your time.
Title: Re: Tips for reducing lag on large builds
Post by: Clerical on February 06, 2014, 12:08:25 PM
Once a map gets built up significantly, the GPU can start struggling to draw all the graphics, causing lower frame rates or draw lag.

It's all about visible faces. A face is the side of a block. If the side of a block is exposed to air, that side is a visible face and the game must draw it. The more visible faces the game has to draw, the more work it has to do; the more likely the map will start to hit the limits of the graphics hardware.

1. Hidden visible faces. How can visible faces be hidden? These are faces inside enclosed areas. The game does not know if a face is inside an enclosed area, all it knows is if the face is exposed to air. Significant landscaping can create enclosed areas. e.g. if you build a flat surface over a non flat terrain, this can leave empty areas underneath the flat surface you built, down to the ground. Any face inside this enclosed area will still have to be drawn, even though players will never see them. So to remove these hidden visible faces, fill in the enclosed areas. The Creative Fill tool is a great way to do that.
Quote

 How does that work with the grass and flowers? If I use flood and it fills in around grass and flowers does it leave a visible face? How about water if I flood over water how does the system handle that? Should I fill in the water first or does it not matter?
Thanks for your time.
By creative flood, he means the creative flood feature that allows you to fill large areas with any block of your choice.
Title: Re: Tips for reducing lag on large builds
Post by: Holiday on February 06, 2014, 01:14:26 PM
By creative flood, he means the creative flood feature that allows you to fill large areas with any block of your choice.

I understand that, but when you use flood it floods the area. It does not change the blocks already down. So grass flowers and anything else in it's path just gets covered over not changed. I am wondering if any of these should be removed or do they not have visible faces when flooded over?
Title: Re: Tips for reducing lag on large builds
Post by: Craig on February 06, 2014, 02:25:49 PM
I understand that, but when you use flood it floods the area. It does not change the blocks already down. So grass flowers and anything else in it's path just gets covered over not changed. I am wondering if any of these should be removed or do they not have visible faces when flooded over?
They have visible faces. You can confirm by using no clip. I've changed flood in 2.0 to overwrite grass, flowers, etc.
Title: Re: Tips for reducing lag on large builds
Post by: Holiday on February 06, 2014, 02:51:15 PM
They have visible faces. You can confirm by using no clip. I've changed flood in 2.0 to overwrite grass, flowers, etc.

Okay, looks like I got some work to do. I use flood a lot. Thanks for the help
Title: Re: Tips for reducing lag on large builds
Post by: James on February 06, 2014, 07:07:52 PM
They have visible faces. You can confirm by using no clip. I've changed flood in 2.0 to overwrite grass, flowers, etc.
Trees?
Title: Re: Tips for reducing lag on large builds
Post by: Holiday on February 06, 2014, 07:12:26 PM
Trees?

That would be included in the "etc."from what I can tell. They are one of the blocks not changed, so I would assume he changed it to overwrite all blocks in flood zone. That would seem to be the simplest solution, unless codeing errors come up.
Title: Re: Tips for reducing lag on large builds
Post by: Craig on February 06, 2014, 07:55:42 PM
Trees?
No, only the blocks with a 'icon' render type. Those are blocks that are drawn as 2 x 2D planes in a cross shape, like flowers, grass, torches, etc.
Title: Re: Tips for reducing lag on large builds
Post by: Holiday on February 06, 2014, 08:13:36 PM
No, only the blocks with a 'icon' render type. Those are blocks that are drawn as 2 x 2D planes in a cross shape, like flowers, grass, torches, etc.

So leaves are okay and don't leave an open face? Just wanna be sure. That would cut down on fill in time.
Title: Re: Tips for reducing lag on large builds
Post by: OPV RAGE on February 10, 2014, 11:46:48 PM
So basically fill in builds?..
Title: Re: Tips for reducing lag on large builds
Post by: .ok on April 06, 2014, 08:16:53 AM
would spikes and/or tress create lag?
Title: Re: Tips for reducing lag on large builds
Post by: The White Wabbit on April 06, 2014, 08:28:07 AM
would spikes and/or tress create lag?

Well since way over half of my map consists of trees I have not seen any issues with severe lag or frame rate the only time I even see a slight shudder is when I place down a few dozen saplings and they grow simultaneously. I would be able to tell you after my entire map is filled but after a few hundred trees with no lag, I doubt that it causes it.
Title: Re: Tips for reducing lag on large builds
Post by: Auroras Calling on April 06, 2014, 10:47:35 PM
Well since way over half of my map consists of trees I have not seen any issues with severe lag or frame rate the only time I even see a slight shudder is when I place down a few dozen saplings and they grow simultaneously. I would be able to tell you after my entire map is filled but after a few hundred trees with no lag, I doubt that it causes it.

I've found that trees create quite some lag, Placing them and allowing them to grow seems to be the cause of that tho
Title: Re: Tips for reducing lag on large builds
Post by: Gary on May 02, 2014, 04:35:25 PM
Do invisible barriers affect lag? Since they are transparent there is not necessarily a "visible face", so I would assume not but I am not sure...
Title: Re: Tips for reducing lag on large builds
Post by: Clerical on May 02, 2014, 04:43:57 PM
Do invisible barriers affect lag? Since they are transparent there is not necessarily a "visible face", so I would assume not but I am not sure...
Yes, they may not have a texture but air is still touching them.
Title: Re: Tips for reducing lag on large builds
Post by: Craig on May 02, 2014, 08:24:56 PM
Do invisible barriers affect lag?
They do not. An invisible barrier is about as efficient as it gets, like air.
Title: Re: Tips for reducing lag on large builds
Post by: Gary on May 02, 2014, 09:28:03 PM
They do not. An invisible barrier is about as efficient as it gets, like air.
Great thanks for the info.
Title: Re: Tips for reducing lag on large builds
Post by: Northernsniper on June 04, 2014, 11:20:38 AM
does that mean if i remove the blocks inside of my skyscrapers I'm creating more lag on my map? I thought because I was using less blocks it would be less lag. but if I get what yur saying because the inside block faces are exposed to air I am creating more lag? I just wanted to know because I have a lot of lag on my map.
Title: Re: Tips for reducing lag on large builds
Post by: Clerical on June 04, 2014, 11:28:53 AM
does that mean if i remove the blocks inside of my skyscgrapers I'm creating more lag on my map? I thought because I was using less blocks it would be less lag. but if I get what yur saying because the inside block faces are exposed to air I am creating more lag? I just wanted to know because I have a lot of lag on my map.
If you have more blocks exposed to air, it will create more lag, so if you fill in all your skyscrapers should have alot less lag as only needs to render the outside of the buildings.
Title: Re: Tips for reducing lag on large builds
Post by: Northernsniper on June 04, 2014, 09:22:13 PM
Oh ok thanks good to know, I wondered why it didnt improve the lag. it actually seemed to have increased my file size when I did it too
Title: Re: Tips for reducing lag on large builds
Post by: DiamondBack662 on June 04, 2014, 09:50:32 PM
They do not. An invisible barrier is about as efficient as it gets, like air.

Nothing to render.. lol.. makes sense.
Title: Re: Tips for reducing lag on large builds
Post by: empire 3001 on June 28, 2014, 10:33:14 PM
 I found another way to keep ram small dont now if someone said this yet but on creative I have 2 worlds I build on one and copy and  paste on other world my world droped 800kb.
Title: Re: Tips for reducing lag on large builds
Post by: Clerical on June 29, 2014, 08:14:38 AM
Yup that works as-well, i removed 2MB from just copying and pasting to a new world.
Title: Re: Tips for reducing lag on large builds
Post by: Zoidberg on July 01, 2014, 12:12:13 PM
So if I were to fill in inaccessible areas of my map (i.e. upper parts of buildings, and other areas that are needed to be seen but cannot be touched by players) with invisible barriers it would reduce lag, but wouldn't it increase the world size? And if I the world size is larger then wouldn't there be more lag anyway? Or does the world size have nothing to do with lag and just the initial time to load?
Title: Re: Tips for reducing lag on large builds
Post by: YoungSykotic182 on July 01, 2014, 01:47:44 PM
So if I were to fill in inaccessible areas of my map (i.e. upper parts of buildings, and other areas that are needed to be seen but cannot be touched by players) with invisible barriers it would reduce lag, but wouldn't it increase the world size? And if I the world size is larger then wouldn't there be more lag anyway? Or does the world size have nothing to do with lag and just the initial time to load?
Invisible barriers won't do anything to increase or decrease lag. They are equivalent to air in a hunch.

As for increasing your world size it wouldn't by much unless the areas you are adding to happen to be chunks you have not edited in before. This obviously wouldn't be the case for you as you would be filling in areas you already built up.

File size shouldn't affect your loading in time too much as the game is only loading in the area immediately around you when you start the world. It will affect other players though as you have more data to send them.
Title: Re: Tips for reducing lag on large builds
Post by: I on July 04, 2014, 07:48:04 PM
I never thought of it that way Young, that gives me a new perspective on map building.
Title: Re: Tips for reducing lag on large builds
Post by: SpiceSoul on September 04, 2014, 09:08:55 AM
thanks this should help my world a lot!
Title: Re: Tips for reducing lag on large builds
Post by: JBL on September 08, 2014, 06:40:53 PM
thank you this will help alot..
Title: Re: Tips for reducing lag on large builds
Post by: Jack Of Shades on September 09, 2014, 05:40:21 AM
Invisible barriers won't do anything to increase or decrease lag. They are equivalent to air in a hunch.

As for increasing your world size it wouldn't by much unless the areas you are adding to happen to be chunks you have not edited in before. This obviously wouldn't be the case for you as you would be filling in areas you already built up.

File size shouldn't affect your loading in time too much as the game is only loading in the area immediately around you when you start the world. It will affect other players though as you have more data to send them.
I'll need to remember this for Trium, loving all the tips and advice. VERY helpful! /sage
Title: Re: Tips for reducing lag on large builds
Post by: Platinum Dryym on June 03, 2015, 12:09:01 PM
Since the 2.2 update's massive performance upgrade, Are hidden faces as much of a problem as they once were?
Title: Re: Tips for reducing lag on large builds
Post by: Craig on June 03, 2015, 06:44:41 PM
Since the 2.2 update's massive performance upgrade, Are hidden faces as much of a problem as they once were?
Yes, hidden (visible) faces are the eternal enemy and should be ruthlessly seeked out and smited.

They add load to the CPU.
They add load to the GPU.
They increase GPU RAM use.
They increase the world's file size.
And most importantly, in online games, they increase bandwidth usage.
Title: Re: Tips for reducing lag on large builds
Post by: Lady Lobo on June 04, 2015, 06:02:01 PM
Thanks for the information Craig, I have hit almost 19  mb on my survival map spider 2 and I filled in 3 huge man made caverns and it helped.  I still have to fill in all the small tunnels, by the time I'm done it should help to reduce even more. 
Title: Re: Tips for reducing lag on large builds
Post by: ShaneSaw Taco on July 04, 2015, 10:41:45 AM
Wow Very Helpful thanks xD
Title: Re: Tips for reducing lag on large builds
Post by: Dream Psychoo Xbox360 on July 15, 2015, 05:40:33 PM
Very helpful, thanks!
Title: Re: Tips for reducing lag on large builds
Post by: Dr_Vex_Ender on September 26, 2015, 06:16:28 PM
Thank you Craig, I know you get a lot of thank you messages, but for large map, This is a good tip!
 ^-^
Title: Re: Tips for reducing lag on large builds
Post by: Dark Hydrak on October 04, 2015, 03:05:24 AM
Once a map gets built up significantly, the GPU can start struggling to draw all the graphics, causing lower frame rates or draw lag.

It's all about visible faces. A face is the side of a block. If the side of a block is exposed to air, that side is a visible face and the game must draw it. The more visible faces the game has to draw, the more work it has to do; the more likely the map will start to hit the limits of the graphics hardware.

1. Hidden visible faces. How can visible faces be hidden? These are faces inside enclosed areas. The game does not know if a face is inside an enclosed area, all it knows is if the face is exposed to air. Significant landscaping can create enclosed areas. e.g. if you build a flat surface over a non flat terrain, this can leave empty areas underneath the flat surface you built, down to the ground. Any face inside this enclosed area will still have to be drawn, even though players will never see them. So to remove these hidden visible faces, fill in the enclosed areas. The Creative Fill tool is a great way to do that.

2. While the sunrise/sunset effect is active, the GPU is executing a lot of extra commands to create the effect. If you freeze the day/night cycle so that the sunrise/sunset effect is always active, the GPU is working much harder than it is during normal day or night time. If your map is experiencing draw lag, freezing the day/night cycle outside the sunrise/sunset effect can help.
So, basically, just stop time and fill in all of your empty builds? That can be very useful. Thanks Craig.
Title: Re: Tips for reducing lag on large builds
Post by: Faint of Clubs on December 10, 2015, 01:40:40 AM
Craig this topic is useful but for awhile now I've wondered how my scripts affect connection, it isn't addressed at all.

I believe the way I've grown to script makes my maps more efficient than the way I used to script but it's only in theory as I have no clue how different scripts affect gameplay.... Could we please g,et an in depth topic on it?

'Reducing lag on heavily scripted maps' perhaps?


Would be super useful to me, and others who haphazardly throw together messy scripts.
Example: I notice using a dynamic item swing that checks equipped item script for multiple items causes less lag than having a script for every item, or is this in my head?
Example2: instead of using multiple loops for timers, use histories and queries to time things in a single script.
Example3: what is he limit of pasted component scripts before slow downs?
Example4: folders, do they help performance by folders get histories etc?
Title: Re: Tips for reducing lag on large builds
Post by: The Sneaky Sort on July 14, 2016, 03:02:11 AM
I've been doing this all wrong the whole time? I always have been hollowing out my builds, I thought the less blocks placed= less space/lag. Thanks for the advice. ;)
Title: Re: Tips for reducing lag on large builds
Post by: November Jim on August 16, 2016, 05:57:09 AM
I'm only seeing this thread now but thank you this will help a lot with my medieval project :)
Title: Re: Tips for reducing lag on large builds
Post by: PriceyMeerkat99 on August 23, 2016, 06:51:55 PM
Normally Markers prduce lag....
thanks for the info craig
Title: Re: Tips for reducing lag on large builds
Post by: Craig on August 23, 2016, 10:42:20 PM
Normally Markers prduce lag....
No they don't.