Page 1 of 1

AI licence issue, reuse of other AI's code

Posted: 23 Jun 2011 09:48
by zupa
Hi,
I'm developing new AI. I've reused few classes from other AIs (mainly from PathZilla by Zutty, Graph related classes - it's so good that rewriting it from scratch would be just stupidity). According to GPL I understood it's allowed. I would like to ask what header I should put at the beginning of the file to satisfy all GPLv2 requirements and author's orginal property. In orginal PathZilla it is:
/*
* Copyright © 2008 George Weller
*
* This file is part of PathZilla.
*
* PathZilla is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* PathZilla is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PathZilla. If not, see <http://www.gnu.org/licenses/>.
*
* [... file description ...]
*
* Author: George Weller (Zutty)
* Created: 15/06/2008
* Version: 1.2
*/
How should it look like in my new AI? Should I keep "Copyright notice"? What should I add? How to state my contributions if I've made some changes?

Re: AI licence issue, reuse of other AI's code

Posted: 23 Jun 2011 10:59
by planetmaker
The only really important thing is that you keep the attribution and make clear to which parts it belongs.

§1 of the GPL specifies that you need to keep license statements as they are, but it refers to unmodified source code distributions. §2 deals with source modifications and only requires clear attribution.

I'd probably go for a thing like
/*
* Copyright (c) 2011 planetmaker
* Additionally:: pathfinding and graph classes are taken from PathZilla v1.2:
* Copyright © 2008 George Weller
*
*
* This file is part of MyAI
*
* MyAI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* PathZilla is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MyAI. If not, see <http://www.gnu.org/licenses/>.
*
* [... file description ...]
*
* Author: MyName (MyNickName)
* Created: 23/06/2011
* Version: 0.0.0.0.0.0.0.1-alpha1
*/
Not entirely sure whether required, but definitely nice: Mention that some of the AI is based on work by Zutty also in the readme

As a general rule: it simply has to be mentioned and made clear which parts are (originally) authored by other people. As long as that is clear and the license is ok (which it is when all sources use GPL), you're unlikely to have any problems :-)

Re: AI licence issue, reuse of other AI's code

Posted: 23 Jun 2011 11:31
by zupa
Thanks for a hint. I'll keep it like you suggested.
And what in the case if I reuse just a single function/method (e.g. from SimpleAI) in my code? If I keep the notice in the comment of this particular function where is it from and who wrote it is it OK? Or should I also state it in the header?

Sorry for stupid questions, but I've never released anything under GPL and it's quite hard to find any "practical" information how to do things right.

Re: AI licence issue, reuse of other AI's code

Posted: 24 Jun 2011 12:40
by planetmaker
zupa wrote: And what in the case if I reuse just a single function/method (e.g. from SimpleAI) in my code?
IMHO, yes. Putting the credits / origin in a comment above that function will do. Of course you also want to mention this in the credits in the readme ;-) An example of how the credits for such "puzzled" code could look like is found in OpenGFX+ Airports' readme: http://dev.openttdcoop.org/projects/air ... .ptxt#L196 (there the credits are mostly not in the image files themselves, though, but "just" in this readme)

But then... I'm not a lawyer :-)