Loading an older save game - variable persistence

  • #1, by andiliddellWednesday, 20. April 2016, 01:13 4 years ago
    Hi all,

    I have a question about variable/condition persistence between save games, but it's confusing to explain so I'm going to make up a scenario to hopefully clear up what is going on.

    Here's a scenario:



    • I'm playing a visionaire game and have progressed to point 4/5 of the storyline and saved my game
    • A number of variables/conditions will have changed during this play session (rg. pickedUpBook = true, wacthedCutsceneA = true)
    • I then realise I've maybe forgotten part of the story so I want to go back and replay from an earlier savegame
    • I load an older save from yesterday when I was only up-to point 2/5 of the storyline
    • I start to play and then realise when I get back to point 3 and 4 that its not showing the book or the cutscene because the variables haven't been reset during this session.


    Is this how the variable/conditions work between save games as It seems to be my experience whilst testing my game.
    Condition changes seem to persist between savegames, which looks like it will be a real headache to code around?

    Anyone else experienced this? Is it the norm and I'm thinking about this the wrong way?

    Any help appreciated.

    Cheers
    Andi

    Forum Fan

    178 Posts


  • #2, by afrlmeWednesday, 20. April 2016, 03:04 4 years ago
    No that doesn't sound right. Save game files are supposed to contain all the relevant data at the time the save file was created. They should contain condition values, string & int values of values, positions of characters, objects & so on.

    If you load from a save file then it should update the game with the values stored in the save file.

    We had a report on the demo game we submitted to some gaming blogs / sites about new game not working. I was sure I'd set it up correctly, but we got at least a couple reports back about the demo not resetting correctly. I wonder if it's a bug that's occurred since the last update of VS?

    P.S: I actually started thinking about other methods of achieving "new game" the other day without needing to use the autosave/quicksave method. I believe it can be done with the replaceGame() Lua function which you can use to swap out vis files or reload the current vis file, but how to make it perform another action after loading I don't know.

    Imperator

    6804 Posts

  • #3, by sebastianWednesday, 20. April 2016, 07:48 4 years ago
    Is the older savegame coming from an older version of the game where the specific values/conditions were not created at that time?

    Thread Captain

    2334 Posts

  • #4, by andiliddellWednesday, 20. April 2016, 10:32 4 years ago
    @sebastian not that I'm aware of.

    I'm trying desperately to play-test my game and fix bugs, tidy things up, re-pace dialog and having to continually make new save games so I don't have to keep playing it from the start again.

    Its currently around 2 hours of play-time (more if you investigate everything) so it's really hard to test end to end, especially if I'm making little changes and having to go back and test again.

    In this case is it possible that because the data structure has actually changed between saves then variables might be messed up? so for example this variable did exist before the save but other variables didn't and now they have effected the xml structure so things have messed up? (maybe length of arrays or number of child nodes)

    I really need a better procedure for testing a long game like this, I wonder what other developers do? This is why I suggested the holy grail of a debug page you could flick to mid game full of radio buttons and values that you could change in real-time, that would be great! smile

    Do you think this could be the issue?
    Anyone have any ideas about how to play-test a long game in VS without having to keep going back to the start all the time?

    cheers
    Andi

    Forum Fan

    178 Posts

  • #5, by afrlmeWednesday, 20. April 2016, 11:53 4 years ago
    Daedalic create their own debug system by utilizing an interface & adding various buttons & conditions / values etc to it. I've not tried building one myself as I've never had the need to yet.

    You can use the developer interface to quickly type & change things such as current scene, active character, outfit, condition states, int of a value, etc. TAB key will open it up. It has auto-complete to a degree too.

    Imperator

    6804 Posts

  • #6, by ke4Wednesday, 20. April 2016, 11:58 4 years ago
    Btw SimonS mentioned in the Vis 4.3 thread that there's gonna be Lua debugger in the new gui.

    Key Killer

    810 Posts

  • #7, by afrlmeWednesday, 20. April 2016, 13:17 4 years ago
    @ Ke4: Yeah there is. David shared a screenshot of it (in the upcoming new GUI) via skype.

    However the debugger is mostly for showing you errors in your scripts & so on. Unfortunately there still won't be any auto-complete support - hopefully it will get added in the future as it really saves a lot of time while you are scripting.

    Imperator

    6804 Posts

  • #8, by ke4Wednesday, 20. April 2016, 13:30 4 years ago
    Yeah auto-complete would be grat, or using colors. Still great, better than checking the log file.

    Key Killer

    810 Posts

  • #9, by sebastianWednesday, 20. April 2016, 14:23 4 years ago
    I think building a debug menu to mass change conditions /values, teleport, give itemms, etc is the best solution here.even if it is hard work...

    Thread Captain

    2334 Posts

  • #10, by afrlmeWednesday, 20. April 2016, 14:30 4 years ago
    Yeah auto-complete would be grat, or using colors. Still great, better than checking the log file.


    Color syntax is already in the current script editor. The VS script editor is using the SCIntilla source code which is what other text editors like Sublime Text & Notepad++ etc are based on.

    @ Sebastian.204: There's also the option of creating a script in which you store everything into a table, but it would probably take you almost as long to type up & sort out as it would take to make the game itself. grin

    Imperator

    6804 Posts

  • #11, by ke4Wednesday, 20. April 2016, 14:49 4 years ago
    Anyway when i'm testing the game i'm using the console as AFRLme mentioned. You can change almost everything there. It's a bit annoying to change conditions over and over again but you don't have to play the whole game for testing things in later parts.

    @AFRLme:
    Cool i think this will be a great improvement.

    Key Killer

    810 Posts

Write post