Advertisement

Saving script state test implementation

Started by May 01, 2011 01:59 PM
1 comment, last by WitchLord 13 years, 7 months ago
I have created implemmentation of saving state.
IT saves call stack of context.
Currently, only primitive types and strings can be saved.
Is this good implementation...?
http://pastebin.com/EH1nsHgK

Patch for AngelScript 2.20.2.
[font="arial, verdana, tahoma, sans-serif"]Current issues of this impl
  • How to save object handle? Make a list of variables, then refer one by index?
  • If script object is passed with ref modifiers, same value may be saved multiple times?
  • Saving grobal properties and its reference(or handle) is not implemented.
  • Saving script object is not implemented.
  • Saving template types (such as arrays and dictionaries) is may be difficult.
  • I am assuming that bytecode is the same on loading time and saving time.[/font]
Advertisement
I think it is a very good start, and similar to what I had in mind for this implementation.

The serializer will need to keep track of objects that have already been saved, so that any references to that same object doesn't cause the object to be saved multiple times.

The template types need to implement the serialization in the same way any other object do, except that it will also need to serialize its internal variables so it can rebuild itself identically to what it was before.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement