Jump to content

WrinkleysRule

Wrinkley
  • Posts

    244
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by WrinkleysRule

  1. Thank you for telling me I apologise profusely, with all the problems getting stuff uploaded I forgot to add the zip file, now corrected and zip added
  2. New scripts and tutorials now posted and available in the Modding Tutorials and Guides -Mapping Section, problem solved thanks to bdbssb's efforts
  3. I have updated and added some extra functions to the Terrain Height, Spline Placement and Paint Terrain scripts. All these scripts together with installation instructions are available here See Updated Spline, CSV, Height, Paint, Place, Scripts – Installation Link to installation post https://farmerboysmodding.com/index.php?/topic/2412-updated-spline-csv-height-paint-place-scripts/ Splines The spline can now be given any name as long as it includes the name ' spline ' in any part of it i.e. road1_Spline or roadspline01 etc. Problems will occur if the spline transform or the spline itself does not have the correct rotation, whether in the transform group of the spline or the spline itself . The rotation has to be set at 0,0,0 for any of the scripts to work correctly. There are a couple of ways of ensuring this, one is to set up your spline in the position you want and freeze transform only the rotation, the other is to select the S cv of the spline and delete it, this brings S to the centre (rotating point) of the spline, then just use the E cv to create the rest of the spline so lessening the chance of inadvertently rotating the start of the spline. Terrain Paint This consists of two scripts Terrain Paint Set Up Terrain Paint To use, create a spline in Giants Editor and align the spline along the terrain to whatever 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 Set Up This will create the User Attributes the necessary for the Terrain Paint script and will also print out the terrain layer textures in the Console log in the following format, 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 User Attributes panel for Terrain Paint 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) To Allow painting of just one edge and not the centre or the other edge set the Set Centre Texture to -1 and the non painting edge to -1 also Once the User Attributes have been set then, With the spline selected Select ---Scripts--- Terrain Paint the textures will then be painted according to the User Attribute settings A print out in the GE console log will detail these 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 The image below shows the result with various texture settings using the above values, with a print out of the Texture No and Name showing in the console log on the right of the picture. In the image above all the examples are based on a 16m Overall width of 8m (Road bed) + Left and Right edges of 4m The following image shows how the Set Distance Between Textures setting can be used to create a pothole effect The first settings were Set Centre Width –16 Set Center Texture---83 (waterPuddle01) which painted the water puddle texture over the whole 16m width. Second settings were Set Centre Texture Width -- 16 Set Edge Texture Width -- 4 Set Edge Texture Left -- 91 Set Centre Texture -- 97 Set Edge Texture Right --100 Set Distanced Between Textures -- 1.5 which then painted the DIRT/GRAVEL/GRAVELGRASS texture over the water puddle texture but because the texture distance was set to 1.1 it left holes in the textures so allowing the water puddle texture to show through. Potholes.png ---------------------------------------------------------------------------------------------------------------------------------------------------------- Terrain Height This script is an enhancement of the normal terrain height script which uses a spline to guide the terrain deformation it also allows the setting of a distance value for Edge Width (value applies to both sides) and Height / Smoothness values to be entered in the TERRAIN HEIGHT attributes allowing independent control of the height and smoothing on either edges. Any Edge Width/Height/Smoothness (L/R) adjustment will have no effect on the Centre Width setting whose height setting is dependent on the actual spline height or Set Spline Height settings This also consists of two scripts Terrain Height Set Up Terrain Height To use Create the spline in Giants Editor and create/align the spline to whatever area you are intending to terraform. Then with the spline selected, Select –Scripts-- Terrain Height Set Up In the User Attributes panel of Giants Editor the necessary User Attributes for the Terrain Height script will be created,as shown below. Set Centre Width --- Width of centre deformation in metres. Set Spline Height -- Height of the start deformation from the spline, can be a negative figure, default is 0, ( actual spline position ) Edge Transformation -- When selected allows independent setting of edge height/ depth, deselected only Centre Width deformation Set Edge Width -- Width of edge deformation on both sides Set Edge Height Left ---Height/Depth of Left Hand deformation Set Edge Height Right –-Height/Depth of Right Hand deformation Set Edge Smooth Right -- Number is used to factor the amount of smoothing -- lower number less smoothing, Higher number greater smoothing (optimal 10) Set Edge Smooth Left -- As smoothing Left Set the relevant User Attributes to your proposed settings and then. With the Spline selected in GE, Select---Scripts---Terrain Height Once the script has been executed a print out will appear in the GE console log detailing these settings for reference Spline name Edge Transformation setting Spline Height Centre Width : Edge Width: Height Left : Height Right : Smoothing Left: Smoothing Right: If the Edge Transformation is deselected only the following will be printed Spline name Spline Height Centre Width Smoothing is carried out much the same way as using the terrain sculpt tool in that it smooths the area down in height so further adjustment of the edge height to match terrain may be required . Below is an image showing the terrain profiles with various settings (Spline Height set to 4m for clarity). Note: Once executed this terrain deformation cannot normally be undone, but provided you haven’t saved the map after executing the script the terrain can be reset back to previous levels by selecting the Reload i3d icon in the toolbar( under the Create tab) then re adjusting script values as required. If the map has been saved then the only way of redoing the terrain is to Copy/Paste your backup map_dem.png into the map data folder. Further Example; The above settings were used as a base for the road in the image below. To get the desired effect required 4 executions of the script as smoothing was carried out by simply reducing the edge width and heights by one each time the script was executed and finally on the last execution (where Edge Widths and Heights equalled 1, -1 for the right hand edge) by increasing the smoothing factor to 5 for both left and right edges. Spline Placement With this script objects can be placed at various fixed, preset distances, random distances and locations away from or along the spline depending on settings in the script. The objects will be placed at terrain height along the spline (using their individual point of origin location) from the 'S' cv to the ‘E’ cv and aligned to the to the spline along their "Z" axis (unless random location selected). e.g. if you have a hedge that is 4m long and 1m wide ensure the longest section (4m)is aligned to the 'Z' axis otherwise rotate it in GE until is aligned along the 'Z' axis and freeze transform rotation also ensure that the point of origin (where the gizmo shows when object is selected) is at the correct point For best results, open any objects you intend to place in GE and adjust axis and origin accordingly, when done , freeze transform all scale/rotation settings (DO NOT freeze transform translations unless point of origin is relocated) on all the relevant objects. This also applies to any transform groups containing objects that required to be placed using the transform group itself, select the transform group and Edit—Freeze Transformation—Transformation, Rotation and scale This script first requires the execution of the Spline Placement Transform script which will create the correct Transform Group (splineObjects) and the relevant sub groups (objectsTo Place and placedObjects),and also create the relevant User Attributes in the User Attributes panel in Giants Editor as shown below All that is then required is to add a spline (Create-Spline) CUT/pasted into the splinePlacement transform group and add required objects to the objectsToPlace transform group and insert the relevant Attribute values. Note. The splinePlacement transform group has to be selected when entering the User Attributes and also when the Spline Placement script is run. Script Parameters Explanation Refer to image above Set Object Distance -- - Sets a fixed distance between objects along the spline in metres. Use Distance Table ---When selected use the values in the Set Distance Table to set the object distance deselected uses distance value in Set Object Distance Set Distance Table Sets a fixed distance between the objects in the objectsToPlace transform when Use Distance Table selected, number of settings must match number of items in the objectsToPlace transform and be separated by a comma. The first object in the objectsToPlace transform will always be put at the start of the spline (distance ‘0’), the entries in the Set Distance Table refer to the distance to the next object from the preceding one. So in the following example; A total of 3 objects in the objectsToPlace transform 1,2 and 3 Set Distance Table = 4,8,20 -- value in metres object ‘1’ placed at ‘0’ by default so no reference in distanceTable object ‘2 ‘ placed 4m from object ‘1’ object ‘3’ placed 8m from object ‘2’ object ‘1’ placed 20m from object ‘3’ and so on until the end of the spline. A distance of ‘0’ will mean that two objects will be placed at the same location on the spline (e.g lamp post ,hedge ) Any incorrect entries in the Set Distance Table will result in a DISTANCE TABLE ERROR in the Console log. Stay Upright ---- When selected all item remains upright, specifically for trees, poles, lights etc deselected reverts to spline 'X'rotation and original object rotation at the placement point. Random Scale -- -When selected allows random object scale between the parameters set by Scale Low, Scale High values.If an item is already scaled then it has to be freeze transformed (Scale) for this to work correctly, deselected' retains original size. Set ScaleLow --- value of the minimum random scale parameter, the value set applies to all scale axis (x, y, z) at the same time Set Scale High --- value of the maximum random scale parameter, the value set applies to all scale axis (x, y, z) at the same time Random Y Rotation -- -When selected' objects randomly rotated on the 'Y'axis deselected' Y’ axis rotation as original object Random Order -- -When selected allows a random order of objects along the spline deselected retains the order set in the objectsToBePlaced transform group. Random Object Distance —When selected sets a random distance between objects along the spline deselected distance set by Object Distance or Distance Table Set Random Object Distance Seed -- percentage factor used to calculate randomObjectDistance, higher number greater variation in distance between objects Random Object Placement -- When selected places the object away from the spline by the Random Placement Distance deselected objects placed along the spline. Set Random Placement Distance -- maximum displacement distance from the spline, displacement varies between 0 and number chosen Set Fixed Distance -- When selected allows a set distance for objects to be placed either to the left or right of the spline depending on value set in Distance Fixed. If selected and Distance Fixed value set this is also the distance around which Random Placement will start. Set DistanceFixed -- Distance objects to be placed to the left or right of the spline in metres, positive number to the left negative to the right viewed from 'S' cv. Note: The spline is not moved so the set distance between the objects will increase depending on value set (like the spokes on a bicycle wheel from the hub to the rim). Objects will be placed at 90 degrees to the spline on the ‘Z’ axis at the relevant spline point. Whilst this next section is not strictly necessary it can help in creating splines and accurate placement when using the Spline Placement script Creating splines for use with this script. Whilst this step is optional (depending on your spline layout) if used will help in creating a spline aligned to the terrain with a large number of cv’s ensuring accurate placement of any object. As the script works by placing object(s) at their point of origin at set distances along or around the spline, aligned to the terrain height and spline rotation at that particular point, for accurate placement it means the spline must have a large number of cv’s (in this case suggest one every metre) to ensure correct alignment to the terrain. Obviously this would be very time consuming, a quick way is to roughly create the spline path as required without paying much attention to height settings (in fact it can go underground without affecting the final created spline). When satisfied with the spline layout in GE, Select ---Scripts- Spline CSV Creator Set Up, set User Attributes as follows, (b).Map Name – Insert your Full map (root folder) name (Note: Case sensitive) (c.).CSV Distance to ‘1’ With the spline selected Select -- Spline CSV Creator in the Scripts dropdown, the new spline will be created in the CSVdata folder (one will be created if not already there) in your map root folder. A Your Name spline_CSVdata.txt file will also be created in the same folder should you wish to use the spline data for creating a road/rail mesh. Import it into your map by File—Import and navigate to where the CSvdata folder is located (map root folder)and select the spline, the spline will have its original name with the suffix _CSV. It will then appear at the location of your original spline, aligned to the terrain at 1 metre intervals In the following image the Attributes have been set with the Farm Name, in this case Manor Farm and CSV Distance to 1 and the new spline01_CSV imported into GE. Console log also shows the relevant information regarding creation of the new items. It also shows the original spline01 (as just a straight line) and the new spline01_CSV with the cv’s aligned to the terrain at 1 metre intervals. Note: the new spline translations will have been reset to zero. Another method of setting objects away from the spline The following method will only work satisfactorily if the spline hasn’t been Freeze Transformed – Translate. Because the objects are placed on the ‘Z’ axis away from the spline, another way of placing objects at a set distance from the first spline and retaining the distance between the objects is to make a copy of the first spline and adjust the ‘Z’ transformation to the required -/+ distance, replacing the first spline in the splineTransform group with the new spline and executing the script, ideal for fences /hedges alongside roads etc. Occasionally alterations to the ‘X’ axis may be required as well on the new spline to get the perfect alignment. This trick can also be used for traffic/AI splines BUT the spline must be ‘freeze transformed Translate’ before use as a traffic /AI spline. Example. The images below shows examples of the various settings used in the Spline Placement attributes to achieve different results Should you need to delete the objects in the placedObjects transform (eg. Resetting settings or just adding objects) then with the splinePlacement transform selected execute the Spline Placement Delete script. NOTE: The Spline Placement Delete script will delete ALL objects in the placedObjects transform so if doing multiple runs of the Spline Placement script copy paste the placedObjects transform directly into the Scenegraph. Note. The splinePlacement transform group has to be selected when entering the User Attributes and also when the Spline Placement script is run otherwise warnings will appear in the Console log. Using a fence from the in game Farm Fence placeable. In the following image the script has been run twice, the first time to place the pole upright and the second to align the rotation of the panel to the terrain, setting used are highlighted in red. There is no need to delete the poles from the placedObjects transform before running the script for a second time the panels will be placed in the same transform. Note; object Distance is used to set the distance in this case Some of the fence panels will need a slight adjustment to align correctly, which can easily be done by selecting the relevant panel and adjusting as necessary. NOTE: When placing a Transform Group with objects inside it, first select the Transform Group and Freeze Transform --Translate/Scale/Rotation settings before adding it to the objectsToPlace transform. Examples of other settings using the road mesh and splines image from the Blender CSV Road/Rail tutorial Example Image splinePlace_Right To create this particular placement I have first moved the m4m hedge point of origin to the centre of the hedge to allow for better placement on bends, an example of the difference after placement can be seen in inset 2 above. To do this simply select the m4m hedge in the objectsToPlace transform group and set the ‘Z’ translation to -2 and Edit—Freeze Transform—Translation. Creating a 4m fence section Create new transform group copy/paste a pole ( pole02) and duplicate twice so you have three poles copy/paste a panel (panel01)and duplicate once Transform Group should look like this 4mFence pole02 panel01 panel01 pole02 pole02 select second panel01 and translate 'Z' -2 select second pole02 and translate 'Z' -2 select thirdpole02 and translate 'Z' 2 with the first pole02 selected (pole02 Transform group) Edit --Freeze Transformations --Translate now all items in that transform group are aligned at zero with reference to the centre pole to use copy/paste the pole02 transform group into the objectsToPlace transform The 4mFence_Section now has the same point of origin as the hedge. The poly count of this 4m fence section can also be reduced by deleting all the collisions for each item and replacing with a new collision made in the following way Create—Primitive –cube Cut/paste cube into the 4mFence_Section transform and scale to fit when done Freeze Transform –Translate and Scale. Set the Rigid body tab and in the shape tab select Cast Shadowmap, Receive Shadowmap, Non Renderable and Distance Blending. Whilst this only saves a poly count of 48 for each section it can make a large difference over a whole map for example a 400m fence will have a poly count of 80,800 with the new collision as opposed to the original poly count of 85,600 Now with the objectsToPlace transform set up as in the Example Image the Spline Placement script attributes can be set up as follows and executed by selecting Scripts—Spline Placement splinePlace_Left To get the desired effect shown in the Example Image using the splinePlace_Left spline, the script was executed four times with various settings in the script and replacing the items in the objectsTo Place transform with new ones. The image below shows the various objectsToPlace transform entry’s and Spline Placement attributes settings. The image below shows the various objectsToPlace transform entry’s and splinePlacement script settings for each execution/run of the script. The lightPoleLarge01 object on the first run had to be rotated on the ‘Y’ axis by 90 degrees and Edit -Freeze Transform --Rotate to get the correct alignment for placing along the spline and matching the road layout. On completion of the four runs of the script the placedObjects transform group will now have all the above items from the various executions in it, if you are happy with the result then this can then be cut pasted and renamed as another transform group. The Distance Fixed value of -15m in the fourth run of the script means that objects will be placed that far away from the spline and random placement will be based on that figure so in order for the trees to not spawn on the road the Random Placement Distance was set to the lower figure of 10. Note: If you execute the Spline Placement Delete script at any time with the splinePlacement transform selected it will delete ALL items in your placedObjects transform group.
  4. NOTE: An updated version of the Spline CSV Creator Panels script is available here https://farmerboysmodding.com/index.php?/topic/2471-spline-csv-creator-panel-updated/ This new version creates a spline.obj file from the newly created spline for direct import into Blender without the need to convert from a .csv file This spline.obj will still need converting to a curve in Blender to create roads etc. There are two parts to this tutorial, the first part deals with creating a 2D spline in Giants Editor and using the Spline CSV Creator scripts to create a new spline aligned to the terrain with more cv's at a chosen set distance along it. Also created is a CSV (Comma Separated Variable ) file for use in Blender 2.79 (Only) to create a road mesh .i3d aligned to the map terrain. The following scripts are also used in this tutorial. Spline CSV Creator Set Up Terrain Paint Set Up, Terrain Paint Terrain Height Set Up Terrain Height The second part, the Blender section deals with creating a new mesh from the CSV data and using it to create a road layout i3d aligned to the terrain of your map for import into Giants Editor. Note: There is now an add on that imports the csv file directly into Blender see https://farmerboysmodding.com/index.php?/topic/2438-blender-plugin-300-and-above-for-splinecsv-data/ Whilst at first the tutorial may seem a little complicated once run through a couple of times it will seem quite easy. All the scripts used in this tutorial, together with the installation instructions are available here. 24/05/23 --- Link to newer versions of the scripts -- these versions do not require the separate setUp scripts https://farmerboysmodding.com/index.php?/topic/2439-new-spline-paint-height-csv-field-creationdimension-panel-scripts/ Link to original updated scripts https://farmerboysmodding.com/index.php?/topic/2412-updated-spline-csv-height-paint-place-scripts/ GIANTS EDITOR Spline CSV Creator Set Up Creates in the Giants Editor User Attributes panel the required User Attributes for the Spline CSV Creator The script is executed simply by Selecting –Scripts -- Spline CSV Creator Set Up in GE --and must be initiated before executing the Spline CSV Creator script. Spline CSV Creator Creates a new Spline_CSV.i3d from an existing spline aligned to the terrain with the CSV distance set by the CSV Distance attribute in the User Attributes panel, also created is a Spline_ CSV data .txt both are placed in the new CSVdata folder created In the root folder of your map. The CSV data is automatically converted from the Giants Editor transform axis to the Blender format, X(Z) axis, Y(X) axis, Z(Y) axis, (Giants in brackets) to use with the csv Importer script in Blender 2.79 The script allows for the original spline to be created in 2D with less cv’s and away from the terrain, the new spline created can easily be used in any of the Spline Height/Paint/ Placement scripts. Create a spline and align it to the road/rail network you wish to model, naming it accordingly. The spline can be called any name as long as it has the word spline in it i.e. road01_spline, spline_2 etc, the name chosen will also be the name of the spline.i3d and spline_CSVdata.txt created in the CSVdata folder in your map root folder. In Giants Editor --Select Scripts—Spline CSV Creator Set Up which will then create the User Attributes required by the Spline CSV Creator script a ‘ ‘SplineName’ CSV Creator Attributes Created ‘ message will appear in the consol log, then, Insert your map name in the (b).Map Name attribute The full name of your map ( root folder name) must be entered (Case Sensitive) in the (b). Map Name attribute in order for the CSVdata folder to be place in the correct position (map Root Folder) Insert the required value to the (c).CSV Distance attribute. The lower the number the more cv’s and greater accuracy in alignment in Blender or when used with the Spline Placement script In the example image below its set to 5, generally a value of 5 for roads and 10 or more for train tracks (gives a smoother incline) should be sufficient, but bear in mind that this distance will be the size of your individual road/rail sections in Blender. With the spline selected Select –Scripts --Spline CSV Creator A new Spline.i3d with your chosen Spline name will be placed in a newly created CSVdata folder in the map root folder along with a Spline_CSVdata.txt file. The message ‘New Spline: road01_spline_CSV.i3d and road01_CSVdata.txt created in Manor Farm / CSVdata Folder’ will also appear in the consol log, in this example the spline has been named road01_spline and map name is ‘Manor Farm. The new road01_spline.i3d can be imported directly into the map in GE by selecting File-Import and navigating to the map CSVdata folder in the map root folder and selecting the road01_spline_CSV.i3d which will then appear at the correct location in your map. The road01_CSVdata .txt is for use with the csv_importer script in Blender 2.79(only at the moment) and can be referenced in Blender directly from the CSVdata folder. The following image shows the Attributes and log messages created when selecting -- Spline CSV Creator Set Up Spline CSV Creator finally showing the imported road01_spline_CSV, note that the imported road01_spline_CSV translation is now set at 0,0,0 not at the road01_spline settings Setting Up the map Navigate to the CSVdata folder (in your map Root folder) and import the new --your name spline_CSV.i3d The next step is to paint the terrain along the road01_spline_CSV spline. Whilst this is not strictly necessary there are two reasons to do it, the first is to paint the terrain under any road mesh with a high AI value texture such as Asphalt or Gravel, although this probably won’t be seen, it means that an AI spline need not be created along any road mesh route not covered by the main traffic or AI splines, the second is purely for indication of road and edge size when setting the terrain height along this spline (settings should roughly reference to final Blender road width). It can also gives a performance advantage by allowing a lower clip distance on the road mesh without any visual loss when viewed from a distance. First Select—Scripts -- Terrain Paint Set Up this will create the User Attributes necessary for the Terrain Paint script and also print out the terrain layers textures in the Console log. In this example the Attributes have been sets as Set Centre Texture Width 5m Set Edge Texture Width 3m (both edges) Set Edge Texture Left 102 --see print out in Console Log for GRASS Set TextureCentre 98 --see print out in Console Log for ASPHALT Set Edge Texture Right 102 --see print out in Console Log for GRASS Set Distance Between Textures 0.5 --textures painted every 0.5m Select—Scripts-- Terrain Paint and the terrain will be painted with the chosen textures the following entry is printed out in the Console log detailing the settings. Spline Name : road01_spline _CSV Texture Left :- 93 -- GRASS Texture Centre :- 89 -- ASPHALT Texture Right :- 93 -- GRASS Centre Width : 5.0 m : Edge Width : 3.0 m : Texture Distance: 0.5 Result shown in following image. To ensure any new road mesh created using this CSV spline as a base fits the terrain it is necessary to provisionally adjust the terrain height along the length of the spline using the Terrain Height scripts. Terrain height may need to be adjusted when road mesh finally completed due to relaxing/smoothing of csv mesh. Before executing the Terrain Height script ensure that you save the map and make a backup copy of your map_dem.png in case of any problems. Select Scripts - Terrain Height Set Up This will create the necessary User Attributes used by the Terrain Height script. In the image above, the inset shows the original terrain profile with a sharp drop on the right hand side and raised terrain on the left hand side so the settings below have taken this into account this allows easier blending of either edge with GE terrain tools once the Terrain Height script has been executed. Also note that the Terrain Paint User Attributes are also shown the User Attributes window this is because the map was saved before the Terrain Height Set Up script was executed so the Terrain Paint User attributes were saved in the normal way and can still be used to adjust terrain textures using this road01_spline _CSV spline. User Attribute values, Set CentreWidth 6 (m) -- size dependant on final mesh size in Blender in this case a 6m roadbed with 2m Edges giving a 1m adjustment for final blending in GE after placement. Set SplineHeight 0 (m) --spline aligned to terrain Edge Transformation ‘selected’ --allows independent height and smoothing to either edge Set EdgeWidth 3 (m) 3m edge width either side of the CentreWidth Set Edge Height Left 4 (m) raises the left hand edge by 4m to match left hand terrain. Set Edge Height Right -4 (m) lowers right hand edge by-4m to match right hand terrain Set Edge Smooth Left 10 factors the amount of smoothing on the left hand edge Set Edge Smooth Right 10 factors the amount of smoothing on the right hand edge Select Scripts—Terrain Height The effects of these values are shown in the main window of the image above also printed in the Console log is a reference detailing the settings used together with the name of the spline, in this case Spline Name : road01_spline _CSV Offset:'True' Spline Height: 0.0 Centre Width: 7.0 m :Edge Width: 4.0 m : Height Left: 4 :Height Right: -4 : Smoothing Left: 8 Smoothing Right:8 Shown bottom right in the above image Further smoothing of the edge area can be made by reducing the EdgeWidth , HeightLeft and HeightRight by 1 and re executing the script until the EdgeWidth is ‘0’ (CentreWidth value not changed during this operation) Also note that the Terrain Paint User Attributes are also shown the User Attributes window this is because the map was saved before the Terrain Height Set Up script was executed . Note: Once executed this terrain deformation cannot normally be undone, but provided you haven’t saved the map after executing the script the terrain can be reset back to previous levels by selecting the Reload i3d in the toolbar( under the Create tab) then re adjusting script values as required. If the map has been saved then the only way of redoing the terrain is to Copy/Paste your backup map_dem.png into the map data folder. Once happy with the results save the map. NOTE: Before continuing see note at the beginning of the tutorial regarding update Spline CSV Panel script which now creates a spline.obj for direct import into BLender BLENDER 3.0.0 and above I have created a new plugin for Blender 3.0.0 and above which allows the SplineCSV data created in the Spline CSV Creator script to be directly imported into Blender instead of having to use an earlier version of Blender and exporting/importing as an obj which was previously necessary. Installation Download the spline_csv_importer.zip file available at the bottom of this topic. Open Blender (3.0.0 and above) Select –Edit—Preferences –Install and in the file browser navigate to where you saved the spline_csv_importer.zip file, Select and Install the Add-on. Once installed Activate it by selecting the check box (a single Left click usually brings up the Activation and Information panel) The Add-on can also be found in the Blender Preferences panel under Import-Export: Spline CSV Importer. Spline_CSV Importer Open Blender, Select File –Import – Import_Spline Data (*txt) a File Browser Panel will pop up. ( an undocumented operator panel appear but this can be ignored it just means I haven’t documented it with Blender) Navigate to where the CSVdata folder is (your map root folder), double click to open the folder and select the relevant spline_CSVdata.txt file, once selected, select the IMPORT CSV tab in the file browser. A new Collection in the Scene Collection Panel , SplineCSV will have been created and into that the new spline_CSVdata mesh (keeping your original name) will have been placed and the new spline_CSVdata mesh will also have been created in the same position in Blender as it was in your map ready for you to work with, the image below is for reference. All subsequent imports of Spline CSV data will be appended to the SplineCSV Collection retaining their original names Note: This Add-on will only create an single edge mesh (no other type of mesh) from a txt file created in the same format as the spline_CSVdata.txt file (i.e. no header), coordinates in the spline_CSVdata.tx have already been converted to the Blender format in the CSV Creator script and can be exported as an i3d or Nurbs curves directly back into Giants Editor. Blender 3.2 and above (other versions may differ in Menu’s and settings) Do NOT change the location of your mesh, if it is changed then problems will occur in placement when exporting final road mesh. (Quick way of getting the mesh in view is with the mesh selected, in the Collections panel, select decimal point on the Keypad) In Edit Mode ,with the mesh selected open the Tools Panel ‘N’ and select Edit – Loop Tools – Relax (arrow to left of word Relax) In the dropdown Interpolation –LinearInput Iterations ‘ 1 ‘ Note: High values will result in straightening out of curves Regular –Selected And select Relax This will relax the mesh giving a smoother line along the whole mesh. Change to Object Mode, with the mesh selected –Select , Object—Convert—Curve , this converts the mesh to a curve ready for use with the Curve Tools. Select the Curve Icon in the Scene panel (green semi circle) to open the Curve Tools Panel With the curve still selected change to Edit Mode The new curve first needs to be aligned along the correct axis for the road, to do this you can either select Control Points—Tilt and type 90 or simply (Ctrl ) -- T -- 90 In the Shape panel of the Curve Tools, select 3D, Fill Mode 'Half', Curve Deform 'Radius Selected', all other settings can be left as is. Open the Geometry and Bevel Tabs Geometry Tab Extrude ‘ 3 ‘ ---this equates to a road bed width of 6 metres , half the desired width Offset ‘ 0 ‘ ---value can be left at 0 as this just raises or lowers the mesh by +-1m Bevel Tab Select -- Profile Depth ‘ 2 ’ -- this figure is the width of the road edges in metres, in this case 2 for 2m Resoloution – ‘ 0 ’ --This figure sets the number of subdivisions in the edge mesh should you wish to create your own custom or preset profile. You will note that after entering the figure in the Depth box the curve point of origin is now aligned to the bottom of the edges, this change will need to be catered for when the mesh is finally imported into GE. The following image shows the result of these transformations. Once you are happy with the basic shape, the curve deformations can now be turned into an editable mesh. With the curve selected Object Mode – Object –Convert --- Mesh The mesh can now be edited in the normal way for example adjusting the bends in the road to be smoother and adding white lines (see Enhancements at the end of the tutorial). Texture Add the texture you are going to use in the normal way One quick method I use is in the example below, Edit mode –with all the road bed faces selected UV –Reset -- adjust the UV map to fit the road bed texture (inset 1 shows full road texture ) Do the same for each of the road edges then, Edit Mode—Edge Select – and select both outside road edges and raise to a shallower angle (inset 2) Finally Export as an i3d either using the .blend filename or creating your own in File Location Open your map in GE and import the road mesh i3d (in this case it is road01_splineCSV) Rotate the ‘Y’ axis by -90 and adjust the ‘Y’ Translation of the road mesh to match the flattened terrain. Further adjustments (texturing/terrain height) of the road area can now be carried out. The image below shows the road imported and adjusted, the inset shows a magnified image of the road placement at the indicated location. Note: To enable the AI to work better with the new road mesh, the Collision Mask (Hex) should be set up as follows, Where 0: "DEFAULT: The default bit", 1: "STATIC_WORLD: Collision with terrain, terrainHeight and static objects", 2: "STATIC_WORLD_WITHOUT_DELTA: Deprecated in FS22: Do not use it anymore!", 3: "STATIC_OBJECTS: Collision with static objects", 4: "STATIC_OBJECT: A static object", Deselected is 5: "AI_BLOCKING: Blocks the AI", 6: "TRACTOR: Deprecated in FS22: Do not use it anymore!", 7: "COMBINE: Deprecated in FS22: Do not use it anymore!", 18: "AI_DRIVABLE: AI can drive over this node", The above settings are taken from the base game road mesh , although numbers 2,6, and 7 state that they are no longer used it would be prudent to include them anyway as the collision masks may have changed in later game patches. ENHANCEMENTS Adjusting and smoothing blocky curves/bends Example; Navigate to a curve section you want to adjust in the viewport Edit Mode Select the outer edges of the road sections in the bend (3 in this case) and subdivide, number of subdivisions will be dependent on smoothness required. Open the Tools Panel ‘N’ and select Edit – Loop Tools – Relax (arrow to left of word Relax) In the dropdown Interpolation –Linear- Projects vertices on straight line, Cubic uses a natural cubic spline to project the vertices Input – Parallel (all) --This will also modify any parallel vertices at the same time, if in doubt select, Section, only selected modified. Iterations ‘ 1 ‘ – No of times tool is run, higher number gives smoother results but straightens out the curve Regular –Selected –When selected vertices spread evenly along the loop Select the vertices along the edge of the curve Section, and select Relax Further smoothing can be carried out by repeating the above process on the relevant section Finally select all the vertices along one edge of the whole road mesh and then select Relax This will smooth out the whole road mesh Image below shows the various stages and images 1 and 3 show the before and after result. Adding Custom road markings. Select all the road bed faces (Shift-Alt held - select face) of your finished road mesh, change to Edge select, again with Shift-Alt held deselect left and right hand edges and Subdivide ' 1 '. Select the new centre edge (Shift-Alt held - select edge) and Shift-D to copy ' P ' Selection to separate from main road mesh, with the new edge mesh selected Object mode – Object--Convert--Curve Curve Tools panel --Shape-- Geometry and set Extrude to ‘ 0.2 ‘ (Extrude value dependent on the width of the road marking texture used) Edit mode Ctrl 'T ' -90 to correct the axis. Object mode -- Object--Convert--Mesh Add texture as normal not forgetting alpha channel settings in Blender Edit mode -Face select --select all UV—Reset -- adjust UV mesh to fit texture Texture may need to be adjust on the bends but that is easily done in the UV editing window Finally when satisfied export as i3d. To do the edge markings (if required), select the left hand or right hand edge and Shift-D to copy ' P ' Selection to separate from main road mesh and continue as above, doing the same for the other edge. Example below The previous tutorial showed two ways of creating the road mesh from the CSV mesh but I think the above method is the quickest and easiest way to get the best results. As it is possible to create a spline in Blender 3.2 and export it as an i3d you can create a set of splines aligned to the road mesh to use in the Spline Placement script and also for traffic/railway splines Using the finished road mesh as an example For Spline Placement In Edit mode, Edge Select Shift-Alt select the left or right hand road edge so all the edges are selected. Shift ‘ D ‘ to copy With the edge still selected ‘ P ‘ Selection to separate Object Mode With the edge selected -- Object –Convert—Curve Edit Mode Curve –Set Spline Type – NURBS Object mode Open i3d exporter Export Tab and ensure that Nurbs Curves and Shapes are selected Set up filename and File Location in the Output tab Export the i3d Import into map set ‘ Y ‘ rotation to -90 and Edit-- Freeze Transformation –Rotate Only (leave preserve instances selected) height settings do not matter as objects will be placed on the terrain at their point of origin. Replace any splines in the splinePlacement transform with this new spline and set up the script parameters accordingly. Example before selecting Object mode and exporting For traffic/railway splines Select all the road bed faces (Shift-Alt held - select face) of your finished road mesh, change to Edge select, again with Shift-Alt held deselect left and right hand edges and Subdivide '3 '. If creating a railroad spline then Subdivide ' 1 ' Subdivide ‘ 3’ is necessary to get the correct location for the traffic splines (midway between centre and edge). The centre edge line can be used, if required, as a new roadSpline01_CSV to adjust any terrain height after smoothing of road mesh (slight straightening of bends etc). Shift-Alt select edge to the left of the centre of the road mesh so all the edges are selected and continue as above for the splineUtilsPlace adding a further step after the ‘With the edge still selected ‘ P ‘ Selection to separate’ of renaming the mesh to traffic01_left for clarity and continue the method above. Repeat the procedure for the right hand edge. Image showing both sets of splines. Once the traffic splines are imported the Translation/Rotation needs to be set up as follows Translate ‘ X ‘ and ‘ Z ‘ to‘ 0 ‘ Translate ‘Y ‘ to a suitable value to align it just above the road mesh, in this case -1.9 Rotate ‘ X ‘ and ‘ Z ‘ to ‘ 0 ‘ Rotate ‘Y ‘ to -90 Once done freeze (Edit-Freeze Transformation) the Transformation/Rotation settings. As both traffic splines, after importing are in the same direction, traffic direction can be set by selecting the relevant spline and pressing the ‘ R ‘ key on your keyboard. All the splines once imported into the map can be edited/ expanded in the normal way. Note: Regardless of the filename you have given the spline in Blender the name in the scenegraph of GE will be the name in the Collections Panel of Blender with the suffix.001 in this case road01_splineCSV.001 Below is an example showing the road mesh, markings, together with the various splines and also objects that have been placed using the Spline Placement script (see Terrain Height, Paint Terrain and Spline Placement scripts (Updated) for details of placement). spline_csv_importer.zip
  5. NOTE: These scripts are personal edits of original scripts by various authors ( Stegei, Evgeny Zaitsev, Nicolas Wrobel,TracMax and W_R ) and posted on the FarmerBoysModding site for members of the FarmerBoysModding community's personal use and not intended for any general public release. Furthermore they are posted on the understanding that NO monetary gain whatsoever,regardless of source can be made from all or parts of them by any person(s). Including but not limited to, Patreon, soliciting for or requiring donations for work done for any purpose, posting on a website that gives any form of remuneration per download or view. Copyright remains with the original creators of these scripts. It would appear there has been some confusion with the new and old versions of these scripts so to avoid any confusion delete any previous versions of these scripts before installing these new versions and read the New Tutorials relevant to the script you are using. 24/05/23 --- Newer versions of some of these scripts available here Installation First a big thank you to Stegei, Evgeny Zaitsev, Nicolas Wrobel and TracMax the originators of some of these scripts. Whats New All the scripts no longer require the use of the Script Editor and are now executed directly from the script dropdown in GE ,- Select--Scripts The scripts now contain a set of Set Up scripts (Spline CSV Creator Set Up, Terrain Paint Set Up, Terrain Height Set Up and Spline Placement Transform ). These have to be run before using the main script as they create in the User Attributes panel of GE the User Attributes required for each script. They only require to be run once for each spline used whilst editing, also if the map is saved between edits the User Attributes created are also saved to the spline used so the setup script does not have to be run again when the map is opened for subsequent edits. Because of the various changes/updates to all the scripts it is recommended that all previous versions be deleted before installing the new versions. Download and unzip the Updated Spline Scripts.zip, and copy/paste the contents as laid out in the zip directly into C:\Users\Your Computer name\AppData\Local\GIANTS Editor 64bit 9.0.3\scripts The Updated Spline Scripts.Zip contains the following files, a brief description of each follows, further detailed information is contained in the relevant tutorials. Spline CSV Creator Set Up Creates in Giants Editor User Attributes Panel the User Attributes for the Spline CSV Creator script. Spline CSV Creator Creates a new Spline.i3d aligned to the terrain with the CSV distance set by the CSV Distance attribute in the User Attributes panel, also created is a Spline CSV data .txt both are placed in the new CSVdata folder created in the root folder of your map. Requires Spline CSV Creator Set Up to be executed first. Terrain Paint Set Up This script prints the terrain layer textures numerically in the Giants Editor Console log. It also creates in the Giants Editor User Attributes panel the necessary User Attributes for the Terrain Paint script operation.. Terrain Paint For painting along the spline using map terrain textures, different textures can be selectedand painted for the centre and left and right edge areas. Requires Terrain Paint Set Up to be executed first. Terrain Height Set Up Creates in the User Attributes panel of Giants Editor the necessary User Attributes for the Terrain Height script Terrain Height Allows for setting the terrain height using a spline and has independent height settings for centre width, left and right edge width. Requires Terrain Height Set Up to be executed first. Spline Placement Transform Creates a splineObjects transform group with the correct hierarchy in the Giants Editor Scenegraph and in User Attributes panel the User Attributes necessary for the operation of the Spline Placement script. Spline Placement Places objects along a spline at terrain height at fixed or random distances along/around and either side of the spline Requires Spline Placement Transform to be executed first Spline Placement Delete Deletes ALL objects in the placedObjects transform group. ----------------------------------------------------------------------------------------------------------------- Giants Editor Spline Scripts User Attributes Brief description of the various User Attribute settings, further information available in the relevant tutorial. Note: If the map is saved the User Attributes created will be saved (complete with settings) to the relevant Transform Group/Object and will be available when the map is reopened, as such to avoid complications with the save if any of the individual User Attributes are deleted (by selecting the red X) then the next time any of the scripts are run a warning will be printed in the Console log, example below \ WARNING\ ATTRIBUTES ERROR PLEASE RESELECT SPLINE PLACEMENT TRANSFORM The User Attributes will then have to be set up again by reselecting the named Set Up script in the above case the error is with the Spline Placement script Spline CSV Creator script User Attributes created after selecting Scripts-- Spline CSV Creator Set Up Terrain Height script User Attributes created after selecting Scripts—Terrain Height Set Up Terrain Paint script User Attributes created after selecting Scripts—Terrain Paint Set Up The letters in brackets on the left of each Attribute name are there to ensure correct layout if more than one set of spline attributes are set up on a single spline, the script name is also entered to separate the individual Script Attributes, example below. Spline Placement script This script isn’t affected by the multiple attributes problem (shown above) although it still uses the same spline as the rest the Attributes are assigned to the splinePlacementTransform not the spline itself. User Attributes created after selecting Scripts—Spline Placement Transform To avoid errors and having to repeat the various Set Up scripts it is advisable not to delete any of the User Attributes until work has finished using the particular spline after which they can be all deleted if required. Further information available from the tutorials Export a Spline from Giants Editor Into Blender to Create Roads/Railways (Updated) Terrain Height, Paint Terrain and Spline Placement scripts (Updated) Note: Before using any of these scripts on a current Work In Progress (WIP) map, it is recommended that a blank starter map is used to experiment and get familiar with the scripts, settings, executions and results. Read the New Tutorials as the operation and execution of all the scripts has changed. Updated Spline Scripts_18.12.2022.zip
  6. I have updated these scripts together with new tutoirials, unfortunately due to restrictions on lenght of posts on this forum I am unable to post them until this problem can be sorted.
  7. Suggest you post your query here, https://gdn.giants-software.com/
  8. Blender 2.93 and later Mapping-- Coordinates --Generated---- now part of the Displacement setting Influence --Deselct Color Select –Intensity -- now part of the BSDF shader color/specul;ar etc However I am using another method in Blender 3.1 that seems to give reasonable result Blender 3.1 (make sure the Render Engine is set to Cycles), (remember to first download and install the Blender Exporter V9.0.1 from https://gdn.giants-software.com/downloads.php) 8kBorderGE image and 8kBorderDem4096 were both created using the snipping tool in Google Earth both saved as RGB pngs In the first image I have created a mesh (Import Image as Plane) with the 8k RGB border texture and added the 8kBorderDem4096 texture I will use for the displacement Main settings are Mapping -- Extension --Extend --this gives a clean edge to the border by extending the edge pixels Clamp -- Deselected -- this allows the full colour range to be used in the displacement All other settings can be left as default though it may be necessary, depending on the dem to set the Color Space to Linear to get better results. Next the 8k border mesh has been subdivided 20 times and Displacment modifier added, Texture coordinates must be set to UV although no UV map is required. and lastly the final settings for alignment to the terrain In the Item pop out you will notice that the Z Location value is different to the Z value in the Dimensions -134.69 and 138 respectively this is to show the GE border area more clearly otherwise it would be mixed in with the border image. Regarding the Dimension Z value (138 in this case) this is normally the highest point of your terrain over the whole border area but can differ due to monitor colour settings and displacement strengths so it is always best to adjust to imported GE terrain. Highest point can easily be found by running cursor over the area in Google Earth and checking the elev figure in the bottom right Don't forget to set shading to smooth (Object-Shade Smooth) and Ctrl-A (Set Scale and location if mesh reset to 0) before exporting i3d When time permits I will be overhauling/updating all the tutorials to reflect the latest updates to links and software.
  9. Just tried both, https://www.usna.edu/Users/oceano/pguth/website/microdem/microdem.htm and https://www.usna.edu/Users/oceano/pguth/md_help/html/download_md.htm downloaded setup.exe with no problem If you need to use another programme I suggest QGIS (free at https://www.qgis.org/en/site/ ) but be warned it is a fully fledged Geospatial programm so will require a bit of familarisation.
  10. From the description of your Dem problem it sounds like a 2k dem that has been resized/enlarged to fit a 4k map thereby stretching all the contours. Also check the unitsPerPixel in your 4k template they should be 2 for correct rendition
  11. Given your previous "problems" and as you haven't bothered to give any translation settings for that road I would suggest A. Incorrect terran height adjustment B. Incorrect road translation/rotation adjustment (in GE or Blender) C. Both of the above. Edit : In your image it would appear you have an aerial roadway in the distance which appears to slope in the same direction as your road over the 'flat terrain'.
  12. Create a suitable junction in Blender
  13. How conversant are you with GE and creating mod from game, as one way of increasing the pickup width is to increase the size of the work area in GE this will increase the pick up area but leave the implement the same size. Another way although not recommended is to modify the workAreaStart/ WorkAreaHeight(actually length) positions in GE of an ingame vehicle i3d such as the scorpio550 in GE (will be reset on any game update) Otherwise a google search might turn up one already modified to a wider pickup area
  14. How wide do you want to go, the ingame ELHO has a working width of 5.5m ( approx 18ft)
  15. Did you first set the terrain height for your roads and then use that spline to create the road system in Blender ? As you are now trying to use a spline to adjust your terrain after creating the roads then it appears you didn't, I suggest you align your spline to the roadway correctly and then use the script or use the terrain sculpt tool to correct your mistakes From the tutorial "In the next image I have used the TerrainHeight by spline script to level the terrain ready for the road," Another point, you have set the spline to -0.1 in the scenegraph but what settings have you put for mHeightOffset in the script (if using the modified Set Terrain Height script not the editor default one)
  16. Create your own in Blender, I gave you some links in a previous post and you said "thank you for the refresher" so I presume you will have no problems creating and texturing a roadway to your own specifications.
  17. Where something like that would work very well is in the multiplayer mode where one player is in charge of the ditribution centre and sells the produce on behalf of the farmer(s) getting the best price and paying the farmer after deductions (storage,transport and the distributers profit). Also as this would only be a paper excersise (extra production models would create to many slots for console players) you could have multiple, say grain mills all competing on price for the farmers goods and the player in charge of distribution sells to the highest bidder. At the moment the farmer only has the direct sell option i.e transport his own goods to the production facility (cutting out the middleman "distibution"). C'mon bdbssb I'm sure you have some thoughts on this idea
  18. I take it you mean something along the lines of a distribution warehouse where you deliver all you crops/items to, then they are automatically distributed to whoever needs them and then pays out to the farmer (minus storage and transport costs). Then there would be no need for any production facilities as there would be no direct interaction between the farmer and factories (which is why Giants introduced production) and everything would be done on paper so to speak, however if this was available as an option to the farmer so he could make the decision where to sell depending on the return he would get it could be a way of adding a bit more variety to the game.
  19. There is your answer your road has too many polygons, try splitting the road into smaller sections or reduce the number of polygons (both operations done in Blender), for reference see the way the base game roads are implemented, for example the total poly count for the roadsCity in Elmcreek is 69,149 but each transform section is no larger than 6000 and looking at your previous screenshot just one of your roads has close on 63,000.
  20. The collision box is selected automatically when you select rigid body, no other box needs to be selected. As a test create a primitive plane and selecting the rigid body tab extend it across the two roads (as another bridge) and drive a base gamer vehicle over that and see what happens. Futhermore remove all mods from your mods folder so you only have the map in that folder
  21. And this occurs on all roads with any vehicle base game or otherwise, However I did notice that the road you show in your picture of the rigid body tab appears to be a different road to the one the vehicle is on in your first image, where it appears to have just come under the bridge shown in the highlighted second image.
  22. From your statement it would appear you are modifying an unzipped folder in GE and then rezipping it to check it in game, so it is quite possible that you haven't saved /rezipped the corrected version. I suggest you follow the method described previously and repeated below, that way you will always have the edited version being read by the game, another point when editing maps do not use a savegame always start a new game for obvious reasons. What was the result when using base game vehicles in your map????
  23. I notice you are using a mod, do any of the base game vehicles do the same if not then you mod is the problem otherwise the only other thing maybe is that you haven't saved the GE map correctly. When editing a map on the fly so to speak, always ensure that you only have a unzipped map folder in your mods folder and work from that, also ensure that you do not have a zipped copy in your mods folder as the game will always take the zip details not the folder
  24. You can only edit the road in Blender, so to make things easier, first create two primitive cubes in GE and place one at the start and one at the end of your proposed edit as markers Ensure that both cubes are in the road section transform that you want to edit and export the transform group as an .obj, open in Blender and edit the road section as you require adding bridges etc as necessary. Once done delete the cubes and export you new edited road section as an i3d and reimport it into your map, if any further editing required just repeat the method, minus the cubes of course. Alternately you could edit the the relevant spline and redo the road in blender as before.
  25. I take you mean that its joined in width rather than length. in which case as I said before ensure your road section is aligned along the X axis, if it is then simply change the road section shape so that the length is aligned along the X axis and the width along the Y axis. Also bear in mind that a road section will have a greater width than length ( to allow for bends).