Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by ffxz7ff · Nov 10, 2013 at 01:54 PM · performancetilemaptiles

How to display a tile map efficiently?

Hello everyone,

I have a pretty general question. I'm wondering what the most efficient way in Unity would be to display a tile map. I'm writing an online game and in my case, the client gets the tile data from the server after login, and then instantiates tiles based on that data.

I am aiming for a view distance of 500 tiles in any direction, so 1001x1001 concurrent tiles, over 1 million in total. Each tile has 4 vertices.

So I figured it would be better to make the tiles part of the scene and move them to wherever I want after the login and assign a material, instead of instantiating them by code. But even instantiating 20,000 tiles takes forever, and the Unity Editor is practically not responsive after I do that.

Does anyone have any hints how I should go about this?

Thanks for your help.

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 Eric5h5 · Nov 13, 2013 at 07:42 AM 1
Share

Do you actually need 500 tiles visible in any direction? They'd only be a few pixels big.

avatar image ffxz7ff · Nov 13, 2013 at 09:25 AM 0
Share

I'm not really sure yet. $$anonymous$$aybe I'll only need 300 or 400 in the end, but I don't know that yet. The tiles also differ in height. There'll be mountains that should be visible over such a distance.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Loius · Nov 13, 2013 at 07:03 AM

You can't have that many objects - you need to build them in chunks. Make a 50x50 mesh, copy-paste it as necessary. You can build meshes at runtime or just assign their uvs at runtime, but Unity just can't handle 20,000 objects being created at once.

Comment
Add comment · Show 6 · 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 ffxz7ff · Nov 13, 2013 at 09:13 AM 0
Share

Hmm that's kind of unfortunate, but good to know at least. If I was making 50x50 chunks, how would I apply different textures to each tile though? Wouldn't I need to create a texture for the whole chunk at runtime, since I don't know before I log in which of those tiles are dirt and grass etc?

avatar image ffxz7ff · Nov 13, 2013 at 10:26 AM 0
Share

I suppose this is where submeshes come into play? Can anyone point me to a submeshes tutorial maybe? I really can't find one.

EDIT: Never$$anonymous$$d, the accepted answer to this link cleared things up for me: http://answers.unity3d.com/questions/312492/submesh-creation-from-script.html

I'll try to make chunks with submeshes.

avatar image ffxz7ff · Nov 13, 2013 at 09:31 PM 0
Share

Well, I did end up doing that. I can make chunks now. But the texture problem isn't solved. Is it even possible to assign different materials to submeshes?

avatar image Eric5h5 · Nov 13, 2013 at 10:10 PM 0
Share

Yes, that's the entire reason submeshes exist.

avatar image ffxz7ff · Nov 13, 2013 at 10:15 PM 0
Share

You don't happen to have any tutorial on how to do that?

I set the number of submeshes and assigned the triangles to each submesh. But the mesh class doesn't have any method like getSub$$anonymous$$esh or anything. I'm confused.

Show more comments

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

19 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

Related Questions

Question regarding TileMap Performance 0 Answers

Streaming in 2D tiled maps for seamless world, does this conflict with Unity's editor? Do I need to use an external editor? 1 Answer

Tilemap gap between tiles 0 Answers

How to resize a single tile from a tilemap? 0 Answers

Largest Rectangle of Tiles 1 Answer


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