Introduction
A while ago @SamIsTwisted and I worked on a project named ‘FlatMine’. It is a two dimensional mining game that is mainly inspired by Terraria and Minecraft. It features terrain generation with biomes and caves. The textures and models were made by @SamIsTwisted.
The open sourced game can be found here. I figured that it would be a shame to let it sit in my games catalog. Therefore, I decided to publish it to at least share it with people.
Also, there is a spawn protection with a radius of about 20 blocks, which prevents players from mining the spawn.
Terrain Generation
Rendering a nearly infinite world
Generated terrain from a distance.
FlatMine’s terrain is made to be nearly infinite. The game draws the terrain on the client and only selects cells that are visible within the user’s point of view. This gives the game a limited amount of cells to render. Each cell can be either cached (due to interactions with the world like mining) or generated.
The game’s terrain generation is based on a seed. This makes it completely pseudo-random. World are recreatable with a seed just like in Minecraft.
Biomes
A mountain biome.
A desert biome.
The game features multiple biomes that are based on noise.
Caves
Some randomly generated caves.
The caves are also based on noise. They become thinner by depth.
UI
The in-game shop UI.
At the moment, there is a shop and inventory UI. The user can buy a new pickaxe in the shop and select it in the inventory.
The shop items have a three dimensional preview, which might be interesting to look at if you want to make one yourself.
Discussion
Security
The terrain generation processes are client-side and therefore vulnerable to potential attacks. Attackers can directly influence the terrain generation by accessing the client-sided scripts.
Lack of gameplay elements
I am an engineer type of guy who struggles with creating beautiful UI and solid gameplay elements, which is one of the reasons why I decided to discontinue this project. This game is far from finished, cause there is no real gameplay. At the moment, it is no more than a showcase.