ID:1446035
 
(See the best response by Ter13.)
I have created a new map on my game with big areas (224x224), something that I have previously done with maps that didn't lag. But I also have some big turfs. However, I did have that too on some other maps. The CPU is increased a lot when people are on that map, it lags so hard that they teleport. I suppose its visual lag, but I dont know what to do. Would it lag less if I had 32x32 icons instead of these? I tried editing the sky area to 32x32 icons but that didnt reduce the lag.

What should I do? Thank you a lot!
What else are you doing that's process-intensive? NPC's with AI? Complex math? Lots of for() or while() loops?
Best response
What map format are you using? Isometry and big icons can create some definite issues with rendering speeds due to the way that they are sorted into the rendering pipeline.

However, having extremely large/inefficiently packed icon files can cause this kind of stutter/delay on intial showing.

Show us what you are doing with some screenshots, and how your icons are packed, and we'll be able to help you get around it.
The map format is the default one, I did a small change though, the client pixel_y is a bit high, but it didn't affect on the other maps. I haven't used NPCs or any formula which involved for() on turfs, that's why I worry about this :S It only lags on that map, the rest seem to work normal.
However, having extremely large/inefficiently packed icon files can cause this kind of stutter/delay on intial showing.

Show us what you are doing with some screenshots, and how your icons are packed, and we'll be able to help you get around it.


The floor below the character is like 96x48 I think.
The background is 224x224
The platform is 224x224 (per tile, it has like 8)
You are probably going to want to attach the background to the player's screen, or separate it into individual tiles on the map. That will keep BYOND from doing excess distance calculations.

As for the platform, you are going to want to break that up into tiles as well. There just isn't any benefit to having this thing being that large.

There's nothing wrong with big icons, if they are used right. But in this case, you aren't getting any benefit out of the system and just leveraging BYOND to do something that there is no reason for.
Altering many 32x32 icons' pixel y wouldnt lag, right? I really need to :S
Actually, I think some large objects would be faster than many small objects due to more view-related calculations. It will take a lot more than what is shown in the screenshot to have any noticeable lag, though. Also, rendering lag is only client-side, while view processing is server-side.
In response to Eternal_Memories
Eternal_Memories wrote:
Altering many 32x32 icons' pixel y wouldnt lag, right? I really need to :S

I'm not sure what you are asking.
In response to Kaiochao
Kaiochao wrote:
Actually, I think some large objects would be faster than many small objects due to more view-related calculations. It will take a lot more than what is shown in the screenshot to have any noticeable lag, though. Also, rendering lag is only client-side, while view processing is server-side.

Only in the case of processing done in the VM.

Internally, BYOND is optimized for tile-based rendering. Large objects kinda mess that up by expanding the view range that has to be sent to the user, which can cause a lot of redundant data to be sent to the user.

Now, what he might be running into is appearance caching. When a large icon is shown to the world for the first time, it has to generate an appearance. This can take some time if the file is really large, so large icons might need to be precached forcibly to avoid the stutter.

I ran into this problem a few months back with a problem FireKING was having. He was showing a really huge spell effect to the user, but it was causing a 2-3 frame delay every time it was shown to the user for the first time. We just forcibly precached it at the start of that bossfight, and it worked fine from there.
In response to Ter13
Ter13 wrote:
Eternal_Memories wrote:
Altering many 32x32 icons' pixel y wouldnt lag, right? I really need to :S

I'm not sure what you are asking.

Sorry for the bad explanation.

I basically meant that if I had, for example, >500 turfs using a 32x32 icon, and with pixel_y var set to 18 (for example), would it cause more lag than having those turfs with their pixel_y var set to default?
No. By default, BYOND sends 4 tiles extra radius to your view size. Until your pixel_x/y values exceed 128 pixels, you won't see any difference.