Jump to content

[WIP] R.E.L Skylon C2. Alpha Released. FAR config broken. (08 Dec 2014)


CaptainKipard

Recommended Posts

Do you want the nacelle models to play with?

Also when you say "dedicated plugin" would that inlcude everything that's needed? That seems like a waste of time since there are other plugins that do what I need.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Yep, it'll literally be a tiny plugin just for the nosecones. Only a few lines of code really, it will be quite simple to do. I'm not talking a full blown, general purpose firespitter type affair you'll use a tiny piece of.

Yes please, I'll set something up to show you what I mean.

It will be something like:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;


namespace Skylon
{
[KSPModule("SkylonNose")]
class SkylonNose : PartModule
{


public override void OnStart(PartModule.StartState state) //this runs once
{
base.OnStart(state);
//find nosecone animation named in config file. Animation only needs to be full travel front to back over maybe sixty frames.
}


public override void OnFixedUpdate() //this runs every physics frame
{
base.OnFixedUpdate();
float speed = (float) this.vessel.srfSpeed; //grab speed
float airDensity = (float) this.vessel.atmDensity; //grab air density
//some maths to determine how far the cones should be from the two values above
//some code to step the animation to the correct point based on the calculation above
}
}
}


That's it, the entire thing. Sometimes a few lines of bespoke code is a lot less work than bending something off the shelf into working for you. This, I think, is one of those occasions.

Link to comment
Share on other sites

You know this sounds good, but maybe you could push your code to Orbitus' plugin instead. I'm not a huge fan of lots of plugins myself, especially when they do similar things. As it stands there are already multiple animation plugins out there, admittedly doing different things, which IMO should be fused into one all-purpose plugin or at the very least into one project where you pick and choose the dlls you want.

I'll get you the models soonTM

Link to comment
Share on other sites

No problem. however you want to play it. I've got the animation code working with a dummy model and a simple tweakable to move the inlet cone. Ignore the slight jerkiness as it moves, this is to do with the step size of the tweakable.

The rest of the code to move it based on airspeed, pressure etc. is trivial, though I'll do a bit of research to find out the correct parameters.

Link to comment
Share on other sites

No problem. however you want to play it. I've got the animation code working with a dummy model and a simple tweakable to move the inlet cone. Ignore the slight jerkiness as it moves, this is to do with the step size of the tweakable. http://youtu.be/Vvy07BN-rsw

The rest of the code to move it based on airspeed, pressure etc. is trivial, though I'll do a bit of research to find out the correct parameters.

Good luck! I would assume that the intake moves in a similar manner to that of the SR-71 air intakes. I don't think much data on the intakes of Skylon is available, so that's probably the best data you will get.

Link to comment
Share on other sites

Thanks. That's where I was heading too, it's about the closest I can think of. We have a rough idea of the projected flight envelope of the Skylon, so I'll try to make a 'best approximation'.

Link to comment
Share on other sites

Yep, it'll literally be a tiny plugin just for the nosecones. Only a few lines of code really, it will be quite simple to do. I'm not talking a full blown, general purpose firespitter type affair you'll use a tiny piece of.

That's it, the entire thing. Sometimes a few lines of bespoke code is a lot less work than bending something off the shelf into working for you. This, I think, is one of those occasions.

Would it be possible to use this for other intakes? I have some SR-71 style shock-spike intakes which I have animated using throttle linking, but that's pretty seriously different from the airspeed linking which they should do

I wonder if I could also use it for the J58 engines themselves to animate the tertiary flaps while the ejector doors remain throttle linked

Link to comment
Share on other sites

This is a problem I've just noticed.

The real Skylon doesn't need very large wings because its fuel is not very dense, and thus the Skylon is very light and not very dense.

KSP's primitive physics model means that tiny wings will have to have a lift rating of around 3.4 or so to lift something that heavy. Although, if you make a custom resource system, you, in theory, could make it much less dense. But I'm sure that a stock-resource "kerolox" system would not work very well.

May I contribute this time? I've learned how to model much better. I could also do closed alpha testing. I just suck at texturing, but I can tell you are really good at it. I'm sorry about not doing anything when I said I would before. :(

But I think I'd be best at part configuration or Unity configuration. I really think that's my favorite part of modding. Thanks for reading. :)

-Naten

Edited by Naten
Link to comment
Share on other sites

Everyone is welcome to contribute. Just remember it's your time to waste. It hurts me not one bit when you half-do a model.

Since you brought that to my attention, then if you want you can do some research on all the different stock resources and resource mods and get back to me so that we can discuss it and make an educated decision. Is that ok?

Also I don't know much about KSP physics, so make sure that a combination of small wings and large attack angle (it has to be large IRL) is still not ok.

Link to comment
Share on other sites

  • 2 weeks later...

I was checking my image stats and found that @Nutt007 (who's apparently also on these forums) has hotlinked to one of my Skylon renders here on facepunch forums comparing it to the exact same parts I ranted about in this thread.

I'm sorry. I know this has nothing to do with anything, but I just found it really funny :D

Edited by Cpt. Kipard
Link to comment
Share on other sites

With the amazing help of stephm, nli2work and several others I have managed to successfully export a working landing gear. One thing I hadn't planned for was the fact that my design resulted in hitting a KSP limitation. FXModuleConstrainPosition and FXModuleLookAtConstraint are simply too basic to precisely animate something like the torque arms. If you're interested in the discussion, you can head over to this thread which also contains a whole lot of useful info about these constraints and rigging landing gears in Unity as well as some SOURCE FILES (OMG WHAT IS THIS?!) Yes! nli2work and stephm have uploaded source files for you to reverse-engineer :D

I also posted a request for a constraint plugin here. If this is something that interests you then join the discussion. I think something like this would be a great benefit to animators.

Finally with everything I have learned in the past few weeks, I can now repeat the process for the main gear, then move on to the remaining parts which I suspect will be much easier to set up. Obviously the torque arms wont animate "correctly" yet, but at least the worst is already behind me. If and when the necessary means to animate them become available I'll revisit this.

One outstanding issue though is animating and controlling the behaviour of the intakes. This is of course just for aesthetics, since it is the actual stock sabre engine bahaviour that determines when to change modes. Tying the animation of the intakes to the functions of the engines is something that can be looked at, but not by me because I don't code. lo-fi already offered to help with some aspects of the intakes.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Firespitter does have an animated intake module that might do what you need. it positions a mesh transform based on min/max intake flow. You set the min/max, and intake mesh object

https://github.com/snjo/Firespitter/blob/master/Firespitter/animation/FSanimatedAirIntake.cs

haven't messed with it. but it would either open or close the intake based on intake flow rate, depending on your settings

Edited by nli2work
Link to comment
Share on other sites

Looks like I'd have to precisely work out the positions for each of the cone segments, but that's ok.

I can't exactly tell. Does it close completely when there's no air? It would be alright for an alpha I guess, the only inauthentic thing about it would be that the real intake cones should close on engine mode change. So it moves back at first and then completely forward.

Link to comment
Share on other sites

Can Firespitter can do a (separate) animation upon closing the intake as well? In that case, the player would just have to manually close the intakes upon going to rocket mode. Then they'd close normally.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...