A downloadable game

The Aim of this project is to render a blocky terrain that a player can travel across with his or her friends across the network and interact with the world together. The world is basically infinite as it is generated by Perlin Noise, though if you travel about 400k in a direction the world will begin to flatten because of floating point errors. The terrain is divided into 16x16 chunks. Chunks around the player get loaded in and out of memory as the player moves around the world, and if any changes are made they get saved and applied the next time the chunk is loaded.

How the landscape is broken into chunks

  • The landscape is divided into 16x16 chunks though this can be changed to what is needed,
  • The height is separated 3 parts: Underground, Ground and Air. Underground is made of stone, then these the Ground layer that varies in height, this is placed on top of the Underground layer then a the air layers are put on top of it so player can have more room to build. Also a min of 8 layers of air are needed because of trees

How they are store in a dictionary of loaded chunks

  • When a chunk is loaded in, it gets add to a dictionary in the chunk manager called chunkArray and if any changes happen to the chunk they get saved in a different dictionary called Changes this holds what chunk, position of change, and what block it is. Also when a chunk is loaded in it checks if this and apply the changes, when a chunk get’s unloaded it gets removed from chunkArray and deleted, this is done to save space.
  • I used dictionary’s because the world is very large and creating an array the size to fit world be in the more then a couple of GB as it would be a 300k by 300k array which hold a 16x16x48 array, so if I use a dictionary at most it’s a 16x16 that holds that data what makes it very good for this task,

how the changes in a chuck and saved to the server

  • When a player makes a change to a chunk it tell the server about it then the server tells the players that a change happed and to update Changes in chunkManager and update the chunk with these changes

Download

Download
Block Placer Sim.zip 27 MB

Install instructions

UnZip and Run "Block Placer Sim.exe", 

Leave a comment

Log in with itch.io to leave a comment.