Jump to content

Terrain Paint Scripts Pothole Effect


WrinkleysRule
 Share

Recommended Posts

  • Wrinkley

Given the interest shown in the pothole example and the problems when textures are aligned to terrain sections (North/South, East/West) I have redone the Terrain Paint Scripts to include a separate section
which allows the painting of a texture at random distances around/either side of a spline which can simulate a pothole effect or just add a random texture to others i.e path texture GRAVEL random texture GRAVELGRASS

The new scripts Terrain Paint R Set Up and Terrain Paint_R are described below and are available in the Terrain Paint R zip at the end of this tutorial to install just copy/ paste the scripts directly into

C:\Users\YOUR COMPUTER NAME\AppData\Local\GIANTS Editor 64bit 9.0.3\scripts             (or whatever GIANTS Editor 64bit version you are using)

They can replace the exsisting Terrain Paint and Terrain Paint Set Up scripts if desired.

The TERRAIN PAINT section of the new script works in the same way as the original terrain paint script all thats been added is an extra RANDOM PAINT section.
To use the TERRAIN PAINT on its own leave the 'Select Random Paint' attribute deselected if this attribute is selected ONLY the RANDOM PAINT section will be executed
when the 'Terrain Paint_R' script is selected

Create a spline in Giants Editor and align the spline along the terrain to whatever area you are intending to paint,
the spline does not have to be accurately aligned painting will only occur at the terrain height.

Then with the spline selected, 

 Select –Scripts--' Terrain Paint R Set Up'

This will create the User Attributes  necessary for the Terrain Paint_R script

User Attributes panel after executing the  'Terrain Paint R Set Up' script

roQDw4U.png

A print out in the Console log of the terrain layer textures in the following format will also be created

Texture No :93:Texture Name : shingle01
Texture No :94:Texture Name : shingle02
Texture No :95:Texture Name : shingle03
Texture No :96:Texture Name : ANIMALMUD
Texture No :97:Texture Name : AS
Texture No :98:Texture Name : ASPHALT
Texture No :99:Texture Name : CONCRETE
Texture No :100:Texture Name : DIRT

Both sections TERRAIN PAINT and RANDOM PAINT are executed independently using the Terrain Paint_R script.
If the 'Select Random Paint' attribute is selected only the RANDOM PAINT section is executed and
conversley if deselected only the TERRAIN PAINT section is executed

Description of settings in TERRAIN PAINT Attributes section

Set Centre Texture Width         ---Width of the Centre Texture in metres
Set Edge Texture Width           ---Width of the Edge Textures in metres (Value set is applied to both left and right edges)
Set Edge Texture Left            ---Enter required left edge texture number from Consol log.
Set Centre Texture               ---Enter required Centre texture number from Console log
Set Edge Texture Right           ---Enter required Right edge texture number from Consol log.
Set Distance Between Textures    ---How far apart the textures are painted along the spline (default 0.5)

Once set up then select the 'Terrain Paint_R' script to execute, ensuring  'Select Random Paint' attribute is deselected,

A print out in the GE console log will detail the following TERRAIN PAINT attribute settings for reference

Spline name:
Texture Left:  no, name
Texture Centre:  no, name
Texture Right:   no, name
Centre Width :(m), Edge Width: (m), Texture Distance: (m)

If the Set Edge Width Texture is set to zero (0) only the following will be shown in the log

Spline Name,
Texture Centre no,
Centre Width
Texture Distance

Should you require only the Centre Texture then Set Edge Width Texture to zero (0) and adjust your Centre Width settings accordingly

Description of settings in RANDOM PAINT Attributes section

Select Random Paint            --- When selected and the 'Terrain Paint R' script executed only allows RANDOM PAINT attributes to be used for painting.
                                                 Must be deselected to allow the normal Terrain Paint Script Operation
Random Width                     --- Value sets the maximum the texture is painted around the spline
                                                 e.g a value of 16m will paint the texture a maximum of 8m around/either side of the spline
Random Texture                   --- Texture Layer number from Console log
Distance Between Textures    --- Sets the distance between textures, the larger the distance the less textures
                                                   the smaller the distance more textures and sometimes greater size due to close proximity of textures.

Once the RANDOM PAINT User Attributes have been set then,

With the spline selected   Select ---Scripts--- 'Terrain Paint_R' the chosen texture will then be painted according to the RANDOM PAINT User Attribute settings

A print out in the GE console log will detail the following RANDOM PAINT attribute settings for reference

Spline Name
Random Texture: no, name
Random Width: (m)
Texture Distance: (m)

If you are not satisfied with the random texture result then simply deselect the 'Select Random Paint' attribute and execute the Terrain Paint_R script which will then repaint the original TERRAIN PAINT settings
overpainting the unwanted random texture which can then be repainted by reselecting the 'Select Random Paint' attribute and after adjusting any attributes as necessarry select the Terrain Paint_R script again.
Note: Because the texture is painted randomly around the spline there will be some textures painted before and after the spline ends, which can easily be cleaned up by using the normal terrain brush.

The images below show the results painting with the TERRAIN PAINT section and then with the RANDOM PAINT section to give a more natural pathway effect
with a print out of the attribute settings in the console log on the right of the pictures.

Image 1
Settings
Set Centre Texture Width         --- 8m
Set Edge Texture Width           --- 4m (Value set is applied to both left and right edges)
Set Edge Texture Left            --- 109 GRAVELGRASS.
Set Centre Texture               --- 113 PATHWAYGRAVEL
Set Edge Texture Right           --- 107 GRAVELDIRT
Set Distance Between Textures    --- 0.2
'Terrain Paint_R' script executed

A 16m wide pathway has been painted with different textures either side of the path

8mnhr2X.png

 

Image 2
Settings
TERRAIN PAINT settings left as before

RANDOM PAINT Settings
Select Random Paint            --- Selected
Random Width                     --- 16m  (from TERRAIN PAINT Settings 8m = two 4m edges = 16m)                                
Random Texture                   --- 109 GRAVELGRASS
Distance Between Textures        --- 1
'Terrain Paint_R' script executed

A random GRAVELGRASS texture has been painted over the 16m TERRAIN PAINT textures

ODl4LW0.png

 

Image 3
Settings
TERRAIN PAINT settings left as before

RANDOM PAINT Settings
Select Random Paint            --- Selected
Random Width                     --- 16m  (from TERRAIN PAINT Settings 8m = two 4m edges = 16m)                                
Random Texture                   --- 91 waterPuddle
Distance Between Textures        --- 2
'Terrain Paint_R' script executed

A random waterPuddle texture has been painted over both the previous script executions giving the impression of potholes

VnhPNZT.png

 

The above images are just an example, always experiment and try out the various script settings on a blank map before using on a WIP first

 

Terrain Paint R scripts.zip

Link to comment
Share on other sites

This is brilliant, and will be used extensively on my map, thanks WR. Your updated scripts have been an absolute godsend to me, I prefered doing the painting by hand in 19 with the terrain resolution increasing in 22 I'm getting a much better and more realistic result with the scripts than I was before, and it's sped up the workflow massively. i've been able to redo areas I wasn't happy with in fractions of the time it's taken to get to where I was when I converted to 22.

Link to comment
Share on other sites

  • Wrinkley

Glad you like it, it does give another dimension to terrain textures, as always use a blank map to experiment on with the all scripts before using on a WIP map and make a note of any settings that you like for reference.

Just a little reminder, if you save the map the attributes and values entered are saved for each individual spline so when opening a map for a fresh session the attributes and values are still there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share