Jump to content

[SOLVED] using XML to take ease off database?


XpertWorlock

Recommended Posts

I'm hoping to use AJAX technology to try and build a game.

 

The map will be built on a X/Y axis.  I'm hoping for on the fly loading, instead of loading the entire map (which seems pointless on a big map)

 

Now let's say you get close to the edge of "your" viewable map, instead of querying the database for the information and relaying it back, could it be less straining and maybe faster if the information was retrieved from an XML file? 

 

or maybe multiple XML files?

 

 

Link to comment
Share on other sites

The only way I could see it work correctly with XML, is if there were multiple XML files, that way if there were 5000 people all on at the same time, they wouldn't all be accessing the same XML file?

 

The best way would be to have the XML file tell you what it's going to be and than have the javascript load the image at the correct spot......?

Link to comment
Share on other sites

Yeah, that's what I would do. I'm no server load guru or anything, but it would make sense to split it up. Like you said, if you have 5000 users, its highly unlikely that they will be loading the same file at the same time. Whereas with mysql, you could run into a 'too many connections' error, even if they aren't loading the same part of the map.

 

I'd recommend putting something like 9 squares of the map in each xml file (you decide how big the squares are) - that way when the user walks into an outside square you know which direction they are heading and you can preload the next images.

 

Example (look at your numpad):

 

1 2 3

4 5 6

7 8 9

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.