Oh my god. It's full of code!

A call to those smarter than me

Hey everyone,
I have a question that I’d be interested in hearing some feedback on. I am developing a browser based javascript/ajax/xml powered game. The XML is used to store information about the current map the player is on and all the objects that inhabit that map. A sample looks like this


Fairly simple as far as XML goes (though I am going to be adding more attributes to the mapObject nodes to support behaviors, IE attached javascript functions). What I am wondering is should, or is XML suited to be stored in a database, or should I keep it all in XML files and just hold references to them in the database. I wonder the same thing about storing the sprite images, do I break them down and hold them in Blob fields, or do I just hold references to their position on the web server? Right now I am doing the later, but hell if I know.

Another random question for any Javascript/XML pro out there, right now when I parse the XML I create an object out of each node which are then stored in an array. To get at the properties of an object I just reference the array and then the stucture contained within. Is this worth doing, or should I just be addressing the XML directly for the attributes. It feels like the array/object approach is faster (don’t have to use a search function to find the node I want every time, I can just address it by index position) but there is the overhead of having all those extra objects and the fairly clunky code for creating them (as I am having a hard time getting looping over attributes in an XML node to work). Thoughts?

Anywho, that is it for now. If you want to see what I am working on, feel free to check out
(it may be broken when you visit as that is my dev copy and I’m working on it a lot).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s