Debug mode with live condition and value access page

  • #1, by andiliddellWednesday, 16. March 2016, 01:20 8 years ago
    Hi all,

    I'm currently trying to debug and test a large game with over 15 rooms and around 150 conditions.

    It would be AWESOME if there was a debug page or slide in panel you could bring up during gameplay, that showed you every game condition listed on one screen with a radio button to toggle them live, or every value with the ability to edit them live and have the playing game be immediately effected by the change.

    I know this is kind of possible using TAB and the console, but It really needs a simple GUI to be effective, it just takes too long to sift through line by line.

    Depending on the architecture of the game engine and the compiled game code as it runs this might not even be possible but I'm assuming as it can be done on the command line, then having a simple page of radio buttons shouldn't be too much more difficult?

    The ultimate would be being able to make changes in the visionaire editor whilst the game was playing and have them update live. This would make bug testing, fixing and play testing so much easier.

    Maybe all wishful thinking! smile

    Forum Fan

    178 Posts

  • #2, by afrlmeWednesday, 16. March 2016, 01:36 8 years ago
    Aye probably wishful thinking although some programming apps such as Swift (I think it's called) do actually allow runtime debugging & modification - I doubt VS will ever get that feature anytime soon (if ever) regardless of how nice a feature it would be.

    If you want something like you are asking for then you can create it yourself inside of an interface. That's what Daedalic do or did or whatever. I reckon it'll be a lot of work though.


    7281 Posts

  • #3, by andiliddellMonday, 24. October 2016, 15:43 8 years ago
    Hello, 7 months later, I'm back..

    I'm desperately trying to debug my game and ended up resorting to your suggestion of a manual made menu. 

    Thought it might be worth letting others know it is a viable solution and works well.

    Ive included a screenshot below with variable names blurred out (don't want to show you any spoilers). Here's my method for anyone who is interested.

    • I hold all of my "main story progression" conditions on my main character object
    • I took a screenshot of this full list and split it into 3 columns in photoshop
    • Added a number and little red dot next to each variable
    • Loaded this as background into a new MENU scene in VS
    • Imported a little green circle for each condition and set it's visible condition to the current value of the condition you want it to represent - this way if its false you see the red dot of the backdrop, if its true the green dot is shown
    • Created a clickable area over each condition name - with a left click action to toggle the conditon in question.
    • Created a new key binding in game settings so when you press SPACE the game goes to this menu.
    • Finally added a resume button to return to the scene of the curretn character, to take you back.

    It's really great for quickly jumping progression to a certain point during testing. combined with a number of savegame points to get you to certain places quick I've already found it to be a real help. (now we just need to solve the savegame, scene restart issue)

    It did take a good 3-4 hours to do/refine/scrap/do again and settle on this tho smile

    If anyone has any thoughts to improve it or other ideas to help with debugging I'm all ears.


    Forum Fan

    178 Posts

  • #4, by sebastianMonday, 24. October 2016, 15:53 8 years ago
    thats really cool. nearly did the same but didnt include conditions (i have to many xD.. . have to sort out the main stuff though) but only fast teleport and give item stuff... 

    Thread Captain

    2346 Posts

  • #5, by sebastianMonday, 24. October 2016, 17:47 8 years ago
    by the way:
    you could search for the conditions names in the main chars condition list, save them to a values string and output it via object text. by that the names are up to date and maybe you can add dynamically more to it. 

    Thread Captain

    2346 Posts

  • #6, by NigecTuesday, 25. October 2016, 08:39 8 years ago
    Years ago I did a combination puzzle which had objects placed on hotspots, it was the Lassie AS engine which only did true or false , no variables
    It took days and the editor started crashing then when it was done I had to go back and change object text because thats how I had to check which condition was which... happy times lol

    nice idea smile

    Key Killer

    630 Posts

  • #7, by andiliddellWednesday, 26. October 2016, 20:24 8 years ago
    Ahh, Lassie AS!, I remember it fondly, I did some icon designs for greg the creator of LassieAS back in the day when he was hoping to release a new version, just before the whole apple killing flash episode!

    Something Fowl Afoot, the game I'm currently trying to finish actually started as a Lassie AS project, thankfully all of the art assets are in adobeFlash, so it was great moving over to VS when LassieAS wasnt continued.

    Sebastian, this sounds like an excellent idea! I'm a reasonably nifty programmer: C# for unity, AS3 for flash back in the day and a bit of JS here and there, but I've really, really struggled to do anything meaningful (or that i truly understood) with lua in VS. It always seemed hit and miss?

    None of the available documentation has managed to get it into my thick skull how the data table structure works, and as there's no code/class completion I find it really heard to learn VS lua coding on the job.

    If anyone had the time I'd love a worked example of accessing a characters condition list, and then during a for loop creating a string for each condition and an output text object dynamically to display each one, and position them on the current scene in a grid.

    This would hopefully help me to understand some key fundamentals. I imagine alot of the stuff I struggle with (epscially a custom autosave interface) would be relatively simple if I had a better command of lua and the VS data structure.

    Forum Fan

    178 Posts

  • #8, by sebastianWednesday, 26. October 2016, 21:44 8 years ago
    out of my head:

    Create a value anywhere (best make the value inside the debug scene) and name it "condition_list_string"

    At the beginning of the debug scene action:

    character_conditions = {}
    local condition_list = ""
    for i = 1, #game.CurrentCharacter.CharacterConditions do --shorthand method to get links of the current characters conditions
     if string.starts(game.CurrentCharacter.CharacterConditions[i]:getName(),"GAMESTATE")then --if conditionname starts with "GAMESTATE" (to prevent other conditions of these char showing up)
       local cond = game.CurrentCharacter.CharacterConditions[i]:getName().."\n"
       condition_list = condition_list .. cond --add the name of the condition to the string
       table.insert(character_conditions,game.CurrentCharacter.CharacterConditions[i]:getName()) --optional write all found conditions inside a lua table to access them later 
    Values["condition_list_string"].String = condition_list --this is the created string saved into a VS Value 

    game.CurrentCharacter.CharacterConditions should be the same as the long method


    when you want to get the conditions of a specific character use

    getObject("Characters[NAME]"):getLinks(VCharacterConditions) --NAME = charactername

    Now you should have the string of all the conditions of the character starting with "GAMESTATE".

    Output them via the "display object text" action part and insert this as the text:

    < vs = condition_list_string >

    without the spaces  (and ; . . . the forum here does weird stuff) 

    Also you have this as a definition script of yout project to check if a string starts with a specific word:

    function string.starts(String,Start)	--check if string starts with specific string
       return string.sub(String,1,string.len(Start))==Start

    I don't have a clue yet how to make some rows out of that string though, but you could count up an integer inside the for loop and if the number is greater than the amount of lines you can write them into a second / third value string ...

    Thread Captain

    2346 Posts