Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  2D terrain generation - with caves and overhangs  (Read 5742 times)
0 Members and 1 Guest are viewing this topic.
Offline f.l.x

Senior Devvie


Projects: 3


there is no place like 127.0.0.1


« Posted 2006-05-08 22:36:12 »

well, at last i'm having a little free time and with a friend of mine, we are begining a new game, a pure java2d worms clone.

I have used a midpoint displacement algorithm to generate the terrain, with some good results, but as this algorithm outputs only one height for each width point, it won't generate caves nor overhangs, and they are a must in any worms clone Smiley .

Are there other 2d terrain generation algorithm i can use? i have founds losts of papers about 3d terrain generation, but no one covering this topic.

thanks

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline woogley
« Reply #1 - Posted 2006-05-08 22:44:28 »

not to sound stupid.. but couldn't you just generate two landscapes? one for the bottom, one for the top? *shrug*
Offline f.l.x

Senior Devvie


Projects: 3


there is no place like 127.0.0.1


« Reply #2 - Posted 2006-05-08 23:20:13 »

that would be fine for a cave-like map, but i'm looking for something like these concave areas

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline woogley
« Reply #3 - Posted 2006-05-08 23:22:54 »

OHHHH I get it. sorry Tongue
Offline f.l.x

Senior Devvie


Projects: 3


there is no place like 127.0.0.1


« Reply #4 - Posted 2006-05-08 23:32:35 »

no problem Grin

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline Kova

Senior Devvie





« Reply #5 - Posted 2006-05-09 12:56:15 »

I don't know nothing about algoritams for terrain creation... so here is an idea.
If you can, how about you additionally generate some round type random irregular shapes on map and then substract them from original terrain. That way you can get caves, wholes in terrain or whatever... only problem is doing substraction.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2006-05-09 13:08:17 »

Semi-randomly placed metaballs could work well. I've been meaning to try that for quite some time now.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline f.l.x

Senior Devvie


Projects: 3


there is no place like 127.0.0.1


« Reply #7 - Posted 2006-05-09 16:39:34 »

wow, thanks  Grin i have just found a good tutorial on metaballs, i'll give it a try tonight

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline Tzan

Junior Devvie





« Reply #8 - Posted 2006-05-09 23:03:47 »

I think the maps for worms were all created by hand. Obviously they had some elements that got used in chunks like those icecream cones.
Offline Kova

Senior Devvie





« Reply #9 - Posted 2006-05-10 00:03:41 »

well obviusly not since those ice-creams have horizontal pedestal that sticks out so they are computer generated.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #10 - Posted 2006-05-10 04:57:36 »

well obviusly not since those ice-creams have horizontal pedestal that sticks out so they are computer generated.

Huh?

The pedestals are clearly part of the artwork for the placables.

There is no reason they could not have been dropped in by hand that I can see...

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 834
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2006-05-10 08:17:42 »

I'm pretty sure the game advertised with "with over 4 billion maps!"

So it must have had a seed-based mapgenerator.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Kova

Senior Devvie





« Reply #12 - Posted 2006-05-10 11:39:28 »

well obviusly not since those ice-creams have horizontal pedestal that sticks out so they are computer generated.

Huh?

The pedestals are clearly part of the artwork for the placables.

There is no reason they could not have been dropped in by hand that I can see...

"so they are computer generated."  ... I mean maps are computer generated, not the artwork, my bad formint the sentence. If it were by hand nobody would put an ice-cream with pedestal touching ground with one pixel and the other 50 are above the terrain, in the air (like the most right ice-cream).
Offline Ask_Hjorth_Larsen

Junior Devvie




Java games rock!


« Reply #13 - Posted 2006-05-10 23:30:56 »

One way to do these things would be to define the boundary between ground and non-ground as a contour curve of some function f(x,y), where the values of f could be randomly generated according to - for example - a diamond-square algorithm. Of course this will treat the x and y axes equally, which might not be desirable when doing a sideways-viewed game. This method would require a grid, but one could interpolate to achieve smooth boundaries.

Of course lots of information is lost if you just use a contour. I'm sure there are more elegant ways to do this.
Offline f.l.x

Senior Devvie


Projects: 3


there is no place like 127.0.0.1


« Reply #14 - Posted 2006-05-11 12:47:54 »

Worms map are random generated, each map is a set of two 2k files, one for the ground and other for the ubicates, and the image is way too large to be compressed into 2k  Roll Eyes

btw, the metaballs worked fine, here is a test

thanks a lot

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

PocketCrafter7 (11 views)
2014-11-28 16:25:35

PocketCrafter7 (5 views)
2014-11-28 16:25:09

PocketCrafter7 (6 views)
2014-11-28 16:24:29

toopeicgaming1999 (73 views)
2014-11-26 15:22:04

toopeicgaming1999 (63 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!