Octet Posted August 12, 2012 Posted August 12, 2012 (edited) 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 August 12, 2012 by Octet Spelling and Additional Information Quote
Dayo Posted August 13, 2012 Posted August 13, 2012 What if you were to store it on a db but use only one column for it and use json_(encode|decode) to read the data that way you don't have hundreds of txt files nor thousands of rows in your database Quote
Spudinski Posted August 13, 2012 Posted August 13, 2012 Shouldn't there only be one centralized map, that grows as the population(userbase) increases? If so, you're better of storing x,y positions. Quote
Octet Posted August 13, 2012 Author Posted August 13, 2012 Shouldn't there only be one centralized map, that grows as the population(userbase) increases? If so, you're better of storing x,y positions. No, because the map is editable. Quote
a_bertrand Posted August 13, 2012 Posted August 13, 2012 I doubt it's a good design, even if each player see a different map you could still store it on a single table. Quote
Spudinski Posted August 13, 2012 Posted August 13, 2012 I doubt it's a good design, even if each player see a different map you could still store it on a single table. ^--- Listen to this guy. He's awesome with these stuff - heck, he even made an engine with such a concept. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.