Author Topic: Releasing partly obfuscated code  (Read 23792 times)

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Releasing partly obfuscated code
« on: July 06, 2013, 02:40:46 PM »
There is always the question of going opensource or not. There are arguments against (of course they are debatable):
- keeping secrets of the game from source divers
- stopping people from making unwanted variants
- having the option to make income from the game in the future
and for:
- attracting contributors
- portability
- higher chance of building a community (?)

I was wondering why not obfuscate parts of the code that you are most worried about, and distribute that. I think you get best of both worlds. You can hide your secret AI stuff, game plot or other logic, while letting people work on improving UI, porting etc. What do you think?
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Releasing partly obfuscated code
« Reply #1 on: July 06, 2013, 03:56:38 PM »
I can't speak for everyone, but I don't open source because my code is me.  Most people I think care about the personal nature of the produced code more than the hypothetical benefits that you speak of.  I'd rather have worse code that is all me than better code that is partially not me.  But everyone has different reasons for why they write code, naturally.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: Releasing partly obfuscated code
« Reply #2 on: July 06, 2013, 04:00:00 PM »
I totally understand you. But then you could release your code completely obfuscated, and at least let people compile it on their platforms.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

daver64

  • Newcomer
  • Posts: 16
  • Karma: +0/-0
    • View Profile
    • Indigo
    • Email
Re: Releasing partly obfuscated code
« Reply #3 on: July 06, 2013, 11:10:37 PM »
Obfuscation won't stop someone from figuring out how the code works. If you don't want people figuring it out then the only option is not to release it open sourced ( but even then someone *really* determined can figure it out from the assembler ).

It's actually arguably the worst of both worlds.

mrrstark

  • Rogueliker
  • ***
  • Posts: 66
  • Karma: +0/-0
    • View Profile
Re: Releasing partly obfuscated code
« Reply #4 on: July 07, 2013, 03:14:05 AM »
what kind of obfuscation?
questionable naming conventions?
oddly commented code?
devious threading?


...?

Unless you release closed source, what is the point of obfuscation?

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: Releasing partly obfuscated code
« Reply #5 on: July 07, 2013, 06:01:05 AM »
I think you guys haven't seen well obfuscated code, it's as easy to read as a binary, and no way of converting it back. Of course there are tools to do it.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

Trystan

  • Rogueliker
  • ***
  • Posts: 164
  • Karma: +0/-0
    • View Profile
    • my blog
Re: Releasing partly obfuscated code
« Reply #6 on: July 07, 2013, 07:55:10 PM »
It's actually arguably the worst of both worlds.

Yup.

If you want some parts to be open source and some parts to be closed source, then why not release some parts as open source and other parts as closed source? If you make open source code that's intentionally hard to understand then you have the costs of open source and none of the benefits and it would just take a few people some time to refactor it into something that could be understood.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Releasing partly obfuscated code
« Reply #7 on: July 08, 2013, 05:42:28 AM »
I think you guys haven't seen well obfuscated code, it's as easy to read as a binary, and no way of converting it back. Of course there are tools to do it.

Like this?

Code: [Select]
#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#\
;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
}'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
  :0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

Believe me or not, there are people who translate stuff like this into plain C within several minutes. Of course, there aren't too many of such people, but releasing closed source has its magic and to numerous developers this is much more important than "better portability" (wow, they have compiled my game to Amstrad CPC, this is so cool, I'm gonna piss my pants! :P).
Fame (Untitled) - my game. Everything is a roguelike.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Releasing partly obfuscated code
« Reply #8 on: July 08, 2013, 09:55:42 AM »
while letting people work on improving UI, porting etc.

Like that's going to happen. You first need a Nethack level game to get people involved in any way.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: Releasing partly obfuscated code
« Reply #9 on: July 08, 2013, 11:01:04 AM »
Really? I've done two small opensource projects before, and both had people involved fairly quickly.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

Endorya

  • Rogueliker
  • ***
  • Posts: 513
  • Karma: +0/-0
  • The non-purist roguelike lover
    • View Profile
    • Email
Re: Releasing partly obfuscated code
« Reply #10 on: July 12, 2013, 08:24:34 AM »
In my case things are different. Though my project will be closed-source, people will still be able to modify it through the editor that will be available for download. In fact, people will be able to build their own world setting with it. Of course the editor will not offer the same flexibility of changing code directly but it will let people add, change and remove pretty much all of its core functionalily. This includes attributes, formulas and a shit load of many other things.

The editor also adds one major advantage over an open-source project without an editor, it allows everyone to change a game without needing coding skills, which I believe that will capture the attention of more people. But hey! I've been wrong before.

In a distant future and if everything goes well, I plan even to let the user to edit the game engine itself so you can change, remove and even add your own functions into it.
« Last Edit: July 12, 2013, 08:39:03 AM by Endorya »
"You are never alone. Death is always near watching you."

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Releasing partly obfuscated code
« Reply #11 on: July 12, 2013, 08:49:12 AM »
In my case things are different. Though my project will be closed-source, people will still be able to modify it through the editor that will be available for download. In fact, people will be able to build their own world setting with it. Of course the editor will not offer the same flexibility of changing code directly but it will let people add, change and remove pretty much all of its core functionalily.

So you are giving up biggest advantages of open source (ability to contribute, portability) while preserving the biggest disadvantages (revealing game's secrets, allowing forks). Interesting.
Fame (Untitled) - my game. Everything is a roguelike.

Endorya

  • Rogueliker
  • ***
  • Posts: 513
  • Karma: +0/-0
  • The non-purist roguelike lover
    • View Profile
    • Email
Re: Releasing partly obfuscated code
« Reply #12 on: July 12, 2013, 10:44:04 AM »
So you are giving up biggest advantages of open source (ability to contribute, portability)...

I don't think contribution is something exclusively done though coding. Regarding portability, since the project is being coded in C# it means that it will be available also for Linux and mac. So it will be able to run on the 3 major platforms. But yes, you won't be able to port it to anything else like Android and IOS, life isn't fair, we all know that.

while preserving the biggest disadvantages (revealing game's secrets, allowing forks). Interesting.
You mean like having anyone accessing the source-code to dig out its secrets? I do tend to miss on purpose movie-trailers that might be related to something I might be fond of, just to make sure I don't get spoiled in any way. Some people enjoy playing in cheat-mode others don't. It is their decision on how hardly they wish to be spoiled during their adventure.

Anyway the editor itself is mainly for contributors. I'm glad you find all this interesting which is always something good. (Yeah, anyone can use sarcasm. But is it something useful? Well, it does tend to add more words in a text)

PS: I'm just really glad people can conduct their own projects the way they want.
« Last Edit: July 12, 2013, 11:33:29 AM by Endorya »
"You are never alone. Death is always near watching you."

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Releasing partly obfuscated code
« Reply #13 on: July 12, 2013, 11:29:25 AM »
I don't think contribution is something exclusively done though coding. Regarding portability, since the project is being coded in C# it means that it will be available also for Linux and mac. So it will be able to run on the 3 major platforms. But yes, you won't be able to port it to to Android and IOS, life isn't fair, we all know that.

Yes, mobile platforms were on my mind. Not a great loss for me as no roguelike game could possibly run on my ancient phone, but there are more and more players with Android and stuff like that, so...

You are totally right about contribution, but should you abandon the project, either temporarily or permanently, your contributors would not be able to develop it anymore without access to the closed part - this is what I meant (recently discussed in another topic, by the way:
http://forums.roguetemple.com/index.php?topic=3483.msg29323#msg29323 ).

Quote
You mean like having anyone accessing the source-code to dig out its secrets? I do tend to miss on purpose movie-trailers that might be related to something I might be fond of, just to make sure I don't get spoiled in any way. Some people enjoy playing in cheat-mode others don't. It is their decision on how hardly their wish to be spoiled during their adventure.

Of course. But releasing the source code (or any part of it, or even your non-code data files) greatly increases chances that you will get involuntarily spoiled in the nastiest way. If a game is popular enough, once the spoilers leak out, they're virtually everywhere unless you cut off your internet cable.

Quote
(Yeah, anyone can use sarcasm. But is it something useful? Well, it does tend to add more words in a text)

That wasn't a sarcasm. OK, maybe that was a *little* sarcastic. But actually I'd love to see how your editor will do. Perhaps I'll be able to steal an idea or two for my own tools :).

Fame (Untitled) - my game. Everything is a roguelike.

Endorya

  • Rogueliker
  • ***
  • Posts: 513
  • Karma: +0/-0
  • The non-purist roguelike lover
    • View Profile
    • Email
Re: Releasing partly obfuscated code
« Reply #14 on: July 12, 2013, 11:39:56 AM »
(...)should you abandon the project, either temporarily or permanently, your contributors would not be able to develop it anymore without access to the closed part - this is what I meant (recently discussed in another topic, by the way:
http://forums.roguetemple.com/index.php?topic=3483.msg29323#msg29323 ).
If I loose interest in the project for good, I will definitely upload its source so people can use it at will. This is something I really doubt it will happen though, because this is my life's project, under development for 7 years now.

That wasn't a sarcasm. OK, maybe that was a *little* sarcastic. But actually I'd love to see how your editor will do. Perhaps I'll be able to steal an idea or two for my own tools :).

Sure. I've stolen so many ideas myself already. The roguelike concept in which we base our projects on, is itself a "stolen" idea  8). Any way, it would make me happy to know that my work actually helped someone or that influenced anyone on their own projects.

More power to game creators!
« Last Edit: July 12, 2013, 11:44:52 AM by Endorya »
"You are never alone. Death is always near watching you."