def save_state(actor, sfile):
    """
        loads previously saved actor state from encoded file

        :param actor: actor class to dump state from

        :param sfile: encoded file used to write state information
    """
    import json, base64
    state_file = open(sfile, 'wb')
    state_file.write(base64.b64encode(json.dumps(actor.dump_state()).encode()))
