Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Utilities Quantum Console: The Ultimate in Game Development Console

Discussion in 'Tools In Progress' started by QFSW, Sep 26, 2018.

  1. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    477
    Oh, okay cool.
    So the challenge would be parsing an input field line by line into a list of commands which can then easily be passed into Quantum.
     
    QFSW likes this.
  2. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Hello- how would I print a list of my custom commands in the console?

    In one of the demo videos you use "user-commands" and it prints a list of the user commands- I want to do exactly that- any tips? Thank you.

    btw- I've disabled the built in commands
     
  3. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Take a look at the definition of the user-commands command inside of QuantumConsoleCommands.cs, should be clear from there :) if not, let me know
     
  4. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Got it! Thank you- great asset btw :)
     
  5. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Great! Glad you like it :) feel free to let me know if you need anything else or have any feedback, and if you have a moment a quick review goes a long way to helping out
     
  6. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    V2.6.2 is now live, with a new custom scan rule system and optional parameters in command suggestions!

    Full release notes here
     
  7. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
    Hi. I was wondering if my previous suggestion of being able to customize console initialize message? Like what if we want to change message like :

    upload_2022-4-25_12-53-31.png
     
  8. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Unfortunately I haven't yet had time to add this although hopefully I can add it for the next update :)
     
  9. Samhot128

    Samhot128

    Joined:
    Sep 2, 2017
    Posts:
    7
    Can you pop the console out into its own window or does it always have to run in the game view?
     
  10. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    As in a completely separate window in your operating system? No Quantum Console doesn't provide anything like that for you
     
  11. Samhot128

    Samhot128

    Joined:
    Sep 2, 2017
    Posts:
    7
    No, I want to doc the quantom console in another tab/view inside the unity editor. It looks like by default it runs in the game view which I dont want. Thanks for the quick reply.
     
  12. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    The included UI/interface is designed as an in game console and not an editor extension, so no out of the box you can't run the UI as an editor extension

    That said, most of the functionality of QC isn't handled inside of the UI so you could most likely write an editor extension interface but it wouldn't be trivial to get all the features like autocomplete working
     
  13. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    @castor76 Quantum Console V2.6.3 has just been released which includes your feature request for customisable localization!
     
  14. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
    Thanks will give it a go. Is there doc on how to do that?
     
  15. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
  16. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
  17. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Depends on when you purchased QC originally - if you purchased it less than a year before V2.6 was released, then the upgrade is completely free; if it was more than a year before then the upgrade fee is heavily discounted
     
  18. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
    Ok, is this reflected on my asset store page then? It seems to be $10
     
  19. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Yes, just make sure you're logged in. $10 would be the discounted fee
     
  20. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
    No problem, thanks for letting me know.
     
  21. rerwandi

    rerwandi

    Joined:
    Dec 8, 2014
    Posts:
    544
    is it can be used for mobile too?
     
  22. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Yep! You'll probably want to add a button to your UI somewhere for opening the console
     
  23. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Quantum Console V2.6.4 is now live! Some standout features
    • Autocompletion works much better now when suggestions contain whitespace
    • New `ReadLine` and `ReadValue` actions for getting user input during a command thanks to @Monsoonexe


    Full patch notes here as always
     
  24. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Quantum Console V2.6.5 is now live!

    I've made two new MonoTargetTypes,
    Argument
    /
    ArgumentMulti 
    that let you provide the target(s) as the first argument to the command. This is basically an automatic version of the old "make a static command that dispatches to the target" trick so should be very convenient!

     
  25. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    I've launched the first version of Made with QC, a showcase of a few of the awesome games that have been made with Quantum Console! Check out everyone's great work here
    https://www.qfsw.co.uk/docs/QC/articles/showcase/showcase.html

    If you're working on something with Quantum Console, please share :) I'm always excited to see what people are using it for
     
  26. WongKit

    WongKit

    Joined:
    Apr 27, 2017
    Posts:
    26
    Hi QFSW,

    is it possible for you to wrap the current QC_DISABLED* preprocessors around the actual source code of Quantum Console?

    I am a bit concerned about people who want to manipulate the release build. With the current implementation, they would simply need to override one simple check in QuantumConsole.cs to be able to access the full console with all the features - even if it was disabled with the preprocessor.
     
  27. fragilequail_unity

    fragilequail_unity

    Joined:
    Mar 24, 2022
    Posts:
    5
    Tried changing the toggle key from escape to tilde also known as the key to the left of the 1. `
    For whatever reason Quantum console doesn't like using that key and I have to manually toggle it with my own script. on ` press.
     
  28. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Hi @WongKit

    While I agree with you on a fundamental basis, it's unfortunately not that simple. I can't wrap _all_ the code in the preprocessor, as putting serialized fields inside of the preprocessor causes build errors. Because of this I would have to wrap most of the code in it, but then provide empty fallbacks for the unwrapped code. This would work, but it's easy for things to go wrong and I've decided it's not currently worth the maintenance cost

    One idea if you want to make your game safer - you could have your QC prefab in an asset bundle inside of in the scene, then you only include the asset bundle (and said loading code) in builds where you want to include QC. This way, even with code modifications, there won't be any easy way to actually add the console in. (I'm aware that this can still be worked around, but at this point it would be similar to modding QC into the game in the first place)
     
  29. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    It may be that the ` key is actually somewhere else on your keyboard based on a layout mismatch. Try ~ instead
     
  30. WongKit

    WongKit

    Joined:
    Apr 27, 2017
    Posts:
    26
    Thank you for your reply! I agree, that it is not feasible to wrap *everything* in the preprocessor, but what about only defusing the commands in QFSW.QC.Extras namespace? Those are the most versatile (dangerous ;)) commands that could be used to manipulate the runtime player. Wrapping them should not produce any build errors as they would be called dynamically anyway.

    I am fully aware, that someone who wants to tamper with an application will find other ways to do so. It is more about not providing easier entry points. Btw, I would not even mind, if someone would be able to show/load the console when it is only capable of viewing the logs. As I am already wrapping my custom commands in preprocessor conditions, they could never be run from a release build.
     
  31. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    That sounds like a good compromise to me! Disabling them is high value, low maintenance. Will do this for the next release of QC
     
    WongKit likes this.
  32. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    68
    I think QC should have some better non-static commands handling. I mean that it would be ideal if we can click on the object in viewport and call some [Command]s on it. I just made the script that polls user to "Ctrl+Click" on an object (That raycasts and searches for some QuantumConsoleClickable script and memorizes the first instance of it if any) and then a command "exec" that takes in a component name and function name

    Code (CSharp):
    1. [Preserve]
    2. [Command("exec")]
    3. private static void ExecuteOnPickedObjectInViewport(string component, string function)
    4. {
    5.     pickedObject.GetComponent(component).SendMessage(function);
    6. }
    The 2 major problems with this approach is that you are unable to pass arguments to the callee and you don't have autocomplete for component/function parts of the command

    I think a solution would be next:
    1. Add `MonoTargetType.SelectedInstance`
    2. In the function that does raycasts logic we call something like `QuantumConsole.Instance.SetCurrentContext(myObject)`
    3. QC switches to context-aware mode where you get all autocomplete for all commands defined on "context" object scripts

    Btw, it requires developers to define colliders on objects to be able to click on them to pick the instance, but I think it's not a big deal

    Edit: I just literally did the same routing through memorizing gameObject instanceId of the clicked object and checking if the instanceId matches in the [Command(MonoTargetType.All)] function but that implies adding these checks in all functions that act as instance-commands
     
    Last edited: Aug 1, 2023
  33. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    68
    Also a copyable-on-click text regions would be nice feature to have. For example, I log something like "Relay room created, room code <copy>{roomCode}</copy>, use 'join \<code\>' to join multiplayer game" and console logs a button-like text region with room code that can be easily copied by just clicking on it
     
  34. nomiswerdnek

    nomiswerdnek

    Joined:
    Jul 14, 2017
    Posts:
    6
    Quantum Console doesn’t show in Windows build on specific computer

    I’ve been experiencing an issue recently where the QC console will not show in a Windows Build on a specific laptop computer (although it has worked previously). The QC console will show on my other desktop computer, and the console also shows OK on both of the computers inside the Unity Editor. I’ve tried using ‘Show Console’, ‘Toggle Console’ and also ‘Activate on Startup’ - they all work in the Unity Editor, but not in a Windows build on my laptop, yet they work OK in a Windows Build on my desktop computer.

    I am using Unity version 2022.3.10f1, URP, Quantum Console 2.6.6

    I have seen some other similar issues on both Discord and the BitBucket issue tracker and I have tried any advice given there, but without success. Is anyone else having this issue, or is it perhaps a known issue that is currently being investigated?

    I have also tried completely removing the QC package and reinstalling it, making a clean build and making a development build, without any success.

    My primary use for Quantum Console is in a build on my laptop, using it to change game settings while people playtest my game. Without it working on this laptop, I am really stuck.
     
  35. RobG88

    RobG88

    Joined:
    May 28, 2015
    Posts:
    28
    I love QC, it's been fantastic debugging multiplayer.
    Any plans for adding filtering or searching for the console output?
     
  36. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Hey @IC_! In your suggestion would SelectedInstance then still require the user to do the raycasts and set the current context or would this be handled automatically by QC? If the user is still doing it I think you can currently achieve this by using the object registry, and only adding in objects that are selected. I think that would work for 1 and 2 but not 3

    Interesting - so if you have something set in this object context, then you'd apply a suggestion filter to only suggest commands that could potentially be valid on this type? I wonder how we could do this efficiently and intuitively, definitely lots of questions to answer
     
  37. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    Glad you like it! No current plans but feel free to put a request into the issue tracker, ideally with an example use case :)
     
  38. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    609
    Trying out Quantum Console and randomly getting this error on start


    Code (CSharp):
    1. Assertion failed on expression: 'm_GameObjects.find(gameObject.GetInstanceID()) == m_GameObjects.end()'
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. QFSW.QC.QuantumConsole:OnEnable () (at Assets/Plugins/QFSW/Quantum Console/Source/Scripts/QuantumConsole.cs:1026)
    4.  
     
  39. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907
    What version of Unity are you on? Seems like an internal error in the engine
     
  40. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,522
    Hi. I was wondering if there is any console command that I can create without showing up in the auto completion or list of custom commands. This is so that I want a hidden console command that actually unlocks the other debug command options. But I don't want that hidden command to be available to the public.
     
  41. FirstRiderRasc

    FirstRiderRasc

    Joined:
    Feb 21, 2017
    Posts:
    16
    I was gonna ask the exact same thing!
     
  42. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,907