Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Vitos23 · Dec 26, 2017 at 07:12 PM · 2dspriteoptimizationsprite rendereroptimizing

How to optimise 5000 sprites?

In the scene I spawn 5000 sprites (I'm creating drill game). But the framerate on my laptop (Nvidia Geforce 960M, 16GB, Intel Core i7 - 4 cores) is 0.9 fps. How to optimize them? Sprite Packer doesn't fix this problem.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vitos23 · Dec 27, 2017 at 02:25 PM 0
Share

Anybody, help me, please!

avatar image Bip901 · Dec 28, 2017 at 01:41 PM 0
Share

If you have a problem with spawning them, have a look at Object Pooling. Now for your actual problem: If you $$anonymous$$UST use sprites in your game and no other solution, a general advice would be to $$anonymous$$imize the amount of calculations done on those sprites. Low quality images and no use of physics could help, as well as optimizing scripts that perform actions on them - especially loops like Update().

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by ShadyProductions · Dec 27, 2017 at 02:36 PM

Instead of making several gameobjects make chunks of mesh https://forum.unity.com/threads/tutorial-procedural-meshes-and-voxel-terrain-c.198651/

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vitos23 · Dec 27, 2017 at 04:48 PM 0
Share

Is there the easier way. That's very complex.

avatar image Vitos23 · Dec 27, 2017 at 04:51 PM 0
Share

And this is bad way, because i need to store some information in blocks

avatar image Vitos23 · Dec 27, 2017 at 05:52 PM 0
Share

And I need to destroy some blocks.

avatar image ShadyProductions Vitos23 · Dec 29, 2017 at 01:12 AM 0
Share

It's not a bad way, this is how it's done. You make an object like:

 public class Block {
     public int Info;
     public bool Info2;
     // keep info variables you need to access
 }

then usually you make a grid like

 Block[,] grid = new Block[5,5]; //multidimensional so x, y dimension

 for (int x=0; x < 5; x++) {
     for (int y=0; y < 5; y++) {
         grid[x,y] = new Block(); //instance a new block
         grid[x,y].Info = 5;
         grid[x,y].Info2 = true; // set info etc
     }
 }

It would be accurately displayed as:

 X X X X X
 X X X X X
 X X X X X
 X X X X X
 X X X X X

Then to later delete blocks you simply change the block data in the array at that x,y coord u want to some kind of air block (empty) and call a render update on the grid.

There is no simpeler way I'm afraid. If you want to go over 500+ gameobjects and have performance you will have to do it like this.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

156 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D-Sprite Bug? 1 Answer

Sprites vs texturesless Meshes - more texture memory with meshes?? 0 Answers

Why is it that some sprites render in game view and others do not? 1 Answer

Sprite not visible? 7 Answers

How to repeat moving a sprite within the screen scale 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges