- Home /
2d game lagging
Hey guys. I'm making a side scroller with orthographic view. When I build and run it it is lagging alot.
I made the background out of 12 tiles all of which are 4096 argb 32bit. I'm not sure if this is a problem or not. It seems to lag the most where the planes meet. Anyone have experience with this ?
To add to what the others have said: I generally try to keep textures for 2D games to just 1024x768 at absolute most, and the majority are 512x512 or smaller. Unity can pump thousands of smaller sprites (64x64 and down) through the pipeline at a great framerate, but you don't want to go too crazy with the larger sprite sizes, even on the PC.
I have the same problem. But my animations work well after 3. or 4. playing. I think Unity don't load my sprites when i instantiate my prefabs. how can i force Unity to load animation sprites before when i want to play.
Answer by Eric5h5 · Apr 21, 2010 at 06:51 PM
12 tiles of 4096x4096 each = 780MB of VRAM, assuming mipmaps are off (or 1020MB if they're on). Which is far too much; you'd be constantly loading and unloading from RAM. A reasonable number of computers can't even use texture sizes of 4096 in the first place.
Answer by e-bonneville · Apr 21, 2010 at 06:31 PM
Well, yeah. The size of those images are massive... you have them on the highest setting, which eats up FPS like crazy. Did you do that on purpose? One way to bring up the FPS is to decrease the size of the images by changing 4096 to 2048 or some smaller number, and if possible, argb 32bit to rgba 16 bit. Remember, a good game features a combination of speed and quality, so if your game is still lagging, you may want to consider creating smaller images for your background.
Your answer
Follow this Question
Related Questions
Android lag 0 Answers
Extreme lag on play 2 Answers
OverlapCircle performance usage 1 Answer
Physics issue with Unity scaling and Hololens 0 Answers
Why does unity crash leads to direct3D and hardware acceleration disappear ? 2 Answers