Profile

Parent element name: hill
Element name: profile

A profile is a continuous function that can be described as a Y(X) (when used as refy) or a Z(X) (when used as refz) function where both X and Y are axes. They are the most important point when creating custom hill constructions. They allow the creation of such buildings as wind grids, towers, and more advanced things.

TIP

This section of the documentation contains things, that can't be described using only words. The best way to test the parameters described below is to use elements from already existing hills and play with them.

Starting with profiles

The root element of the profile is the profile. It takes up to five attributes.

NameTypeAllowed valuesDescriptionOptional
idStringA profile name
sideStringleft, rightPlacement in terms of refxTrue
maxstep+FloatA profile linear points max interval lengthTrue
maxturn+FloatA profile nonlinear points max interval lengthTrue
refxStringA reference to the X-axis, which profile is based onTrue

TIP

Maxstep can be understood as the max length of subelements, which create linear elements. The smaller the maxstep value is, the linear elements are split into smaller elements not longer than the maxstep value. It's not usually required to adjust the maxstep. One of the cases, when you can adjust it, might be better-looking spot lights.

TIP

Maxturn attribute can be understood as max chord length of curved lines. The smaller the maxturn value is, the smoother the profile is, but more vertices and faces are rendered.

TIP

If you defined the refx attribute in this element, all children will have the same reference to the refx attribute (until you overwrite this in the child element).

Children elements

TIP

In your defined profile you don't need to use all of the below elements. The only use of the start element and one of other elements (line, polynom3, arc, or profile) is required. line, polynom3, arc, or profile elements can be used multiple times.

Start

Parent element name: profile
Element name: start

The starting point of every profile is the start element.

NameTypeDescriptionOptional
xFloatThe starting point in position relative to the X-axis
yFloatThe starting point in position relative to the Y-axis
refxStringA reference to the X-axis, which profile is based onTrue
refyStringA reference to the Y-axis, which profile is based onTrue
refyxFloatA reference to X-point, which Y-point (from y attribute) is based onTrue

WARNING

If you don't define the ref[x, y] attribute, the point position is based on the corresponding axis (X or Y) of the global coordinate system. In some cases, this may be the desired action. You can find more information about the global coordinate system in the Arc section.

Line

Parent element name: profile
Element name: line

The next points can be defined using the line element. As the profile is continuous, the start and lines will be connected in defined coordinates.

TIP

refyx attribute can be used to create surfaces that are not parallel to the refy. You have to set the refyx attribute value equal to the x attribute value from the previous element.

NameTypeDescriptionOptional
xFloatThe next point in position relative to the X-axis
yFloatThe next point in position relative to the Y-axis
refxStringA reference to the X-axis, which profile is based onTrue
refyStringA reference to the Y-axis, which profile is based onTrue
refyxFloatA reference to X-point, which Y-point (from y attribute) is based onTrue
cornerBooleanToggles better corner rendering at this pointTrue

Polynom3

Parent element name: profile
Element name: polynom3

The next points can also be reached using more sophisticated ways e.g. with polynom3. Polynom3 element describes a third-degree polynomial.

TIP

polynom3 attribute can be described using maths. Let's suppose you have the following third-degree polynomial and two points x0 and x1.

f(x) = ax^3 + bx^2 + cx + d

Let's take a derivative from it.

f'(x) = 3ax^2 + 2bx + c

then

k1 = f'(x0)
k2 = f'(x1)

In most cases, you don't need to use mathematical equations of polynom3 and its derivatives. Usually, a simple adjustment of x, y, k1, and k2 attributes is enough.

NameTypeDescriptionOptional
xFloatThe next point in position relative to the X-axis
yFloatThe next point in position relative to the Y-axis
k1FloatFirst derivative at the start of polynom3True
k2FloatFirst derivative at the end of polynom3
refxStringA reference to the X-axis, which profile is based onTrue
refyStringA reference to the Y-axis, which profile is based onTrue
refyxFloatA reference to X-point, which Y-point (from y attribute) is based onTrue

TIP

The start of polynom3 means the end point of the previous element.

TIP

If you don't define the k1 attribute, polynom3 will continue the previous element at the starting point.

Profile

Parent element name: profile
Element name: profile

Your defined profile can also contain build-in or your other predefined profiles.

NameTypeDescriptionOptional
idStringA profile name
xFloatThe end point of profile in position relative to the X-axisTrue
yFloatA profile shift in position relative to the Y-axisTrue
nFloatA profile shift in position perpendicular (using normal vectors) relative to this profileTrue
dxFloatA profile shift in position relative to the X-axisTrue
refxStringA reference to the X-axis, which X-point (from x attribute) is based onTrue

WARNING

Profile, by default, is shifted in position relative to Y-axis to match the previously used element. y and n attributes apply to this default shift.

TIP

The term "end point of profile" means the end point of use of the given profile, not the end point of this profile in general.

Arc

Parent element name: profile
Element name: arc

Arc element defines the arc that is part of a circle. It can be used e.g. to create elements that can't be created by beams.

NameTypeDescriptionOptional
xFloatThe next point in position relative to the X-axis
yFloatThe next point in position relative to the Y-axis
x0FloatThe center point of the circle in position relative to X0-axis
y0FloatThe center point of the circle in position relative to Y0-axis
refxStringA reference to the X-axis, which profile is based onTrue
refyStringA reference to the Y-axis, which profile is based onTrue
refyxFloatA reference to X-point, which Y-point (from y attribute) is based onTrue

WARNING

[x, y]0-axis are the axis of the global coordinates system. You can't change its reference.

TIP

The origin of the global coordinates system is located under the center of the take-off as shown in the picture.

1

Required profiles

There are two required profiles that you have to define by yourself, without them, your hill won't load.

NamePlacement
inrun-leftThe left side of the inrun
inrun-rightThe right side of the inrun

Built-in profiles

DSJ4 already includes some predefined profiles, that can be used to create basic constructions.

NamePlacementApplies for
dhillThe whole hillrefx
dhill-leftThe left side of the downhillrefz, ref[l, r]z
dhill-rightThe right side of the downhillrefz, ref[l, r]z
dhill-topThe top side of the downhillrefy, [b, t]refy
inrunThe whole inrunrefx
inrun-topThe top side of the inrunrefy, [b, t]refy
terrainThe terrainrefy, [b, t]refy

Overridable profiles

These profiles are also built-in, however, you have to specify their start and line elements, otherwise, the game won't include them.

TIP

inrun-extension profile example usage can be seen on Bischofshofen HS140 hill.

TIP

For inrun-terrain and dhill-terrain profiles, reference navigate to the Terrain section.

NameDescription
inrun-extensionCollision area after the ending of the inrun
inrun-terrainTerrain at the inrun
dhill-terrainTerrain at the downhill
inrun-left-guardThe left side of the inrun
inrun-right-guardThe right side of the inrun

Code snippets

<!-- The most basic irnun-left profile definition -->
<profile id="inrun-left" side="left" maxstep="1000">
    <start x="-10" y="1.0" refx="inrun" />
    <line x="0" y="1.0" refx="dhill" />
</profile>
<!-- The most basic irnun-right profile definition -->
<profile id="inrun-right" side="right" maxstep="1000">
    <start x="-10" y="-1.0" refx="inrun" />
    <line x="0" y="-1.0" refx="dhill" />
</profile>
<!-- The inrun-extension profile code taken from Bischofshofen HS140 hill -->
<profile id="inrun-extension">
    <start x="0" y="4" />
    <line x="3" y="3.42757" />
    <line x="3.1" y="3" />
</profile>