lassefolkersen / highfrontier

The goal of High Frontier is a civilization-like game, which uses more realistic modelling of economy, climate, research and migration. Uniquely this game starts today - the initiation date of a game is todays date and the existing world is the world as we know it today, complete with cities and countries and people. The aim from there - that is whatever the player thinks the aim is for the world. Developing of the underdeveloping world, action against climate changes, expansion into the rest of the solar system, or just racking in a lot of money.
13 stars 3 forks source link

Hopefully fixing save games #17

Closed lassefolkersen closed 1 month ago

lassefolkersen commented 1 month ago

Hmmmm....seems like something introduced back when threading was done. It seems I literally just needed to stop the thread, save, and then restart it after.

lassefolkersen commented 1 month ago

Ok, seems like this one needs more work. The tests are failing, which is odd - because actually the real game save/load seems to work

lassefolkersen commented 1 month ago

Ok, this should work. Give it a look and a ✅ - maybe also do a more full tests yourself first, I only tried once, in a real game - not many edge-cases tested.

JonathanLochridge commented 1 month ago

Ok, seems like this one needs more work. The tests are failing, which is odd - because actually the real game save/load seems to work

So you tested it and were able to load a game properly? Big step forward if so, I can test on linux as well. Just to be sure.

If this works then I will be super happy!

And GUI will probably be my next focus. Along with taking some time to just play it again. (And maybe work on a manual, guide, user documentation, etc.)

lassefolkersen commented 1 month ago

Yes, exactly. Tested on mac. But the problem didn't seem platform specific, it was because threading had been introduced later, and that broke the saving. So just had to stop threading while saving and then restarting.

JonathanLochridge commented 1 month ago

Multi-threading can be hard to deal with but speed things up a lot, no wonder I couldn't fix it back when I tried a couple years ago.

lassefolkersen commented 1 month ago

OK let's, and let's see if that segmentation fault happens again, and if so make a new issue out of it. I haven't seen that (yet)

JonathanLochridge commented 1 month ago

If I spot it come up again rather than a 1-off I will make an issue.