1
\$\begingroup\$

I am a huge fan of Minecraft and (to an extent) Terraria. I’ve always wanted to make my own version of that type of Creative sandbox game, and recently I’ve been thinking of so many things I could add to it.

The game I’m imagining is a very different style from these two games. It’s 3D, and cartoony to a point but not too cartoony to not be realistic. I’m talking more realistic than Fortnite’s style but I definitely do not want to attempt to make a photo-realistic game.

I want my games world to be more fluid than the worlds of Minecraft and Terraria. I don’t want the player to be necessarily limited to a grid of blocks, though that should maybe be implemented at some points, like when the player is placing pieces of a structure down (blocks).

Generated structures such as trees, rocks, and the terrain I don’t really want to be blocky or constrained to a set grid.

The things that I see players being able to place into the world are things like wood columns to form the base of a house, wall blocks for a house, tables and chairs, doors, and different blocks required to create different items.

I like how the Minecraft and Terraria worlds are generated and saved. It’s simple: each coordinate is a block and that can be stored away very easily. I still haven’t figured out how I can save the type of world I want in my game, though.

So my question is: how should I structure the terrain, structures, and player-placed blocks layout/saving system so that I can save it efficiently and write it relatively simply as well?

Something I’ve thought about: there is a mod for Minecraft called the no cubes mod which essentially removes all the cubes from the game and seamlessly blends blocks together. That might be a good way to make this game since the blocks are still stored the same way but they are not actual blocks, and terrain can be made more realistic through this method.

\$\endgroup\$
1
\$\begingroup\$

A lot of game with modifiable terrain actually use a grid structure to store blocks internally (called "voxels" in game dev terminology, which is short for "volumetric pixels") but they are using processing algorithms like Marching Cubes to smooth them and make them look less blocky. A more advanced algorithm is Dual Contouring. Developers have come up with a lot more interesting algorithms to smooth out voxel data into good looking high-polygon landscapes. Judging from the screenshots, the "No cubes" Minecraft mod seems to do the same thing.

The advantage of voxels is that each block is just a number in a 3-dimensional array which represents the type. The location of the block is derived from its location in the array. That results in very little memory usage per block. And on top of that, the terrain data is usually pretty compressible with standard compression algorithms like Deflate or LZW, so you can save space when you save chunks of terrain to disk or exchange them via network.

If you have objects which are not constrained to integer-coordinates within the grid, then you usually store their position as a set of floating-point coordinates within each object.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.