Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Qo2770 · Jul 21, 2015 at 10:03 PM · voxelsaveloadchunksterrain genpreformance

Questions about voxel terrain(loading/saving and optimizing performance)

Hi,

I am working on a cube world-type voxel game. I managed to generate chunks via PerlinNoise, but I got stuck when trying to save/load them using a text file. I looked all over the internet and through several games to see how they managed it, but I still don't understand it. This is my first game and I have not gotten much experience, but I now the basics of Unity.

Also, every time I try to play, I get intense lag. I have already multithreaded as much as I could, but it hasn't helped.

In my GenerateChunk method, I instantiate a square of voxels in a 16x16 square, then load in dirt and stone underneath that square. I had to use mesh colliders to be able to place blocks manually, but even changing them to box colliders(rendering player block placement impossible) does not increase performance much.

Please tell me which snippets of code I need to upload!

Any help would be appreciated!

-Qo2770

EDIT: Could someone tell me how I could hide blocks that are not visible (Adjacent to air or water)?

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 Cherno · Jul 22, 2015 at 07:07 AM 2
Share

Hard to say without knowing exactly how you generate your terrain chunks and colliders. In any case, take a look at this gem of a thread if you haven't already:

After playing $$anonymous$$ecraft...

Also, saving to a text file is something I used to do for my voxel game as well. Don't do it. Even though I only saved 24x24x16 blocks, it was rather taxing. Ins$$anonymous$$d, serialize your data and write it to a file. You can use SerializeHelper , for example. I advise you to first get your terrain generation in order before diving into saving & loading data, since it's a whole new field full of pits and traps :)

avatar image Qo2770 · Jul 22, 2015 at 12:57 PM 0
Share

Thanks, I'll try that

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Runalotski · Jul 22, 2015 at 11:57 PM

http://alexstv.com/index.php/category/voxel-tutorial

This has all the voxle stuff you could want to start with including saving and loading.

Comment
Add comment · 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

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

24 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

Related Questions

Voxel terrain - NOT MINECRAFT - Digging and creating with resources 0 Answers

Cube made out of many voxels 0 Answers

How to load stacking chunks on the fly? 1 Answer

Access a multidimensional array inside an array 1 Answer

Help with generating Chunks! 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