Gmod minecraft is a project I have been working on for a few weeks now, primarily to see if it is possible, and I have achieved some rather incredible results. The system uses dynamic meshes to render thousands of blocks without using entities meaning there is little to no lag. It uses a perlin noise algorithm very similar to the technique used in minecraft (this algorithm is still being fine tuned to get nice looking terrain)
With this project I hope to bring yet another new form of gameplay to garrysmod, which is possibly one of the most advanced building games to date with hundreds of modes of gameplay.
I hope to create infinate worlds rendered using a combination of the beautiful terrains made possible by dynamicly generated terrain, combined with the beautiful rendering and physics capabilities made possible by Gmod and its easy to use lua mod system.
By the end of the summer I hope to have support for most of the block types available in mine-craft, realistic and beautiful terrain generation with multiworld support, and an infinite map system.
How It Works
One of the biggest problems when designing a system like this is datamanagment. How does one process hundreds of thousands to millions of blocks at a reasonable speed. My solution: a mixture if oct trees and “zones” each zone is a 64 by 64 by 64 box which contains an oct tree that stores the blocks in the zone. Whats nice about this system is we can simply tell the system we want to store blocks in a particular area, even if that area goes through multiple zones, and the system will store them using as little data as possible, without having to fill up every block in the zone. This is immensely advantagous because it greatly simplifies mathematics and makes the system easier to work with, unlike my first version where simply getting a block required about 10 lines of code.
You may be asking well whats so cool about this? So u can store stuff easily, well heres what: using this method we can easily generate blocks as needed rather than generating blocks in huge batches creating lag spikes. As a player moves around we simply generate the blocks that have now entered his view radious and throw out the old ones that have left it.
Another advantage of this system is our ability to devide up meshes independent of chunks. This means we can create a mesh out of just the top layer of visible blocks and easily add code to ignore cave systems which clearly arnt visible.
Lastly, and most importantly, this system makes it easy for building where we must be able to quickly insert or deletr blocks and calculate the blocks that we now need to update on the clients. By allowing entities like the physics ents to quickly access and take on the physics hulls of blocks from any zone they desire, rather than a single chunk, we can have smaller physics meshes that just load blocks near players and NPCs
TheLastPenguin - everything lua based.
Sphax Team - using their 256by265 res texture pack.
5/25 - Started recoding system.
5/25 - Oct Tree block managment system. No more “chunks” (sorta)
6/9 - Finished Rendering System
6/9 - Finished MultiPlayer Support
6/9 - Finished Terrain Generation to follow players
6/9 - Finished Physics System
Block Placement / Destruction - WIP
Inventory System - WIP
Crafting System - WIP
Infinate Map Size
Terrain Generation - DONE
Water and Lava
Realistic Lighting (no dark tunnels at the moment)
**NEW SCREEN SHOTS!!!
The Physics System
Some Zombies walking around
Screen shot showing the incredible texture quality I can get using gmod’s awesome mesh rendering:
Screen shot showing a massive overhang generated with the 3D Perlin noise generation:
Screen shot rendered with graphics on high settings with anti-aliasing and higher texture detail.
This is a rather immersive view of a nice terrain I generated using 3D perlin noise. Probably the best looking / least technical of the screen shots i’ve selected.
View looking up from within a generated cave. Walls should be rock but they are dirt for some reason… it’s a glitch I’ll have fixed soon.
Side view so you can see the structure of the cave system.
Zoomed out view of the top of the terrain shown in the other screen shots.
For those interested here is a print out of my speed results for the chunk generator for one 8 by 8 by 64 blocks chunk. ( 4096 blocks total )
9927Built Chunk at 80:64:0 Basic Terrain: 0.07300000000032 -- that's the most intensive part generating the general form. Post Processing: 0.020000000000437 -- should it be stone, dirt, grass etc Mesh Builder: 0.04100000000107 -- make it into a render mesh so the GPU can actually draw it
Please post any thoughts, likes, dislikes, suggestions, ideas, just cause, or anything else you want to say or ask about the project!
Block Type Suggestions
If you want to suggest a block type follow the following format:
State a general name and description and its applications.
Provide artwork at 256 by 256 resolution for each of the faces in jpeg or png format.
Include a recipy / means by which it would be found. If an ore give an approximate frequency relative to iron or gold for example.