Custom plane laggy in FS2

  • Hello,

    Again, I encounter some problems in the development of my custom aircraft. I have a 3D model which is comfortably in the poly-count limits (around 35K faces). However, when I open it in the simulator, it is incredibly laggy... I have found out that the reflections are costly, so I have disabled the reflections alltogether in the 3D model, but it still doesn't solve the issue. Also, the TMD file of the aircraft is still pretty simple, and I don't see why this would be the cause...

    If anyone knows what could be the source of the lag, I would appreciate ;).

    Happy flying !

    Antoine Brunner

  • I think your physics are in a constant crash loop. This could be caused by your joint multi setup.

    Start with a working aircraft tmd file like the cessna c172.tmd and remove all of the graphics and also the collision hull. If you load that you should have an invisible plane. Then add your rigidboygraphics for the fuselage and in its geometry list you add the names of your 3d model parts. Then you should see your plane which now flies like the c172.

    When you start moving the landing gear be careful to move the rigidbody R0 as well as the joint R0 position to a similar location. It usually crashes when you have a light landing gear part like the nose gear steering far away from the pivot point. That high leverage creates very high forces which make the gear explode almost instantly and you get a constant reset loop.

  • It is very weird, it still doesn't work... I have commented everything in my TMD file, except for the following :

    I had to keep the telemetry section, because for some unknown reason, removing it makes the simulator crash at startup... As you can see, there is only one rigid body, and no joints, so I don't see what could be the problem here. But still, the simulator freezes and I cannot move the mouse cursor anymore.

    I am really helpless right now, and I am starting to question whether I am extremely stupid or not...

  • Hi helpless...:):) been there done it got the tee shirt as they say.

    Ok, might I suggest an old thread for some useful information

    Aircraft TMD Self Help Group

    There is a zip file with a collection of explanations by Master Obi Jan at the end of the posts.

    I looked at your code above and if that is all you have then there are some bits missing from the code, I have corrected what I can see obviously wrong. I called it temp.tmd and its in the correct format for notepad++. This may not be your problem as you may have omitted them from your code above, but without seeing the whole TMD it's somewhat difficult. Also indent the tmvector lines as I have done as it makes it a whole lot easier on the eyes when things get a little more complicated.

    You may also need left and right wing in the dynamics, not sure if FS2 will play without them.


    edit, if it still doesn't play post the TMD and I will have a look

  • Hello,

    First, let me tell you that an actual issue was that I was putting an empty line at the beginning of the TMD file, causing the aircraft converter to crash... The parser for the TMD file is definitely very brittle (and not talkative, which is even worse for the aircraft developers, but anyway, let's not get distracted). But unfortunately, once one error is solved the next stupid error shows up (that seems to be a constant in the world of computer science).

    Here is the minimal TMD file that I am trying to get through :

    Now, when I use the aircraft converter, I get an "unreferenced geometry Wing, SpeedBar, Cables and Keel", even though they're referenced in the TMD file, so I don't understand the problem here. When I open it in FS2, the preview is empty, and the game freezes during the loading screen.

    I really have no idea why all those things happen to me, even though I have read all the documentation very carefully, and several times... I feel very stupid now, because this aircraft converter has driven me crazy ;)...



  • Hi Antoine

    I suspected that you had but to be on the safe side I included them. Your quest for a hang glider did get me thinking.

    I doubt FS2 supports the control method of a hang glider, master jan will correct me if I'm wrong, so you will have to build a 'normal' aircraft in the dynamics section and adapt the hang glider graphics to fit this later. If it were me I would start with one of the gliders and adapt from there as master Jan suggested with the Cessna.

    When I say 'normal' this will include fuselage, left wing, right wing, ailerons, elevator, stabilizer, rudder and probably trims. Main gear, wing gears and a tail wheel. Most of these will have to be imaginary and at positions that will achieve realistic hang glider performance. As the hang glider performance is way below the glider we are using we need to cripple it. If you know all about airfoil theory then you could adjust it there else we could adjust the weight to maie it fly like a brick.

    Usual terms and conditions apply and if it goes wrong I'll simply blame my old age :thumbup:


  • Hi Antoine

    Only thing I can suggest is to spilt the wing in your model to LeftWing and RightWing. Rename keel to Fuselage. Then in the TMD rename your rigidbody to Fueslage. It may be that FS2 is expecting these as you have named them in the dynamics. You could then add another entry for you extras




    <[string8][GeometryList][ SpeedBar Cables ]>


    doing it this way we are at least starting from a known TMD format that works


  • Please start with a working tmd from one of our default aircraft. Then remove all graphics objects except the rigidbodygraphics for the fuselage.

    Clear the GeometryList parameter and add only your 3d model objects back in.

    Then remove the collisionhull objects in the physics.

    This way you have a working physics setup that shouldn't crash constantly.

  • Morning master

    Isn't that a rather simplistic statement to make.

    Lets say our budding hang glider designer followed the advice and chose the 777 for his default aircraft. Some 40,000 lines of code of which 39,000 plus would be useless to him. Perhaps, start with a default aircraft that is an approximate of what your planning to build would be better. Or better still, chose from one of our templates that IPACS has provided within the SDK, ( if we had them) , ie glider, small GA, large Jet, helicopter, military)

    Also, are you saying the TMD file we are using above will not be acceptable as I am sure that is what Antoine will now be thinking , if not then please explain to him and me why it's not.

    Would it not be better to start with a simple IPACS written TMD that purely gets the aircraft into the sim, To give the designer that satisfaction factor and willingness to carry on rather than spend a lifetime bastardising a bunch of code, most of which means zero to them. What is child's play to you and sometimes to me is a mountain to others and we should remember that.

    I can feel my throat starting to contract, aka Darth Vader, so i'll stop right now :D

    Steve ( apprentice)

  • It really depends on what aircraft you want to create. For a hang glider the closest match would probably be the Swift S1 glider and not the B777, yes :) But back when we created the B777 we used the B747 tmd because that is the closest aircraft in terms of systems, displays and what not. So even a complex tmd may be the right choice if you plan on keeping most of it or if you know that most systems are alike.

    There are two approaches you can take.

    1) Start from scratch and with the bare minimum and work your way up from there.

    2) Copy a similar aircraft and change it from there

    The 1st one can be done if you already have a good idea of what elements you need. It's not easy to set up a rigidbody system from scratch though, you need to pay attention to the joints and their forces, check every code snippet you copy over, etc.

    The copy option get's the job done in a shorter time and you have to do far less to get a new model into the sim. The physics, graphics and sound are all completely independent, so why not keep the physics and just change the graphics? You can even remove the graphics and you would still have a flying aircraft, though invisible and not as easy to fly :D

    Here is the swift.tmd but with the necessary changes applied to remove the graphics:

    All you should need to do is adjust the geometry list to:

    <[string8][GeometryList][ Wing SpeedBar Cables Keel ]>

    Regarding the question if a hang glider can be done with Aerofly physics: I'm sure it can, we do have these kind of aircraft in our Aerofly RC 8 which uses the same core physics engine as far as I know. Obviously some parameters are different at larger scale but in the fundamental physics don't really change at smaller or larger scale.

    To get it to fly correctly you may have to deviate from the default airfoil parameters and you have to set up the aerowings correctly with the correct wing twist etc. It's certainly easier to start with "another Cessna" than with a new aircraft category but it's also easier to start with a hang glider than with a tilt rotor aircraft or gyrocopter.

    I'd recommend starting with an aircraft that has a regular tail, maybe an ultralight like this:

  • I agree with Jan's option. For the aircraft I made, I always started with a similar existing aircraft (DR400 or C172 in my case). Simply copy the tmd file, remove everything in the graphics section except the fuselage, wings, gear and wheels so you have a functional aircraft from the beginning. Then you can add the rest of the graphic objects and change the dynamics to match your aircraft specs quite easily by changing some values.

    Best, Sylvain

  • I also agree with Jan it is the best option but in the case of our hang glider we don't have the like for like which is why I suggested the glider and an imaginary one at that. The hang glider doesn't have a gear or wheels, or tail section, or ailerons for that matter. As Jan said, it's a new class.

    I am sure Antoine thought of a hang glider as a simple option but it may prove to be a little more complicated but it is one we can all help out to get it into the sim. I'm sure it will be a fascinating addition to the fleet and I'm looking forward to watching it's development.


  • Thank you guys for your help, I really appreciate it !

    I have done what you said and started from a working file. I have taken the template.tmd file from the aircraft workshop, added my geometries, and added the aerowing definition from the asg29 glider. It doesn't crash anymore, which is some good progress ! However the dynamics are very unstable, so I will have to tweak it that so that the hangglider is actually flyable...

    For the flight dynamics, I thought about controlling the hangglider using weightshift, so that it is as realistic as possible. The setup I thought of is having a rigidbody (the pilot) connected below the fuselage through a linearjoint which can be actuated by the player. I am not sure whether this is going to work, since nobody really did that before. Anyway, I will experiment, and who knows, maybe it's gonna work.

    I attached some screenshots of my model (to tease you :P), which I am very proud of. I have made it myself using Blender and GIMP, but I haven't added specular and reflection maps yet.

    I will keep you updated if I manage to make some progress. Cheers !