Minecraft like project

About Monkey 2 Forums Monkey 2 Projects Minecraft like project

This topic contains 5 replies, has 2 voices, and was last updated by  Pakz 5 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #14113



    After watching a create Minecraft in a week video’s and following a Udemy course on how to create a Minecraft like game I started on creating something like this in Monkey2.

    Currently: I was able to figure out how to create cubes from meshes. Then chunks from the cubes by combining these into models. Then a crude world made from the chunks.

    I have various stages(example code) of the project in the above linked github folder.


    Learn/figure out mouse controls, Removing/Adding blocks, Texturing blocks inside the model chunks. Better (realtime/infinite?) generating. Collisions. And more.


    World made of chunks.



    Just compiled it for browser :


    I only needed to add a little bit of memory in the env.txt.






    I noticed a new chunks method being mentioned in the udemy course and had spend some time thinking about how to implement it. I was able to create this(I think I did) It basically now creates a chunk at once instead of cube by cube. The cube by cube method used the addmesh command. Mark mentioned this would cause a lot of copying.  The new FastChunk method uses a couple of lists where the vertices etc are put in and these are then used to create one complete chunk mesh.

    I had not seen a huge speed increase on the main laptop, but I am still testing(rebuilding on the low end lappy now)

    I also was able to implement a texture atlas. Here on the forum I learned that you can texture the cubes with that. They are different textures on one image. I made a couple of mistakes so spend a long time figuring out what went wrong, but I managed to get it working.

    There is now a new file in the github folder mining called worldtest fastchunk.

    I am planning on creating more textures and some work on the generator for placements of the textured cubes.



    I spend a whole bunch of hours working on the project. I got the chunk building updating so that it does not really cause screen freezes anymore. It seems to work pretty well even in debug mode on the lower end amd a8 laptop.  I also got the memory useage down. I added a check so it does not create unused data in the chunk generator. The memory useage went down from 600 mb to 300 mb.

    I also spend time adding block manipulation. I created a block model that I place on the block underneath the cursor. It is a blinking block. While doing this I also needed to create code to handle chunks next to each other. (faces) The v key is used to remove blocks.

    The last file I made is called : worldtest_blockmanip.monkey2 (no external files needed)

    I need to see what I feel like adding next.

    edit: i created a short video.



    It has been a while since I did anything with the project but I spend a night and morning trying to make it better.

    I added trees which are placed based on a seed(grow) array. This is a array where I place numbers on. I enter a loop and pick a random x and y and see if a number is present there and if so place that same number besides it. This way you end up with zones or islands if you will. This I use to see if a tree can be placed there. This makes it look like there are area’s on the map where there are no trees and area’s where there are trees.

    I also added a dungeon algorithm that I did. I simply copied into the project and added a ceiling and a floor. I still want to add different heights for the rooms and a stair to the surface. The dungeons are randomly placed on the map and should be mostly underground. Usualy they are unreachable unless the tunnelling algorithm broke through the walls.

    I also was working a bit on the texture atlas. There is still something not right on the edges. I still want to make it so that each side of a cube can have a different texture.

    Another thing I was planning is ambient lighting. I think(?) this is done with having a larger texture atlas where every image has a version with shadows on the edges. These textures then get placed in corners making it look like it has been lighted. Since I am using small textures I think I can make this work. This would be useful since the regular lighting on lower end machines seem not to give a good framerate and need to be disabled there.

    The code is still on github in my account (pakz001) in the public monkey2 3d rep in the mining folder. There are a number of examples and experiment files there that should mosly compile with a later version of monkey2.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.