MrHappyFace

Members
  • Content Count

    485
  • Joined

  • Last visited

Community Reputation

476 Excellent

2 Followers

About MrHappyFace

  • Rank
    Kerbal Animator

Profile Information

  • Location Array

Recent Profile Visitors

3,346 profile views
  1. Not a feature, I tried fixing it several time, but it's still broken.
  2. Oh, no, I'm not dead yet. And while its not prohibited by the license, releasing another version under a new name just causes more confusion, considering I'm still here. I'm still in the process of updating. 1.1.3 only released a few weeks ago, and I have 2 other mods I've been working on on top of personal stuff.
  3. Done! That was way easier than expected. Download: https://www.github.com/HappyFaceIndustries/KerbalAnimationSuite/releases/latest Changelog: Updated to KSP 1.1.3 Remade animation player window, allowing custom binding of animations to number keys Reduced download size by 11kb by deleting those pesky thumbs.db files Added other things to increase the size of the changelog Here's a screenshot of the new animation player window:
  4. Now that 1.1.3 is out, I feel comfortable updating. Update will include a better animation manager. BTW, almost all of the kerbal's animation system uses legacy animations, so it makes no sense to use non-legacy.
  5. If I did that, then I'd have to seperate all the other PQSMods I have planned as well, and if I separated everything out based on their purpose, I'd have several plugins instead of just one, which would be hugely inconvenient for me. Also, the way KopernicusExpansion is structured, it has very little overhead unless one of it's features is in use. plus the mod is currently just a 2mb dll and a ~1mb config file, so overall it's a very small mod overall. I might want to do so in the future for some of the larger features, but not now.
  6. I have no idea what could be causing the bouncing. Maybe it's got something to do with some parts still falling while others have already settled on the surface. Does this happen with 1-part (non-EVA) vessels?
  7. Why not do this: public float impulseSpeed = 0.01; //... var gravityVector = FlightGlobals.getGeeForceAtPosition (vessel.GetWorldPos3D ()); var impulseVector = gravityVector.normalized * (gravityVector.magnitude * -(1 + impulseSpeed)); vessel.parts.ForEach( part -> { if (part.GroundContact) { part.rigidBody.AddForce(impulseVector, ForceMode.VelocityChange); } }); The function getGeeForceAtPosition is the standard way to calculate gravity, used by stock code and all the mods I've seen, and it's probably more optimized than yours is. Math.Pow function calls are relatively expensive too. Also, I'm pretty sure the EVA thing was because EVA kerbals don't take kindly to odd forces. I've had a kerbal fly into to the air at 100m/s for hitting the ground in ragdoll mode. Yup, you're right. I was in the mindset of KSP where everything is listed as kilonewtons and tonnes. I meant m/s as in that's how much the velocity was increased in that frame. It doesn't make much sense to use m/s2 when we're dealing with instantaneous impulses. Impulses last one frame, and frames are of variable length, although meters per frame squared might work.
  8. Impulse is not v * m. (Note that acceleration is change in velocity and velocity is change in position.) In unity, you pass a vector into the AddForce function, which is used as a force when it's in Force or Impulse mode, and an acceleration when it's in Acceleration or VelocityChange mode. That means that the resulting change in velocity (acceleration), in Force and Impulse mode can be calculated easily by solving for A in the equation F = MA. F = MA (input of AddForce function) = (mass of rigidbody) * A (input of AddForce function) / (mass of rigidbody) = A Now, assuming you input a force of 1kN with a mass of 10kg, you get this acceleration: F = MA 1kN = 10kg * A 1kN / 10kg = A A = 1/10m/s or 0.1m/s If you add a 10kN force to a mass of 1kg, you get this: F = MA 10kN = 1kg * A 10kN / 1kg = A A = 10m/s From this, we can see that (in force or impuse mode) it requires a greater force to accelerate more massive objects by the same amount, so we increase the force by multiplying it by the mass, NOT dividing it by the mass like (I think) you were doing. Of course you can bypass masses and forces entirely by just using Acceleration or VelocityChange modes, and just pass the desired acceleration in directly. EDIT: I reread your first post, and now I'm not entirely sure I know what the problem is. I though it was that the AddForce was behaving differently in different conditions, but that doesn't seem logical. Are you applying the force upwards as in (0, 1, 0), or upwards as in negative gravity. The gravity in KSP isn't always down, or even consistent for different positions, so you need to use the function getGeeForceAtPosition I explained in my first post. Also, are you using AddForce or AddRelativeForce, because if you're using AddRelativeForce, then the force would be applied in different directions based on the orientation of the rigidbody. Some source code would be immensely helpful.
  9. You multiply by mass. Newtons 2nd law states F = MA You want to increase your upwards velocity by 0.01 + g m/s, which is an acceleration of 0.01 + g. To get the correct Force, you multiply Mass by Acceleration. F = MA. Alternatively you could use the VelocityChange ForceMode, and just use 0.01 + g as the magnitude, without mucking about with masses. Side note: The difference between the ForceModes are as follows: Force - A regular force. Applying a force of 1kN for 1 second on a 1kg object speeds it up to 1m/s. Acceleration - An acceleration. Applying an acceleration of 1kN for 1 second speeds the object up to 1m/s regardless of mass. Impulse - An impulse force. Applying an impulse of 1kN for 1 frame on a 1kg object speeds it up to 1m/s. VelocityChange - A change in velocity. Applying a velocity change of 1kN for 1 frame speeds the object up to 1m/s regardless of mass. Side note 2: You can get the vector for gravity (gravity is not always down because of round planets) by using the following code: var gravityVector = FlightGlobals.getGeeForceAtPosition (vessel.GetWorldPos3D ()); The vessel.GetWorldPos3D() function gets the worldspace position of the vessel. For your purposes, you'd do this to apply an upwards impulse of 0.01m/s: var impulseVector = gravityVector.normalized * (gravityVector.magnitude * -(1 + impulseSpeed)); //impulseSpeed is 0.01m/s in this case You'd take the impulseVector and use it in the rigidbody.AddForce function.
  10. I got around to uploading the camera code I was talking about earlier. https://gist.github.com/HappyFaceIndustries/d997e268d38bd638881e4033606216f9 The rendering takes place in the RenderCameras method, you can change the Render function to RenderToCubemap to get Cubemaps instead of RenderTextures. The skybox exposure stuff is just to dim the skybox because this was a telescope mod, and the skybox is really bright if you zoom in too far, but I can't imagine reflections would zoom in, so it's not really needed. The UpdateVisibleObjects function is also not needed because it just makes far-away planets visible to the camera. I haven't tested this in 1.1.x yet, but I don't see any reason it wouldn't work with little to no modification. You may need to reference Assembly-CSharp-firstpass.dll for it to work.
  11. What exactly confuses you? Installing them? Using them?
  12. It would be easy enough to supress ragdolls, or replace the behaviour that triggers ragdolls. It would require modifying the kerbal's FSM, see the source code for my mod Kerbal Animation Suite for some information on how to do that (hint: look in the EditableAnimationClip.cs file), but yeah you'd need a custom plugin to do it.
  13. Mods that reparent kerbin (set it's parent body to something other than the sun) are inherently glitchy because of the way KSP's planets work internally. It seems this bug doesn't adversely affect gameplay and it's just a visual glitch, so I wouldn't worry about it.