Wednesday, February 8, 2012

Late night quick post

A little more gets added each day. Most important was actually last week but mock up a proper "scene" just didn't seem to get my programing spirits up as tacking on more stuff. So no ascii in game image.

What we do have now is saving through good old fashioned not really efficient pickling. Took a few days to uncouple TKinter from the data structures and getting methods all to the top most module for remembering functions and it was golden. Size was a little big so I subclassed some dictionaries to act as 2d lists, which I could further optimize by making it just a single dictionary with some more trickery and math in it, but I don't do math well. The save right now is about 16 KB which through zipping can get down to 10 KB, not bad for out of the box saving.

I can improve this through some better class sub classing and getting rid of irrelevant data to be saved (like stats in a wall or objects). Though the real size change would come from me writing my own save output. For now though pickling is the way to go and lets me examine a world to a degree and modify it on the fly without recoding in the middle of it.

So saves and loads done. Next I overhauled the display system getting it more towards useable. I have event text coming out at the bottom that is triggered through various things. Only holds 5 of the past events and no logs at the moment so a bit limited but workable. After that I set up somewhat of an internal scripting system to allow events such as stepping on to give commands to the engine without a whole bunch of function nonsense (as there is enough of that) so stepping on an item can tell the DM to remove it from teh room. Somewhat proper object orientated design as the item never needs to know the room it's in or how to interact with it. Last I got done was the beginning of puzzles. I can get objects to disappear and be placed by stepping on them. So things such as switches are now possible. Next I'll see about getting damage back into the game and smack a few mobli-goblins around in the test dungeon. I've already had them spawned just  to see if they'd persist room transition but had no interaction with them beyond trying to get past them as they move about randomly.

5 comments:

  1. way to go, sounds like you're really cooking with gas! Out of curiosity are you dividing stuff into different files or is it all in one huge file?

    ReplyDelete
  2. Sounds like you're making progress :)

    ReplyDelete
  3. @convictus
    The actual python code is in about 5 files and I may need to divide it up again soon. The save file is one file mostly due to relation issues. To put it simply if I pickle an object with "a" in it and there is an object in this object with "a" they will be the same when I unpickle it. If I had this sub object outside and pickled it away from the first object these "a"s would not be the same thing, they would be equivalent to each other but not the same thing which I rely on in code at the moment. I could almost make a post out of this as I'm explaining poorly. Though sufficent to say if I were to chop up my top level object and save the pieces separately it wouldn't' work at the moment unless I made a lot of effort to piece the relations back together.

    ReplyDelete
  4. couldn't decide between calling them moblins or goblins?

    ReplyDelete
  5. @shaw
    Couldn't decide at all, we'll see what they become later.

    ReplyDelete