Hi, today i connected to Vatsim via swift on Linux and on a some-days-old next.
Nearby planes were shown, and the swift model matching did show them correctly as "FG C172P".
In the sim I have seen them as blue/yellow gliders.
The properties looked "good", as in /ai/models/swift[n]/sim/model/path=/Aircraft/c172p/c172p-set.xml correctly reflected the C172 matched of a particular nearby aircraft I checked.
It however made me curious, as my local models path does not have the slash prefix in the path (local model is at Aircraft/c172p/Models/c172p.xml).
So I changed the path creation like this:
diff --git a/src/AIModel/AISwiftAircraft.cpp b/src/AIModel/AISwiftAircraft.cpp
index cf09faf28..46302c037 100755
--- a/src/AIModel/AISwiftAircraft.cpp
+++ b/src/AIModel/AISwiftAircraft.cpp
@@ -25,7 +25,7 @@ FGAISwiftAircraft::FGAISwiftAircraft(const std::string& callsign, const std::str
{
std::size_t pos = modelString.find("/Aircraft/"); // Only supporting AI models from FGDATA/AI/Aircraft for now
if(pos != std::string::npos)
- model_path.append(modelString.substr(pos));
+ model_path.append(modelString.substr(pos+1)); // strip first slash
else
model_path.append("INVALID_PATH");
After recompiling the model now shows as: /ai/models/swift[n]/sim/model/path=Aircraft/c172p/c172p-set.xml
However, still the glider is rendered, and not the detailed cessna model (nor the fallback one).
What is wrong? :(
My git looks like this:
flightgear: f8fc7630c origin/next (https://git.code.sf.net/p/flightgear/flightgear)
fgdata: c54b238c3 origin/next (git://git.code.sf.net/p/flightgear/fgdata)
simgear: 29f23fc5 origin/next (https://git.code.sf.net/p/flightgear/simgear)
@ltoenning, this one's for you ;-)
I will take a look at this tomorrow.
I can reproduce this.
But was it previously even possible to use user-flyable planes to render other planes? IIRC, this was never possible, but I could be wrong.
From the comments I see that it was just AI planes.
But, it would be very good to have them visible, even if there is an actual detailed user flyable version installed (as is the case for the 172 in every fgfs installation).
Last edit: Benedikt Hallinger 2024-07-27
Just as a note; I did not test Airliners or so.
We were a bunch of small planes here, and I just have seen the glider.
In my opinion, it would be good to see actual c172 planes out the window :instead of the gliders :)
If I can do anything, please get in touch
You could add the "FG AI C172/C-FGFS" from $FGDATA/AI to your model set. This renderes fine. You can also test this without connecting to a network by using the model browser (https://swift-project.org/troubleshooting/model_browser/)
Regarding using detailed (non-AI) models to display others: If I remember correctly, there were some limitations on how the AI Subsystem (which swift uses behind the scenes) can use these models. Hence, only the AI/not-detailed/non-userflyable planes are available. If this is still the case, we should make this more clear.
The wiki reads:
I think this is correct, but misses the point that you should refer to the actual model files, rather than -set.xml?
Added something to the wiki, is this correct now?
Thanks, redone my set and now I can test-load the C172.
Will this now show other real C172?
Have you tested that this works? I just looked at the swift code that parses the model folders and it seems that the following happens:
Having this hardcoded path-piece is worse... But thats why swift is still in beta ;-)
See this page about included/excluded models: https://swift-project.org/documentation/swift_data/excluded_models/
It seems that the FG C172 was accidentially added to the database as an included model (overwrites the default "exclude" for -set.xml files). Hence it is used for matching in your case and the glider is shown. I will check with the swift database admin if we can change.
Nevertheless, just by the code inspection, I assume that it is not possible to use any airplanes except the ones in "/AI/Aircraft" for rendering right now.
The default C172 is now excluded for matching. The only other C172 model for FlightGear in the database, that is not exluded is "FG AI C172/C-FGFS". This model is located in $FGDATA/AI/Aircraft/c172.