Jump to content
Vulcan

Publishing a game

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!

Share this post


Link to post

Another suggestion to publishing : Zip packaging of ressources, some Lua files and encrypted at least.

Actually even some demo published , all your 3D art and code is visible :(

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

I would also suggest to add install option of desktop shortcut (at least on windows). Also there is no uninstall (Control Panel->Uninstall a program).

Share this post


Link to post
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.

Share this post


Link to post

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. :)

Share this post


Link to post

As long as people can still get paid that's cool with me. Everyone has to eat.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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

(best not in cleartext in a variable as that makes it really easy to read)

 

and use your lua project with that.

Share this post


Link to post
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.

Share this post


Link to post

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;
}



Share this post


Link to post

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 ;)

Share this post


Link to post

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.

Share this post


Link to post

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 ^^

Share this post


Link to post

 

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.

Share this post


Link to post
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.

Share this post


Link to post

This should really be built into the editor if it is that much of a standard requirement to protect purchased assets.

Share this post


Link to post

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.

Share this post


Link to post

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 :(

Share this post


Link to post

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.

 

I do. Aggror is also. It won't be complete but enough for things I would need and build on as I go.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...