Jump to content
MakeWebGames

A Table Per User - Storing a Tile Map


Recommended Posts

Ok,

I've taken a bit of a break due to a complete lack of ideas but I'm back with another crazy idea that I am sure shall make you laugh and question my sanity!

I am creating a PHP, HTML, CSS and some JavaScript/JQuery game engine that shall serve up a tile based map. I've done some stress testing and managed to load 75 000 images simultaneously with ease in four seconds at a size of 70 kB.

I am planning on creating a tile map which is considerably smaller, which I am sure my server can handle and to which the bandwidth shouldn't be too high. The map would be 30 X 30 which would bring it to a little bit over the average resolution in terms of width and 1500px downwards.

This would be 900 cells (tiles), my question is:

Do you think it would be better to store each persons map in a .txt file and then read it once and store it (still working on this) so that it doesn't need to query it again and only needs to scroll through and update once at the end when they click 'Save' (security concerns with reading and writing to text files?)

or

Do you think it would be better to store each persons map in a table in a MySQL database and read it once and store it so that it only needs to be queried once?

Do you see any problems with creating 900 tiles for a map, they won't be displayed all at once and instead would be scrolled through with JavaScript. From my tests, I think my server can handle it providing there aren't too many players online at the same time, and providing I monitored it correctly I got a download of about 48 B from a randomly generated map.

 

Thanks and hope I made sense!

(Forgot to mention, this is also prior to compression so the pages should be even smaller)

Edited by Octet
Spelling and Additional Information
Link to comment
Share on other sites

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.   Paste as plain text instead

  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...