Search Unity

recommended approach for promo codes and dev tools

Discussion in 'General Discussion' started by alex1st1, Jan 21, 2020.

  1. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    Hi All!
    Is there any recommended approach how to implement:
    1) promo codes into your game (including mobile), e.g. you enter promo code and get new special objects or game currency. this should persist between game runs.
    2) dev tools (e.g. buttons to load any scene, enable god mode, etc). this doesn't need to persist
     
  2. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I don't have any experience with promo codes, but the 'cheat codes' you call dev tools are definitely crucial when testing and debugging.

    Almost all large scale games have a dedicated command line for cheat codes, the 'quick and easy' approach I usually use is a monobehaviour with
    #if UNITY_EDITOR
    that processes keystrokes (usually f keys) and does stuff like full heals, kill target, add resources, etc.

    This kind of thing is a no brainer, and definitely important for testing.
     
  3. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    Ok good for editor, but what for target build, especially mobile?
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Back in the day when I had a short stint in computer game QA they would drop a config file into the game's folder the game would look for which would unlock the cheats, or add something to the registry. The problem is this means the cheats are actually in your real build ready to be unlocked, and are not impossible for someone to find if they are skilled enough, and once one finds out they tell everyone else through the magic of the Internet. These are usually left in though because they are someone risky to remove, since QA is unable to run a proper pass on your final build otherwise, or any later update builds for your game.

    I'd expect mobile is done similarly.
     
    frosted likes this.
  5. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    This doesn't make sense to me. Why can't you just exclude whatever cheat codes you don't want to publish?

    Just exclude whatever you want from a build with a preprocessor tag.

    That said, many, many single player games are published with live cheat codes. Nothing wrong with that. Games will usually disable access to achievements or high scores when cheats are active.
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Yeah that's Dev thinking, but It is just terrible QA practice. When you exclude code from a build, and never properly test the build after you do so, you run a small but real risk that change will affect the software in a way you didn't anticipate. Then the first people to discover the problem are your customers instead of internal testing. (you're guaranteed not testing this build properly since the cheat codes were there to allow you to test the build properly)
     
  7. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    You kinda misunderstand. You should be sending the release build to QA, which if you were using preprocessor tags to exclude cheats, would already exclude that code... so all your formal QA is on release build (with whatever config excluded).

    In less than multi-million dollar projects, the idea of having a separate QA department from dev is pretty ridiculous anyway.

    In real indie environments, dev, testing, playtesting is all much more fluid and occurring constantly.
     
  8. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    That's great discussion but could we talk about practical solutions?
     
  9. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Not always. We are a very small indie team, and we use 3 builds, Main (active), QA (stable) and Staging (what production is built from). Main is typically only accessible by dev team. QA builds are available to a larger audience, including other teams in our studio, and we often contract out some QA when we are close to major releases.

    https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
    For example we have debug menus (cheat buttons) that are conditionally compiled. (also only work on non-live accounts). Basically like this:

    Code (CSharp):
    1.  
    2. #if !PRODUCTION
    3.         debugMenu.SetActive(true);
    4. #else
    5.         debugMenu.SetActive(false);
    6. #endif
    7.  
    Promo codes are bit trickier. Depending on the platform and type, they may not be allowed. For example the Apple store doesn't allow them for some things like things that may be purchased in game. Check with your platform to ensure they are allowed.
     
    hippocoder likes this.
  10. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I was wondering about outsourced QA, what exactly does that look like?

    I've worked with formal QA in bigger firms, but I never really found a lot of value in it. Seems like they were either a rubber stamp or a nuisance. Have you gotten real value out of outsourced QA for games?
     
    zombiegorilla likes this.
  11. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    Thanks, will check. If you know about Google play limit on promo codes please let me know. I have no iap now.

    Nethertheless I wanted to have cheat codes in production build.
    What is recommended approach?
     
  12. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
  13. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Yes we have. We have used a couple of different firms. One in the UK, and the other I believe in Sweden. It definitely works better if you have a long term relationship, as they get to know the games. The one my team uses, we drop them an email when we have a new QA build, we typically give them a list of things we want them to specifically look at (new updated/features) They spend a couple of days going through it. (I am not sure of the specifics on the contract), and they have access to our Jira, so they enter bugs directly (they have actually been working with us long enough that they can, in some cases, directly assign bugs to specific developers). We can contact them directly to discuss issues, and they are good about looking at and noting issues elsewhere in the game, not just being narrowly focused. The overall feel/usage is very much like when I was at the bigger™ company, where we had our own QA.

    The main benefits for us are:
    - Our team is very small, it is impractical for us to spend time also carefully QAing and developing.
    - Blind Spots!!! When you are looking at the same thing over and over for months or years, your brain edits it out. That piece of "temp" music is that placeholder, you forget about. Or you are so focused on one aspect of something that you completely miss terrible bugs elsewhere. And the very worst of all, assuming its a known issue and someone else's problem. With a small team, and a decent amount of overlap, it is easy for something to get missed assuming since it is a clearly obvious issue someone must be working on it, and opting not to pester them about it. QA being divorced from development doesn't ignore that that "crash that always happens when press pause" or whatever.
    - Cost. A dedicated QA team is a lot less expensive than doing it internally. Not just staffing costs, but overhead and hours to manage it. Like I said, we basically just fire off an email with some notes and it is all handled. We are indie, but we are also funded, and our staff is all senior. While we do playtest, and certainly test when we can, dedicating an internal developer to QA is crazy expensive, and just being honest, not the same level of quality you get from someone dedicated to it. A professional QA person is way better at it than I am, or our lead engineer, or artist.
    - Stacks of Devices. We have a pretty good mix of devices just among the developers. (personally, I don't trade in my phones, I keep them for testing, I have iPhone 11Pro Max, iPhoneX, 7+, 6s+, 5s, 4s & 4 plus a couple of ipads. but no androids). The rest of the team covers most Androids and more. But It is time consuming for me to build to old devices, and/or test. The QA team basically has a big list and we check the devices we want. It is super convenient. Internally we check on the iPhone, the iPhone before notch, Android common and a latest (Pixel 3? with notch). We also have special builds for other platforms that they check. It is soooo much of time saver for us.

    And just like any QA, it is great (and important) ROI. Players are super fickle and a have a ton of option in a competitive marketplace. If we stupidly let a critical but through like a hanging on the FTUE, we lose lots of players that we'll never get back. If they play, it breaks, most of the time they uninstall and play something else. (we did this once at Disney, and it was devastating.. it was back when pushing an update could take several days). Our QA is obsessed with finding game breaking bugs... and when they do, it means thousands of players that won't quietly disappear.

    Basically, I cannot recommend it highly enough.
     
    Joe-Censored and frosted like this.
  14. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    For the app-store, anything that is unlockable/accessible outside of game play (a code for example) must go through IAP. You can generate a certain amount of free codes that you can distribute for promotional purposes. But everything must go through their system. (otherwise it creates a bypass to the their store). Dunno about google, you would have to check their TOS. I would guess they don't care, they don't seem to care about much.

    There really isn't one. Debug cheats shouldn't be production. Game cheats may be against store policy (depending on what they are), unless they are directly part of game play, then just do them how you would do any aspect of game play UI.
     
  15. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    How much detail do you need to provide in terms of the test plans and the like? From my traditional app experience, the test plans often took huge amounts of time to prepare, this was the main pain point. Do you need intense detail, or since its a game (that's hopefully mostly self explanatory) are the test plans relatively straight forward?

    Are they approaching it somewhat like a player would, or do they have strict testing guidelines?

    How often are do they test, is it like a one shot or at each release candidate, or more or less ongoing?
     
  16. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
  17. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    These days, not much. We have been using them for years, they know the game very well, they have been doing the testing on it for around 3 years. They generate test plans, but from our side, it's largely just a written description of what the feature is, how it is supposed to work. Often just derived from the design doc. And yea, part of is them looking at it from a player perspective.
    Whenever we need them to. It is literally just firing off an email letting them know what build to test and the notes. We typically don't bother mid-development, but start having them check once a feature is fully functional, but not always tuned, or art final. More often closer to release. So it may be every day, or we may go weeks without. Basically anytime we want someone to carefully look over something.
     
    frosted likes this.
  18. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
  19. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I'm sold. I'm gonna look into costs for this. Thanks!
     
  20. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    My NDA has expired when I worked in QA outsourcing, so I can say the company in the San Francisco bay area I worked for would charge approximately 80/hour for one off or smaller contracts, and give a bit lower price for contracts that were long term or estimated to be a larger number of hours. Prices can of course be different depending on where the QA business is located.
     
    Ryiah likes this.
  21. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Interesting, without getting too personal, my assumption is they payed somewhere between 1/3 and 1/4 of that for the actual labor, is that ballpark correct? If so, then obviously, its smarter to skip the actual company and just contract the testers directly.
     
  22. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Correct.

    Though test planning work by the QA company might not end up billed, as much of that has to occur just to provide an accurate estimate before any contract is signed. So if you're bringing on your own testers, you're going to need to also do the test planning to ensure proper coverage, especially if the testers you bring on are more gamer than professional tester. If you don't have your own bug tracker, that's another hassle that a QA company would include usually for free if you don't have one ready.
     
    Ryiah and zombiegorilla like this.
  23. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Indeed, that is a big value for us. All the overhead, planning maintaining devices, etc... is handled by them. We toyed with the idea of hiring someone, but they would have have to be high enough level to handle all that stuff, which precludes much of the "savings" and because the company we use has several staffers, and many other contracts, we only pay when we need QA and they are always available. If we were to hire someone on an as-needed basis, they could have schedule conflicts with other clients. I am not really sure what our costs are, but I believe they are less than that. But we have been with them forever, and they are UK based not, SF. Everything is more expensive here in the bay area. ;)
     
  24. alex1st1

    alex1st1

    Joined:
    Jan 26, 2019
    Posts:
    275
    thanks for your idea, have done it this way:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.SceneManagement;
    5.  
    6. public class EditorCheats : MonoBehaviour
    7. {
    8. //for cheats in editor
    9.  
    10.     // Update is called once per frame
    11.     void Update()
    12.     {
    13. #if UNITY_EDITOR
    14.      
    15.         //1 and 2 = set wave + reload
    16.         if (Input.GetKeyDown(KeyCode.Alpha1))
    17.         {
    18.             // Debug.LogError("EditorCheats: key 1 pressed");
    19.             PlayerPrefs.SetInt("Wave", 1);
    20.             PlayerPrefs.Save();
    21.             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    22.         }
    23.         else if
    24.              (Input.GetKeyDown(KeyCode.Alpha2))
    25.         {
    26.             // Debug.LogError("EditorCheats: key 2 pressed");
    27.             PlayerPrefs.SetInt("Wave", 2);
    28.             PlayerPrefs.Save();
    29.             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    30.  
    31.  
    32.         }
    33.         //N - load next
    34.         else if
    35.              (Input.GetKeyDown(KeyCode.N)) //next lvl
    36.         {
    37.             // Debug.LogError("EditorCheats: key 2 pressed");
    38.             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    39.         }
    40. #endif
    41.  
    42.  
    43.     }
    44.  
    45. }
    46.  
     
    frosted likes this.