

Moderators: Lone Wolf, Snake Man
Yea, I just zoomed down to the street level its fairly flat some ditches. The fields appear to be slightly elevated. I'm not sure hot to fix that.Snake Man wrote: ↑2022-10-17 02:23:11 Heightmap looks rough, obviously I don't know all of iowa and there is some elevations, but for traditional iowa landscape that looks like you did not setup heightScale correctly. For example our garden city is so flat that you have to comb it through with a microscope to find elevations heh.
But anyways nice job getting source files done.
Downloaded from where?I've loaded the whole us dem first
Elevation Data (NED) I loaded that first then zoomed in, not sure if it does it the correct way but now the terrain appears to be more accurate. When I import to l3dt it turns the blue to pure white almost with some black streaks.
Will do, my first terrain kinda looked like the one out of the ohio one. (I've been following that one) the very first one at least that I had to redo for what ever reason. That was at the PA location that I'm not sure I am going to do still since there is a quarry right in their backyard, but I feel like that is also very unique. For some reason I think just this location is giving trouble.Snake Man wrote: ↑2022-10-17 21:56:46 You have probably already read this PMC Farming Simulator Real World Data Terrain tutorial page which links to PMC Editing Wiki for ArmA 3 Real World Data Terrain tutorial. There are some differences when it comes to ArmA 3 and FS19 terrain source file creation (heightmap + satellite imagery), but overall the process is the same.
If you want to see a video of me creating FS19 real world data terrain from scratch, then watch ohio arcanum dev diary E01.
Please note that this is NOT a tutorial but just a dev diary of me editing stuff. Dev Diary PMC Ohio Arcanum 8km Terrain E01 2020-05-18 Farming Simulator 19.
In that video you see me doing 8.1km terrain source files, at least you can see how I did the heightmap file(s).
Yes Sir, I got three maps in the works I may just rename this to my dev adventures, instead of spamming this section. Things will just take longer since its only myself doing them at the moment.
True, I do have a backup of both, I may just make the larger one for myself since I like big maps for myself and my group, and make the public release the 4km.Snake Man wrote: ↑2023-02-20 16:00:25 Its not a real world data terrain if you down or up scale it. Might still be a nice terrain to play on, but have to be clear on the designations.
You could have left the fields with one or two pixels less, maybe that would have helped. Through the history there are other terrains that fields get drawn together, for example FS19 Nebraska Lands you cannot use courseplay normally as it merges several fields together as it "cant see" that the nearby field edges are just that, edges, instead of one single field. I've also seen this happen in FS22 terrain as well, so yeah its known issue.
Code: Select all
-- Author:KR-Softwares/kevink98
-- Name:FieldDimensions with bitmap
-- Description:You can draw the filed on a bitmap (*.grle). The script create automaticly fielddimensions.
-- Icon:
-- Hide: no
-- Set filename to a bitmap file (*.grle)
local filename = "FS22_MarbleRck/maps/mapUS/data/infoLayer_fieldDimensions.png"
--Set bits of bitmap (normaly 8 bits)
local bits = 8
--Set size of map (normaly 1024)
local size = 8192
--Set factor for bigger grle's
local factor = 6
--Set field factor (glreSize/mapSize) (f.e. standardmap: 4096 / 2048 = 2
local fieldFactor = 4
--HELPS
--szie:
--1x Map : 1024
--4x Map : 2048
-- factor:
-- use 1x Map and grle size 1024x1024 : 1
-- use 1x Map and grle size 2048x2048 : 2
-- use 4x Map and grle size 2048x2048 : 1
-- use 4x Map and grle size 4096x4096 : 2
-- NO CHANGES HERE --
local map = createBitVectorMap("FieldDefs")
local success = loadBitVectorMapFromFile(map, filename, bits)
if not success then
print("Can't load file!")
return
end
local localMapWidth, localMapHeight = getBitVectorMapSize(map)
local foundFields = {}
local sceneRoot = getChildAt(getRootNode(), 0)
local terrainNode = getChild(sceneRoot, "terrain")
for y = localMapHeight-1, 0, -1 do
local lastValue = -1
for x = 0, localMapWidth - 1 do
local value = getBitVectorMapPoint(map, x, y, 0, bits)
if value > 0 then
if foundFields[value] == nil then
foundFields[value] = {}
foundFields[value].lines = {}
end
if foundFields[value].lines[y] == nil then
foundFields[value].lines[y] = {}
end
if lastValue == -1 then
local newLine = {}
newLine.y = y / factor
newLine.start_x = x / factor
newLine.end_x = -1
table.insert(foundFields[value].lines[y], newLine)
lastValue = value
end
elseif lastValue > -1 then
local lastlineIndex = nil
for k,line in pairs(foundFields[lastValue].lines[y]) do
if line.end_x == -1 then
lastlineIndex = k
break
end
end
if lastlineIndex ~= nil then
foundFields[lastValue].lines[y][lastlineIndex].end_x = (x / factor) - 1
lastValue = -1
end
end
end
end
local node = getSelection(0)
if node == 0 or getUserAttribute(node, "onCreate") ~= "FieldUtil.onCreate" then
print("Error: Please select FieldDefinition defintions root!")
return
end
local function FormatNumber(idx)
if idx < 10 then
return string.format("00%s", idx)
elseif idx < 100 then
return string.format("0%s", idx)
else
return idx
end
end
for i=0, getNumOfChildren(node)-1, 1 do
local childField = getChildAt(node, 0)
unlink(childField)
end
local function GetStartPosFromLine(line)
local s_x = line.start_x*2 - size
local s_z = line.y*2 - size
local w = (line.end_x - line.start_x) * 2 + 2
return s_x, s_z, w
end
local function GenerateFieldDimensions(x,y,z,w,h, cornerIdx)
local c1 = createTransformGroup(string.format("corner%s_1", FormatNumber(cornerIdx)))
local c2 = createTransformGroup(string.format("corner%s_2", FormatNumber(cornerIdx)))
local c3 = createTransformGroup(string.format("corner%s_3", FormatNumber(cornerIdx)))
link(c1, c2)
link(c1, c3)
setTranslation(c1, x, y,z)
setTranslation(c2, 0,0,h)
setTranslation(c3, w, 0,h)
return c1
end
for v, data in pairs(foundFields) do
local fieldTg = createTransformGroup(string.format("field%s", FormatNumber(v)))
local fieldDimensions = createTransformGroup("fieldDimensions")
local fieldMapIndicator = createTransformGroup("fieldMapIndicator")
link(fieldTg, fieldDimensions)
link(fieldTg, fieldMapIndicator)
local cornerIdx = 1
local s = size + 1
local min_x = s
local max_x = -s
local min_y = s
local max_y = -s
local skippedLines = {}
for y = 0, localMapHeight-1 do
if data.lines[y] ~= nil then
for yi = 1, (#data.lines[y]),1 do
--for _,line in pairs(data.lines[y]) do
local s_x, s_z, w = GetStartPosFromLine(data.lines[y][yi])
if s_x < min_x then
min_x = s_x
end
if s_x + w > max_x then
max_x = s_x + w
end
if s_z < min_y then
min_y = s_z
end
if s_z > max_y then
max_y = s_z
end
if skippedLines[yi] == nil then
skippedLines[yi] = {}
skippedLines[yi].s_x = s_x
skippedLines[yi].s_z = s_z
skippedLines[yi].w = w
skippedLines[yi].height = 1 / fieldFactor
elseif skippedLines[yi].s_x == s_x and skippedLines[yi].w == w then
skippedLines[yi].height = skippedLines[yi].height + 1 / fieldFactor
else
local y = getTerrainHeightAtWorldPos(terrainNode, skippedLines[yi].s_x, 0, skippedLines[yi].s_z)
local c1 = GenerateFieldDimensions(skippedLines[yi].s_x, y, skippedLines[yi].s_z, skippedLines[yi].w, skippedLines[yi].height, cornerIdx)
link(fieldDimensions, c1)
cornerIdx = cornerIdx + 1
skippedLines[yi] = {}
skippedLines[yi].s_x = s_x
skippedLines[yi].s_z = s_z
skippedLines[yi].w = w
skippedLines[yi].height = 1 / fieldFactor
end
end
end
end
for yi,_ in pairs(skippedLines) do
local y = getTerrainHeightAtWorldPos(terrainNode, skippedLines[yi].s_x, 0, skippedLines[yi].s_z)
local c1 = GenerateFieldDimensions(skippedLines[yi].s_x, y, skippedLines[yi].s_z, skippedLines[yi].w, skippedLines[yi].height, cornerIdx)
link(fieldDimensions, c1)
end
local ind_x = min_x + (max_x - min_x) / 2
local ind_y = min_y + (max_y - min_y) / 2
setTranslation(fieldMapIndicator, ind_x, getTerrainHeightAtWorldPos(terrainNode, ind_x, 0, ind_y), ind_y)
setUserAttribute(fieldTg, "fieldAngle", "Integer", 90)
setUserAttribute(fieldTg, "fieldDimensionIndex", "Integer", 0)
setUserAttribute(fieldTg, "nameIndicatorIndex", "Integer", 1)
link(node, fieldTg)
end