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

Going away from pickle #27

Open
lionel42 opened this issue May 13, 2024 · 4 comments
Open

Going away from pickle #27

lionel42 opened this issue May 13, 2024 · 4 comments

Comments

@lionel42
Copy link
Collaborator

Pickle is not a good tool to save files, it has many security issues.

With the recent developpements, we have moslty removed all the pickle dependence.

The last one that we need to change would the the game saving/loading in the solarsystem.py file. functions save/load_solar_system .

I would suggest to save all the necessary data to a .json format, as it is very easy to interact with.

What do you think about this suggestion ?

@lassefolkersen
Copy link
Owner

Sounds good. Yes I like json too. Now.

@JonathanLochridge
Copy link
Collaborator

JSON is cool, would make saves a little larger.
But in theory that opens things up to allow savegame editing and creating mods/scenarios easier?

@lassefolkersen
Copy link
Owner

lassefolkersen commented May 13, 2024

They're currently 40MB, which was a lot in 2009, less today. I think we could probably scrape out some further non-essential things to slim to counter-act, right now the logic is just "save the entire solar system. but remove images because they don't pickle". Maybe better to start listing the stuff that we know to be needed for a save?

Also - I'm a big fan of the json, because I - today - know much more about working with that, and it could be a real enabler for tuning the whole company/firm logic computer player intelligence ("2009 AI"). In most play-throughs I do, the markets find reasonable equilibrium after a while, but having a (more) workable data format we could do some really really cool things about pre-training everything ("2024 AI")

@JonathanLochridge
Copy link
Collaborator

I love JSON too, In a lot of my favorite open source games, they have content encoded in JSON, which makes it much easier for non-programmers to make content additions/mods, and contributions. It worked particularly well for CDDA.

And JSON and textfiles specifying elements of the program are how I first got started modding games before I even knew a thing about coding.

Although, with this genre of game it might not help as much. (although, maybe we start get custom scenarios and such?)

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

No branches or pull requests

3 participants