• Home
  • About
    • Biography
    • Contact Info
  • Projects
    • 2D Map Editor
    • Dodge and Destroy
    • Intruder's Run
    • Procedural Terrain
    • Jim Bob's Jam
Nickpdevelop.net

Editor resource problem! EEPS 02/21/2012 at 13:48

While I was working on the java support for the map files generated from my map editor application I found something major that I overlooked, resource/file structure. Right now the editor saves the external path for resources(tilesets) used instead of a relative path to the map file itself. This is ok for the most part on PC platforms(WELL not entirely ok, but workable), however when it comes to pushing a project to the web, or mobile device this sort of breaks everything as the paths will be screwed up entirely. So basically I need to fix the way resources are handled with map files.

My first solution I came up with is to make it work somewhat similar to the way Eclipse handles projects. Upon launching the editor, select a working directory, and a resource directory. When adding a Tileset, you can still select from a external directory and it will move the resource to an resource directory, or place the file in the resource directory itself. Allow the user to add as many resource directories as they want for that workspace directory as they want. The map file will be saved in the directory which you are working on should you choose to save, and all paths will be relative to the directory which the map file is saved. This way for instance if you are developing an Android app, you can make the working directory in your resource folder and when loading the map everything will be relative to that source.

The other solution I came up with would be to keep everything the same now but when the map is saved create a resource directory relative to the map path, and copy the resources into that folder.

There are probably other ways and better ways to do this but so far these are the solutions I am thinking of. Can’t wait to get all of this done so I can start working on some games >< oh well, learning experience.



« Maps, games and web design Self-adjusting AI in Dodge and Destroy »