Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

Using X-Plane ACFs instead of CSLs


Chris Kawchuk 1129097
 Share

Recommended Posts

Chris Kawchuk 1129097
Posted
Posted

Hi All,

 

Ive found a quick-and-dirty way to use a built-in X-Plane ACF instead of the "OBJ 700" CSL

 

If you remove everything in the "plugins/Xsquawkbox/CSL" folder, X-Plane will default to using your "Aircraft and Situations" aircraft loaded in Slot #2.

 

Basically, I was tired of seeing ye olde "bright-lights and no night textures" Object 700 CSL Items, so I was "tinkering" around with forcing XSB to load OBJ850 or .ACF files instead via the config files. Turns out XSB doesn't support loading the newer 850 objects nor the ACF objects at all (or I'm unaware of how to make it do this!) - but in my adventures it had an unintended side-effect of not loading in any CSLs at all. I found to my amazement that when XSB has nothing to load, X-Plane instead renders the first "AI" aircraft in place of any aircraft in the local surroundings when I went online.

 

The upshot is that I now have a fully rendered "other aircraft", complete with correct positions of flaps, speedbrakes, landing gear, etc, and uses the modern lighting system (so objects react to HDR and reflect, as well as cast normal lights and strobes). I used the "XPFW" AI-Aircraft library for my "AI" slot #2 - which are optimized aircraft specific for AI or object rendering (you cant fly them, but they are fully detailed on the exterior).

 

The downside is that every other aircraft is always the same. However, I find this to be acceptable when flying online.

 

- CK.

 

P.S. if wade is reading this, is there a way in the xsb_aircraft.txt to reference an '.acf' file instead of an '.obj' 700? I could easily build a completely new CSL library based on Morten's XPFW-AI aircraft - which would go a long way to adding to the immersion (a.k.a. "a next-gen CSL library") for XSB.

 

Cheers.!

Link to comment
Share on other sites

Phillip Kurus
Posted
Posted

Interesting.

 

Any FPS hit?

Link to comment
Share on other sites

Chris Kawchuk 1129097
Posted
Posted
Any FPS hit?

 

Negligible.

 

...However, I'm using Morten's "XPFW-AI" Planes, which are optimized for "looking pretty on the outside" only. (no internals, no 3D-pit, etc...i.e. designed to be non-hugely FPS impacting)

 

To be honest, I didn't do an "OBJ7" vs "ACF" back-to-back frame-rate test under the same condition to be able to measure it in any way (I was just more amazed that it worked at all). If there is any FPS impact, I didn't notice it.

 

- CK.

Link to comment
Share on other sites

Phillip Kurus
Posted
Posted

Ah, okay. Guess I'll go track those down. Thanks!

Link to comment
Share on other sites

Chris Kawchuk 1129097
Posted
Posted

On Another Note, I read the XSB Developers docomeentation, and know how to load Aircraft now as part of the xsb_aircraft.txt directives file.

 

The unfortunate part, is that XSB seems to die if I specify any .ACF (Any 'HASGEAR YES|NO' directive seems to crash it on initialization, and if I omit that statement, it loads the ACF but crashes upon pattern matching)

 

.... More tinkering is needed =)

 

- CK.

Link to comment
Share on other sites

Mathew Sutcliffe
Posted
Posted

Very interesting.

 

On Another Note, I read the XSB Developers docomeentation, and know how to load Aircraft now as part of the xsb_aircraft.txt directives file.

 

The unfortunate part, is that XSB seems to die if I specify any .ACF (Any 'HASGEAR YES|NO' directive seems to crash it on initialization, and if I omit that statement, it loads the ACF but crashes upon pattern matching)

AIRCRAFT <minimum version> <maximum version> <acf file>
AIRCRAFT 670 700 __XPFW_PROPS/Turboprops/BE20/Kingair.acf

From a quick perusal of the code, it seems that if your simulator version ID (e.g. 1025) is not between the specified min and max (670 and 700 in the example) then the AIRCRAFT command will be ignored, and the subsequent HASGEAR command will act upon whichever AIRCRAFT or OBJECT command came before it. If there was no AIRCRAFT or OBJECT command before it, then the HASGEAR command will attempt to act upon a non-existant value, and this could cause a crash. Just a guess.

 

And you might like to know that they are already working on a new CSL format for XSB based on OBJ 850 with custom animation datarefs. ACF are not ideal because their number is limited ("AI slots") and loading happens on the main thread and causes the sim to freeze for a couple of seconds.

 

For specific technical questions, you might have better luck on the X-Plane development Yahoo group.

swift - Developer
Link to comment
Share on other sites

Chris Kawchuk 1129097
Posted
Posted

Aha got it. You are correct - it was indeed ignoring my aircraft. (I added a standard OBJ700 before the ACF, and it loaded, but the ACF itself didnt); which then led me down the road of the version number not matching the bounds-check.

 

I was using a version of "AIRCRAFT 0 9999 __TestCSL/testing123/myaircraft.acf" and it still wasn't loading. I changed the MAX_VERSION to "99999" on the string and it loaded, which leads me to a sneaky suspicion that the internal $VERSION is actually "10025" and not "1025" as we thought. (I'll figure out how to dump the dataref to see what the actual value is, but this is my suspicion).

 

Upshot, yes, it loaded the prescribed ACF now.! =)... My next snag: Theyre not rendering "in-game". (Still tinkering around w/AI setup, number of slots, .debug XXXX commands etc..). Hopefully this code-path still works.

 

Thanks for the insights...! I indeed read the docomeentation as linked, but couldn't find the current sourcecode with my google-fu. The Source is indeed doing a straightforward "atoi()" in the two version numbers - I thought there may be some bounds-checking going on to ensure the number was 3-digit (as this was all written for X-Plane 700-970); glad to see it's accepting any integer here.

 

In terms of the load delay, I'll try it out with 20 aircraft or so, and check for the sim-freezes when they're loaded. It looks like XSB now loads "on demand" versus loading everything into memory at the beginning (this is my hunch); so I may be able to get away with it. (once I figure out why they're not actually rendering in-game).. the Text Labels are there however...

 

I'll report back to see how acceptable/unacceptable this is when I have large #s of differing aircraft around as ACFs (if anyone is interested)

Link to comment
Share on other sites

Phillip Kurus
Posted
Posted
(if anyone is interested)

 

Interested.

Link to comment
Share on other sites

  • 2 weeks later...
Keith Smith
Posted
Posted

Chris, with the new CSL system that's being worked on, you'll be able to use multiple OBJ's per aircraft, real lights, normal maps and animations. The planes cast shadows...all the good stuff. I already have it functional elsewhere. There's asynchronous loading of the planes and textures, too, and everything is loaded on demand rather than up front. This means you can have almost limitless CSL libraries. The future is pretty bright there.

Link to comment
Share on other sites

  • 1 month later...
Rich Heimlich
Posted
Posted

Keith, what sort of ETA is there on this sort of thing? Are we talking months, years? Just wondering if I should start reading up on CSL, etc.

Link to comment
Share on other sites

 Share