Ross Posted March 12, 2014 Share Posted March 12, 2014 Hey all, I'm wondering what is the best way to load level data into a game. I'm considering, XML, JSON, comma delineated files, or anything else. I've seen some of the examples for loading data, but I'm wondering if anyone has any real world experience with it. What I'm trying to accomplish is to feed a game level some parameters and using them to randomly create a new level. I'd like the technique to work for a mobile version of the game as well (using Cocoon, or something similar). Thanks,Ross Link to comment Share on other sites More sharing options...
RyanTheBoy Posted March 12, 2014 Share Posted March 12, 2014 I am currently using Toast Editor which outputs a .CSV. I am curious though as to what the preferred or 'best' format is. Will one format necessarily load more quickly than another? Link to comment Share on other sites More sharing options...
drhayes Posted March 12, 2014 Share Posted March 12, 2014 I'm not sure what either of you mean by "best". "Best" by what measure? I don't think the level format loading time makes much difference compared to loading assets, or, in Phaser's case, actually constructing the tilemap. I'm pretty sure you're safe using whatever format the tool you like generates that Phaser can read. Ross: If you need to dynamically modify the map at runtime, I would use JSON since, in JS, it's just an object. Link to comment Share on other sites More sharing options...
Ross Posted March 12, 2014 Author Share Posted March 12, 2014 Thanks drhayes! I think my use of "best" was probably the wrong way to phrase the question. I thought I read somewhere that Cocoon does not support XML, or JSON, or another format. I should have asked what is the "best practice" for loading data into Phaser if I plan on using Cocoon. thanks again. Link to comment Share on other sites More sharing options...
drhayes Posted March 12, 2014 Share Posted March 12, 2014 Okay, yeah, that makes sense. I hadn't considered that some of the mobile wrappers might not be able to handle certain data formats. So... thanks for letting me know. ( = And I wish I could help you, but I don't know. Link to comment Share on other sites More sharing options...
sleekdigital Posted March 12, 2014 Share Posted March 12, 2014 http://www.html5gamedevs.com/topic/2312-ludei-cocoonjs-xml-bitmap-font-workaround/ Link to comment Share on other sites More sharing options...
Recommended Posts