Jump to content
  • Advertisement

C# C# Game and Security/Source access

Recommended Posts

To set the tone of my question, I'm currently working on a game made entirely in C#, all my own doing except the various third party libraries that it is built on, no engines. I don't know if I'll finish, or if it would be even remotely successful if I did finish but I would obviously like it to be.

I'm currently adding some support for scripting to the game to clean up logic and make my life easier, I'm using C# for scripting because why not? and loading code files that fit an interface class and compiling them at runtime and then I run the object as a script, it works nicely.

As I have been extending the scripting capabilities I have been thinking about the interfaces that I am exposing and how to separate the user scripts, the scripting system and the core of the game to create a clean system, easy to use, simple and secure... By secure I mean hiding my core game code and logic from those who might have nefarious intentions, like cheating or ripping off my ideas (I know, I know but I cant get it out of my head.). I have started to realise, c# reflection is going to open up all of my code and people can just decompile the whole thing anyway.

I think I already know the answer, "focus on making a game", but should I be taking anything into consideration with regards to security in this manner. Any styles of programming, techniques or technologies that I should be considering or relevant discussions I should be aware of. Or just give me some reassurance that I should be getting on with things.

Share this post

Link to post
Share on other sites

There is no architecture, code pattern, design trick, compiler setting, or any other flavor of magic that can deter a serious reverse engineering attempt. You run the risk of making it more fun for the attacker if you get overly clever; they'll just be that much happier to defeat your protections.

If I were you I would think the opposite direction. Instead of trying to hamper efforts at using your code, go for broke. Publish the code (not the assets!) for free. Encourage modding and user scripting. Encourage people to break the game in entertaining ways. A popular YouTube video of your game glitching in a funny manner is worth quite a bit in terms of exposure and awareness.

I know a lot of people will say this is defeatist or whatever. But it isn't. Trying to lick a bonfire to death is a bad idea; nobody says it's defeatist to reach for a different approach. Choosing your battles is a vital skill. Think of it like judo - redirect the energy of "security" into making a great game that people love. Yes, there's still a risk you will get burned. That is always true of any creative effort.

Share this post

Link to post
Share on other sites

This is helpful, thanks! pretty much what I was thinking just needed to get another perspective and some reassurance to get me going again.


Its very easy to get distracted from the core goal, which is making a game.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!