Re: [Algorithms] 2D Side Terrain generation
Brought to you by:
vexxed72
From: Joel B <one...@ea...> - 2011-08-15 04:17:15
|
Actually I got inspired by Andy's code to start writing code to read and write WAV files, it will be interesting to actually hear the output of his algorithm! Sent from my iPhone On Aug 14, 2011, at 2:05 PM, Andy Farnell <pad...@ob...> wrote: > > > Oops that was possibly my bad etiquette to fork off there, > I replied to Joel off-list because I wasn't sure about > policy on posting code. As it turns out it was less than > 20 lines. Maybe Joel will post back some results later. > > Actually it is simple, the synthesis components, > being interpolated lookups of a cosine table (or > math function), are summed and used directly, and if > there's several of them (between 5 and 10 maybe) the > terrain looks okay. Joel sent me a video clip to show > it working. > > The next idea I had was maybe to provide some FM feedback > to get a range of quasi-noisy textures > > see http://www.youtube.com/watch?v=Hu9FR_1l0Nc > >> Also, do you want heightfield-style terrain (each X has exactly 1 Y) or >> overhangs/crags? That may change how you implement the subdivision. > > That's an interesting thought. > > Andy > > > On Sun, 14 Aug 2011 13:12:17 -0700 > Jon Watte <jw...@gm...> wrote: > >>> From his description, it sounds as if he uses Fourier synthesis to generate >> control values for some fractal algorithm. For example, subdivision >> algorithms often have "roughness" parameters, which determine how much to >> subdivide a segment once it's selected for subdivision; I would imagine >> you'd get an interesting-looking terrain by varying roughness in some >> locally-smooth but globally-varying way. >> >> Also, do you want heightfield-style terrain (each X has exactly 1 Y) or >> overhangs/crags? That may change how you implement the subdivision. >> >> Sincerely, >> >> jw >> >> >> -- >> Americans might object: there is no way we would sacrifice our living >> standards for the benefit of people in the rest of the world. Nevertheless, >> whether we get there willingly or not, we shall soon have lower consumption >> rates, because our present rates are unsustainable. >> >> >> >> On Tue, Aug 9, 2011 at 1:20 PM, Joel B <one...@ea...> wrote: >> >>> Hi Andy, do you have any examples of the algorithm? Is it just a standard >>> Fourier transform and use the waveform output as landscape? >>> >>> - Joel >>> >>> >>> On Aug 9, 2011, at 7:51 AM, Andy Farnell wrote: >>> >>>> >>>> >>>> >>>> An alternative take to random/quasi-stochastic methods I'll mention >>>> an exercise we did with my London undergraduates for a Lunar Lander >>>> terrain. The problem was to make the terrain controllable, in order to >>>> insert plausible landing sites, (or IIRC "defender" well, you might >>>> want to create volatile terrain to nicely hide ground based missle silos) >>>> >>>> Rather than starting with a Perlin source and filtering as Megan >>> suggests, >>>> we found a great way was to Fourier construct with about 5 or 6 sine >>> components. >>>> By setting the frequency and amplitude coefficients the terrain could >>> have >>>> a useful "roughness" parameter, with local consistency, without >>> unexpected >>>> dicontinuities (effectively band limiting the terrain within the frame >>>> resolution) and remain well bounded in height. Compared to a pink or >>>> Perlin source and IIR filter it's swings and roundabouts in terms of >>> cost. >>>> >>>> - Andy >>>> >>>> >>>> On Tue, 9 Aug 2011 07:49:44 -0600 >>>> Megan Fox <sha...@gm...> wrote: >>>> >>>>> I'd also recommend Perlin - once you start mixing high or low passed >>>>> low-frequency Perlin noise with high/low-passed high-frequency noise, >>> you >>>>> get some very, very interesting results. >>>>> >>>>> The key, and what will define your continents and the feel of the >>> resultant >>>>> shape, is the number of layers of noise, and how you scale or cut >>> (high/low >>>>> pass) each layer. >>>>> >>>>> Hugo Elias's page is an oldy, but it has some really great info on this >>>>> topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm - >>> that >>>>> page is the one that turned me on to how cool noise could be in the >>> first >>>>> place (my version of his cloud algorithm: >>>>> http://www.youtube.com/watch?v=kHvJqPxXUXM). I realize he's working in >>> a >>>>> slightly different space, but those basic techniques can be applied from >>> a >>>>> side view just as they can from a top-down view. >>>>> >>>>> On Mon, Aug 8, 2011 at 11:34 PM, Marc Hernandez <ma...@gm...> >>> wrote: >>>>> >>>>>> The big revelation for me was that I realized I could use fractals >>>>>> as input functions to other fractals, as well as composing them from >>>>>> adding or multiplying. >>>>>> >>>>>> I tend to start with the standard perlin noise to define the major >>>>>> continents, then use things like rigid multifractal to build mountains >>>>>> into it. >>>>>> From there I use another perlin noise to add smaller hills and >>>>>> valleys, and use yet another to define where to place all those. >>>>>> >>>>>> Here's a 2d example of the output. >>>>>> >>> http://redmine.alephnought.com/projects/cubit/wiki/World#Pretty-pictures >>>>>> I didnt have a terrain renderer yet, so I dont know what the >>>>>> landscape looked like, but I liked the start of it. >>>>>> >>>>>> For something like you're mentioning, I think I might treat it as a >>>>>> strip of a standard 2d heightmap. That way you might get some neat >>>>>> parallax as the ship flys through it. >>>>>> >>>>>> On Mon, Aug 8, 2011 at 8:39 PM, Brennan Rusnell >>>>>> <bre...@gm...> wrote: >>>>>>> I'd recommend using Ridged Multifractals: >>>>>>> >>>>>> >>> https://www.internal.pandromeda.com/engineering/musgrave/unsecure/S01_Course_Notes.html >>>>>>> http://www.ypoart.com/downloads/Musgrave.htm >>>>>>> http://vterrain.org/Elevation/Artificial/ >>>>>>> This is a great book on the topic: >>>>>>> >>>>>> >>> http://books.google.com/books/about/Texturing_modeling.html?id=bDlSJd8GfMcC >>>>>>> Hope this helps. >>>>>>> -- >>>>>>> Brennan Rusnell >>>>>>> >>>>>>> On Mon, Aug 8, 2011 at 7:22 PM, Joel B <one...@ea...> >>> wrote: >>>>>>>> >>>>>>>> Hello, I'm looking for algorithms for generating 2d terrain from a >>> side >>>>>>>> view, like the old Defender game from the 80's, except with mountains >>>>>> grass, >>>>>>>> rocks, lakes etc instead of just lines. >>>>>>>> >>>>>>>> Here is an example of what I have done in Photoshop: >>>>>>>> >>>>>>>> http://img855.imageshack.us/img855/8125/examplelp.png >>>>>>>> >>>>>>>> Anyone on this list have some suggestions? It doesn't have to be real >>>>>>>> time, although that would be interesting too. >>>>>>>> >>>>>>>> - Joel >>>>>>>> >>>>>>>> >>>>>> >>> ------------------------------------------------------------------------------ >>>>>>>> uberSVN's rich system and user administration capabilities and model >>>>>>>> configuration take the hassle out of deploying and managing >>> Subversion >>>>>> and >>>>>>>> the tools developers use with it. Learn more about uberSVN and get a >>>>>> free >>>>>>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>>>>>> _______________________________________________ >>>>>>>> GDAlgorithms-list mailing list >>>>>>>> GDA...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>>>>>>> Archives: >>>>>>>> >>>>>> >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>>>>>> >>>>>>> >>>>>>> >>>>>> >>> ------------------------------------------------------------------------------ >>>>>>> uberSVN's rich system and user administration capabilities and model >>>>>>> configuration take the hassle out of deploying and managing Subversion >>>>>> and >>>>>>> the tools developers use with it. Learn more about uberSVN and get a >>> free >>>>>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>>>>> >>>>>>> _______________________________________________ >>>>>>> GDAlgorithms-list mailing list >>>>>>> GDA...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>>>>>> Archives: >>>>>>> >>>>>> >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> /// // >>>>>> >>>>>> >>>>>> >>> ------------------------------------------------------------------------------ >>>>>> uberSVN's rich system and user administration capabilities and model >>>>>> configuration take the hassle out of deploying and managing Subversion >>> and >>>>>> the tools developers use with it. Learn more about uberSVN and get a >>> free >>>>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>>>> _______________________________________________ >>>>>> GDAlgorithms-list mailing list >>>>>> GDA...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>>>>> Archives: >>>>>> >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Megan Fox >>>>> http://www.glassbottomgames.com/ >>>> >>>> >>>> -- >>>> Andy Farnell <pad...@ob...> >>>> >>>> >>> ------------------------------------------------------------------------------ >>>> uberSVN's rich system and user administration capabilities and model >>>> configuration take the hassle out of deploying and managing Subversion >>> and >>>> the tools developers use with it. Learn more about uberSVN and get a free >>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>> _______________________________________________ >>>> GDAlgorithms-list mailing list >>>> GDA...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>>> Archives: >>>> >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> uberSVN's rich system and user administration capabilities and model >>> configuration take the hassle out of deploying and managing Subversion and >>> the tools developers use with it. Learn more about uberSVN and get a free >>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>> _______________________________________________ >>> GDAlgorithms-list mailing list >>> GDA...@li... >>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>> > > > -- > Andy Farnell <pad...@ob...> > > ------------------------------------------------------------------------------ > FREE DOWNLOAD - uberSVN with Social Coding for Subversion. > Subversion made easy with a complete admin console. Easy > to use, easy to manage, easy to install, easy to extend. > Get a Free download of the new open ALM Subversion platform now. > http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |