One of the great hopes I had when working on the design of my game was that a lot of other grunty, gritty feature implementation would be taken care of for me by writing things in a high level language.
Particularly, I was looking forward to not implementing save and restore, and instead using the builtin
serialisation engine. This has definitely not been all I was hoping.
The first problem was when I reintroduced shadows in a more limited capacity ( they are no longer an object level implementation, but are turned on or off by individual getter functions ). A lot of the shadows would be represented by anonymous functions, generated by the lambda keyword.
Unfortunately, it turns out pickle only performs shallow persistence of instance variables - when it hits the code object generated by lambda, it dies. I managed to solve this by instead storing the function definition as a string and then using exec to generate a code object on the fly, but the shallow only nature of pickle has some other, more annoying consequences.
One is that, as only instance data is persisted ( and not e.g. the class definition ), if someone installs a module, grabs an item out of it at some point, and then uninstalls it, it invalidates their save file. This is not what I had wanted.
I have a terrible feeling I'm going to have to end up implementing save and load after all. Combined with the difficulties I am having writing decent AI, I am definitely feeling the mid-project doldrums.
( I missed? )