Ground altitude for AISimulatedObjects are wrong in SimConnect

Hi, I was trying to find height of terrain (ground altitude) for different
locations by creating different objects by
SimConnect_AICreateSimulatedObject() function and setting positions of each
object and then requesting GROUND ALTITUDE data from them. I confirmed that
objects were set to correct positions by looking at their visuals. However,
the GROUND ALTITUDE data I retrieve is the same for all objects, same as the
aircraft itself. This method was applicable in FSX but it seems it’s broken in
MSFS2020. Do you know any other way to retrieve height of terrain for
different locations? Thanks in advance!

We have also observed this issue. Not only that, moving the object after its
creation will not refresh its altitude to the ground at the new location. We
have to create a non-flyable aircraft and inject it to make it work. A simple
object will not work.

Thank you for the tip! Can you describe that process a little bit? Is it like
creating multiple wasm modules and make them send data to the main module? Or,
is it handled by a single module? I could not get what you mean by non-flyable
aircraft.

The structure for a non-flyable aircraft looks like this:
\MSFS\Official\OneStore\asobo-aircraft-generic-airliner-
twinengines\SimObjects\Airplanes\Asobo_Generic_Airliner_TwinEngines
The
structure for a “StaticObject” looks like this:
\MSFS\Official\OneStore\asobo-simobjects-
landmarks\SimObjects\Landmarks\Windsock
While they are treated the same in
WASM/SimConnect, they behave differently in terms of physics in the sim.

You can’t read the ground altitude of a Static Object, its physic doesn’t
support it and, for the same reason, you can’t read or set the PLANE ALT ABOVE
GROUND variable. The object you create must be at least a GroundVehicle. No
need to create an Aircraft, which has an even more complex physics than a
GroundVehicle. Note that, this is valid whether you need to just “probe” the
ground altitude for any reason, or if you want to actually place an object on
a certain altitude above ground, without having to deal with absolute
elevations. In fact, it would be nice if we could have the “SimpleObject”
class which was available in FSX, that lies between a Viewer ( now called
“StaticObject” so, it’s totally static ), but with a very simple physic not
requiring the possible overhead of a GroundVehicle so, it could have a minimal
support for reading the ground altitude and could be set “above ground”. Also,
it would be nice it we could have a dedicated function to probe the ground
altitude at a specific location, without having to create an object.

I like this suggestion, and I’d even suggest it would be nice not to have a
“simpleobject”, but a SimObject SDK instead so that you could create you own
simobject with the necessary APIs to get the low level data you’d need for
whatever the reason you need a custom simobject from the first place, which
can be widely different from one 3rd party vendor to the other, and for which
a one size fits all Asobo designed “SimpleObject” might just be too “simple”
“object” only useful for “simple” “needs”.

Thank you! I checked it and yes, if I define my AIObject as ground vehicle, I
am able to retrieve the ground altitude for each object. I wonder if I can
create a ground vehicle without any visual (or make it transparent); so that
they won’t be seen in simulation. Do you have any idea?

Thank you so much!

Just create a gltf with made of a single triangle flipped (normals pointing
down), as long as it stays on ground, it will be invisible. No need to assign
any material to it, just vertex colors.

My probe objects are supposed to fly with the aircraft, since they will
represent skid locations. Therefore, it may not be applicable for my case.
Thank you for the help anyways! Edit: I was able to do that by not specifying
any gltf file, in case someone wonders.