Compile Mission files
by Howard Dortch · in Torque Game Engine · 07/21/2008 (5:48 am) · 17 replies
Most all of the editable files in torque are compiled to *.dso files so we can remove the *.cs file and the user can't edit them.
I noticed there is no such thing for the mission.mis files. Is there a mechanism to compile the *.mis files and ship only mission.dso ?
I noticed there is no such thing for the mission.mis files. Is there a mechanism to compile the *.mis files and ship only mission.dso ?
#2
09/08/2008 (10:29 am)
I think if you manually do compile("blabla.mis") it can be compiled.
#3
09/08/2008 (4:41 pm)
It compiles to a dso file but the engine wont load it. I guess the engine is looking for text. Anyone able to hide the mission files ? Alter the engine to read a compiled file ?
#4
09/08/2008 (7:39 pm)
The reason the engine wont load it(I think?) is because even if you are trying to load a .dso, you still need to exec the .cs file(Right? idk its been awhile) so simply rename your mission files to .cs(and make sure to change it so your game trys to load the .cs, once it notices the .cs is gone it should go for the .dso instead, Maybe...maybe not. Try it out)
#5
You mean something like that doesn't work? Keep in mind, you will want to make a backup of your mission before running that '-)
09/09/2008 (12:29 am)
function buildShippingMission()
{
compile( "mission.mis" );
fileDelete( "mission.mis" );
exec( "mission.mis.dso" );
}You mean something like that doesn't work? Keep in mind, you will want to make a backup of your mission before running that '-)
#6
09/16/2008 (6:25 am)
None of these suggestions work. When createServer() is called it wants a mission file not a dso. Trying to load the mission looks for actual text in the mission file and only finds compiled version. So no go here. How do any of you protect the missions when you send out a game? Do I have to rewrite that part of the engine ?
#7
Most of us don't. Especially not MOD-friendly developers, or developers who understand that protecting something like this with anything other than simple obfuscation is a waste of time.
There's no need to rewrite anything. Torque was made with MOD's in mind, however, reading a compiled script file should be trivial enough. If createServer() expects non-binary data, then modify it so it doesn't care, and execute the compiled script afterwards. After all, mission files are just script files that add objects into an already created GameConnection.
09/16/2008 (8:07 am)
Quote:
How do any of you protect the missions when you send out a game?
Most of us don't. Especially not MOD-friendly developers, or developers who understand that protecting something like this with anything other than simple obfuscation is a waste of time.
Quote:
Do I have to rewrite that part of the engine ?
There's no need to rewrite anything. Torque was made with MOD's in mind, however, reading a compiled script file should be trivial enough. If createServer() expects non-binary data, then modify it so it doesn't care, and execute the compiled script afterwards. After all, mission files are just script files that add objects into an already created GameConnection.
#8
Thats why I found your intro to the solution very handy, as there will be many times where we dont want the player touching the missions (campaigns, not moddeable games, tournament maps...). Although not necessarily as a perfect 'security meassure', it is still a tool to consider.
09/16/2008 (8:18 am)
@Stefan, you made your point clear about modding. However, I dont see what the script compilation has to do with that: your game can be still tottally moddable, while you include only compiled scripts.Thats why I found your intro to the solution very handy, as there will be many times where we dont want the player touching the missions (campaigns, not moddeable games, tournament maps...). Although not necessarily as a perfect 'security meassure', it is still a tool to consider.
#9
In a multiplayer environment, torque will fail if the mission file has been changed.
09/17/2008 (4:34 pm)
Protecting a .mis file sounds kind of useless to me, unless it's a single player game. In a multiplayer environment, torque will fail if the mission file has been changed.
#10
09/17/2008 (4:45 pm)
Well, thats another reason to prevent the user to modify the mis file!
#12
09/24/2008 (7:13 am)
I see that experience about the same as I see enabling god mode in games. If people want to do it, they can. You can provide a solid gameplay experience, but you can't overcompensate for what a small number of players will do (or even a large number if they find a section of your game overly complex or not worth their time).
#13
One of the things you could do to overcome it is to bury the mission file and others into a password protected .zip file (find the resource which helps you set that up). The engine loads up the .zip seamlessly as a directory. The passwords can be cracked but it's usually more effort than most are willing to go through. Also change its name and extension to be less clear as to what it actually is to the casual observer.
Other obfuscation could mean loading up all the mission objects from a database (sqlite) and transmitting it to the client, with only a barebones mission file.
09/24/2008 (8:52 am)
Stefan is right, you could pretty easily change its extension to a .cs and then exec it, creating a dso. The mission loading process would then load the .dso and not the .mis file.One of the things you could do to overcome it is to bury the mission file and others into a password protected .zip file (find the resource which helps you set that up). The engine loads up the .zip seamlessly as a directory. The passwords can be cracked but it's usually more effort than most are willing to go through. Also change its name and extension to be less clear as to what it actually is to the casual observer.
Other obfuscation could mean loading up all the mission objects from a database (sqlite) and transmitting it to the client, with only a barebones mission file.
#14
What i do is save the mission as a .cs file, compile it and delete the .cs file after that. Then I add a .mis file in the same directory with the same name and a single line like:
test1.mis
test.cs.dso <= compiled file, contains the mission data
09/25/2008 (2:43 am)
A while ago I played around with saving missions and also want a little protection for the saved missions. What i do is save the mission as a .cs file, compile it and delete the .cs file after that. Then I add a .mis file in the same directory with the same name and a single line like:
test1.mis
exec("./test1.cs");test.cs.dso <= compiled file, contains the mission data
#15
09/25/2008 (9:14 am)
Haha! smarty!
#16
09/25/2008 (11:01 am)
Ty ;) Btw. on multiplayer games there is no need to ship the *.mis files because the mission data is loaded from the server.
#17
09/25/2008 (2:33 pm)
Code is hardwired to look for .mis You can easily change that, the engine can handle dso missions just fine, it just needs to be told to do so.
Torque 3D Owner Howard Dortch
Default Studio Name