Author Topic: Pixel Dungeon source code  (Read 29567 times)

watabou

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
    • Pixel Dungeon
    • Email
Pixel Dungeon source code
« on: July 29, 2014, 02:23:13 PM »
Hopefully, it will be useful for someone:
https://github.com/watabou/pixel-dungeon

There is nothing special in the code, I guess, and the style is too far from perfect, but it works :)

Short game info:
Quote
Pixel Dungeon is a traditional roguelike game with pixel-art graphics and simple interface for Android.

The game itself is available on Google Play:
https://play.google.com/store/apps/details?id=com.watabou.pixeldungeon

reaver

  • Rogueliker
  • ***
  • Posts: 207
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #1 on: July 29, 2014, 02:52:30 PM »
Cool, thanks!

Eben

  • Rogueliker
  • ***
  • Posts: 339
  • Karma: +0/-0
  • Controversializer
    • View Profile
    • SquidPony!
Re: Pixel Dungeon source code
« Reply #2 on: July 31, 2014, 08:31:08 AM »
nice, although as usual I wish it wasn't GPL so I could grab the interesting bits for my library

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #3 on: July 31, 2014, 03:27:51 PM »
What licensing do you require for your library? 

'Cos, honestly, GPL usually allows that sort of thing - and if not, most of the people who'd put something under GPL will cheerfully give you explicit permission to relicense, as long as you're not trying to lock something up so nobody else can do what you did with it.

watabou

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
    • Pixel Dungeon
    • Email
Re: Pixel Dungeon source code
« Reply #4 on: July 31, 2014, 07:52:47 PM »
What licensing do you require for your library? 

'Cos, honestly, GPL usually allows that sort of thing - and if not, most of the people who'd put something under GPL will cheerfully give you explicit permission to relicense, as long as you're not trying to lock something up so nobody else can do what you did with it.

Exactly!

chooseusername

  • Rogueliker
  • ***
  • Posts: 329
  • Karma: +0/-0
    • View Profile
    • Email
Re: Pixel Dungeon source code
« Reply #5 on: August 01, 2014, 09:36:41 AM »
What licensing do you require for your library? 

'Cos, honestly, GPL usually allows that sort of thing - and if not, most of the people who'd put something under GPL will cheerfully give you explicit permission to relicense, as long as you're not trying to lock something up so nobody else can do what you did with it.
This is disingenuous and misleading.  The GPL is well known as a viral licence.  It's viral nature is the forced requirement to release any code in turn, which touches the GPL licensed code.  You do not need to necessarily license your touching code as GPL, as long as you make it available.  There is no need to relicense, except if you wish to avoid this viral requirement to release your own code.  In what way can someone relicense if you get the GPL nature whether you relicense or not?

It is unfortunate that the proponents of the GPL misrepresent it, with nothing speak like this.

chooseusername

  • Rogueliker
  • ***
  • Posts: 329
  • Karma: +0/-0
    • View Profile
    • Email
Re: Pixel Dungeon source code
« Reply #6 on: August 01, 2014, 09:37:47 AM »
What licensing do you require for your library? 

'Cos, honestly, GPL usually allows that sort of thing - and if not, most of the people who'd put something under GPL will cheerfully give you explicit permission to relicense, as long as you're not trying to lock something up so nobody else can do what you did with it.

Exactly!
Exactly what?

Omnivore

  • Rogueliker
  • ***
  • Posts: 154
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #7 on: August 01, 2014, 04:21:02 PM »
It is unfortunate that the proponents of the GPL misrepresent it, with nothing speak like this.

Biting off a large chunk aren't you?  It is obvious you don't like GPL, however, some of us do not like giving away the fruits of our labor so that others may profit without giving something back to the community.

When I license something as GPL, I *intend* it to be viral.

However, the authors of source code released under GPL, may at their discretion, re-release that same source code under any licensing they choose.  If a library you want to use is under GPL, I suggest you contact the author directly and negotiate for the license of your choice. 
« Last Edit: August 01, 2014, 04:59:33 PM by Omnivore »

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #8 on: August 01, 2014, 05:58:07 PM »
I get where you're coming from, honestly.  I'm even sort-of in the same boat, in terms of not using GPL code in my project either.  I guess the main difference is that I have absolutely no problem with the existence of a whole boatload of code that doesn't fit in my project and you do.  I want the right to use any license I choose to, and therefore it behooves me to respect that choice without complaint when others make it.

There is nothing wrong with wanting to do something that won't allow you to use GPL code.  I am not using GPL code in the roguelike game, because GPL would allow someone else to "take over" development without my cooperation and I want to retain artistic control over what content goes into the official version of the game. 

That said, I don't have any problem at all with someone reusing my code.  I just don't want people introducing overpowered crap that will screw up game balance or design, and in doing so pretending to be a later, presumed "improved", version of the same game.  If they make a game with different content, I want them to be required to identify it as a different game.

So I picked the Artistic License instead of GPL.  People can copy the code, use it, change it, build new stuff on it, whatever -- but they can't release a changed version or derived work pretending to be a later version or continuation of my development.  If they want to release something based on my code, it cannot continue to use my project name.

Not using GPL code in my project (because it won't allow me to relicense it under the Artistic License) means I have free access to all the public-domain code that people posted and released in rgrd, free access to all the LGPL code like standard libraries, compilers, etc, and although I haven't searched for it, I suppose there is other Artistic-License code out there that I could use at will if it seems appropriate. 

That's enough.  The people who really wanted a copyleft on their code weren't writing it for my use, and I respect that.  That was their right, they exercised it, and it is a point of pride, not to mention the right thing to do, to honor and abide by that decision.  I want the power to make that same decision myself, and have others abide by my choice in copyright.  I'm sure as HELL not going to gripe about the choices others made. 


Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #9 on: August 01, 2014, 07:43:23 PM »
Anyway, getting distracted here. 

The main reason to ask what licensing you require for your library, is to see if I can make contributions.  As I mentioned in the last post, I have a bunch of code I've written which is more or less free for reuse as far as I'm concerned, and doesn't have any copyleft. Putting it in a library, completely away from the game content I want to protect, would satisfy me that it won't be used to hijack creative control over my game content.  So.... 

Seriously, what do you need?


Eben

  • Rogueliker
  • ***
  • Posts: 339
  • Karma: +0/-0
  • Controversializer
    • View Profile
    • SquidPony!
Re: Pixel Dungeon source code
« Reply #10 on: August 01, 2014, 08:38:39 PM »
Anyway, getting distracted here. 

The main reason to ask what licensing you require for your library, is to see if I can make contributions.  As I mentioned in the last post, I have a bunch of code I've written which is more or less free for reuse as far as I'm concerned, and doesn't have any copyleft. Putting it in a library, completely away from the game content I want to protect, would satisfy me that it won't be used to hijack creative control over my game content.  So.... 

Seriously, what do you need?

I need Apache 2.0 or compatible.

I do it that way so that people can port parts of my library to other languages without having to go GPL on their project. LGPL isn't appropriate for me because I want people to freely change and use my code, not just use the library itself.

As an example, if Blacken took my code for sizing to arbitrary fonts and put in their project, I think that would be really cool even though it's a "competing" project. The reverse of that is that when Blacken went Apache 2.0 (right before it became unmaintained) I was able to use some bits of it that were better than my equivalents.

The biggest problem with GPL license for me isn't even that I can't use the code in my non-GPL project. It's that because I can't use the code it's dangerous for me to even look at the code and risk re-implementing something that turns out to be similar enough that someone thinks I ripped it off against the license. So I end up not even looking at the code and potentially missing out on some good ideas regardless of the usefulness of the code itself.

My understanding is that if an author gives me permission to use their GPL code in my Apache 2.0 project, that code is then Apache 2.0 forever and they might as well have not made it GPL to start with. I understand why you'd want your game code in GPL though, especially for a game as popular as Pixel Dungeon. And it's a pain to try to maintain just the "library" sections in a BSD-style and the "game" sections in GPL if you're not planning that from the start.

I wish there was a license that was "Anyone may use this code freely but has to give me credit. And if they make a lot of money off it they have to give me some." But that's basically not possible :)

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #11 on: August 02, 2014, 07:52:43 AM »
Well, as I understand it you can suck essentially anything that's licensed under Artistic License into an Apache-licensed project (it's compatible -- you can relicense under Apache, in the context of a different project, without infringing Artistic).  Further, just in case anyone disagrees, I have no problem contributing stuff I've written (and am otherwise licensing with Artistic License) for an Apache-licensed library.  So I'll say again.... 

What is it, specifically, that your library needs?


Eben

  • Rogueliker
  • ***
  • Posts: 339
  • Karma: +0/-0
  • Controversializer
    • View Profile
    • SquidPony!
Re: Pixel Dungeon source code
« Reply #12 on: August 03, 2014, 07:56:11 PM »
Well, as I understand it you can suck essentially anything that's licensed under Artistic License into an Apache-licensed project (it's compatible -- you can relicense under Apache, in the context of a different project, without infringing Artistic).  Further, just in case anyone disagrees, I have no problem contributing stuff I've written (and am otherwise licensing with Artistic License) for an Apache-licensed library.  So I'll say again.... 

What is it, specifically, that your library needs?

Do you mean what does it need in terms of functionality?

Artistic License (or more specifically the Clarified or 2.0 versions) is perfectly fine as far as me using code in my lib. Pixel Dungeon and its supporting library are both GPL, which is what I thought we were talking about with the "what my library needs" question.

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Pixel Dungeon source code
« Reply #13 on: August 04, 2014, 06:20:31 AM »
If you had said that you needed pathfinding code - for example - I could have sent you a library of C routines that implement A-Star, Sight-gradient pathfinding, and Breadth-first search pathfinding, all licensed under the Artistic License.  If you had said you needed an implementation of poison, with damage over time, antidotes, a 'cure poison' spell and a 'slow poison' spell ... well, I'd have kept you in mind for when I finish what I'm planning to work on a week or two from now.

Why should we have gone on talking about Pixel Dungeon if we've already determined that it isn't what you want?  I'm asking what code functionality you would like to add to your library, If you can find it under a license that suits your needs.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Pixel Dungeon source code
« Reply #14 on: August 04, 2014, 07:51:51 AM »
It's that because I can't use the code it's dangerous for me to even look at the code and risk re-implementing something that turns out to be similar enough that someone thinks I ripped it off against the license.

That's quite funny, because all possible algorithms have been implemented under all possible licenses. But maybe it's like that in US where people copyright and patent everything starting from smileys and blinking cursors.

Btw, I was looking at one source file of Pixel Dungeon. It has magic numbers all over the place (I think it was the dungeon generator or something like that). I wonder if the rest of the source code is equally bad.