Jump to content

Regarding Cephei source, and EULA


Recommended Posts

I may have this completely wrong, but from a couple posts recently, I gather Cephei was using decompiled code in his/her plugin.

-I\'ve been writing a new engine class not derived from either stock engine class.

-I think I still have an old version of Cephei\'s code somewhere.

As I\'m trying to replicate (most) of the functionality of the stock engine classes, and I assume Cephei had at least one decompiled in there, it would be extremely helpful to at least read through that to find out exactly how/where some things should be implemented. I\'m writing my own code in any eventuality, but without actual documentation of the KSP bases, everything is really just guesswork now.

What I need clarified is exactly what we\'re allowed/not-allowed to do with that code and still be within the bounds we were set.

ED: The reason I\'m asking is that we were told not to reverse engineer the thing. Brute force or guesswork is a generally accepted form of RE for software(I believe) in the US, but that\'s purely a function of our own law scheme/treaties/etc, and if you use compromised code while doing so, it\'s no longer viable. Without real documentation, that\'s what we\'re doing with plugins now.

I imagine Squad really didn\'t want to get bogged down in international IP law. So I\'m just wondering if we could get an official directive of 'damage done; go ahead and read, but don\'t directly use it', or the legalese 'no how, no way', and not get into the legal interpretation mess.

Link to comment
Share on other sites

The rule is: you may inspect KSP engine members marked as \'public\' and \'protected\'. Visual Studio Object Browser tool provides such an inspection without decompiling the code -- and AFAIK this tool is allowed.

You still may not inspect members marked as \'private\' or decompile the game.

Moreover since all the plugins authors must open their source code you may freely learn from plugins already released ;). Though if you plan to use a significant amount of some plugin\'s code you may need author\'s permission to do so. Otherwise you\'ll need to rewrite all the code completely in you own way :)

Link to comment
Share on other sites

For the decompiled code:

In Cepheis IonEngine, there was a line that included a float rounding error (0.69999.... instad of 0.7) so I looked through the code carefully and found somme obvious comment lines at the beginning that included the words 'assembly-csharp.dll' and 'class: LiquidEngine' and where (probably) made by Cepheis decompiler.

My problem:

I reported the post with the code to the moderators and it dissapeared within one hour. I then re-wrote the plugin (any code outside of the IonEngine was really nooby) almost from scratch, but it still includes some original lines like the class names, using directives and the code for the VAB description window. Also, I wasn\'t able to do this before I saw the decompiled code, and even if I whould re-start now only with my completely own EL_API class, it whould still be more or less based on decompiled code. To make it even worse, most of my C#/KSP plugin skills are based on this plugin...

I need to know if it is legal to release the plugin, I can\'t really move away further from the decompiled code, I could re-write the stuff that still might be decompiled, but there whouldn\'t be a difference (if I delete all the maybe decompiled {s, I whould have to readd them, there whouldn\'t be a difference even in the physical appereance on my hard disk).

Link to comment
Share on other sites

Thanks Tosh, just wasn\'t sure exactly how far I had to take the secret squirrel routine. I write all my own code anyway, don\'t trust anything I didn\'t make myself.

Kreuzung, I\'m certainly not a mod or dev here, but it shouldn\'t really be a question of what your code looks like, just whether or not it directly came from someone else. If Cephei\'s original code was taken straight from the ksp assembly internals, then it didn\'t belong to him. If you take code straight from Cephei\'s source, it doesn\'t belong to you. I\'d suggest actually working through what you want your plugin to do, and writing your own code as you go.

If you don\'t know how to make something work, you can look at how other people did it, and search msdn/unity reference for how to use the objects at your disposal. Very effective hands on learning that way too, a couple days ago, I\'d never touched C#.

Once I get my engines to at least consume basic fuel, and turn on/off without a key, I\'ll post my source somewhere around here, and I\'m commenting as I go.

Link to comment
Share on other sites

For the decompiled code:

In Cepheis IonEngine, there was a line that included a float rounding error (0.69999.... instad of 0.7) so I looked through the code carefully and found somme obvious comment lines at the beginning that included the words 'assembly-csharp.dll' and 'class: LiquidEngine' and where (probably) made by Cepheis decompiler.

I haven\'t seen Cepheis code, but I\'d like to know on what you base your accusations of 'decompiling' - it seems you are using this word quite a lot.

This is what is publicly visible of the Liquid engine class by reflection without any need for decompiling. All of this info is (surprise, surprise) contained within Assembly-CSharp.dll:


public class LiquidEngine : Part
{
// Fields
public float minThrust;
public float maxThrust;
public float fuelConsumption;
public float heatProduction;
public float gimbalRange;
public float gimbalAngleH;
public float gimbalAngleV;
public Vector3 thrustVector;
protected Vector3 thrVector;
public bool thrustVectoringCapable;
protected float thrust;
protected Part fuelSource;
protected Transform gimbal;
protected Quaternion initRot;

// Constructors
public LiquidEngine ();

// Methods
protected virtual void onPartStart ();
protected virtual void onFlightStart ();
protected virtual void onCtrlUpd (FlightCtrlState ctrlState);
protected virtual void onDecouple (float breakForce);
protected virtual bool onPartActivate ();
protected virtual void onPartDeactivate ();
protected virtual void onActiveFixedUpdate ();
public virtual void OnDrawStats ();
}

EDIT:

Ok, so now I have seen Cephei\'s code (the web never forgets...), and all I can find is this 'obvious comment at the beginning'


// Type: LiquidEngine
// Assembly: Assembly-CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Assembly location: D:\Games\KSP\KSP_Data\Managed\Assembly-CSharp.dll

using System;
using System.Collections.Generic;
using UnityEngine;

namespace KSPPartTest
{
public class IonEngine : Part
[snip]

which doesn\'t really hint at any illegal activity, if you don\'t count using backslashes for file paths.

Regarding that ominous 0.699999988079071, that is a close representation of 0.7, as the exact value of 0.7 can not be represented using IEEE 754 double-precision floating-point numbers; again I don\'t see how this would give away any 'decompiling'. I\'d suppose a decompiler would be even more precise, as this is still not the exact value of 0x3FE6666666666666 if you use 64bit-numbers, even if represented as a 32-bit float it would have more significant digits than that.

I\'m not omniscient and certainly not infallible, but I can see nothing in Cephei\'s code that would back up your accusation.

Link to comment
Share on other sites

Well, it was deleted after I reported it. If that isn\'t enough, his code was saved in ASCII, and there are no rounding errors in ASCII, but if compiled, ASCII 0.7 turns into double 0.999999... (I think) and when decompiled by Cephei, it staid 0.999999...

I don\'t have any idea what a (de)compiler does exactly, they only generate machine code and errors for me. And I use the word \'decompiled\' a lot \'cause I have to explain to anyuser what happened with the plugin he needs for his favorite addon (maybe the moderators should at least leave a comment when disintegrating threads, just as a thought).

Link to comment
Share on other sites

Hang tight on this guys; The post was moved to a private forum for review, and I don\'t think a decision has been made. Once it is, something will be made known. Don\'t release any derivative work until then.

Link to comment
Share on other sites

I just want to provide a little 'testimony' as it were:

I haven\'t seen any of the code beyond what\'s been pasted in this thread. However, it seems very likely that this is a case of decompilation.

[list type=decimal]

[li]The headers at the top are indeed indicative of a decompiler. They state plainly that the given code comes from a KSP assembly, and that the current class is a LiquidEngine. Now, it looks like the file has been modified somewhat, but that kind of comment is very typical. (I\'ve done [legal] decompilation as part of my job.)

[/li]

[li]The floating-point roundoff is a strong clue. Here\'s why: compiled code doesn\'t store constants as ASCII characters. It stores them in binary form, so any roundoff error is stored in the assembly. There\'s no way for the decompiler to know whether the original code actually wanted that weird constant or 0.7. In fact, it has no reason to believe the user wanted to represent 0.7, and it doesn\'t make a difference anyway since 0.7 would round to that value anyway. The decompiler represents the number as precisely as it can.[/li]

I\'m not trying to get anyone in trouble here, but from what I see, this is a clear case of decompilation. (I have written about this topic, but for now it\'s disallowed.)

Link to comment
Share on other sites

Thanks for clarifying the situation. My code has moved even more far away from Cepheis today and I wasn\'t release the plugin int the next days because someone else is doing almost the same and we should agree on making one plugin instead of 2. I also thought about sending my code to a developer and ask if I could release that, but for now, I\'ll just wait for this issue to end. Thanks.

Link to comment
Share on other sites

Personally, I\'d much prefer actual documentation, and/or an API part VAB to puzzling everything out by trial and error and parsing other\'s work in any event. I won\'t post anything else regarding custom engine code until this is cleared up, just to avoid making things more confused. The world will just have to wait for my magic broomstick rocket.

Link to comment
Share on other sites

BTW, Kreuzung, if all you want is a working ion engine, just use r4m0n\'s MuMech Variable parts here; that\'s how I do my ions. Or if you\'re intent on making a new plugin, you\'d find it much easier to just derive a part from LiquidEngine and intercept the fuel call with one of your own.

The only reason I\'m going through the exercise of recreating the LiquidEngine class is that Japan has some helo/prop units that were having problems with the rocket engine exhaust 'death ray', and wanted a better solution. And I wanted autorotation/better prop physics eventually.

AFAIK 'Ion' thrusters are generally not something you want thrusting toward your vessel body, so there\'s no real reason to recreate the base class at all.

In short, if you\'re just trying to add, or modify functionality, you can just create a new derived class. I\'m trying to remove functionality, so I need to remake the thing itself.

Link to comment
Share on other sites

Well, it was deleted after I reported it. If that isn\'t enough[...]

Everything else aside, no, for me that isn\'t enough by far. Where I live, there\'s a principle called 'innocent until proven guilty'. When someone is accused of a crime, he may be taken in, but that is not any proof of guilt. Even if the evidence is against him, as long as there is no proof, the accused is to be seen as innocent. Various political groups are constantly trying to undermine these principles (no, I\'m no conspiracy theorist, but I see with concern how stating things like 'these forums are not a democracy, you have no rights here' has a subversive effect in line with that process).

It is my view that basic rights, such as the principle of innocence, or freedom of speech for that matter, must be valid here, too.

If someone thinks of that as off-topic, I think this is exactly the right place and time.

Also, if you have doubts about something, either confront the person openly XOR in private mail, XOR report it to the mods, but then stick to the way you have chosen; unless of course there is no progression. Keep it in the open, XOR keep it in private mail, XOR let the moderators deal with it. But don\'t go around announcing your deeds as if you had rescued the world. Especially if nothing has been proven, and all your evidence are a comment and a debatable representation of a number, and all your proof is that the thread has been hidden from view. I myself have (hand-)written comments strikingly similar to this when I started the first iteration of my plugin, simply to remind me where to look for the stuff I\'d need.

EDIT:

taken out uncalled-for accusation

Link to comment
Share on other sites

Everything else aside, no, for me that isn\'t enough by far. Where I live, there\'s a principle called 'innocent until proven guilty'. When someone is accused of a crime, he may be taken in, but that is not any proof of guilt. Even if the evidence is against him, as long as there is no proof, the accused is to be seen as innocent. Various political groups are constantly trying to undermine these principles (no, I\'m no conspiracy theorist, but I see with concern how stating things like 'these forums are not a democracy, you have no rights here' has a subversive effect in line with that process).

It is my view that basic rights, such as the principle of innocence, or freedom of speech for that matter, must be valid here, too.

If someone thinks of that as off-topic, I think this is exactly the right place and time.

Also, if you have doubts about something, either confront the person openly XOR in private mail, XOR report it to the mods, but then stick to the way you have chosen; unless of course there is no progression. Keep it in the open, XOR keep it in private mail, XOR let the moderators deal with it. But don\'t go around announcing your deeds as if you had rescued the world. Especially if nothing has been proven, and all your evidence are a comment and a debatable representation of a number, and all your proof is that the thread has been hidden from view. I myself have (hand-)written comments strikingly similar to this when I started the first iteration of my plugin, simply to remind me where to look for the stuff I\'d need.

EDIT:

taken out uncalled-for accusation

If he\'s also a U.S. citizen, then yes, he has those rights in court. (That said, I think you misinterpret the burden of proof. It seems the only proof you would accept is footage of him actively performing decompilation. In practice, courts are much more accepting of evidence, because the court is said to do the proving.) While I generally like U.S. law, I don\'t think we can force it upon these forums.

The evidence is pretty clear here. I have serious doubts that you would ever include 'Culture=neutral, PublicKeyToken=null' in a comment designed to remind you where something is from. I have serious doubts that you\'d choose to represent 0.7 as 0.699999988079071 knowing full well that the computer will use the same value for both anyway. I also strongly suspect that if you found the top five most popular .NET decompilers and tried each of them, you could exactly reproduce the offending code.

I do wish the KSP moderators would encourage discussions related to the EULA to happen in the open. I think we can all be thoughtful and reasonable people. I agree, though, that a 'witch hunt' is not something we want.

Link to comment
Share on other sites

I would like to remind people that Squad is a Mexican company and therefore is under Mexican law.

I\'m pretty sure the delay in getting this issue resolved has to do with consulting lawyers. Until we get a ruling, it\'s best if people do not release any code from compiled binaries, regardless of where or how it was obtained.

Cheers!

Capt\'n Skunky

KSP Community Manager

Link to comment
Share on other sites

I\'m a little sorry now that I brought this up in the first place, didn\'t mean to make a huge issue of it. I thought Squad was based from Mexico, which is one of the reasons I was a little concerned to begin with(I have no idea what Mexican law is re: IP); and though the whole thing is more than a little silly, IP rights tend to get serious very quickly.

I\'d suggest just a little patience until Squad can figure out what they want to do about it.

ED: I figured out how to compute the necessary parameters for engine thrust from a reply

the Unity reference, and a little logic(and many failures).

I also figured out how to call the basic fuel request simply by trial and error.

It never occurred to me that there might be a way to peek under the hood at how the game does it until

I never planned on actually using any of Cephei\'s code myself.

I assume I\'m still free to keep working with what I figured out myself, as none of it came from Cephei, or anything we\'re not allowed to do. Capt\'n Skunky\'s reply was just a tad unclear.

Link to comment
Share on other sites

i didn\'t use his code but i made parts for it and looked at his code while trying to learn c# and i\'m kind of freaked whether i\'m getting banned for that, i have no clue whether anything i used in my code goes against the EULA, which is why i stopped working on the coding side of things.

i-have-no-idea-what-im-doing.jpeg

Link to comment
Share on other sites

I highly doubt anyone would ban you for using what everyone assumed was a perfectly legit plugin until very recently. I stopped coding also until this can get sorted out. Kind of wish it would move a little faster, but it\'ll take as long as it takes I guess.

Link to comment
Share on other sites

Well, guys, I believe \'stoppin\' coding\' is not an answer.

I repeat: according to rules currently in effect we are allowed to inspect and use all KSP package members marked as \'public\' and \'protected\'. I\'d recommend verifying your code against that list, ensure that the code does not call anything fishy through Invoke or SendMessage mechanisms -- and then go on.

Link to comment
Share on other sites

That\'s nice. But where exactly are those rules? And is there any kind of documentation yet?

I\'m pretty sure my code is clean then, I know I used neither of those two commands.

Link to comment
Share on other sites

That\'s nice. But where exactly are those rules? And is there any kind of documentation yet?
http://kerbalspaceprogram.com/forum/index.php?topic=8088.0 \'BY THE WAY\' section in the end of the page.

There\'ve been a long discussion (primarily in PM) which concluded that due to lack of documentation exploring public/protected interfaces is necessary for plugin development -- and by no means harms Squad \'cause game implementation is still not exposed. Capt\'n, correct me if I\'m wrong.

BTW I believe EULA should be updated too...

Link to comment
Share on other sites

I will reiterate: Since Squad has yet to post an official position, it\'s best if you keep your work to yourselves for now. Nothing says you can\'t continue to do what you want as far as a personal project. It\'s when you start posting the stuff for download here that we run into murky waters. Until such a time when Squad makes their position known on this, the only prudent move is to just not publish.

I\'m pretty sure the delay has everything to do with waiting on the legal team to hammer out issues and write something that will not only give coders and modders the freedom to create, but will also protect Squad\'s IP and any potential legal issues.

Cheers!

Capt\'n Skunky

KSP Community Manager

Link to comment
Share on other sites

We had a discussion about this in a recent meeting, and the decision was that the current rules are okay for the time being. However, we\'re working towards a better system that balances protecting Squad\'s IP while allowing you guys to access what you need. Discussion is still ongoing, so none of this is final.

To clarify the current rules:

This (the method signature) is okay to look at and discuss:


public int LolAMethodThatDoesThings(Herp derp);

This (the code inside the method, PLUS methods that are private) is NOT to be looked at, discussed, or distributed in any form or fashion:


public int LolAMethodThatDoesThings(Herp derp) { return derp.asNumber/0; }

Link to comment
Share on other sites

And there we have it. That seems pretty straight forward and common sense. Public functions are public, but the code that they run is not.

As I figured though, Squad will be looking at ways to make it easier for you guys to develop for the game while protecting their IP. Quite reasonable if you ask me.

Since this debate has been settled and the rules clarified per N3X15 above, I will lock this thread.

Cheers!

Capt\'n Skunky

KSP Community Manager

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...