Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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  
  [Help] Perlin Noise for 2d tile game  (Read 4457 times)
0 Members and 1 Guest are viewing this topic.
Offline maxking1234

Senior Newbie





« Posted 2012-04-08 16:18:23 »

Hello all,
I am at the moment building a top-down 2d tile rpg like game. I am currently rendering from a set map defined in a seperate file. I would like to be able to generate a world so it looks realistic but generates fast and is easy to add to later (e.g. add more tiles later to generate in subsequent updates). I have heard of perlin noise generation, but would to know your advice and how i can use it

Max
Offline maxking1234

Senior Newbie





« Reply #1 - Posted 2012-04-10 22:56:00 »

Anyone?
Offline _Al3x

JGO Coder


Medals: 7
Projects: 1


Indie Games FTW!


« Reply #2 - Posted 2012-04-10 23:05:08 »

Maybe you should change the title to:
[Help] Perlin Noise for 2d tile game

Anyhow, I hope this link helps you Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline maxking1234

Senior Newbie





« Reply #3 - Posted 2012-04-10 23:06:22 »

Thanks, I have done this but could not find how to actually apply it to generating tiles

On the http://mrl.nyu.edu/~perlin/noise/ source, when you run the method noise what do you do with the double it returns?
Offline maxking1234

Senior Newbie





« Reply #4 - Posted 2012-04-10 23:07:15 »

Maybe you should change the title to:
[Help] Perlin Noise for 2d tile game

Done that Cheesy
Offline _Al3x

JGO Coder


Medals: 7
Projects: 1


Indie Games FTW!


« Reply #5 - Posted 2012-04-10 23:14:21 »

Smiley

Well, this link led me to this:

- How to Use Perlin Noise in Your Games
- Generating Tiling Noise Maps “on the fly”

But I'm sure someone here knows a lot about this, let's hope that with the new title experts come in Smiley I'm also interested in this.

Offline maxking1234

Senior Newbie





« Reply #6 - Posted 2012-04-10 23:15:57 »

Thanks so much Smiley
Offline _Al3x

JGO Coder


Medals: 7
Projects: 1


Indie Games FTW!


« Reply #7 - Posted 2012-04-10 23:17:48 »

You're welcome Smiley

By the way, please share your progress, I'd like to know how you implement it Smiley

Offline maxking1234

Senior Newbie





« Reply #8 - Posted 2012-04-10 23:18:22 »

You're welcome Smiley

By the way, please share your progress, I'd like to know how you implement it Smiley

Will do. Trying it out now Smiley
Offline maxking1234

Senior Newbie





« Reply #9 - Posted 2012-04-10 23:23:56 »

I can generate noise now well , but I still can't work out how to interpret it to generate biomes and terrain? Any ideas?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Choochoo545

Junior Newbie


Medals: 1



« Reply #10 - Posted 2012-04-17 19:53:35 »

once you generate noise, you did 99% of the work, just loop the pixels and test for case  

if(pixelValue > 0x888888)
place mountain
if(pixelValue < 0x888888)
place grass

Thats just a very basic way, there are many ways, just be creative

edit: for biomes if going from mountains to plains change your values
if(pixelValue > 0xEEEEEE)
place hill
if(pixelValue < 0xEEEEEE)
place grass

depending on your perlin noise generation, you may have to create multiple noises depending on the feature (trees)

height and trees would have to be seperate 2d noises, or you could do a 3d noise and make trees be the alpha, there is lots of ways
Offline maxking1234

Senior Newbie





« Reply #11 - Posted 2012-04-17 20:51:40 »

Thanks Cheesy
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.

xsi3rr4x (54 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (246 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!