Page MenuHomeFeedback Tracker

[Feature Request] New scripting command: getTerrainInfo
Feedback, NormalPublic

Description

Currently there is a command in diag exe diag_getTerrainGrid. But that command is just a getter of terrain cell size and it's perfectly safe and useful for normal exe as well.

I had already asked for that command but sadly another newer ticket requesting the command to be added to diag exe was accepted.... :(

So instead, I'm gonna ask for a new command: getTerrainInfo, which is more general.
This command will return an array of 4 values: The terrain cell size, its heightmap resolution, world size, and the water level offset (due to tides): T164260.
[cellSize, heightMapResolution, worldSize, waterOffset]

This command can be further expanded in the future to return more useful terrain info. (I can't currently think of anything)

The cell size is an important attribute of the terrain. For example, you can know where the terrain "slope" is gonna change (which is the next adjacent cell triangle) compared to the current pos.

This feature can be useful for scripts that find "empty and flat positions", as currently there's no good approach to do this (if you pick small "step", the algorithm is slow; if you pick a large one, it's inaccurate...)
There are many other applications as well.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Feature Request

Event Timeline

Leopard20 updated the task description. (Show Details)Jun 17 2020, 11:20 AM
Leopard20 renamed this task from [Feature Request] New scripting command (or config value) for reading the terrain cellSize? to [Feature Request] New scripting command: getTerrainInfo.Mar 21 2022, 8:35 AM
Leopard20 updated the task description. (Show Details)

Shameless bump. I also remade and reworded the ticket entirely.

Leopard20 updated the task description. (Show Details)Mar 21 2022, 8:37 AM
Leopard20 updated the task description. (Show Details)Mar 21 2022, 8:41 AM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)Mar 29 2022, 10:37 AM
dedmen added a subscriber: dedmen.Mar 30 2022, 11:36 AM

If added, diag_getTerrainGrid should be removed

Leopard20 added a comment.EditedMar 30 2022, 12:10 PM

If added, diag_getTerrainGrid should be removed

I don't think it's being used much anyway. It's a diag exe only command. And it's very new, So even if scripts are broken because of it they can fix it.

Or you can keep it. There are already many commands that do duplicate things anyway... (e.g. getPos and position)

Leopard20 updated the task description. (Show Details)Sun, Jun 19, 2:07 AM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)Sun, Jun 19, 9:57 AM
dedmen changed the task status from New to Feedback.Mon, Jun 20, 12:56 PM

getTerrainInfo
on stratis
[32,256,4,2048,0]

land grid size per pixels (32 meters per pixel)
land grid number of pixels
terrain grid size per pixel (4 meters per pixeL)
terrain grid number
seaLevel height without waves.

gridSize*gridNumber is always worldSize. worldSize uses landGrid, but using terrainGrid yields same result.