Jump to content

Publishing a game


Vulcan
 Share

Recommended Posts

I have been testing how well a C++ project does deploy to end-users. In Leadwerks->Project manager I created an installer (publish). The installer which are created for the game is OK, except it does not include redist files: vcredist and OpenAL runtime.

 

My suggestion is to include a folder "Redist" within the game folder and have it installed while installing the game.

 

If I were to publish a game on Steam, how should I do it? (Let us say I created a C++ project with Leadwerks)

 

Thanks!

  • Upvote 1
Link to comment
Share on other sites

We've had this discussion. Zip packaging and reading is possible with Leadwerks (just not documented).

The discussion, gamecreator is referring to, is http://www.leadwerks.com/werkspace/topic/8659-implement-virtual-filesystem/

 

I second encryption, just to keep out copycats. But doesn't ZIP format support this by default? Password protection as I recall it. Don't know if it is good enough either.

It will work for some script-kiddies but you can't do anything against a skilled hacker (at least I don't know of anything): He could just take all the files from RAM while the game is running.

Link to comment
Share on other sites

We've had this discussion. Zip packaging and reading is possible with Leadwerks (just not documented).

 

I really would like some "Publish zipped" button, easy for all people, assets protected a minimum from all non crackers people instead of full visible textures and models inside folders.

Stop toying and make games

Link to comment
Share on other sites

I think the world is heading more and more towards an open-source model... And about time too. I'd rather have a thriving modding community than have my work locked up inside a fortress of concrete and steel. But that's just me. :)

Ubuntu 14.04 / 64bit. Dell XPS430, Intel Core 2 Quad Q8300 @ 2.50GHz, 4Gb Ram, Radeon HD 6670, Leadwerks Pro edition (Steam).

Link to comment
Share on other sites

  • 2 months later...

Without some ecnrypted game publishing functionnality, no one using LE3 Steam edition (Lua only) is able to publish a game.

This feature should be a priority, or it seems no one using Lua Steam is considering this version for serious game creation and publishing.

Stop toying and make games

Link to comment
Share on other sites

I am pretty bummed about this because I purchase all my models and per their licenses I need to password protect them. I've had a few demo's I've wanted to share but I can't because of this. That being said I'm not really sure how we would go about doing it in Lua. I think I might have to purchase that 3rd party app that puts everything into an exe.

Link to comment
Share on other sites

i guess you could compile your own exe with the zip + password function included.

Steam Lua LE3 users don't have access to C++ LE3 version.

 

I think I might have to purchase that 3rd party app that puts everything into an exe.

If you will try , tell us if it works without any problem :)

Seems the only possible alternative for LE3 Steam Lua version users if it would work.

Stop toying and make games

Link to comment
Share on other sites

If you have the c++ version, you can easily build a basic protection for lua based games.

 

Here is a quick example, compress all your assets folders with a password and rename them as .dat files.

 

In main.cpp

 

Find this and change into something like this

 

		 std::string file = dir->files[i];
	 if (Leadwerks::String::Lower(Leadwerks::FileSystem::ExtractExt(file))=="dat")
	 {
		 Leadwerks::Package::Load(file,"password");
	 }

 

Here is a App.cpp for lua execution of App.lua

 


#include "App.h"

using namespace Leadwerks;

App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}

App::~App() { delete world; delete window; }

Vec3 camerarotation;
#if defined (PLATFORM_WINDOWS) || defined (PLATFORM_MACOS)
bool freelookmode = true;
#else
bool freelookmode = false;
#endif

bool App::Start()
{
   int stacksize = Interpreter::GetStackSize();

   //Get the global error handler function
   int errorfunctionindex = 0;
#ifdef DEBUG
   Interpreter::GetGlobal("LuaErrorHandler");
   errorfunctionindex = Interpreter::GetStackSize();
#endif

   //Create new table and assign it to the global variable "App"
   Interpreter::NewTable();
   Interpreter::SetGlobal("App");

   //Invoke the start script
   if (!Interpreter::ExecuteFile("Scripts/App.lua"))
   {
       System::Print("Error: Failed to execute script \"Scripts/App.lua\".");
       return false;
   }

   //Call the App:Start() function
   Interpreter::GetGlobal("App");
   if (Interpreter::IsTable())
   {
       Interpreter::PushString("Start");
       Interpreter::GetTable();
       if (Interpreter::IsFunction())
       {
           Interpreter::PushValue(-2);//Push the app table onto the stack as "self"
#ifdef DEBUG
           errorfunctionindex = -(Interpreter::GetStackSize() - errorfunctionindex + 1);
#endif
           if (!Interpreter::Invoke(1, 1, errorfunctionindex)) return false;
           if (Interpreter::IsBool())
           {
               if (!Interpreter::ToBool()) return false;
           }
           else
           {
               return false;
           }
       }
   }

   //Restore the stack size
   Interpreter::SetStackSize(stacksize);


   return true;
}



bool App::Loop()
{
   //Get the stack size
   int stacksize = Interpreter::GetStackSize();

   //Get the global error handler function
   int errorfunctionindex = 0;
#ifdef DEBUG
   Interpreter::GetGlobal("LuaErrorHandler");
   errorfunctionindex = Interpreter::GetStackSize();
#endif

   //Call the App:Start() function
   Interpreter::GetGlobal("App");
   if (Interpreter::IsTable())
   {
       Interpreter::PushString("Loop");
       Interpreter::GetTable();
       if (Interpreter::IsFunction())
       {
           Interpreter::PushValue(-2);//Push the app table onto the stack as "self"
#ifdef DEBUG
           errorfunctionindex = -(Interpreter::GetStackSize() - errorfunctionindex + 1);
#endif
           if (!Interpreter::Invoke(1, 1, errorfunctionindex))
           {
               System::Print("Error: Script function App:Loop() was not successfully invoked.");
               Interpreter::SetStackSize(stacksize);
               return false;
           }
           if (Interpreter::IsBool())
           {
               if (!Interpreter::ToBool())
               {
                   Interpreter::SetStackSize(stacksize);
                   return false;
               }
           }
           else
           {
               Interpreter::SetStackSize(stacksize);
               return false;
           }
       }
       else
       {
           System::Print("Error: App:Loop() function not found.");
           Interpreter::SetStackSize(stacksize);
           return false;
       }
   }
   else
   {
       System::Print("Error: App table not found.");
       Interpreter::SetStackSize(stacksize);
       return false;
   }

   //Restore the stack size
   Interpreter::SetStackSize(stacksize);

   return true;
}



HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

It should be possible to create a lua lib that that can do the above for you

 

[/size]
require("libLua-cryptloader")
cryptloader:LoadDir("Data/","password");

 

ofcourse you'd need to obfuscate the password a bit ;)

  • Upvote 2

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

If you have the c++ version, you can easily build a basic protection for lua based games.

Again i talked about all non C++ users, Lua only users that can't do anything, i suppose we are only too few people asking that feature.

 

Rick talked about some program that compact your game project in one exe file , that could be a good solution.

Stop toying and make games

Link to comment
Share on other sites

It should be possible to create a lua lib that that can do the above for you

 

[/size]
require("libLua-cryptloader")
cryptloader:LoadDir("Data/","password");

 

ofcourse you'd need to obfuscate the password a bit wink.png

 

Managed to write and build a shared lib to do just this before I remebered that the linux version cannot load it yet and I've no way of compiling it on windows... oh well later ^^

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

 

Again i talked about all non C++ users, Lua only users that can't do anything, i suppose we are only too few people asking that feature.

 

Rick talked about some program that compact your game project in one exe file , that could be a good solution.

 

Or have a cpp user just build you a executable with a password of your choosing if you are publishing or want to test.

Ofcource they would have to know the password.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Or have a cpp user just build you a executable with a password of your choosing if you are publishing or want to test.

Ofcource they would have to know the password.

Well , yep i would not want to share password specially for a commercial game.

Until it would become incorporated in the editor, non C++ Lua users have one solution only that is to buy a program making some exe file from your project like Rick suggested.

  • Upvote 1

Stop toying and make games

Link to comment
Share on other sites

A lib for Lua would be nice as it would meet most 3rd party purchased licenses. There is no real way to protect the password however. http://en.wikipedia.org/wiki/Security_through_obscurity but that's not really a big issue (for me anyway). Hell I can open up all of World Of Warcrafts models as there is no pw protection there. A lot of AAA games these days aren't protecting their assets because it's pointless as it'll just be hacked once it's on the client side anyway. Delaying anything is pointless. Even with the password in the exe it can easily be found but if the 3rd party artists think it can be protected with a password zip file then so be it smile.png

 

I don't think loading libs for a sandboxed game is possible and I think that's what the leadwerks game player can only use and that's the easiest way to get people to check the game out. That rules out custom C++ build too as the game player seems to run it's own exe. It would be nice to have this built into the editor like DerRidda says. Even if it's not the most secure it'll be something.

Link to comment
Share on other sites

I don't think loading libs for a sandboxed game is possible and I think that's what the leadwerks game player can only use and that's the easiest way to get people to check the game out. That rules out custom C++ build too as the game player seems to run it's own exe. It would be nice to have this built into the editor like DerRidda says. Even if it's not the most secure it'll be something.

 

That same would be true of gui's - unless you fancy writing a complete gui manager in lua you will be using an external lib.

 

But it may be a moot point as I just noticed that there was no .so emitted from my build, instead I got;

 

/usr/bin/ld: /home/morten/.local/share/Steam/SteamApps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a(Package.o): relocation R_X86_64_32S against `_ZTVN9Leadwerks7PackageE' can not be used when making a shared object; recompile with -fPIC
/home/morten/.local/share/Steam/SteamApps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

 

had hoped that I could depend on getting the symbols from the executable running the lua instance, seems not :(

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...