So this has been a long standing work in progress for me. Not just procedurally generating an underground cave system like Terraria, but also setting the correct blocks. So it knows if it's a corner piece, middle piece, side piece, disconnect completely, etc. Right now it is based on a giant array filled with numbers. So it starts off with the entire array being filled in with a single number. Then through iteration it cuts out cave systems. After that it checks each block to figure out what it is, top left corner, top middle, top right corner, etc and gives it a number value in the array. Then of course we generate a tilemap based off the numbers. For me it takes about 20 seconds to load in the game. The entire map is 8400x2400, the player is 16x24 and the blocks are 8x8. I'm still working on finding a way to only render what is on screen to help with performance. Anyways without further adieu.
ARROW KEY MOVES
MOUSE WHEEL ZOOM IN/OUT
LEFT CLICK PLACE BLOCK
RIGHT CLICK REMOVE BLOCK
Oh that's nice! I'm looking forward to what comes out of it in future. I hope you will keep developing it.
Some progress made. Below you can find the updated game link, link to the current commented .CAPX, and links to sources I cobbled together to make this happen. The last major feature I need to tackle is only rendering what is on screen with like a 10-20 tile buffer off screen so I can really make this a HUGE world without hitting performance issues. My current tiles are not seamless due to my lack of bravado within Photoshop, but hopefully I can make or find better ones in the future, probably find.
Smaller Map, Larger Tiles for testing purposes.
Placing new blocks updates neighbor blocks
WSAD- Move Camera
Middle Mouse - Zoom
Left Click/Hold - Place Block
Right Click/Hold - Remove Block
https://drive.google.com/open?id=0BzhJb ... k85dE9QU0U
https://www.scirra.com/tutorials/746/au ... ise-method
Develop games in your browser. Powerful, performant & highly capable.
So I decided to try out some water simulations this is a work in progress and it hits the FPS pretty hard so the current way I am doing it is not sustainable. I do however like the outcome, it's pretty fun filling these caves with water and creating these little air pockets.
Hold Shift and Left Click/Hold to add water.
looks great so far
Thanks, I'm having trouble with cellular automata for the fluid simulations. I understand the concept/idea of it, but I can't seem to get it working. At least not without having a constant check of the entire array, which is what is causing the slowdowns.