Upcoming ChoiceScript Feature: Checkpoints

First, a few points of clarification from my understanding:

  • Ink, the “new” DD has been updated to the newest “released” version of CS (non-beta) and it also has saves to the hosting site enabled for those who log into their account there.

  • the old “save” checkpoint system that is seen in titles like Daria does work with both Ink and Dashingdon – at least it did when I enabled it in my Emigre demo a year or so ago.

For demos, I feel the system enabled on Ink (smPlugin stored on hosting site) is sufficient and it is something that most in the community has grown used to.

With that said, assuming you do enable the checkpoint system as you are pondering in this thread, I would want to test my deployment of this feature with my demo, so I would wish the system you do decide to release to be able be tested.

My “ideal” system for demos would be: the “autosave” feature, the “save_game” system (saved on the hosted site) and a flexible checkpoint system with specified save-slots available as originally described at the top of the thread.

Then for released games, the “save_game” save system would ideally save to the CoG servers for CoG, HG, and HC games.

I use CSIDE, so I am anxious about all the updates and the lag-time involved impacting my projects.

Ever since the browsers “changed” due to their security concerns, I have had all sorts of issues to get the base CS and testing to work on my own, and as everything gets updated further, I fear my struggles will only get worse in this.

Sorry I don’t have enough time to fully understand all the nuances and provide any decent feedback… but I’m incredibly happy that this features is being added! :slight_smile: I’ll try to read in more detail in the next few days…

I think that most games hosted on Dashingdon would likely continue to use smPlugin over *save_game as it’s more flexible and can be used whenever the player wants. The smPlugin method is also very established and people are used to how it works, etc.

Yes, definitely - I will be using *save_checkpoint for my games for publication once they’re implemented whether or not they’re functional on Dashingdon, and they will be very useful for me during testing too.

As a player, I do not use save slots often but I know I’m in the minority in that, and that it is a much desired feature. I believe a lot of players would be the most delighted with a save-at-will system ala smPlugin but would see *save_checkpoint with multiple slots as a very solid alternative.

For me when playing the lack of “autosave” is the biggest thing that causes me problems when playing/testing WIPs, especially when playing on a phone. But being able to restore at will as proposed in *save_checkpoint would also be fantastic because it means if I happen to click the wrong option I can immediately go back and replay to fix it, rather than continuing to the next checkpoint knowing I’ll want to restart.

3 Likes

For the in-game time-looping mechanics & such, the checkpoint system as outlined in the first post seems good. For an actual save system where the player returns to a previous point in the game, I much prefer the way that smPlugin handles it. Way less fiddly work on my end. The player can save/restore whenever they want and I don’t have to keep track of it and set up parts of the game where saving/restoring needs to be initiated (and all the possible bugs connected to that). It’s simply the least amount of work required from the author.

I also prefer a save/checkpoint system that persists until the player actively overwrites or deletes it (like the way it works in smPlugin/Twine/Renpy/etc since I’m pretty sure that there will be players who reload the game and will expect that their checkpoint/save slots from their last playthrough will still be available. Either stored in the browser (with the player having to manage their own browser settings) or on the CoG website (which seems more manageable now with the option to delete saves) is fine.

Of course, while smPlugin works great on Dashingdon/Moody Ink/Itch.io/etc it’s not allowed in officially published games, so my beta test on Dashingdon will include whatever can actually be included in an officially published Hosted Game.

And that sample code that you just posted looks a lot like my current checkpoint code… and is probably indeed what I would’ve tried with *save_checkpoint

1 Like

Yes! The smPlugin is great for playtesting, but since it can’t be used in published games it’s not really that interesting for me. *save_game or *save_checkpoint that can be used for a published game is the holy grail for me. I did put in checkpoints in Fallen Hero: Retribution, but everything would be so much simpler if there were an easier time to do it. I’ve been planning to update Fallen Hero: Rebirth with checkpoints in the nearish future, and I have already forgotten the rather complicated process and need to start over again…

Another unrelated thing to consider about saves/checkpoints.

Is there any way to make them compatible with a saving command from the stat screen?

3 Likes

It would be great if a completed technical demo is available showing the features of save_checkpoints so authors can refer to its working to implement the same in their demos and games

Edit: like the savepoint template available on dashingdon by @HarrisPS

Amazing! Thank you very much Dan, it’s great to not only see this being implemented but also to have this opportunity to give feedback.

I’m the sole bottleneck here. It can be months, as Dan said, but it usually isn’t. I have to update ChoiceScript manually (including testing that none of my modifications broke because ChoiceScript wasn’t designed to be used inside other apps as a “Library”), but it doesn’t usually take an inordinate amount of time. When it’s taken months that’s usually because I’ve not believed any of the updates are immediately valuable to CSIDE users. I might not always get this right, so feel free to tag me on the CSIDE thread if there are features you’re chomping at the bit to try. I otherwise aim to be reasonably quick where any new functionality/commands/features are concerned. So don’t fret, I’ll be pulling this one into CSIDE as soon as possible!

My understanding is that @dashingdon has had to “retire” from properly maintaining both dashingdon and its moody.ink successor… I don’t think we’ll be seeing many updates moving forwards, unless someone else from the community steps up.

Which brings me nicely to this point: I’d much rather see a shift towards official CoG/ChoiceScript solutions wherever possible. I love that the community can and does often fill in the gaps in the developer ecosystem with CoG’s blessing, and that’s one of the primary reasons I’ve stuck around so long. We’ve come up with some pretty cool stuff and developing with ChoiceScript has certainly come a long way. That said, community-made enhancements are supported and maintained by volunteers, often even just one volunteer, and there’s a real risk of those volunteers moving on/getting bored/not having time. So it’s always my hope and intent that unofficial solutions are just a stop-gap (CSIDE included) until CoG comes up with something official (however realistic/unrealistic that may sound).

tl;dr I’d rather see people migrate away from smPlugin if there’s an option for an official solution, though I’d encourage that solution to exhibit the characteristics people like about smPlugin.
The modern smPlugin is actually largely based on the save_gave functionality, it just adds some new commands (which are also a bad thing; as they’ll never be supported by tests) and access to an always available UI (which is what I believe most people use/want from the save_game function, in addition to local support).


As for the save_checkpoint feature itself, I think you’ve thought of pretty much everything I’d have wanted. I agree with throwing an error over “restarting” on a lack of checkpoint. I much prefer deterministic behaviour you can catch, and workaround, to potentially accidental behaviour you wouldn’t detect until runtime.

An author could always implement the other behaviour, deliberately:

   *if (choice_saved_checkpoint)
        *restore_checkpoint
   *else
         *restart

Actually, I don’t think *restart is a valid command atm, but I don’t imagine it would be too hard to add?

I think the only enhancement suggestion I have at the moment, and it could be tricky to do without losing checkpoint names, is if we could make checkpoints use ChoiceScript arrays/numerical IDs.

This would allow things like printing out the checkpoint list via a loop and dramatically simplified choice construction (for e.g. using CSLIB’s “build_array” menu).

You've unlocked the following checkpoints so far:
*temp n 1
*label checkpoint_print_loop
*if n <= choice_saved_checkpoint_count
   --> ${choice_saved_checkpoint_name[n]}
   *line_break
   *set n + 1
   *goto checkpoint_print_loop

or

*gosub_scene cslib_menu build_array "choice_saved_checkpoint_name"
*if cslib_ret <= 0
   *return
*temp checkpoint_idx cslib_ret
Restoring '${choice_saved_checkpoint_name[checkpoint_idx]}'...
*restore_checkpoint checkpoint_idx
9 Likes

Multidimensional array where the ID is in one node and name in another? That’s how I’d do that.

I run RT 20,000 times (takes 2 hours) on a 1.5 million word game and errors occur beyond that number of iterations. :slight_smile:

I like *save_game the way it currently exists.

*save_checkpoint for checkpoints within scenes.

*save_checkpoint – it appears to give more control with less burden on writers.

Moody updated arrays and some CS versions but not the more recent versions.

1 Like

Well … that’s a jumpscare to warm me up for Halloween :scream: I stand corrected (if terrified)

7 Likes

I have been meaning to ask, with all these updates released or the ones pending,

What’s stopping Choice Of Games to create an app with all these features.Allowing the public to start their projects offline.I think you would agree with me that, some users with great ideas lack the funding to be online consecutively.

ACTUALLY!You already have done it with the novels on Playstore, coz you can play those novels offline whilst it is running all these features.
Why not make one app capable of allowing a users to start their projects.I hope this is not too much of an ask.

1 Like

Honestly, @CC_Hill I think has the best feedback and reasoning what we should do. Failure of this being implemented I will be putting a checkpoint as the first action in the story (when/if I use them).

My biggest concern over the implications of the Checkpoint feature is the emergence of a new stigma from readers/players not wanting to play or giving lower reviews for stories/games not implementing this. I fear that the use of this will become an expectation.

It depends on if I can jump back to a present time using the same system. I have been floating an idea of allowing readers to go back chapters and reread events and their choices. This would not be to replay and change choices, but simply catch up incase they stopped reading for a month and are coming back to a game. That is the first thing that comes to mind.

I don’t think it matters if it works on Dashingdon. It’ll be used.

1 Like

I’m absolutely delighted with this development, thank you for making this happen @dfabulich! (and everybody else at CoG who gave this the green light)

2 Likes

Just a word of caution on this, if dashingdon’s goes down in the future (since it may no longer be being updated), I’m not sure how easy it is to install alternative save points if hosted elsewhere. Can be a problem for a later time, but if there was a way to have something that could work with and without the COG servers for testing/hosting, that would be amazing (not sure how hard this is to implement though.)

Also if the save slots don’t work on dashingdons and HG authors don’t have access to hosted beta testing, how can we be sure they are bug free on release?

As a preference out of the options, I’d prefer author set checkpoints that can be saved/accessed.

Good GOD this is all I’ve ever wanted. Can’t believe it took this long, but it’s finally here.

Aahh excited, I’m the type that always loves to see all the variations for even the more minor conversations, but don’t really want to do a whole playthrough just for those. Sounds like this will make it far easier. Hoping some of my favorite authors implement this down the road.

1 Like

I just found an ugly bug: checkpoints aren’t compatible with smPlugin. :confounded:

Checkpoints each have their own “save slot,” but smPlugin uses the legacy “password” system, which includes the current playthrough’s save slot, but not the checkpoint save slots.

That means that even if Dashingdon and/or Moody Ink were to include my latest code, if you *save_checkpoint at the start of chapter 3, then save in the middle of chapter 3 with smPlugin, then restart the game, and then restore back to the middle of chapter 3, when you *restore_checkpoint at the end of chapter 3, your game will crash.

I’m… going to have to think about how to fix this.

I think I can gradually begin that process.

For my first guess, I think the main thing to do is just to make it super, super easy for people to use a tool like CSIDE (at first, probably literally CSIDE) to generate a single-file HTML file for their game, and for that HTML file to include a unique storeName (perhaps based on the IFID?).

That way, people can just upload HTML files to Itch.io or something…?

6 Likes

If it would be possible to generate an HTML file like this without CSIDE as well, that would be brilliant as not everyone uses it.

smPlugin has been deprecated for a long time now in favour of the GitHub - ChoicescriptIDE/ChoiceScriptSavePlugin: A small addon script for ChoiceScript to allow control over persistent (hard) saves., which doesn’t use the password system (but provides similar functionality to smPlugin). Unfortunately, I don’t think dashingdon or moody.ink ever upgraded. I don’t think you should need to change your design over that incompatibility. Ideally those sites should update their plugins, or deprecate them in favour of an official solution. If the ChoiceScriptSavePlugin linked above is also incompatible with the checkpoint system, I’ll be happy to modify it to be compatible.

CSIDE is already capable of exporting a compiled game, but I’m happy to make any other changes that are required too. I’d love to implement a direct built-in feature to upload straight to itch.io, but they don’t have an API capable of that, as far as I’m aware.

There’s a compile.html/compile.js shipped directly with ChoiceScript (which is basically what CSIDE uses too). The only thing I think vanilla ChoiceScript is missing is a way to automatically generate the ifid.

4 Likes

Of course! :sweat_smile: it’s been so long since I did it that I forgot how easily it can be done…