Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:42:09+00:00 2026-06-01T01:42:09+00:00

i am working on voxel based game engine, in which i need to have

  • 0

i am working on voxel based game engine, in which i need to have chunks. I have tried to read a Chunk class from minecraft, but i cant understand it.
By chunk i mean: 16x16x256 array of blocks

So my question is: How chunk works and how does it store data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:42:10+00:00Added an answer on June 1, 2026 at 1:42 am

    By chunk i mean: 16x16x256 array of blocks

    Well, that defies some geometrical structure then. If this is a Micraft-esque game, then a block is either filled, or it’s void. Do you want those blocks be of different types, or just “there” or “not there”.

    Lets say, for the sake of simplicity, that you want to have 2^CHAR_BIT different states for a block (CHAR_BIT is 8 on most systems). The state 0 means void. So you can store those blocks in a array of the structure

    char chunk[16][16][256];
    

    You can encapsulate this in a class.

    class Chunk
    {
    private:
        char chunk[16][16][256];
    }
    

    Of course your world consists of more than one chunk, you’ll probably arrange your chunks in a grid, where each grid cell takes up one chunk

    class ChunkGrid
    {
    private:
        std::list<Chunk> chunks;
    

    And for sure you also want to organize those Chunks in a spatial subdivision structure, so that you can quickly index chunks depending on their position in the world, a Octree works wonderfully for that

        class ChunkOctree
        {
        private:
            union Fork
            {
                ChunkOctree *branch;
                Chunk *leaf;
            };
            Fork forking[2][2][2];
        }
    

    you’ll also want some functions to traverse this structure, but I’ll leave the research up to you, as a learning experimence. I’ve given you plenty of keywords to search the interwebs for.

    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working a program which renders a dynamic high resolution voxel landscape. Currently I
I'm working on a Minecraft-like engine as a hobby project to see how far
I am running a complicated multithread java game, which is working perfectly with the
I'm making a simple voxel engine (think Minecraft) and am currently at the stage
Working on a project at the moment and we have to implement soft deletion
Working with python interactively, it's sometimes necessary to display a result which is some
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
Working on calling a C function from my asm project. I'm trying to push
I am working on implementing a spell check function for a web-based WYSIWYG editor.
Working with an API where I need to send a value over in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.