Capital_Asterisk

Ground Effect Development Thread

Recommended Posts

I don't know how expensive the raycast is, but I see at least two other ways to get your AGL:

vessel.radarAltitude

vessel.altitude - vessel.terrainAltitude

These two should probably be the same.  Either should be much less expensive than doing the raycast.  The problem I see is that if you have a craft with a lot of lifting surfaces, control surfaces, etc, there will be increased overhead for each raycast.

I do understand that using a single value will not be as accurate as for individual parts, but personally, I would give up a little bit of accuracy for better performance.

I am watching this with extreme interest, feel free to ask for help if you need it

Share this post


Link to post
Share on other sites
16 hours ago, Capital_Asterisk said:

It shouldn't work with FAR at all, it uses its own values and ignores the stock aerodynamic values during flight. I'll add FAR compatibility before the official release.

Do you have FAR working for 1.5.1 for test? 

Share this post


Link to post
Share on other sites
On 10/24/2018 at 9:07 PM, Me1_base said:

Do you have FAR working for 1.5.1 for test? 

Nope. Just tried for my career save(1.5.1) with FAR(LightHill) and the game crashed. 

I lost another shuttle, full of rescuees, right down on the runway because of the bouncing and skidding. Beside my poor landing skills, too much landing speed was the cause, I believe.

Desperately need this mod for the safe landing.

 

EDIT: the crash was not from this mod. Can open game without any problem, but the mod is not working.

Edited by JWS

Share this post


Link to post
Share on other sites
On 11/9/2018 at 6:41 PM, linuxgurugamer said:

@Capital_Asterisk  Any progress on this?

I'm still working on this, there has just been other things I've been working on (such as making a new aerospace simulator entirely). I think it's kind of important to have ground distance vary between parts; this allows some ekranoplan designs to stay stable without SAS. After a bit of research, I'd agree that that raycasting per wing per update can really kill performance. The newest commit has some conditions that prevent raycasting when not necessary, but I just got another idea while typing this. Instead of raycasting, radarAltitude and terrainNormal (or a few raycasts around the vessel) are used to approximate a flat plane below the vessel, and distance from that is calculated per part using only geometry. This might also work better as a VesselModule instead. That's the best solution I can think of so far.

Also, the state of FAR compatibility: the code is there but it doesn't work. The method I use is very hacky: get aero force from FAR module, scale, then apply it as force. I've successfully accessed the FAR PartModule, but AddForce behaves weirdly or (most likely) I don't know how FAR works and the aero force values it provides are not used in the way I think they are. Considering that this is going to be an aerodynamics mod for an aerodynamics mod, and how FAR is designed to make KSP more realistic, ground effect should instead be part of FAR itself.

Share this post


Link to post
Share on other sites
On 11/22/2018 at 6:48 PM, Capital_Asterisk said:

but I just got another idea while typing this. Instead of raycasting, radarAltitude and terrainNormal (or a few raycasts around the vessel) are used to approximate a flat plane below the vessel, and distance from that is calculated per part using only geometry.

Ummm, isn't that what I suggested here:

 

Share this post


Link to post
Share on other sites

Sorry for being slow, but this mod has been almost completely redone using a VesselModule instead of a PartModule. The PartModule version has a couple flaws. The 12,000 raycasts per second kills performance, and the module is saved into crafts, which show up as invalid if the mod isn't installed.

New version calculates once per-vessel instead of per-wing. Performance is a couple thousand times faster, using only a single raycast. There are also some calculations that approximate the wingspan of the vessel, which scales the distance at which the effect start. Also, Module Manager is no longer required.

On 11/23/2018 at 4:46 PM, linuxgurugamer said:

Ummm, isn't that what I suggested here:

Sort of, but it considers the positions of the individual parts. This new version uses terrain distance and normal to create a Unity Plane where the ground would be. Ground distance is approximated using GetDistanceToPoint.

Share this post


Link to post
Share on other sites

Fantastic! 

I know you originally compiled it for 1.3.1, but I'm going to try it in 1.6.1 and see if it works. :-)

Share this post


Link to post
Share on other sites

If this is in a good state, would you mind if I added it to CKAN?

Share this post


Link to post
Share on other sites

There's a bug that causes vessels consisting of a single wing to enter the NaN dimension, breaking the game. So decoupling a wing from a stack separator, or having a wing explode off of a craft, would destroy everything. This has been fixed in the latest release. By now, I think it's time to post this on Add-on Releases.

On 3/20/2019 at 3:01 PM, linuxgurugamer said:

If this is in a good state, would you mind if I added it to CKAN?

Sure!

Share this post


Link to post
Share on other sites

Again, I found another bug that causes small vessels landed in water to explode violently. Wings get a huge increase of lift when they have a negative depth (underwater). I'll fix this soon. I don't know whether to trust myself or not when I say something is ready for release.

On 3/24/2019 at 8:12 AM, plausse said:

How does this play with FAR these days? I'm obviously very excited.

Sorry, but I decided to discontinue FAR support for a couple of reasons:

  • Solution would be like writing a separate mod, as FAR completely replaces stock aerodynamics.
  • Rewriting and replacing parts of FAR is hacky and inelegant
  • An aerodynamics mod for an aerodynamics mod wouldn't be good
  • FAR source code is slightly difficult to understand

As I mentioned in a previous post, ground effect (the phenomenon) should instead be added as a feature to FAR itself.

 
 

Share this post


Link to post
Share on other sites
On 3/25/2019 at 3:01 PM, Capital_Asterisk said:

 

Again, I found another bug that causes small vessels landed in water to explode violently. Wings get a huge increase of lift when they have a negative depth (underwater). I'll fix this soon. I don't know whether to trust myself or not when I say something is ready for release

Wondering the state of the mod, I don’t see any recent updates on Github

Share this post


Link to post
Share on other sites
On 9/9/2018 at 7:21 AM, Capital_Asterisk said:

First post, I've just been looking around the forums for some help, though you might recognize me from the /r/kerbalspaceprogram discord server. I'm not really sure if I'm doing things properly. Plenty of testing, cleaning, and a few tweaks is needed for this mod to be considered complete. I also have a mod that creates particles on separations, and one that ejects kerbals when the cabin explodes. This was the only mod that seemed successful.

Were these ever released anywhere?

Share this post


Link to post
Share on other sites

Sorry about the double post, but this is a separate thing from my previous post.

@Capital_Asterisk Do you think it would be possible to make a multiplier for the ground effect available to module manager so users can define it on a per part basis? I really want to create some alexander lippisch style wing in ground effect craft, which have optimized reversed delta wings in an anhedral angle, almost like a hover craft skirt, which perform far better in ground effect than traditional wing shapes. I basically want to use MM to create duplicates of the stock wings, intended to be used in this different orientation, with a 2 x multiplier on the ground effect.

 

In reality they enter ground effect at a larger % of their wing span than regular wings do. The Ekranoplan was able to achieve ground effect at about 10% of it's wingspan, while most of the WIG crafts shown in this link are able to achieve it at about 50% of their wing span....I imagine just applying a multiplier to the effect would be easier than altering the calculation of wingspan and altitude, but I'm not a programmer. I love that ksp mods so often abstract aspects of physics from reality in order to  be more playable or for performance reasons, so either a per part lift multiplier, or a per part altitude % mechanic would be fine with me.

http://www.hassanhameed.com/?page_id=1108

X-113:
ac932489_X-113_lippisch-1.jpg
 

WIG-Lippisch-RFB-x-114.jpg

Edited by Errol

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.