YAML serialization of cyclic object classes

G

gga

I have a program that is trying to use YAML to save out its data,
without much success.
In the program, several of the classes have cyclic dependancies.
To be more specific, the program deals with "rooms" and "connections"
between the rooms, with each room and connection being represented as a
class.
Each room has up to 8 possible connections and each connection
contains, in turn, a reference to each of the two rooms it connects.
When YAML saves out its data for extremely simple graphs (2 or 3 rooms
interconnected), YAML spits out everything fine, and handles the cyclic
connections using ids to represent the same objects.
Problem seems to be that this is not working appropiately as the graph
grows in complexity (even 16 or so rooms can create issues). YAML just
hangs when saving out the file or, at least, it takes exponentially
much, much, much longer to save the scene (I'm taking minutes vs. less
than a second for the 3 rooms).

Is this how it should be? It seems like a bug in the YAML library to
me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top