Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Export Stock Data #1

Open
ScriptForAll opened this issue Dec 18, 2020 · 1 comment
Open

Feature Request: Export Stock Data #1

ScriptForAll opened this issue Dec 18, 2020 · 1 comment

Comments

@ScriptForAll
Copy link

Hi! I've been using some of your Insugar Trading and Spiced Cookies add-ons for a few weeks and let me tell you they're quite the helpful ones.

The idea is the following: implementing a "Extract this session's stock price history to File" option? "Session" being employed here meaning as "browsing session" and not "between ascensions".

This would be useful for those who want to take this stocks game to the next level since it would allow the user to make a post-analysis of the data (e.g. long-term graphs, averages)

However this feature raises a few questions, namely:

  • I've have no idea if this feature falls under SC's scope, IT's scope (or even base game's scope) since both tackle the Stock Market minigame.
  • I believe this add-on saves the stock price history through the save file. Therefore, the longer the session the longer the save file.
  • Which format to use? txt file, csv file, another?
@staticvariablejames
Copy link
Owner

Currently, Spiced Cookies simply saves/restores the internal state of the minigame. Since Cookie Clicker itself only keeps 65 data points (1h 5min), the size of the save file does grow but the bloat due to stock data is limited to about 20kb. (This feature is responsible for the majority of the save file size if you are using the mod.) This is saved in JSON format, so you can clearly see it in the save file after base64-decoding it.

Exporting this browser session's stock price history would be a brittle feature. In order to protect it against closing the browser tab accidentally, the history would either have to be saved to web storage directly (thus making it incompatible with save game backup/restore) or added to the save file (thus bloating it up to hundreds of KB).

I don't think it fits Insugar Trading, as IT also does not compute e.g. the average for the past hour. Spiced Cookies is a better fit for that. I think that exporting it to CSV format is the best solution, as it is very easy to write a parser for it, and this data would never be imported back into the game, so JSON is not that attractive.

If you simply want to generate stock data (for, say, running machine learning algorithms on it), I implemented the stock algorithm in C++ here. And, of course, you can use the Insugar Trading datasets directly.

What is your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants