Cogdemos.ink - New ChoiceScript Game Hosting

Okay, so @jcollins set me onto a path that made me (and the dev) realize that the problem revolves around attempting to hold the player’s place in the game.

As long as the browser stayed open and didn’t refresh (apparently, some browsers auto-refresh pages, and that was causing problems as well), then it worked fine. As soon as you closed the browser or the page refreshed, everything got hosed because all of the info in startup.txt (i.e., variables and achievements) were lost. Basically the game was attempting to continue while not knowing wtf it was working with.

I attempted setting up a mygame.js file in the “mygame” folder, containing all of the necessary game info that is stored in startup.txt in hopes that would solve the issue. The dev was convinced it would work, since that’s what the published game uses in lieu of startup.txt (mygame.js is actually generated based on startup.txt), but I couldn’t get it to work and still got the achievement error after closing the browser, opening it, and continuing the game.

So, in the meantime, to try to remedy this problem, he has removed the ability to “pick up” where you left off in the game. If you close your browser, or the screen refreshes, you’ll be put back at the beginning of the game. However…

You can use the local or server saves to get closer to where you left off. Now that we have the local save options working, you can save scum to your heart’s content. I recommend you do it often.

One caveat… when you go to play again, you will continue to get the achievement error until you delete all the data for your game and clear your cache/cookies for cogdemos.ink. I tested it and tried to get it to work without doing that, but kept getting the error until I deleted all my saves and cleared my cache. Once I did that, I restarted the game (at the screen where the error popped up), and was able to play without issue, even after closing the browser and loading my last local save.

I apologize for the aggravation with all of this, but I don’t see any other way to deal with the errors or get the game to pick up after being closed and still load startup.txt. At least now you won’t get bombarded with the errors. Just make sure to save.

7 Likes

Regarding the achievement list: the button shows fine on my tablet, but not on my phone (using Safari on both). Maybe it’s a screen size issue?

1 Like

Could well be. I’ll take a look at it.

The dev also pointed out that when I added the sorting feature it doesn’t look right on mobile devices, so I need to figure out how to get that to be mobile-friendly, too.

1 Like

For me, the achievement button disappears when I refresh the browser page. Same as how the achievement errors come up. When I hit restart, the button comes back. I haven’t deleted my cache/cookies yet though.

I tried that, but it doesn’t fix it on my phone.

Could be both then? :thinking: The refresh thing AND the button is too big for small screens :smiley:

All…

The issue with missing variables and achievements should be fixed now.

The problem is that the code was set to save where the player left off, even when they close their browser. Unfortunately, it had no way of reloading startup.txt, so if anything was changed–i.e., new variables were added or achievements were enabled–it didn’t recognize them.

After talking to @Havenstone, I went ahead and pulled a branch that disables the code where it saves the player’s last spot in the game. It reloads everything and forces them to restart the game from the beginning (just like it does on dashingdon).

The dev has a fix for this that requires authors to create a mygame.js file (which is how Steam works and, had I to bet, how the web app works as well). I haven’t tested it yet (I decided to take a break over the holidays, both from work and from dealing with cogdemos code) but will try to do so tonight, after work. If it works, we’re going to code another button in the dashboard that will create the file for the author–they’ll have to do this any time they change startup.txt to make sure all variables exist in the js file. But we’ll worry about that when we get there!

For now, no one should be getting those issues.

14 Likes

Thanks so much, @EvilChani – really appreciate your giving time to this!

2 Likes

You’re welcome! I’m just sorry it’s been such a pain in the ass getting everything working appropriately.

We had planned on working on the Patreon plugin next, but I think we’re going to wait on that until I can see if mygame.js actually fixes the “pick up where you left off” section of the code.

10 Likes

This is great, thank you for doing this! I hope that you’ve had a good break for the holidays.

7 Likes

Are save slots gone now? I noticed that there is no active slots when I playtest.

No, you should be able to save, both locally and on the server. I tested both just now and had no trouble saving. The only thing affected by the change I made is that it should no longer track where in the game you are if you close your browser. Your saves should still work.

Edited to add:

I tried testing the dev’s fix for keeping a cookie to track where the player left off, without causing new variables and changes to startup.txt to make the game crash. It didn’t work for me, and I realized that, with these being alphas and betas, it may not be a good idea to have such a thing, anyway. As it is, some changes to the game will cause saves to break, and adding cookies in on top of that probably isn’t so wise. I’m still of the opinion that authors could use a version tracking system and the saves could be matched to the version, so if something will break previous saves, players can be warned ahead of time so authors don’t feel compelled to make another game link to keep that from happening. Will probably work on that later, though.

So, for now, we’re going to start work on linking Patreon accounts to games, for those who want to use it. When that’s done, we’ll probably move on to including an optional back button, which should make testing easier.

After that, we are going to attempt to create a “load character” feature for sequels–unless we can create a plugin to download game states, doing this on cogdemos may require a bit of work on the player’s part (creating a text document with all of the appropriate variables and set them for their character). Authors could provide the template (basically what’s in startup.txt declaring variables), then players could chage the create to set for the character load. Just rambling now… we’ll figure it out when we get there.

6 Likes

I like the idea of version control, would that just be a “game version” setting that is in the save comparing to the version of the game, or something more involved?

1 Like

I’m thinking just a game version setting so the save can be compared to the game version. I’m thinking changes to startup.txt should be tracked, though, since that’s what usually causes saves to break. Just not sure how to do it yet.

Any suggestions (or request) you have are welcome!

2 Likes

The new update where the game isn’t keeping track of the previous session seems to be working! I’m still getting an insane amount of messages about achievement and variable errors since I updated the game 2 days ago, but deleting the cookies seems to solve these in every case.

1 Like

Thanks! Once they do it the first time, the new cookies shouldn’t be an issue. It’s just hard to clear it out the first time–if they just delete temp files, it won’t work. I feel like Palpatine: “Wipe them out. All of them…”

Now I need to get some time and play Weeping Gods again, now that I saw you updated it. I’m addicted to that game already!!

2 Likes

Yeah, I just told them to delete all the cookies for cogdemos. I think I had 4 cookies in my own browser for it? I did it last week, and had no issues since then.

(Before you read the new update, please read the content warnings, there is some heavy stuff present in the new chapter)

1 Like

Two thoughts on the way saved games currently work.

  1. Could we maybe get a confirmation window for loading a game? It’s currently very easy to hit Load Game by accident and immediately wipe out whatever progress you’ve made in any given game without any chance to back out of it.

  2. I can’t see a way to overwrite old saves at the moment, which means that I have to make new saves each time I want to save, and then once I fill up my save slots I have to go back and delete old ones to make more room to save again. It would be much nicer if it was possible to just save over filled slots, because most of the time when I am playing I just want one rolling “main” save file, with maybe some others saved at specific progress points.

Overall, though, I really like the new system and think it feels pretty good to use outside of those two issues.

7 Likes

Yep, I can manage that one. I’ll work on getting that functionality up over the weekend.

The main reason we did it that way was to prevent accidental overwriting, but I see your point. I’ll likely need the dev to take care of that part. The save system coding/plugin is a bit complicated.

Oh, and I don’t know if you noticed or not, but you can export batches of server saves to your local machine so you have them backed up. If you import (restore) the export (save), you’ll have all of the saves from that export. Just in case you lose a save you later decide you want.

Thanks for the suggestions! If you have any more, let me know.

Great! I’m glad it’s working. I figure there will still be some stragglers with the achievement/variable errors until everyone gets their cookies wiped. We’ll just have to remind them to get it cleared up.

8 Likes

CoGDemos works well, I don’t have the same saving problems that I had with Moody. However, I had some problems with the automatic translation of the page. (Unfortunately, I started my English course a few days ago)

The automatic translation is not applied when the page is advanced (it is necessary to return the text to the original and translate again each time, it is very uncomfortable)

I know that non-English speakers are not your focus, so I apologize in advance if I am being annoying or asking too much.

3 Likes