FT3 Core Mechanics Questions

Hmm, that title sounds like I'm asking about an RPG. Ah, well. I have a few questions about the basic operation of FT3. They are sort of generic in that they are not connected to any particular use, but I am hoping that having answers to these will obviate a lot of "how do I" questions subsequently. [Having now written out my first question, I think I will stop there for the moment; probably plenty all by itself for one go.]

1) Is there a succinct description of the Altitude calculation? The thrust of this question is to improve my intuition about the effects and interactions of the quantities that are modifiable with the editing tools. Given that the precise answer might be a rather large chunk of code, something that elides some details but reflects the basic idea is fine. In particular, I'm not looking for a description of the fractal function computation. At the level I'm sort of thinking about, it seems like the inputs include fractal function values, roughness, prescale offset, land offset, and a (?) scale factor. Global values - Highest Peak, Lowest Depth, Percent Sea, Land Size, Continental Shelf depth - obviously have to play in there somewhere, but my guess is they, variously, get folded into the fractal computation or the (hypothetical) scale factor.

Comments

  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    Altitudes in FT3 are computed according to:

    altitude = continentalshelf((fractalfunction + prescaleoffset + worldoffset) * worldscale * roughness) + offset

    The fractal function typically has values ranging from -1 to +1, but some of them range from 0 to 2 or through some other range. During the initial world generation, the fractal function is evaluated across the world surface and those initial values are used to calculate a linear mapping from the fractal function range to the user-specified Lowest Depth and Highest Peak values (together those values give worldoffset and worldscale). If your Lowest Depth value is -9000 meters, your Highest Peak value is 9000, and your chosen fractal function run from -1 to +1, then the calculated worldoffset value will be +1 and the worldscale value will be +9000.
    The prescaleoffset, roughness, and offset quantities are floating-point images defined in the Equirectangular projection that contribute to the final altitude. The prescaleoffset value is unfortunately defined in the same units as the fractal function rather than in real-world units like meters or feet, meaning that you'll need to use values like 1/worldscale to get a 1 meter change in altitude. The roughness value ranges from 0 (no roughness) to 1 (full roughness) or beyond to get more extreme roughness values. The offset value is internally defined in meters (real-world units at last!)
    The continentalshelf function is a broken exponential function with the break defined at the continental shelf level. Below the continental shelf level, it's a 1/x exponent; above the continental shelf level, it's a x value. See http://www.fracterra.com/cshelf/index.html for a discussion of how it works, even though the software package in question is different.

    A critical point about how FT works is that the user-defined editing things (prescaleoffset, roughness, and offset) are floating-point images defined in the Equirectangular projection. Their size is specified in the world settings Editing tab. The fractal function is defined in a continuous (in a computer mathematics sense) manner at very much higher resolution than the editing data. This difference in size means that making even the smallest editing change is likely to affect a fairly large area around the spot being edited. The brushes usually show the editing resolution as squarish bits (it would have been easier to draw them as round, but I felt that it was better to show the editing resolution when it became relevant).
  • Thank you very much again. That is exactly the kind of description that I wanted. Digesting now...
  • edited July 2017
    <blockquote><cite>Posted By: jslayton</cite>If your Lowest Depth value is -9000 meters, your Highest Peak value is 9000, and your chosen fractal function run from -1 to +1, then the calculated worldoffset value will be +1 and the worldscale value will be +9000.
    <snip>
    The roughness value ranges from 0 (no roughness) to 1 (full roughness) or beyond to get more extreme roughness values. </blockquote>

    (Edit: not sure why the quote is not working.)

    A few follow-up questions:
    1) Assuming roughness is 1, the example values you gave result in values between 0 and 18000. How/when does that get mapped to [-9000,9000]? (Or is my arithmetic off?)
    2) How does the value of the Roughness slider in the World Settings affect the Altitude computation? Does it have anything to do with the value in the roughness channel, or are these two separate things (with, perhaps, a similar effect)?
  • jslaytonjslayton Moderator, ProFantasy Mapmaker
    I was a little loose in the description of the altitude, sorry. I tried to keep the technical parts reasonable, but there are some messy technical details that actually make the process a good bit uglier than it first appears. There are multiple offsets and scales required to produce the requested land/sea ratio, for example. Consider the required transformations: the noise function is defined as a 3D space of values. How that space is sampled determines the overall character of the displayed landscape. The basic round-world sampling looks at a spherical shell of values in the 3D space with the default center point and radii determined by the World Seed value. Where that shell is sampled is determined by the map projection in use. Once the rough samples are generated, they are processed in various ways to get the final altitude.

    The parameters for all that processing fall into several broad groups: parameters to the fractal function, parameters that define how the fractal function is sampled, parameters to convert the fractal function to real-world altitude units, and user-paintable spatially-varying adjustment parameters to the final result.

    Parameters to the fractal function are defined on the Map Settings:Fractal Function page behind the "Parms" button. To help confuse things, one of these fractal function parameters actually sneaks out into the Map Settings:Primary page as the "Roughness" slider (it's the H parameter for the fractal functions, which is very roughly the fractal dimension: see Musgrave's discussions of these functions in any internet search engine for a technical discussion). The fundamental set of random values used to define the noise function is defined via the Map Settings:Primary page's World Seed value. This value might be most precisely called "Universe Seed" because that single value controls the generation of the set of values used for most fractal functions.

    Parameters that control how the function is sampled are found on the remainder of the Map Settings:Fractal Function page and include where, what shape, and what direction to sample the fractal function (some of the sampling parameters are found on the Map Settings:Secondary page under "North Pole Position" and on the Map Settings:Primary page under Land Size).

    Parameters to convert the fractal function value to real-world units are mostly found on the Map Settings:Primary page under Highest Peak, Lowest Depth, and Percent Sea values. In my original discussion, I didn't mention the Percent Sea computation, but it feeds into the computation of offsets and scale factors. During the initial phase of world generation, the fractal function is sampled coarsely over the world surface using an equal-area projection. This initial sampling is used to calculate a histogram of fractal function over the world surface. This histogram is used to determine the breakpoint in the fractal function for the required land/sea ratio and that breakpoint is used to calculate the initial values for offsets and scale factors needed to convert the raw fractal values to the final altitudes in real-world units. The initial world scan is pretty rough and it can miss absolute maximum and minimum values, which means that the final world Highest Peak and Lowest Depth values will be close to specified values, but probably won't be exact. The continental shelf values also isn't used in the initial calculation, meaning that worlds are generally going to be a bit more sea than specified if continental shelf values are enabled and set to other than 0.

    The user-paintable values (prescale offset, roughness, and offset) are specified in the Map Settings:Editing page. Each of these channels gets sampled using a Catmull-Rom interpolating spline, which accounts for the unfortunate ringing effects seen at sharp transitions in the editing values.

    The answers to your questions:

    1) Your math isn't wrong, I just didn't give you all of the information in the original discussion.
    2) The value of the Roughness slider is an input to the fractal function and is in no way related to values of the roughness editing channel.
Sign In or Register to comment.