Skip to content

Savegame Improvement.#123

Closed
Xenega wants to merge 2 commits intomasterfrom
savegame
Closed

Savegame Improvement.#123
Xenega wants to merge 2 commits intomasterfrom
savegame

Conversation

@Xenega
Copy link
Member

@Xenega Xenega commented Jan 5, 2019

Do not save game data in savegame. Basically all types are removed from save.

@Xenega Xenega mentioned this pull request Jan 5, 2019
@nthykier
Copy link
Member

nthykier commented Feb 3, 2019

I think a better approach will be to tackle #52 at the same time as #56 by defining a new format for the save game. I.e. choose a new serialization format (without code execution issues), convert the code to properly serialize to and deserialize from that format from the minimum required.

That said, I can fully respect the desire for incremental improvements and I am fine with doing that while still using pickle. Some notes about the branch/code that are worth looking at before merging:

  • I think this is missing a bump of current_save_version.

  • Loading a save game in this format does not properly restore bases:

Exception in function show at Sun Feb  3 13:01:01 2019 CEST:
Traceback (most recent call last):
  File "./singularity/code/safety.py", line 47, in safe_call
    return func(*args, **kwargs)
  File "./singularity/code/graphics/dialog.py", line 202, in show
    result = self.handle(event)
  File "./singularity/code/graphics/dialog.py", line 329, in handle
    return self.call_handlers(handlers, event)
  File "./singularity/code/graphics/dialog.py", line 341, in call_handlers
    handler(event)
  File "./singularity/code/graphics/button.py", line 154, in handle_event
    self.activate_with_sound(event)
  File "./singularity/code/graphics/button.py", line 167, in activate_with_sound
    self.activated(event)
  File "./singularity/code/graphics/button.py", line 196, in activated
    self.function(*self.args, **self.kwargs)
  File "./singularity/code/screens/map.py", line 407, in open_location
    dialog.call_dialog(self.location_dialog, self)
  File "./singularity/code/graphics/dialog.py", line 96, in call_dialog
    retval = dialog.show()
  File "./singularity/code/screens/location.py", line 137, in show
    return super(LocationScreen, self).show()
  File "./singularity/code/graphics/dialog.py", line 188, in show
    Dialog.top.maybe_update()
  File "./singularity/code/graphics/widget.py", line 362, in maybe_update
    self.update()
  File "./singularity/code/graphics/widget.py", line 366, in update
    self.prepare_for_redraw()
  File "./singularity/code/graphics/widget.py", line 358, in prepare_for_redraw
    child.prepare_for_redraw()
  File "./singularity/code/graphics/widget.py", line 358, in prepare_for_redraw
    child.prepare_for_redraw()
  File "./singularity/code/graphics/widget.py", line 358, in prepare_for_redraw
    child.prepare_for_redraw()
  File "./singularity/code/graphics/widget.py", line 340, in prepare_for_redraw
    self.rebuild()
  File "./singularity/code/graphics/listbox.py", line 213, in rebuild
    self.update_element(element, list_index)
  File "./singularity/code/graphics/listbox.py", line 257, in update_element
    self.key_list[list_index])
  File "./singularity/code/screens/location.py", line 130, in update_item
    elif base.is_building_extra():
  File "./singularity/code/base.py", line 351, in is_building_extra
    for item in self.extra_items:
AttributeError: 'Base' object has no attribute 'extra_items'

(Triggered a load followed by opening the base)

@Xenega
Copy link
Member Author

Xenega commented Feb 3, 2019

@nthykier Basically, the response is time. Doing big changes is more time-consuming that just small incremental changes. Big changes have the drawback to be in conflicts with each other when they stall for too long.

Feel free to try improve it if you can, but take care that I try to refactor the code and if you take this road, difficult rebase are expected.

@Xenega Xenega mentioned this pull request Feb 10, 2019
8 tasks
@Xenega Xenega closed this Aug 7, 2019
@Xenega Xenega deleted the savegame branch August 19, 2019 09:13
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

Successfully merging this pull request may close these issues.

2 participants