Hmm. These "caves" are more like valleys or canyons, then? Since (if I'm reading it right), there's no way to have an empty tile beneath a solid tile...
Also, is it intentional that each screenshot shows several disconnected "cave" systems?
These look great. The scale seems about right for exploration, too.
Cool, what way do you seed the algo? Seems like there is some bias there to ensure the elongated shape.
Random rnd = new Random(); //this automatically builds a random object with a random seedRandom rnd = new Random(1230044) //Initializes the random object with a specific seed
int iDirection = rnd.Next(0, 5); //Returns an random number from 0 to 4if (iDirection == 0) //Moves southif (iDirection == 1) //Moves Eastif (iDirection == 2) //Moves Westif (iDirection >= 3) //Moves North
The above code tells the moving north has twice the chances of coming up because it triggers with a 3 or 4. You can further increase the elongating effected simply by increasing the X: rnd.Next(0, X) to a higher number.
Quote from: Endorya on July 17, 2013, 09:11:30 PMThe above code tells the moving north has twice the chances of coming up because it triggers with a 3 or 4. You can further increase the elongating effected simply by increasing the X: rnd.Next(0, X) to a higher number.I like the longer caves - much cooler than the big blobby things most caves end up being. Weighted randomness is always cool too.Since we're talking about implementation details; another way to get longer paths is to use forward, left & forward, and right & forward instead of north, south, east, west. If forward is more common then turn & forward then you'll tend to get longer paths that meander a bit. Or you can have a certain % chance that it just repeats the same direction instead of choosing a new one.
Quote from: ekolis on July 17, 2013, 07:09:32 PMHmm. These "caves" are more like valleys or canyons, then? Since (if I'm reading it right), there's no way to have an empty tile beneath a solid tile... The floor color oscillation tells only the floor depth of each tile, darker means deeper. They are all empty tiles.
Is your game logically 3D Or 2.5D?Looks awesome.
What I mean is, a cave has passages that are located under the ground. What your algorithm appears to generate is just a heightmap - it has no way of generating passages located beneath solid ground.
Quote from: requerent on July 18, 2013, 03:57:34 AMIs your game logically 3D Or 2.5D?Looks awesome.Thanks. I'm still deciding but I probably go with 2.5D game logic. There is already too much complexity in the whole project and some parts of it should stay "less" complicated.