Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: 0rph3u5 on March 16, 2017, 05:21:23 pm

Title: Making a Secret Mission Cheat-proof
Post by: 0rph3u5 on March 16, 2017, 05:21:23 pm
HLP, I've come to bargain. This is more a question of "do I've overlooked something" rather than "how to do it".....

I have this campaign which going to include a secret mission. But I don't want that mission to be playable unless the campaign has been beaten at least one before - so it will only unlock on the second playthrough.

To make it so that you can't cheat your way into the mission from the mainhall, I devised two systems of checks:

First, you have accumulating campaign-persitent variable which is increased everytime a mission is successfully completed by the mission number. @MissionsCompleted therefor has score from 0 (no mission completed, default value) to 171 (all missions completed), by adding up the number of missions in the campaign.
If by the time credits roll (sperate mission file) the score has reached 171 an event will set a player perstient-variable @{Acronym}completed by 1 (unless it is already 2). @{Acronym}completed being 2 is required for the campaign to progress to the Secret Mission.

Second, in the Secret Mission it imideately checks if @MissionsCompleted has a value of 171. If it doesn't an event will end-mission at once (the Secret Mission will have no Briefing).

So did I miss anything?

Edit:corrected transcription error which containted the wrong logic
Title: Re: Making a Secret Mission Cheat-proof
Post by: Phantom Hoover on March 16, 2017, 05:27:46 pm
Why bother? If the player wants to outright cheat, just let them. You're never going to actually keep a mission secret on a modding platform this open.
Title: Re: Making a Secret Mission Cheat-proof
Post by: 0rph3u5 on March 16, 2017, 05:48:41 pm
Why bother? If the player wants to outright cheat, just let them. You're never going to actually keep a mission secret on a modding platform this open.

a) because I want to, b) because I can and c) to reward players that come back
Title: Re: Making a Secret Mission Cheat-proof
Post by: mjn.mixael on March 16, 2017, 08:49:21 pm
This is a post to remind me to respond when I get home.
Title: Re: Making a Secret Mission Cheat-proof
Post by: xenocartographer on March 16, 2017, 09:16:46 pm
b) because I can

Thaaaaat's a negative. You can hide the mission as well as you'd like, but nothing's going to stop someone going into the .vp, copying it, and loading it up in the simulator. You can add checks to stop someone launching it from the simulator, and the player can remove them just as easily. You can get into an obfuscation arms-race if you want, but all you're doing is making your mission more complicated (and introducing the possibility of bugs while you're at it); if a player wants to cheat into the mission, they'll, because they've got all the data there already.

It's like the old "how do I stop someone copy-pasting an image from my Web page question"? The answer is, you don't. By the time someone can see the image in their browser, they're in control of it. You can try to shut off the right-click menu through Javascript, but someone can always disable Javascript; you can render it as a Flash file or <canvas> element, but they can take a screenshot. So you watermark your image or put a banner asking people not to steal your images, because there's no solution.

...hell, even if you did find some effectively unbreakable system, nothing stops the player from ~k-ing their way through the entire campaign.

Now, I mean, there's nothing wrong with having an Easter egg mission or w/e, but going out of your way to hide it is an exercise in futility. The checks you have in place seem fine.
Title: Re: Making a Secret Mission Cheat-proof
Post by: mjn.mixael on March 16, 2017, 10:22:39 pm
BtA has 3 hidden arcade missions that I don't think anyone has found yet... Just saying. You can't absolutely stop HLP's modders from finding the mission files, but you can obfuscate them in clever ways where no one has yet thought to look. :)
Title: Re: Making a Secret Mission Cheat-proof
Post by: xenocartographer on March 16, 2017, 10:40:31 pm
Yes, those

Spoiler:
texture files

were pretty clever. :)
Title: Re: Making a Secret Mission Cheat-proof
Post by: karajorma on March 17, 2017, 03:40:31 am
So did I miss anything?

Yeah. The behaviour of persistent variables that you're counting on is actually a bug.

http://www.hard-light.net/forums/index.php?topic=93306.0

And it's going to be fixed at some point which will result in the secret mission being completely inaccessible. When the new kind of persistent variable is in, you can just switch over to it though.


BTW, if anyone plays your campaign halfway through and then restarts the secret mission won't be accessible unless you're checking the score is equal or greater than 171.
Title: Re: Making a Secret Mission Cheat-proof
Post by: mjn.mixael on March 17, 2017, 10:44:57 am
Unless you set the score back to 0 in mission 1.
Title: Re: Making a Secret Mission Cheat-proof
Post by: xenocartographer on March 17, 2017, 10:46:36 am
Better yet, do both!
Title: Re: Making a Secret Mission Cheat-proof
Post by: 0rph3u5 on March 18, 2017, 10:01:28 am
So did I miss anything?

Yeah. The behaviour of persistent variables that you're counting on is actually a bug.

http://www.hard-light.net/forums/index.php?topic=93306.0

It's telling that I knew something like it was going to pop up - that's why I ask
Thanks for the heads up

BTW, if anyone plays your campaign halfway through and then restarts the secret mission won't be accessible unless you're checking the score is equal or greater than 171.

Unless you set the score back to 0 in mission 1.

Yeah, I overlooked that - Thanks

You can hide the mission as well as you'd like, but nothing's going to stop someone going into the .vp, copying it, and loading it up in the simulator. You can add checks to stop someone launching it from the simulator, and the player can remove them just as easily. You can get into an obfuscation arms-race if you want, but all you're doing is making your mission more complicated (and introducing the possibility of bugs while you're at it); if a player wants to cheat into the mission, they'll, because they've got all the data there already.

mjn.mixeals teaching me his black arts nitwithstanding, this isn't about the segment of people who would open the .vp
But thanks to a narrative device I got those already covered :)