Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by michidk · Jul 23, 2014 at 05:46 PM · c#terrainlaggenerationinfinite

[C#] 2D infinite Terrain Generation with prefabs?! -> lag

Hi, i'm currently working on a topdown game. I already have a infinite terrain generator (works with SimplexNoise) and a chunk system (a chunks loads, if needed and will be destroyed if its too far away; each chunk has 16 tiles) It looks like this:

alt text

1) If the player moves and generates new terrain it lags. Thats because each tile is a prefab (a quad) that will be colored (remember? a chunk consist out of 16 prefabs) -> lag

2) Below you find a version where each chunk is a quad and i modify only the pixels on the quad instead of creating tiles:

http://www.codebukkit.de/michidk/Web.html

  • no lag

3) then i tried this ObjectPool: http://unitypatterns.com/new-tool-objectpool/ the result is the same as 1) -> lag

4) i tried to use coroutines, but then it tooks too long to load the chunks:

alt text

and even there: -> lag (not much as above)

  • i need prefabs, because i need colliders (you can't swim and climb up mountains)

  • i need a lot of chunks because it takes so long to load a chunk, and the player is very fast

has someone an idea, how to slove this problem?

29651-ss+(2014-07-23+at+07.18.03).png (10.3 kB)
ss (2014-07-23 at 07.23.59).png (21.2 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Procedural 2D Tilemap Terrain - Mesh or Unity Tilemaps? 0 Answers

Is there a way to load premade terrain chunks randomly? 1 Answer

How to make a game with lots of objects?!! 1 Answer

15625 blocks are making my game lag? Increase performance? 3 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