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 boop5 · Aug 01, 2014 at 02:27 AM · meshesarchitectureblockschunks

How to set up a minecraft-like game?

Okay first: I'm new to Unity but not to programming. I also have already some gamedev experience and understand what matrices are etc. I don't want you to do the work for me - I'm asking here for an architectural advice, okay? ;)

I'm currently creating a minecraft-like game. That means:

  • The world exists out of blocks (cubes, 1x1x1)

  • Blocks are collected in chunks

  • The world is infinite

  • You can destroy / build blocks

  • You collect destroyed blocks in your inventory

  • ..

My first attempt - which worked pretty flawless so far - was set up this way:

My World checks every update if there are enough **Chunk*s around me to see viewRange* far, if not it creates all missing chunks.

Okay now to my Problem:
A chunk consist of blocks. That means currently I texture every block from a spritesheet with an adjusted UV mapping. This works so far but this is absolutely annoying since it is hard to maintainable IMHO. But the more important reason is I want to have different materials. In the simplest case I just want to have a different material color or shader for a single block.

In more complex scenarios I want to have different physical behaviours. Imagine a sand block, that has gravity.

So what I want to do:
My World consists of a number of **Chunk*s. A Chunk consists of a number of Block*s. Every Block has his own mesh with a texture from a single material. The material is a single texture - not a spritesheet. A block can exists of one of 255 different Materials.

And my question is:
What would be a good approach to accomplish this with Unity?

I hope this question is not to offensive. As I said, I don't want you to programm my game. I'm just asking for an advice.

Comment
Add comment · Show 4
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 robertbu · Aug 01, 2014 at 02:30 AM 0
Share

I went ahead and published your question in case someone has a quick and easy answer. But in general we refer design questions to Unity Forums. Unity Answers is designed to deal with single specific technical questions where multiple people attempt an answer. It is poor for design questions. Plus i think more people that can help you with this specific issue live on Unity Forums than here.

P.S. Have you explored sumeshes and the materials array? If so, have you run any performance tests?

avatar image boop5 · Aug 01, 2014 at 02:40 AM 0
Share

Thanks for your answer.

Submeshes: Yes, materials array: No. After a quick google this seems pretty interesting (Even when the thread says something like "horrible performance", but you never know when you didn't tried it at least)

I understand. Would it be rude to repost this question in the forums?

avatar image robertbu · Aug 01, 2014 at 03:00 AM 0
Share

I would suggest you repost it on the forums. I left it open here ins$$anonymous$$d of just closing it and sending you to the forums because there is sometimes a 'magic bullet' for a question like this one.

avatar image boop5 · Aug 01, 2014 at 04:26 AM 0
Share

FYI: I've got it working with Submeshes and the material array. So far I can't notice any performance losses. Well, for now I'm happy with this solution.

Feel free to post your comment as an answer for your +1 :)

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

How Can I make random level generation? 3 Answers

Mesh overlapping and textures. 0 Answers

Destructible Meshes At Runtime? 1 Answer

How to disable self-shadowing on a mesh 0 Answers

How can i merge mesh vertices using a script? 2 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