Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411540 Posts in 69383 Topics- by 58442 Members - Latest Member: vicemask

May 03, 2024, 01:49:15 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsBraving Procedural Generation
Pages: 1 ... 17 18 [19] 20 21 ... 23
Print
Author Topic: Braving Procedural Generation  (Read 213484 times)
JustIntroverted
Level 0
*

nub


View Profile
« Reply #360 on: September 10, 2011, 02:18:28 PM »

After reading this thread, I had to test my own luck, then register to the forum.  This has probably become one of my more favorite things to do. Tongue

« Last Edit: September 10, 2011, 02:33:03 PM by JustinPZFX » Logged
bertling
Level 0
*


View Profile
« Reply #361 on: September 16, 2011, 07:07:05 PM »

Figured out an algorithm to generate better caves with distinct rooms and corridors:

First, divide the map into random squares, then in each square, make a circle:


Draw Bresenham lines between circles until you've made a spanning tree, add a couple of extra paths just to make things more interesting. Use midpoint displacement to make lines meander. Add some background perlin noise.

Et voila
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #362 on: September 16, 2011, 07:21:43 PM »

That look like magic
Logged

wademcgillis
Guest
« Reply #363 on: September 16, 2011, 08:24:59 PM »

That look like magic
Not look like.

Is.  Wizard
Logged
Geeze
Level 5
*****


Totally.


View Profile
« Reply #364 on: September 17, 2011, 12:07:08 AM »

That technique looks worth of stealing. I might "steal" it and use it in my next project. Wizard
Logged

_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #365 on: September 17, 2011, 04:04:56 AM »

Wow, that's the best cave generator in this thread, hands down! Lots of designer control and interesting caves,  Beer!
Logged

Ben_Hurr
Level 10
*****


nom nom nom


View Profile
« Reply #366 on: September 17, 2011, 06:05:31 AM »

Figured out an algorithm to generate better caves with distinct rooms and corridors:

First, divide the map into random squares, then in each square, make a circle:


Draw Bresenham lines between circles until you've made a spanning tree, add a couple of extra paths just to make things more interesting. Use midpoint displacement to make lines meander. Add some background perlin noise.

Et voila


That is-
Wow.

Makes me want to get into PC genn'd worlds again  Addicted
Logged
Zack Bell
Level 10
*****



View Profile WWW
« Reply #367 on: September 17, 2011, 09:29:54 AM »

Figured out an algorithm to generate better caves with distinct rooms and corridors:

Again, very impressive. I'm going to play around with this  Wizard
« Last Edit: September 17, 2011, 03:53:59 PM by Zack_B » Logged

ChevyRay
Guest
« Reply #368 on: September 17, 2011, 12:21:03 PM »

Haha you don't need to quote the whole thing, you guys.

That's an interesting method there, bertling.
Logged
bertling
Level 0
*


View Profile
« Reply #369 on: September 17, 2011, 04:08:27 PM »

Thanks guys. Glad you like it.

Cheers
Logged
wademcgillis
Guest
« Reply #370 on: September 17, 2011, 06:52:57 PM »

I'm going to start using XorShift for the random number generator in Red Rogue.

For starters, it's faster than Math.random() by a degree of 30%. Speed benefits here are also from not calling a static function from another class. If you inlined the operation I expect you would see another 30% boost from not calling a function.

Secondly, it's seedable, which should mean that I can let players enter a seed for generating dungeons.

Stealing this, okay?  Roll Eyes
Logged
st33d
Guest
« Reply #371 on: September 18, 2011, 07:43:59 AM »

I stole it from someone else who typed it up off Wikipedia.  Gentleman
Logged
Aquanoctis
Level 6
*


View Profile WWW
« Reply #372 on: September 19, 2011, 12:11:06 PM »

There's some really cool stuff in here, so glad I stumbled upon this thread. I've always wanted to give this kind of stuff a shot, so thought I thought I'd give it a go myself. It's not all that advanced but it gets the job done.



Top-down view. Green = start, Red = end.
2 and 3 are normal generations, where single blocks have a chance to turn into water or lava, then spread. 1, 4 and 5 show the additional generation of water or lava 'lakes'.
Logged
deadZed
Level 0
**



View Profile
« Reply #373 on: September 19, 2011, 01:06:58 PM »

long since ive been here but i thought id show the procedural levels im working on. Its supposed to be some kind of mining game where you start at the top and dig your way around, platformer style. Its a combination of perlin noise and the random walk method. The random walk is supposed to generate a near-continous cave that spans from the top down to somewhere in the middle of the map, and to break off the "regularness" of the noise.

One map:


Left is final map, middle is random walk, right is perlin noise with random walk on top and some filtering done

White and shades of gray = caves (with background shades for depth feeling)
Black = walls
Brown = harder walls
Bright color = valuable mineral

More generations:
http://i.imgur.com/Redoe.jpg
http://i.imgur.com/3yoVP.jpg

I would however like to make the top of the map (surface) a random landscape, and not a straight line. Any ides on how to do this? edit:swapped imagehost
« Last Edit: September 19, 2011, 01:17:13 PM by deadZed » Logged

bertling
Level 0
*


View Profile
« Reply #374 on: September 19, 2011, 08:32:12 PM »

Cool ideas guys.

deadZed, I have to do the same thing for my game, for the ocean floor.

I was going to use midpoint displacement to make a jagged boundary line across the map and just "cut out" everything above that line, in order to make the surface of the ocean floor.

And then you could have some sort of a gradient for the rest of the map. Like suppose your map is stored in a 2d array like map[y, x] then..

for (int y = 0; y < height; y++)
 for (int x = 0; x < width; x++)
   map[y, x] = map[y, x] * ( y / height )

I'm assuming your program renders elevation = 0 as the black stuff, then if you do the gradient, then there will only be black stuff near the surface, and as you descend into the cave, more interesting landscape features gradually starts to emerge.

That's basically what I'm going to do for my game.  Smiley
Logged
Ashkin
Guest
« Reply #375 on: September 19, 2011, 09:26:08 PM »

Its supposed to be some kind of mining game where you start at the top and dig your way around

Goshdarnit
*abandons project due to lack of originality*
Logged
deadZed
Level 0
**



View Profile
« Reply #376 on: September 19, 2011, 11:02:17 PM »

Thanks for the idea bertling, i feel stupid for not realizing i have a lot of noise already generated, so instead of doing the midpoint displacement, i took the top pixel-row of the perlin noise and used it as a height map for the surface. Added it after the random walk so the smoothing and such would follow through.

Surface applied:
http://i.imgur.com/WT1hP.jpg

sometimes i get neat volcanoes


Ashkin; nice game you got going there, if i mashed up

with these maps, id have something similar Wink

Update: drew some stuff, wrote a tiling system for the maps and smacked some physics on (sorry for the devlog)
http://i.imgur.com/2qNfg.jpg
« Last Edit: September 20, 2011, 10:06:49 AM by deadZed » Logged

bertling
Level 0
*


View Profile
« Reply #377 on: September 20, 2011, 11:17:08 PM »

lol I didn't even think of that. It looks really great too!
Logged
XRA
Level 4
****

.


View Profile WWW
« Reply #378 on: September 21, 2011, 11:40:46 PM »

Figured out an algorithm to generate better caves with distinct rooms and corridors:

That's great, and secondly that really illustrated proc-gen for my brain in a nice visual sort of way!
Logged

_ej
Level 0
**


View Profile
« Reply #379 on: September 22, 2011, 03:26:05 AM »

here's something to brave: procedurally generate a good game
Logged
Pages: 1 ... 17 18 [19] 20 21 ... 23
Print
Jump to:  

Theme orange-lt created by panic